Added PYTHON path ot Jamconfig.

Introduced HAVE_CONFIG_H flag for each source file so config.h can be included safely. For now some things
collides with some edelib macros.
Added conditional code in emountd: if HAL is not present or system does not supports it, emountd will
be compiled without and will display a message about it.
This commit is contained in:
Sanel Zukan 2009-01-22 14:25:40 +00:00
parent f90fa0bb5b
commit bf3b276c1e
2 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -15,9 +15,15 @@
* since HAL documentation pretty sucks.
*/
#include <unistd.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#ifdef HAVE_HAL
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <libhal-storage.h>
@ -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
}