summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-12-16 06:19:04 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-12-16 06:19:04 +0000
commitd12bdf251815c8081a1c6dcba5c2b670520f7f7f (patch)
tree39d5329a0695851a41b8188d9b12e8920f1f7b77
parent205906011e2e91e6dbe5b5d9c6a026c9c5ff8e08 (diff)
downloadgpsd-d12bdf251815c8081a1c6dcba5c2b670520f7f7f.tar.gz
Graceful degradation of the build if pthreads is not present.
This time for sure.
-rw-r--r--INSTALL11
-rw-r--r--configure.ac4
-rw-r--r--libgps.c2
3 files changed, 11 insertions, 6 deletions
diff --git a/INSTALL b/INSTALL
index ff64970e..652f1225 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,10 +1,11 @@
Here are the steps for installing gpsd and verifying its performance:
-0. Prerequisites you will need to build the entire suite include C,
-C++ and pthreads. Python is optional; it's used for the test tools, but
-not for the daemon itself. Support for DBUS is optional. The ncurses
-library is also optional; if you have it, the build will generate two
-additional test clients.
+0. Prerequisites you will need to build the entire suite include C and
+C++. The pthreads library is optional, needed if you want support
+for PPS timekeeping on serial GPSes. Python is optional; it's used for
+the test tools, but not for the daemon itself. Support for DBUS is
+optional. The ncurses library is also optional; if you have it, the
+build will generate two additional test clients.
1. Start by making sure you can get data from your GPS, otherwise the later
steps will be very frustrating. In this command
diff --git a/configure.ac b/configure.ac
index d42bb1d2..a77298f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,9 @@ AC_CHECK_LIB(m, rint, LIBM="-lm")
AC_SUBST(LIBM)
AC_CHECK_LIB(c, open, LIBC="-lc")
AC_SUBST(LIBC)
-AC_CHECK_LIB(pthread, pthread_setcancelstate, LIBPTHREAD="-lpthread")
+AC_CHECK_LIB(pthread, pthread_setcancelstate,
+ [LIBPTHREAD="-lpthread"
+ AC_DEFINE([HAVE_LIBPTHREAD], [], [pthread libraries are present])])
AC_SUBST(LIBPTHREAD)
AH_VERBATIM([_GNU_SOURCE],
diff --git a/libgps.c b/libgps.c
index e289c704..a8023ff6 100644
--- a/libgps.c
+++ b/libgps.c
@@ -549,6 +549,7 @@ int gps_query(struct gps_data_t *gpsdata, const char *fmt, ... )
return gps_poll(gpsdata);
}
+#ifdef HAVE_LIBPTHREAD
static void *poll_gpsd(void *args)
/* helper for the thread launcher */
{
@@ -600,6 +601,7 @@ int gps_del_callback(struct gps_data_t *gpsdata, pthread_t *handler)
(void)gps_query(gpsdata,"w-\n"); /* disable watcher mode */
return res;
}
+#endif /* HAVE_LIBPTHREAD */
#ifdef TESTMAIN
/*