]> err.no Git - mapper/commitdiff
Use AM_CONDITIONALs to decide what GPS source to use.
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 17 Jan 2008 09:42:35 +0000 (11:42 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 17 Jan 2008 09:42:35 +0000 (11:42 +0200)
configure.ac
src/Makefile.am
src/gps-bluetooth-bluez.c [moved from src/bt-bluez.c with 98% similarity]
src/gps-bluetooth-hildon.c [moved from src/bt-maemo.c with 99% similarity]
src/gps-bluetooth-maemo-marshal.list [moved from src/bt-maemo-marshal.list with 100% similarity]

index 09aaae504aadce0a6e76b8b681ac8fd9030e0789..fcb15e85ab2d870251a10d9ade2870ee15a9b732 100644 (file)
@@ -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)
index 647175b8c8a15fc2dea0b43119a64f374e5c45c8..cc8afd871ce75c26208c1f93e4eed81675205433 100644 (file)
@@ -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 $< > $@ 
similarity index 98%
rename from src/bt-bluez.c
rename to src/gps-bluetooth-bluez.c
index 9b124bdb2630ddd198b29580ed108eed728e2739..8617fcd5c3d59ecc2c8ce5a6ade25b78993fe68e 100644 (file)
@@ -1,8 +1,5 @@
 #include <config.h>
 
-/* XXX: well, we are not using dbus yet, but anyway.. */
-#ifdef WITH_BLUEZ_DBUS_BT
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -264,5 +261,3 @@ free(ii);
 scan_info->sid = 0;
 return FALSE;
 }
-
-#endif
similarity index 99%
rename from src/bt-maemo.c
rename to src/gps-bluetooth-hildon.c
index c01e1cda9c47892b3b283e8c90c7c9e07a757b02..97050f94392f29108c9f13f69d70809eee87fb65 100644 (file)
@@ -25,8 +25,6 @@
 
 #include <config.h>
 
-#ifdef WITH_HILDON_DBUS_BT
-
 #include <fcntl.h>
 
 /* 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