From 3d6bacac85d7ab9f3e5b56edc7392093ddbd4ee2 Mon Sep 17 00:00:00 2001 From: Adam Boggs Date: Sun, 22 Jan 2012 16:01:37 -0700 Subject: [PATCH] Added --with-gps flag for selectively compiling with or without gpsd support. Defaults to no gpsd support since it's still beta. --- configure.ac | 20 ++++++++++++++++---- src/plugins/Makefile.am | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index b3c0d4a..7223877 100644 --- a/configure.ac +++ b/configure.ac @@ -17,10 +17,22 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) PKG_CHECK_MODULES(GRITS, grits >= 0.6) # Check for gpsd support -AC_CHECK_LIB(gps, gps_open, GPS_LIBS="-lgps") -AM_CONDITIONAL(HAVE_GPSD, test "$GPS_LIBS" != "") -AC_DEFINE([HAVE_GPSD], [1], [GPSD support]) -AC_SUBST(GPS_LIBS) +AC_ARG_WITH([gps], AS_HELP_STRING([--with-gps], [Build with gpsd support])) + +if test "x$with_gps" = "xyes"; then + PKG_CHECK_MODULES(GPSD, libgps >= 3.0) + AC_DEFINE([HAVE_GPSD], [], [Have GPSD support]) + AC_SUBST(HAVE_GPSD, [TRUE]) +fi +AM_CONDITIONAL([HAVE_GPSD], test "$HAVE_GPSD" = "TRUE") + +# PKG_CHECK_MODULES(GPSD, libgps >= 3.0) +#AC_ARG_WITH([gps], AS_HELP_STRING([--with-gps], [Build with gpsd support])) +#AS_IF([test "x$with_gps" = "xyes"], [ +# PKG_CHECK_MODULES([GPSD], [libgps >= 3.0], +# [AC_DEFINE([HAVE_GPSD], [1], [Use GPSD])], +# [AC_DEFINE([HAVE_GPSD], [0], [No GPSD])] +# ]) # Define odd RSL install location AC_CHECK_LIB(rsl, RSL_wsr88d_to_radar, RSL_LIBS="-lrsl") diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 691f7fb..23d8004 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -28,7 +28,7 @@ gps_la_SOURCES = \ gps_la_CPPFLAGS = \ -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ -I$(top_srcdir)/src -gps_la_LIBADD = $(GPS_LIBS) $(GRITS_LIBS) +gps_la_LIBADD = $(GPSD_LIBS) $(GRITS_LIBS) endif if HAVE_RSL -- 2.43.2