diff --git a/Jamconfig.in b/Jamconfig.in index 4d516ae..7c145b2 100644 --- a/Jamconfig.in +++ b/Jamconfig.in @@ -24,6 +24,7 @@ sysconfdir ?= "@sysconfdir@" ; # tools used by jam rules XGETTEXT ?= @XGETTEXT@ ; MSGFMT ?= @MSGFMT@ ; +PYTHON ?= @PYTHON@ ; RMDIR_UNSAFE ?= $(RM) -Rf ; RMDIR_SAFE ?= rmdir ; CP ?= cp ; @@ -47,7 +48,7 @@ OPTIMFLAGS ?= @EDE_OPTIM_FLAGS@ ; DEBUGFLAGS ?= @EDE_DEBUG_FLAGS@ ; # global flags used to be passed to every target -GLOBALFLAGS ?= -Wall -pedantic -I$(TOP) $(OPTIMFLAGS) $(DEBUGFLAGS) ; +GLOBALFLAGS ?= -Wall -pedantic -DHAVE_CONFIG_H -I$(TOP) $(OPTIMFLAGS) $(DEBUGFLAGS) ; STDLIB ?= -lstdc++ ; # Note that REMOVE_UNUSED_DEPENDENCIES_TRICK _does not_ works when diff --git a/emountd/emountd.cpp b/emountd/emountd.cpp index a6bddc8..59d8db8 100644 --- a/emountd/emountd.cpp +++ b/emountd/emountd.cpp @@ -15,9 +15,15 @@ * since HAL documentation pretty sucks. */ -#include -#include +#ifdef HAVE_CONFIG_H +#include +#endif + #include +#include + +#ifdef HAVE_HAL +#include #include #include #include @@ -295,6 +301,8 @@ void device_property_modified(LibHalContext* ctx, const char* udi, const char* k device_info_send(ctx, udi); } +#endif // HAVE_HAL + void help(void) { puts("Usage: emountd [--no-daemon]"); puts("EDE mount/unmount notify manager"); @@ -311,6 +319,12 @@ int main(int argc, char** argv) { } } +#ifndef HAVE_HAL + printf("HAL support not enabled!\n"); + printf("Make sure you have system supporting HAL and installed HAL package and libraries\n"); + printf("For more details, please visit: 'http://freedesktop.org/HAL'\n"); + return 1; +#else /* run in background */ if(go_daemon) daemon(0, 0); @@ -417,5 +431,7 @@ int main(int argc, char** argv) { error: if(!ctx) libhal_ctx_free(ctx); + return 0; +#endif // HAVE_HAL }