From: Kaj-Michael Lang Date: Thu, 17 Jan 2008 09:42:35 +0000 (+0200) Subject: Use AM_CONDITIONALs to decide what GPS source to use. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa910dec78ad8c045ef94e3d323b7972af8e423d;p=mapper Use AM_CONDITIONALs to decide what GPS source to use. --- diff --git a/configure.ac b/configure.ac index 09aaae5..fcb15e8 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,9 @@ else AC_DEFINE([WITH_BLUEZ_DBUS_BT], 1, [bluez D-Bus bluetooth]) fi +AM_CONDITIONAL(HAVE_HILDON_DBUS_BT, [test "$enable_itbtdbus" = "yes"]) +AM_CONDITIONAL(HAVE_BLUEZ_DBUS_BT, [test "$enable_btdbus" = "yes"]) + if test "x$enable_hildon" = "xyes" ; then dnl Ckeck for hildon-libs PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no) @@ -220,11 +223,13 @@ if test "x$ac_cv_libgps" = xyes; then AC_DEFINE(WITH_LIBGPS, 1, [build with gpsd]) fi fi +AM_CONDITIONAL(HAVE_GPSD, [test "$enable_gpsd" = "yes"]) if test "x$enable_gypsy" = "xyes" ; then PKG_CHECK_MODULES(GYPSY, [gypsy]) AC_SUBST(GYPSY_CFLAGS) AC_SUBST(GYPSY_LIBS) AC_DEFINE(WITH_GYPSY, 1, [build with gypsy]) fi +AM_CONDITIONAL(HAVE_GYPSY, [test "$enable_gypsy" = "yes"]) if test "x$enable_geoclue" = "xyes" ; then PKG_CHECK_MODULES(GEOCLUE, geoclue, HAVE_GEOCLUE=yes, HAVE_GEOCLUE=no) @@ -234,6 +239,7 @@ if test "x$HAVE_GEOCLUE" = "xyes"; then AC_SUBST(GEOCLUE_LIBS) fi fi +AM_CONDITIONAL(HAVE_GYPSY, [test "$enable_geoclue" = "yes"]) PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11) AC_SUBST(GNOME_VFS_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 647175b..cc8afd8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,9 +46,6 @@ mapper_LDADD = $(GLIBGTK_LIBS) $(GTKHTML_LIBS) \ mapper_SOURCES = utils.c \ file.c \ gpx.c \ - bt-bluez.c \ - bt-maemo-marshal.c \ - bt-maemo.c \ gps.c \ gps-browse.c \ gps-nmea-parse.c \ @@ -79,6 +76,22 @@ mapper_SOURCES = utils.c \ search.c \ mapper.c +if HAVE_BLUEZ_DBUS_BT +mapper_SOURCES+=gps-bluetooth-bluez.c +endif + +if HAVE_HILDON_DBUS_BT +mapper_SOURCES+=gps-bluetooth-maemo.c gps-bluetooth-maemo-marshal.c +endif + +#if HAVE_GPSD +#mapper_SOURCES+=gps-gpsd.c +#endif + +#if HAVE_GYPSY +#mapper_SOURCES+=gps-gypsy.c +#endif + osm2db_CFLAGS = $(EXPAT_CFLAGS) $(SQLITE_CFLAGS) $(GLIBGTK_CFLAGS) osm2db_LDADD = $(EXPAT_LIBS) $(SQLITE_LIBS) $(GLIBGTK_LIBS) $(BZ2_LIBS) -lm libosmdb.la osm2db_SOURCES = osm.c @@ -95,11 +108,11 @@ libosmdb_la_CFLAGS = $(GLIBGTK_CFLAGS) $(SQLITE_CFLAGS) $(defines) libosmdb_la_LIBADD = $(GLIBGTK_LIBS) $(SQLITE_LIBS) libosmdb_la_LDFLAGS = -lm -no-undefined -EXTRA_DIST = bt-maemo-marshal.list +EXTRA_DIST = gps-bluetooth-maemo-marshal.list -BUILT_SOURCES = bt-maemo-marshal.h bt-maemo-marshal.c +BUILT_SOURCES = gps-bluetooth-maemo-marshal.h gps-bluetooth-maemo-marshal.c -bt-maemo-marshal.h: bt-maemo-marshal.list +gps-bluetooth-maemo-marshal.h: gps-bluetooth-maemo-marshal.list glib-genmarshal --prefix _bt_maemo --header $< > $@ -bt-maemo-marshal.c: bt-maemo-marshal.list +gps-bluetooth-maemo-marshal.c: gps-bluetooth-maemo-marshal.list glib-genmarshal --prefix _bt_maemo --body $< > $@ diff --git a/src/bt-bluez.c b/src/gps-bluetooth-bluez.c similarity index 98% rename from src/bt-bluez.c rename to src/gps-bluetooth-bluez.c index 9b124bd..8617fcd 100644 --- a/src/bt-bluez.c +++ b/src/gps-bluetooth-bluez.c @@ -1,8 +1,5 @@ #include -/* XXX: well, we are not using dbus yet, but anyway.. */ -#ifdef WITH_BLUEZ_DBUS_BT - #include #include #include @@ -264,5 +261,3 @@ free(ii); scan_info->sid = 0; return FALSE; } - -#endif diff --git a/src/bt-maemo.c b/src/gps-bluetooth-hildon.c similarity index 99% rename from src/bt-maemo.c rename to src/gps-bluetooth-hildon.c index c01e1cd..97050f9 100644 --- a/src/bt-maemo.c +++ b/src/gps-bluetooth-hildon.c @@ -25,8 +25,6 @@ #include -#ifdef WITH_HILDON_DBUS_BT - #include /* Let this header handle all ifdefs */ @@ -283,4 +281,3 @@ if (!dbus_g_proxy_call(scan_info->req_proxy, BTSEARCH_START_SEARCH_REQ, &error, return 0; } -#endif diff --git a/src/bt-maemo-marshal.list b/src/gps-bluetooth-maemo-marshal.list similarity index 100% rename from src/bt-maemo-marshal.list rename to src/gps-bluetooth-maemo-marshal.list