cleanup specfile for packaging
[profile/ivi/gpsd.git] / configure.ac
1 dnl This file is Copyright (c)2010 by the GPSD project
2 dnl BSD terms apply: see the file COPYING in the distribution root for details.
3
4 AC_INIT
5 AM_INIT_AUTOMAKE(gpsd, 2.95)
6 dnl AC_PREFIX_PROGRAM(gcc)
7 AM_CONFIG_HEADER(gpsd_config.h)
8 AC_LANG([C])
9
10 # ACREQUIRE_BUGFIX
11 # ----------------
12 # Due to a longstanding Autoconf bug (Autoconf 2.50 to at least 2.63),
13 # any macro that is AC_REQUIREd at any point must be AC_REQUIREd
14 # *before* it is directly expanded.  The macros below were being
15 # directly expanded before being AC_REQUIREd, so we AC_REQUIRE them
16 # early to prevent out-of-order expansion problems.  See the threads
17 # at:
18 # http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00039.html
19 # http://lists.gnu.org/archive/html/autoconf-patches/2008-12/msg00058.html
20 # http://lists.gnu.org/archive/html/bug-autoconf/2009-01/msg00019.html
21 # http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00247.html
22 AC_DEFUN_ONCE([ACREQUIRE_BUGFIX],
23 [
24   AC_REQUIRE([AC_PROG_CPP])
25   AC_REQUIRE([AC_PROG_EGREP])
26   AC_REQUIRE([AC_PROG_CC])
27 ])
28 ACREQUIRE_BUGFIX
29 # ACREQUIRE_BUGFIX done
30
31 dnl AM_PATH_PYTHON provided with automake can be too old.  Look
32 dnl for newer python first, and include 2.6 on the list.
33 m4_define([_AM_PYTHON_INTERPRETER_LIST],
34             [python2.6 python2.5 python2.4 python])
35 AM_PATH_PYTHON([2.4])
36 ac_python=yes
37 if test "x$PYTHON" = "x"; then
38         AC_PATH_PROG(PYTHON, python, none)
39 fi
40
41 if test "x$PYTHON" = "xnone"; then
42 AC_MSG_WARN([*** Python interpreter not found, Python support disabled.])
43         ac_python=no
44 fi
45
46 if test "x$ac_python" = "xyes"; then
47         AC_MSG_CHECKING(Python version and location)
48         PYTHON_PREFIX=`$PYTHON -c "import sys; print(sys.prefix)"`
49         PYTHON_VERSION_MAJOR=[`$PYTHON -c "import sys; print('%d' % (sys.version_info[0]));"`]
50         PYTHON_VERSION_MINOR=[`$PYTHON -c "import sys; print('%d' % (sys.version_info[1]));"`]
51         PYTHON_VERSION="${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
52         AC_MSG_RESULT([$PYTHON, $PYTHON_VERSION, $PYTHON_PREFIX])
53
54         PYTHON_CFLAGS="-DHAVE_PYTHON -I$PYTHON_PREFIX/include/python$PYTHON_VERSION"
55
56         # Define the directories we ask setup.py to install the
57         # modules/extensions and scripts to. The way chosen here reproduces
58         # the internal behaviour of distutils. Unfortunately distutils does
59         # not export the pre-defined/configured directories, so we have to
60         # define them on our own. For default installations of distutils the
61         # chosen values here will match what distutils uses.
62         # See Makefile.am to see how they're used with setup.py.
63         PYTHON_DISTUTILS_LIBDIR=[`$PYTHON -c 'import distutils.util; import sys; print ("build/lib.%s-%s" %(distutils.util.get_platform(), sys.version[0:3]))'`]
64         PYTHON_DISTUTILS_SCRIPTDIR=[`$PYTHON  -c 'import sys; print ("build/scripts-%s" %(sys.version[0:3], ))'`]
65
66         OLD_CPPFLAGS="$CPPFLAGS"
67         OLD_CXXFLAGS="$CXXFLAGS"
68         CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
69         CXXFLAGS="$CXXFLAGS $PYTHON_CFLAGS"
70
71         AC_CHECK_HEADERS([Python.h],
72                         [],
73                         [AC_MSG_WARN([*** Python include files not found! You should install the Python development package. Python support disabled]); ac_python=no])
74         CPPFLAGS="$OLD_CPPFLAGS"
75         CXXFLAGS="$OLD_CXXFLAGS"
76
77         if test "x$ac_python" = "xyes"; then
78                 AC_SUBST([PYTHON_CFLAGS])
79                 AC_SUBST([PYTHON_DISTUTILS_LIBDIR])
80                 AC_SUBST([PYTHON_DISTUTILS_SCRIPTDIR])
81
82                 ac_python=no
83                 for pylibpath in '/usr/lib' $PYTHON_PREFIX/lib $PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
84                         eval `echo unset ac_cv_lib_python$PYTHON_VERSION'___'Py_Finalize | tr '.' '_'`
85
86                         save_LIBS=$LIBS
87                         LIBS="$LIBS -L$pylibpath $PYTHON_LIBS"
88                         AC_CHECK_LIB(python$PYTHON_VERSION, Py_Finalize, PYTHON_LIBS="-L$pylibpath -lpython$PYTHON_VERSION $PYTHON_DEPS"; ac_python=yes,,$PYTHON_DEPS)
89                         LIBS=$save_LIBS
90                         if test "x$ac_python" = "xyes"; then
91                                 break
92                         fi
93                 done
94
95                 if test "x$ac_python" != "xyes"; then
96                         AC_MSG_WARN(*** Python development libraries required, Python support disabled)
97                 fi
98                 AC_SUBST([PYTHON_LIBS])
99
100                 AC_SUBST(pkgpythondir)
101                 if test "x$python_install" = "xyes"; then
102                         pkgpythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION"/site-packages/gpsd"
103                 fi
104         fi
105 fi
106 AM_CONDITIONAL([HAVE_PYTHON], [test x"$ac_python" = xyes])
107
108 AC_PROG_LN_S
109 AC_PROG_MAKE_SET
110 AC_PROG_INSTALL
111 AC_PROG_LIBTOOL
112 AC_PROG_CXX
113 AC_C_BIGENDIAN
114 type_error="no"
115 AC_CHECK_SIZEOF([char])
116 AC_CHECK_SIZEOF([short])
117 AC_CHECK_SIZEOF([int])
118 AC_CHECK_SIZEOF([long])
119 AC_CHECK_SIZEOF([long long])
120 AC_CHECK_SIZEOF([float])
121 AC_CHECK_SIZEOF([double])
122 if test x"$ac_cv_sizeof_char" != "x1" ; then
123         AC_MSG_WARN(gpsd requires sizeof(char)==1);
124         type_error="yes"
125 fi
126 if test x"$ac_cv_sizeof_short" != "x2" ; then
127         AC_MSG_WARN(gpsd requires sizeof(short)==2);
128         type_error="yes"
129 fi
130 if test x"$ac_cv_sizeof_int" != "x4" ; then
131         AC_MSG_WARN(gpsd requires sizeof(int)==4);
132         type_error="yes"
133 fi
134 if test x"$ac_cv_sizeof_long_long" != "x8" ; then
135         AC_MSG_WARN(gpsd requires sizeof(long long)==8);
136         type_error="yes"
137 fi
138 if test x"$ac_cv_sizeof_float" != "x4" ; then
139         AC_MSG_WARN(gpsd requires sizeof(float)==4);
140         type_error="yes"
141 fi
142 if test x"$ac_cv_sizeof_double" != "x8" ; then
143         AC_MSG_WARN(gpsd requires sizeof(double)==8);
144         type_error="yes"
145 fi
146 if test x"$type_error" = "xyes" ; then
147         AC_ERROR(Your system does not provide all required data types);
148 fi
149
150 AC_FUNC_ALLOCA
151 AC_STDC_HEADERS
152 AC_C_CONST
153
154 AC_MSG_CHECKING([for properly working floating point implementation])
155 if test "x$build" = "x$host"; then
156         if eval "$CC $CFLAGS -o test_float ${srcdir}/test_float.c"; then
157                 if ./test_float > /dev/null; then
158                         AC_MSG_RESULT([yes])
159                 else
160                         AC_MSG_RESULT([no])
161                         AC_MSG_WARN([We strongly recommend you manually examine the test_float results])
162                 fi
163         else
164                 AC_MSG_RESULT([failure compiling test_float])
165         fi
166 else
167         AC_MSG_RESULT([skipped test (cross-compiling)])
168         AC_MSG_WARN([We are cross-compiling, and thus cannot run the floating point test now.
169 We strongly recommend running test_float on the target platform.])
170 fi
171
172
173 if eval "test x$GCC = xyes"; then
174         CFLAGS="$CFLAGS -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE"
175         dnl -Wcast-qual -W
176 fi
177
178 AC_CHECK_HEADERS(sys/termios.h sys/select.h sys/time.h sys/modem.h sys/ipc.h sys/shm.h sys/stat.h sys/socket.h sys/ioctl.h sys/un.h)
179 AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/tcp.h)
180 AC_CHECK_HEADERS([netinet/ip.h], [], [],
181 [[#if HAVE_NETINET_IN_SYSTM_H && HAVE_NETINET_IN_H
182 #include netinet/ip.h
183 #endif
184 ]])
185 AC_CHECK_HEADERS(termios.h strings.h getopt.h netdb.h syslog.h pwd.h grp.h)
186
187 AC_CHECK_FUNCS(round, roundf)
188 AC_CHECK_FUNCS(strlcpy)
189 AC_CHECK_FUNCS(strlcat)
190 AC_CHECK_FUNCS(strtonum)
191 AC_CHECK_FUNCS(setlocale)
192 AC_CHECK_FUNCS(vsnprintf)
193
194 AC_HEADER_TIME
195 AC_STRUCT_TIMEZONE
196
197 AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
198         AC_TRY_COMPILE([
199 #include <time.h>
200         ], [
201                 timezone = 1;
202         ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
203 if test $ac_cv_var_timezone = yes; then
204         AC_DEFINE(HAVE_TIMEZONE, [], [Have timezone variable])
205 else
206         AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
207                 AC_TRY_COMPILE([
208 #include <time.h>
209                         ], [
210                         struct tm tm;
211                         tm.tm_gmtoff = 1;
212                         ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no
213 ))
214         if test $ac_cv_struct_tm_gmtoff = yes; then
215                 AC_DEFINE(HAVE_TM_GMTOFF, [], [struct tm has tm_gmtoff])
216         else
217                 AC_ERROR(unable to find a way to determine timezone)
218         fi
219 fi
220 AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
221 [  AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
222       mb_cv_var_daylight=yes,
223       mb_cv_var_daylight=no)
224 ])
225 if test $mb_cv_var_daylight = yes; then
226    AC_DEFINE([HAVE_DAYLIGHT], 1,
227            [Define if you have the external 'daylight' variable.])
228 fi
229
230 AC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl")
231 AC_SUBST(LIBNSL)
232 AC_CHECK_LIB(socket, socket, LIBSOCKET="-lsocket")
233 AC_SUBST(LIBSOCKET)
234 AC_CHECK_LIB(m, rint, LIBM="-lm")
235 AC_SUBST(LIBM)
236 AC_CHECK_LIB(c, open, LIBC="-lc")
237 AC_SUBST(LIBC)
238 AC_CHECK_LIB(pthread, pthread_setcancelstate,
239         [LIBPTHREAD="-lpthread"
240         AC_DEFINE([HAVE_LIBPTHREAD], [], [pthread libraries are present])])
241 AC_SUBST(LIBPTHREAD)
242
243 PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0, [ac_libusb=yes], [ac_libusb=no])
244 AC_SUBST(LIBUSB_LIBS)
245 AC_SUBST(LIBUSB_CFLAGS)
246 if test x"$ac_libusb" = x"yes" ; then
247         AC_DEFINE([HAVE_LIBUSB], 1, [libusb support])
248 fi
249
250 AH_VERBATIM([_GNU_SOURCE],
251           [/* Some libc's don't have strlcat/strlcpy. Local copies are provided */
252 #ifndef HAVE_STRLCAT
253 # ifdef __cplusplus
254 extern "C" {
255 # endif
256 size_t strlcat(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);
257 # ifdef __cplusplus
258 }
259 # endif
260 #endif
261 #ifndef HAVE_STRLCPY
262 # ifdef __cplusplus
263 extern "C" {
264 # endif
265 size_t strlcpy(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);
266 # ifdef __cplusplus
267 }
268 # endif
269 #endif
270
271 #define GPSD_CONFIG_H])
272
273
274
275 dnl Check for curses headers and libraries.  The presence of the
276 dnl library is used to decide whether or not to build some programs.
277 dnl Those programs use ncurses.h if found, and otherwise use curses.h.
278 dnl TODO: give an example of what system uses curses.h with
279 dnl libncurses.  We define our own variables to reduce the risk of
280 dnl breaking if autoconf changes (private) variable names.
281 AC_CHECK_HEADERS(ncurses.h)
282 AC_CHECK_LIB(ncurses, initscr, NCURSES_LIBS="-lncurses")
283 AC_SUBST(NCURSES_LIBS)
284 if test x"$NCURSES_LIBS" = x"" ; then
285   AC_MSG_WARN([Not including curses support])
286   AM_CONDITIONAL([HAVE_NCURSES],false)
287   ac_ncurses="no"
288 else
289   AM_CONDITIONAL([HAVE_NCURSES],true)
290   ac_ncurses="yes"
291 fi
292
293 dnl check for NMEA support
294 AC_ARG_ENABLE(nmea,
295   AC_HELP_STRING([--disable-nmea],
296                  [disable NMEA support]),
297   [ac_nmea=$enableval], [ac_nmea=yes])
298 AC_MSG_CHECKING([for NMEA support])
299 if test x"$ac_nmea" = "xyes"; then
300     AC_MSG_RESULT([yes])
301         AC_DEFINE([NMEA_ENABLE], 1, [NMEA chipset support])
302 else
303   AC_MSG_RESULT([no])
304 fi
305
306 dnl check for OnCore support
307 AC_ARG_ENABLE(oncore,
308   AC_HELP_STRING([--disable-oncore],
309                  [disable Motorola OnCore chipset support]),
310   [ac_oncore=$enableval], [ac_oncore=yes])
311 AC_MSG_CHECKING([for Motorola OnCore support])
312 if test x"$ac_oncore" = "xyes"; then
313     AC_MSG_RESULT([yes])
314         AC_DEFINE([ONCORE_ENABLE], 1, [Motorola OnCore chipset support])
315 else
316   AC_MSG_RESULT([no])
317 fi
318
319 dnl check for SiRF support
320 AC_ARG_ENABLE(sirf,
321   AC_HELP_STRING([--disable-sirf],
322                  [disable SiRF chipset support]),
323   [ac_sirf=$enableval], [ac_sirf=yes])
324 AC_MSG_CHECKING([for SiRF support])
325 if test x"$ac_sirf" = "xyes"; then
326     AC_MSG_RESULT([yes])
327         AC_DEFINE([SIRF_ENABLE], 1, [SiRF chipset support])
328 else
329   AC_MSG_RESULT([no])
330 fi
331
332 dnl check for Novatel SuperStarII support
333 AC_ARG_ENABLE(superstar2,
334   AC_HELP_STRING([--disable-superstar2],
335                  [disable SuperStarII chipset support]),
336   [ac_superstar2=$enableval], [ac_superstar2=yes])
337 AC_MSG_CHECKING([for SuperStarII support])
338 if test x"$ac_superstar2" = "xyes"; then
339     AC_MSG_RESULT([yes])
340         AC_DEFINE([SUPERSTAR2_ENABLE], 1, [SuperStarII chipset support])
341 else
342   AC_MSG_RESULT([no])
343 fi
344
345 dnl check for Trimble TSIP support
346 AC_ARG_ENABLE(tsip,
347   AC_HELP_STRING([--disable-tsip],
348                  [disable Trimble TSIP support]),
349   [ac_tsip=$enableval], [ac_tsip=yes])
350 AC_MSG_CHECKING([for Trimble TSIP support])
351 if test x"$ac_tsip" = "xyes"; then
352     AC_MSG_RESULT([yes])
353         AC_DEFINE([TSIP_ENABLE], 1, [Trimble TSIP support])
354 else
355   AC_MSG_RESULT([no])
356 fi
357
358 dnl check for FV-18 support
359 AC_ARG_ENABLE(fv18,
360   AC_HELP_STRING([--disable-fv18],
361                  [disable San Jose Navigation FV-18 support]),
362   [ac_fv18=$enableval], [ac_fv18=yes])
363 AC_MSG_CHECKING([for FV-18 support])
364 if test x"$ac_fv18" = "xyes"; then
365     ac_nmea=yes
366     AC_MSG_RESULT([yes])
367         AC_DEFINE([FV18_ENABLE], 1, [San Jose Navigation FV-18 support])
368         AC_DEFINE([NMEA_ENABLE], 1, [San Jose Navigation FV-18 requires NMEA support])
369 else
370   AC_MSG_RESULT([no])
371 fi
372
373 dnl check for Tripmate support
374 AC_ARG_ENABLE(tripmate,
375   AC_HELP_STRING([--disable-tripmate],
376                  [disable DeLorme TripMate support]),
377   [ac_tripmate=$enableval], [ac_tripmate=yes])
378 AC_MSG_CHECKING([for Tripmate support])
379 if test x"$ac_tripmate" = "xyes"; then
380     AC_MSG_RESULT([yes])
381         AC_DEFINE([TRIPMATE_ENABLE], 1, [DeLorme TripMate support])
382 else
383   AC_MSG_RESULT([no])
384 fi
385
386 dnl check for EarthMate support
387 AC_ARG_ENABLE(earthmate,
388   AC_HELP_STRING([--disable-earthmate],
389                  [disable DeLorme EarthMate Zodiac support]),
390   [ac_earthmate=$enableval], [ac_earthmate=yes])
391 AC_MSG_CHECKING([for EarthMate support])
392 if test x"$ac_earthmate" = "xyes"; then
393     AC_MSG_RESULT([yes])
394         AC_DEFINE([EARTHMATE_ENABLE], 1, [DeLorme EarthMate Zodiac support])
395 else
396   AC_MSG_RESULT([no])
397 fi
398
399 dnl check for iTrax support
400 AC_ARG_ENABLE(itrax,
401   AC_HELP_STRING([--disable-itrax],
402                  [disable iTrax hardware support]),
403   [ac_itrax=$enableval], [ac_itrax=yes])
404 AC_MSG_CHECKING([for iTrax support])
405 if test x"$ac_itrax" = "xyes"; then
406     AC_MSG_RESULT([yes])
407         AC_DEFINE([ITRAX_ENABLE], 1, [iTrax chipset support])
408 else
409   AC_MSG_RESULT([no])
410 fi
411
412 dnl check for Ashtech support
413 AC_ARG_ENABLE(ashtech,
414   AC_HELP_STRING([--disable-ashtech],
415                  [disable Ashtech support]),
416   [ac_ashtech=$enableval], [ac_ashtech=yes])
417 AC_MSG_CHECKING([for Ashtech support])
418 if test x"$ac_ashtech" = "xyes"; then
419     AC_MSG_RESULT([yes])
420         AC_DEFINE([ASHTECH_ENABLE], 1, [Ashtech chipset support])
421 else
422   AC_MSG_RESULT([no])
423 fi
424
425 dnl check for Navcom support
426 AC_ARG_ENABLE(navcom,
427   AC_HELP_STRING([--disable-navcom],
428                  [disable Navcom support]),
429   [ac_navcom=$enableval], [ac_navcom=yes])
430 AC_MSG_CHECKING([for Navcom support])
431 if test x"$ac_navcom" = "xyes"; then
432     AC_MSG_RESULT([yes])
433         AC_DEFINE([NAVCOM_ENABLE], 1, [Navcom support])
434 else
435   AC_MSG_RESULT([no])
436 fi
437
438 dnl check for Garmin support
439 AC_ARG_ENABLE(garmin,
440   AC_HELP_STRING([--disable-garmin],
441                  [disable Garmin kernel driver support]),
442   [ac_garmin=$enableval], [ac_garmin=yes])
443 AC_MSG_CHECKING([for Garmin support])
444 if test x"$ac_garmin" = "xyes"; then
445     AC_MSG_RESULT([yes])
446         AC_DEFINE([GARMIN_ENABLE], 1, [Garmin support])
447 else
448   AC_MSG_RESULT([no])
449 fi
450
451 dnl check for Garmin Simple Text support
452 AC_ARG_ENABLE(garmintxt,
453   AC_HELP_STRING([--enable-garmintxt],
454                  [enable Garmin Simple Text support]),
455   [ac_garmintxt=$enableval], [ac_garmintxt=yes])
456 AC_MSG_CHECKING([for Garmin Simple Text support])
457 if test x"$ac_garmintxt" = "xyes"; then
458     AC_MSG_RESULT([yes])
459         AC_DEFINE([GARMINTXT_ENABLE], 1, [Garmin Simple Text support])
460 else
461   AC_MSG_RESULT([no])
462 fi
463
464 dnl check for True North support
465 AC_ARG_ENABLE(tnt,
466   AC_HELP_STRING([--enable-tnt],
467                  [disable True North Technologies support]),
468   [ac_tnt=$enableval], [ac_tnt=yes])
469 AC_MSG_CHECKING([for True North support])
470 if test x"$ac_tnt" = "xyes"; then
471     ac_nmea=yes
472     AC_MSG_RESULT([yes])
473         AC_DEFINE([TNT_ENABLE], 1, [True North Technologies support])
474         AC_DEFINE([NMEA_ENABLE], 1, [True North requires NMEA support])
475 else
476   AC_MSG_RESULT([no])
477 fi
478
479 dnl check for OceanServer support
480 AC_ARG_ENABLE(oceanserver,
481   AC_HELP_STRING([--disable-oceanserver],
482                  [disable OceanServer support]),
483   [ac_oceanserver=$enableval], [ac_oceanserver=yes])
484 AC_MSG_CHECKING([for OceanServer support])
485 if test x"$ac_oceanserver" = "xyes"; then
486     ac_nmea=yes
487     AC_MSG_RESULT([yes])
488         AC_DEFINE([OCEANSERVER_ENABLE], 1, [OceanServer support])
489         AC_DEFINE([NMEA_ENABLE], 1, [OceanServer requires NMEA support])
490 else
491   AC_MSG_RESULT([no])
492 fi
493
494 dnl check for UBX support
495 AC_ARG_ENABLE(ubx,
496   AC_HELP_STRING([--disable-ubx],
497                  [disable UBX Protocol support]),
498   [ac_ubx=$enableval], [ac_ubx=yes])
499 AC_MSG_CHECKING([for UBX support])
500 if test x"$ac_ubx" = "xyes"; then
501   AC_MSG_RESULT([yes])
502   AC_DEFINE([UBX_ENABLE], 1, [UBX Protocol support])
503 else
504   AC_MSG_RESULT([no])
505 fi
506
507 dnl check for EverMore support
508 AC_ARG_ENABLE(evermore,
509   AC_HELP_STRING([--disable-evermore],
510                  [disable EverMore binary support]),
511   [ac_evermore=$enableval], [ac_evermore=yes])
512 AC_MSG_CHECKING([for EverMore support])
513 if test x"$ac_evermore" = "xyes"; then
514     AC_MSG_RESULT([yes])
515         AC_DEFINE([EVERMORE_ENABLE], 1, [EverMore binary support])
516 else
517   AC_MSG_RESULT([no])
518 fi
519
520 dnl check for MTK-3301 support
521 AC_ARG_ENABLE(mtk3301,
522   AC_HELP_STRING([--disable-mtk3301],
523                  [disable MTK-3301 support]),
524   [ac_mtk3301=$enableval], [ac_mtk3301=yes])
525 AC_MSG_CHECKING([for MTK-3301 support])
526 if test x"$ac_mtk3301" = "xyes"; then
527     ac_nmea=yes
528     AC_MSG_RESULT([yes])
529         AC_DEFINE([MTK3301_ENABLE], 1, [MTK-3301 support])
530         AC_DEFINE([NMEA_ENABLE], 1, [MTK-3301 requires NMEA support])
531 else
532   AC_MSG_RESULT([no])
533 fi
534
535 dnl check for GPSClock support
536 AC_ARG_ENABLE(gpsclock,
537   AC_HELP_STRING([--disable-gpsclock],
538                  [disable GPSClock support]),
539   [ac_gpsclock=$enableval], [ac_gpsclock=yes])
540 AC_MSG_CHECKING([for GPSClock support])
541 if test x"$ac_gpsclock" = "xyes"; then
542     AC_MSG_RESULT([yes])
543         AC_DEFINE([GPSCLOCK_ENABLE], 1, [GPSclock chipset support])
544 else
545   AC_MSG_RESULT([no])
546 fi
547
548 dnl check for RTCM104V2 support
549 AC_ARG_ENABLE(rtcm104v2,
550   AC_HELP_STRING([--disable-rtcm104v2],
551                  [disable rtcm104v2 support]),
552   [ac_rtcm104v2=$enableval], [ac_rtcm104v2=yes])
553 AC_MSG_CHECKING([for rtcm104v2 support])
554 if test x"$ac_earthmate" = "xno" -a x"$ac_evermore" = "xno" -a x"$ac_garmin" = "xno" -a x"$ac_itrax" = "xno" -a x"$ac_sirf" = "xno" -a x"$ac_superstar2" = "xno" -a x"$ac_tsip" = "xno" -a x"$ac_navcom" = "xno"; then
555     ac_rtcm104v2=no
556 fi
557 if test x"$ac_rtcm104v2" = "xyes"; then
558     AC_MSG_RESULT([yes])
559         AC_DEFINE([RTCM104V2_ENABLE], 1, [rtcm104v2 binary support])
560 else
561   AC_MSG_RESULT([no])
562 fi
563
564 AM_CONDITIONAL([HAVE_RTCM104V2], [test "$ac_rtcm104v2" = "yes"])
565
566 dnl check for RTCM104V3 support
567 AC_ARG_ENABLE(rtcm104v3,
568   AC_HELP_STRING([--disable-rtcm104v3],
569                  [disable rtcm104v3 support]),
570   [ac_rtcm104v3=$enableval], [ac_rtcm104v3=yes])
571 AC_MSG_CHECKING([for rtcm104v3 support])
572 if test x"$ac_earthmate" = "xno" -a x"$ac_evermore" = "xno" -a x"$ac_garmin" = "xno" -a x"$ac_itrax" = "xno" -a x"$ac_sirf" = "xno" -a x"$ac_tsip" = "xno" -a x"$ac_navcom" = "xno"; then
573     ac_rtcm104v3=no
574 fi
575 if test x"$ac_rtcm104v3" = "xyes"; then
576     AC_MSG_RESULT([yes])
577         AC_DEFINE([RTCM104V3_ENABLE], 1, [rtcm104v3 binary support])
578 else
579   AC_MSG_RESULT([no])
580 fi
581
582 AM_CONDITIONAL([HAVE_RTCM104V3], [test "$ac_rtcm104v3" = "yes"])
583
584 dnl check for NTRIP support
585 AC_ARG_ENABLE(ntrip,
586   AC_HELP_STRING([--disable-ntrip],
587                  [disable NTRIP support]),
588   [ac_ntrip=$enableval], [ac_ntrip=yes])
589 AC_MSG_CHECKING([for NTRIP support])
590 if test x"$ac_ntrip" = "xyes"; then
591     AC_MSG_RESULT([yes])
592         AC_DEFINE([NTRIP_ENABLE], 1, [NTRIP support])
593 else
594   AC_MSG_RESULT([no])
595 fi
596
597 AM_CONDITIONAL([HAVE_NTRIP], [test "$ac_ntrip" = "yes"])
598
599 dnl check for AIVDM support
600 AC_ARG_ENABLE(aivdm,
601   AC_HELP_STRING([--disable-aivdm],
602                  [disable Aivdm support]),
603   [ac_aivdm=$enableval], [ac_aivdm=yes])
604 AC_MSG_CHECKING([for AIVDM support])
605 if test x"$ac_aivdm" = "xyes"; then
606     AC_MSG_RESULT([yes])
607         AC_DEFINE([AIVDM_ENABLE], 1, [AIVDM protocol support)])
608 else
609   AC_MSG_RESULT([no])
610 fi
611 AM_CONDITIONAL([HAVE_AIVDM], [test "$ac_aivdm" = "yes"])
612
613 dnl check for latency timing support
614 AC_ARG_ENABLE(timing,
615   AC_HELP_STRING([--disable-timing],
616                  [disable latency timing support]),
617   [ac_timing=$enableval], [ac_timing=yes])
618 AC_MSG_CHECKING([for latency timing support])
619 if test x"$ac_timing" = "xyes"; then
620     AC_MSG_RESULT([yes])
621         AC_DEFINE([TIMING_ENABLE], 1, [latency timing support)])
622 else
623   AC_MSG_RESULT([no])
624 fi
625
626 dnl check for client debugging support
627 AC_ARG_ENABLE(clientdebug,
628   AC_HELP_STRING([--disable-clientdebug],
629                  [disable client debugging support]),
630   [ac_clientdebug=$enableval], [ac_clientdebug=yes])
631 AC_MSG_CHECKING([for client debugging support])
632 if test x"$ac_clientdebug" = "xyes"; then
633     AC_MSG_RESULT([yes])
634         AC_DEFINE([CLIENTDEBUG_ENABLE], 1, [client debugging support)])
635 else
636   AC_MSG_RESULT([no])
637 fi
638
639 AM_CONDITIONAL([CLIENTDEBUG_ENABLE], [test x"$ac_clientdebug" = x"yes"])
640
641 dnl check for support for oldstyle protocol
642 AC_ARG_ENABLE(oldstyle,
643   AC_HELP_STRING([--disable-oldstyle],
644                  [disable oldstyle (pre-JSON) protocol support]),
645   [ac_oldstyle=$enableval], [ac_oldstyle=yes])
646 AC_MSG_CHECKING([for oldstyle support])
647 if test x"$ac_oldstyle" = "xyes"; then
648     AC_MSG_RESULT([yes])
649         AC_DEFINE([OLDSTYLE_ENABLE], 1, [oldstyle (pre-JSON) protocol support])
650 else
651   AC_MSG_RESULT([no])
652 fi
653
654 dnl check for profiling support
655 AC_ARG_ENABLE(profiling,
656   AC_HELP_STRING([--enable-profiling],
657                  [enable profiling support]),
658   [ac_profiling=$enableval], [ac_profiling=no])
659 AC_MSG_CHECKING([for profiling support])
660 if test x"$ac_profiling" = "xyes"; then
661     AC_MSG_RESULT([yes])
662         AC_DEFINE([PROFILING], 1, [profiling support])
663 else
664   AC_MSG_RESULT([no])
665 fi
666
667 dnl check for NTP time hinting support
668 AC_ARG_ENABLE(ntpshm,
669   AC_HELP_STRING([--disable-ntpshm],
670                  [disable NTP time hinting support]),
671   [ac_ntpshm=$enableval], [ac_ntpshm=yes])
672 AC_MSG_CHECKING([for NTP time hinting support])
673 if test x"$ac_ntpshm" = "xyes"; then
674     AC_MSG_RESULT([yes])
675         AC_DEFINE([NTPSHM_ENABLE], 1, [NTP time hinting support])
676 else
677   AC_MSG_RESULT([no])
678 fi
679
680 dnl check for PPS time syncing support
681 AC_ARG_ENABLE(pps,
682   AC_HELP_STRING([--disable-pps],
683                  [disable PPS time syncing support]),
684   [ac_pps=$enableval], [ac_pps=yes])
685 AC_MSG_CHECKING([for PPS time syncing support])
686 if test x"$ac_pps" = "xyes"; then
687     AC_MSG_RESULT([yes])
688         AC_DEFINE([PPS_ENABLE], 1, [PPS time syncing support])
689 else
690   AC_MSG_RESULT([no])
691 fi
692
693 dnl check for PPS input on CTS line
694 AC_ARG_ENABLE(pps-on-cts,
695   AC_HELP_STRING([--enable-pps-on-cts],
696                  [Enable PPS pulse on CTS rather than DCD]),
697   [ac_ppsoncts=$enableval], [ac_ppsoncts=no])
698 AC_MSG_CHECKING([for PPS pulse on CTS rather than DCD])
699 if test x"$ac_ppsoncts" = "xyes"; then
700     AC_MSG_RESULT([yes])
701        AC_DEFINE([PPS_ON_CTS], 1, [PPS on CTS rather than DCD])
702 else
703   AC_MSG_RESULT([no])
704 fi
705
706 dnl check for privilege revocation user at compile-time
707 AC_ARG_ENABLE(gpsd-user,
708   AC_HELP_STRING([--enable-gpsd-user=username],
709                  [GPSD privilege revocation user]),
710   [ac_user=$enableval], [ac_user=nobody])
711 AC_MSG_CHECKING([privilege revocation user])
712 if test x"$ac_user" != "xnobody"; then
713     AC_MSG_RESULT([$ac_user])
714         AC_DEFINE_UNQUOTED([GPSD_USER], "$ac_user", [GPSD privilege revocation user])
715 else
716   AC_MSG_RESULT([nobody])
717 fi
718
719 dnl check for privilege revocation group at compile-time
720 AC_ARG_ENABLE(gpsd-group,
721   AC_HELP_STRING([--enable-gpsd-group=groupname],
722                  [GPSD privilege revocation group, use if /dev/ttyS0 not found]),
723   [ac_group=$enableval])
724 AC_MSG_CHECKING([privilege revokation group])
725 if test x"$ac_user" != "xnobody"; then
726     AC_MSG_RESULT([$ac_group])
727         AC_DEFINE_UNQUOTED([GPSD_GROUP], "$ac_group", [GPSD privilege revokation group])
728 fi
729
730 dnl check for port speed fixed at compile-time
731 AC_ARG_ENABLE(fixed-port-speed,
732   AC_HELP_STRING([--enable-fixed-port-speed=nnn],
733                  [compile with fixed serial port speed]),
734   [ac_baud=$enableval], [ac_baud=no])
735 AC_MSG_CHECKING([for fixed port speed])
736 if test x"$ac_baud" != "xno"; then
737     AC_MSG_RESULT([$ac_baud])
738         AC_DEFINE_UNQUOTED([FIXED_PORT_SPEED], $ac_baud, [Fixed port speed])
739         FIXED_PORT_SPEED="-DSPEEDFLAGS=$ac_baud"
740 else
741   AC_MSG_RESULT([no])
742 fi
743
744 dnl Check for BlueZ support
745 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--enable-bluetooth], [Enable support for Bluetooth GPS devices via BlueZ (experimental)]),
746   [ac_bluetooth=$enableval], [ac_bluetooth=no])
747 AC_MSG_CHECKING([for BlueZ support])
748 if test x"$ac_bluetooth" = x"yes"; then
749     AC_MSG_RESULT([yes])
750     AC_DEFINE(HAVE_BLUEZ,1,[Define if we have Bluez])
751     # Older versions of autotools barf and die on this.
752     #PKG_CHECK_MODULES(BLUEZ, bluez )
753     BLUEZ_CFLAGS=`pkg-config --cflags bluez`
754     BLUEZ_LIBS=`pkg-config --libs bluez`
755     AC_SUBST(BLUEZ_CFLAGS)
756     AC_SUBST(BLUEZ_LIBS)
757 else
758     AC_MSG_RESULT([no])
759 fi
760
761
762
763 dnl Manually configure DBUS until we figure out a
764 dnl distro-independent was to check for both libraries and headers
765 AC_ARG_ENABLE(dbus,
766     AC_HELP_STRING([--enable-dbus],
767                 [enable DBUS support]),
768     [ac_dbus=$enableval], [ac_dbus=no])
769 AC_MSG_CHECKING([for DBUS support])
770 if test x"$ac_dbus" = "xyes"; then
771     AC_MSG_RESULT([yes])
772     AC_DEFINE([DBUS_ENABLE], 1, [DBUS support])
773     # Older versions of autotools barf and die on this.
774     #PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.23.4 )
775     DBUS_CFLAGS=`pkg-config --cflags dbus-glib-1`
776     DBUS_LIBS=`pkg-config --libs dbus-1`
777     AC_SUBST(DBUS_CFLAGS)
778     AC_SUBST(DBUS_LIBS)
779     #PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.22 )
780     DBUS_GLIB_LIBS=`pkg-config --libs dbus-glib-1`
781     AC_SUBST(DBUS_GLIB_CFLAGS)
782     AC_SUBST(DBUS_GLIB_LIBS)
783 else
784     AC_MSG_RESULT([no])
785 fi
786
787 dnl check for limited maximum clients
788 AC_ARG_ENABLE(max-clients,
789   AC_HELP_STRING([--enable-max-clients=nnn],
790                  [compile with limited maximum clients]),
791   [ac_maxclients=$enableval], [ac_maxclients=no])
792 AC_MSG_CHECKING([for limited max clients])
793 if test x"$ac_maxclients" != "xno"; then
794     AC_MSG_RESULT([$ac_maxclients])
795         AC_DEFINE_UNQUOTED([LIMITED_MAX_CLIENTS], $ac_maxclients, [Limited maximum clients])
796         LIMITED_MAX_CLIENTS="-DLIMITED_MAX_CLIENTS=$ac_maxclients"
797 else
798   AC_MSG_RESULT([no])
799 fi
800
801 dnl check for max number of GPS devices
802 AC_ARG_ENABLE(max-devices,
803   AC_HELP_STRING([--enable-max-devices=nnn],
804                  [compile with maximum allowed devices]),
805   [ac_maxdevices=$enableval], [ac_maxdevices=no])
806 AC_MSG_CHECKING([for max devices])
807 if test x"$ac_maxdevices" != "xno"; then
808     AC_MSG_RESULT([$ac_maxdevices])
809         AC_DEFINE_UNQUOTED([LIMITED_MAX_DEVICES], $ac_maxdevices, [Maximum gps devices])
810         LIMITED_MAX_DEVICES="-DLIMITED_MAX_DEVICES=$ac_maxdevices"
811 else
812   AC_MSG_RESULT([no])
813 fi
814
815 dnl allow gpsd to reconfigure gps receiver
816 AC_ARG_ENABLE(reconfigure,
817   AC_HELP_STRING([--disable-reconfigure],
818                  [do not allow gpsd to change device settings]),
819   [ac_reconfigure=$enableval], [ac_reconfigure=yes])
820 AC_MSG_CHECKING([if device reconfiguration is allowed])
821 if test x"$ac_reconfigure" != "xno"; then
822     AC_MSG_RESULT([$ac_reconfigure])
823         AC_DEFINE([ALLOW_RECONFIGURE], 1, [Allow gpsd to reconfigure device])
824 else
825   AC_MSG_RESULT([no])
826 fi
827
828 dnl allow tools to use control_send method
829 AC_ARG_ENABLE(controlsend,
830   AC_HELP_STRING([--disable-controlsend],
831                  [do not allow gpsctl/gpsmon to change device settings]),
832   [ac_controlsend=$enableval], [ac_controlsend=yes])
833 AC_MSG_CHECKING([if control sending is allowed])
834 if test x"$ac_controlsend" != "xno"; then
835     AC_MSG_RESULT([$ac_controlsend])
836         AC_DEFINE([ALLOW_CONTROLSEND], 1, [Allow gpsd to controlsend device])
837 else
838   AC_MSG_RESULT([no])
839 fi
840
841 dnl enable raw measurements
842 AC_ARG_ENABLE(raw,
843   AC_HELP_STRING([--enable-raw],
844                  [enable raw measurement processing]),
845   [ac_raw=$enableval], [ac_raw=yes])
846 AC_MSG_CHECKING([for Raw Measurement support])
847 if test x"$ac_raw" = "xyes"; then
848     AC_MSG_RESULT([yes])
849         AC_DEFINE([RAW_ENABLE], 1, [Raw Measurement support])
850 else
851   AC_MSG_RESULT([no])
852 fi
853
854 dnl Automatic check for DBUS.
855 dnl It's broken -- leads to bad compiles on systems with DBUS libraies
856 dnl but no DBUS headers.
857 dnl ac_dbus=no
858 dnl AC_CHECK_LIB(dbus-1, dbus_bus_get, [true], [false]) # do not update $LIBS
859 dnl if test x"yes" = x"$ac_cv_lib_dbus_1_dbus_bus_get" ; then
860 dnl    # Found dbus library, check for required versions and enable it
861 dnl
862 dnl    AC_MSG_CHECKING([for DBUS support])
863 dnl    PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.23.4,
864 dnl       [ac_dbus=yes],[ac_dbus=no])
865 dnl    AC_MSG_RESULT([$ac_dbus])
866 dnl    AC_SUBST(DBUS_CFLAGS)
867 dnl    AC_SUBST(DBUS_LIBS)
868 dnl
869 dnl    if test x"ac_dbus" = x"yes" ; then
870 dnl       AC_DEFINE([DBUS_ENABLE],1,[Found DBUS libraries])
871 dnl    fi
872 dnl
873 dnl    # Check for glib and dbus-glib, used by gpxlogger
874 dnl    PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2.0 )
875 dnl    AC_SUBST(GLIB_CFLAGS)
876 dnl    AC_SUBST(GLIB_LIBS)
877 dnl
878 dnl    PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.22)
879 dnl    AC_SUBST(DBUS_GLIB_CFLAGS)
880 dnl    AC_SUBST(DBUS_GLIB_LIBS)
881 dnl fi
882 AM_CONDITIONAL([HAVE_DBUS], [test x"$ac_dbus" = x"yes"])
883 AM_CONDITIONAL([HAVE_BLUEZ], [test x"$ac_bluetooth" = x"yes"])
884
885 dnl mute logging functions?
886 AC_ARG_ENABLE(squelch,
887   AC_HELP_STRING([--enable-squelch],
888                  [squelch gpsd_report and gpsd_hexdump to save cpu]),
889   [ac_squelch=$enableval], [ac_squelch=no])
890 AC_MSG_CHECKING([for disabled logging])
891 if test x"$ac_squelch" = "xyes"; then
892     AC_MSG_RESULT([yes])
893         AC_DEFINE([SQUELCH_ENABLE], 1, [Squelch logging and hexdumps])
894 else
895   AC_MSG_RESULT([no])
896 fi
897
898 dnl C++ bindings
899 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
900     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
901     (test "X$CXX" != "Xg++"))) ; then
902   ISCXX="yes"
903 else
904   ISCXX="no"
905 fi
906
907 AC_ARG_ENABLE(libgpsmm,
908   AC_HELP_STRING([--disable-libgpsmm],
909                  [don't build C++ bindings]),
910   [ac_libgpsmm=$enableval], [ac_libgpsmm=$ISCXX])
911 AC_MSG_CHECKING([for C++ support])
912 if test x"$ac_libgpsmm" = "xyes"; then
913     AC_MSG_RESULT([yes])
914         AC_DEFINE([LIBGPSMM_ENABLE], 1, [C++ support])
915 else
916   AC_MSG_RESULT([no])
917 fi
918
919 AM_CONDITIONAL([LIBGPSMM_ENABLE], [test x"$ac_libgpsmm" = x"yes"])
920
921
922
923 dnl Check for QtNetwork library and qmake. Both are necessary
924 dnl to build libQgpsmm. We use pkgconfig to check for the library
925 dnl and AC_CHECK_PROGS to search for qmake. As it is possible to
926 dnl install qmake from qt and qt4 in parallel, check for qmake-qt4
927 dnl first as this ensures we're using qmake for qt4.
928 AC_ARG_ENABLE(libQgpsmm,
929                 AC_HELP_STRING([--disable-libQgpsmm],
930                 [don't build QT bindings]),
931                 [ac_libQgpsmm=$enableval], [ac_libQgpsmm=$ISCXX])
932 AC_MSG_CHECKING([for QT support])
933 if test x"$ac_libQgpsmm" = "xyes"; then
934   PKG_CHECK_MODULES(QtNetwork, [QtNetwork >= 4.4],  ac_qt="yes", ac_qt="no")
935   if test x"$ac_qt" != "xyes"; then
936     AC_MSG_WARN([QtNetwork library not found. Not including QT support])
937     ac_libQgpsmm="no"
938     AM_CONDITIONAL([LIB_Q_GPSMM_ENABLE], false)
939     AC_MSG_RESULT([no])
940   else
941     AC_CHECK_PROGS(QMAKE, [qmake-qt4 qmake], [no])
942     if test x"$QMAKE" != "xno"; then
943       AM_CONDITIONAL([LIB_Q_GPSMM_ENABLE], true)
944       AC_MSG_RESULT([yes])
945     else
946       AC_MSG_WARN([qmake not found. Not including QT support])
947       ac_libQgpsmm="no"
948       AM_CONDITIONAL([LIB_Q_GPSMM_ENABLE], false)
949       AC_MSG_RESULT([no])
950     fi
951   fi
952 else
953   AC_MSG_RESULT([no])
954   AM_CONDITIONAL([LIB_Q_GPSMM_ENABLE], false)
955 fi
956
957
958
959 AC_ARG_ENABLE(ipv6,
960   AC_HELP_STRING([--disable-ipv6],
961                  [don't build IPv6 support]),
962   [ac_ipv6=$enableval], [ac_ipv6=$ISCXX])
963 AC_MSG_CHECKING([for IPv6 support])
964 if test x"$ac_ipv6" = "xyes"; then
965     AC_MSG_RESULT([yes])
966         AC_DEFINE([IPV6_ENABLE], 1, [IPv6 support])
967 else
968   AC_MSG_RESULT([no])
969 fi
970
971 AM_CONDITIONAL([IPV6_ENABLE], [test x"$ac_ipv6" = x"yes"])
972
973 dnl Test for XSLT processor (xsltproc or xmlto)
974 AC_CHECK_PROG(WITH_XSLTPROC,[xsltproc],[yes],[no])
975 XMLPROC=
976 MANTARGET=
977 XMLPROCFLAGS=
978 if test "x$WITH_XSLTPROC" = "xyes"; then
979     AC_MSG_CHECKING([whether xsltproc knows about docbook xsl])
980     DOCBOOK_MAN_URI='http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
981     DOCBOOK_HTML_URI='http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl'
982     cat >conftest.xml <<_EOF
983        <refentry id="foo.1">
984           <refmeta>
985             <refentrytitle>foo</refentrytitle>
986             <manvolnum>1</manvolnum>
987             <refmiscinfo class='date'>9 Aug 2004</refmiscinfo>
988           </refmeta>
989           <refnamediv id='name'>
990             <refname>foo</refname>
991             <refpurpose>check man page generation from docbook source</refpurpose>
992           </refnamediv>
993         </refentry>
994 _EOF
995     if xsltproc --nonet --noout "$DOCBOOK_MAN_URI" conftest.xml >/dev/null 2>&1; then
996         XMLPROC=xsltproc
997         MANTARGET="$DOCBOOK_MAN_URI"
998         HTMLTARGET="$DOCBOOK_HTML_URI"
999         XMLPROCFLAGS="--nonet"
1000         AC_MSG_RESULT([yes])
1001     else
1002         AC_MSG_RESULT([no])
1003     fi
1004     rm -f conftest.xml foo.1
1005 fi
1006 if test x"$XMLPROC" = x; then
1007     AC_CHECK_PROG(WITH_XMLTO,[xmlto],[yes],[no])
1008     if test "x$WITH_XMLTO" = "xyes"; then
1009         XMLPROC=xmlto
1010         MANTARGET=man
1011         HTMLTARGET=xhtml-nochunks
1012         XMLPROCFLAGS=
1013     else
1014         AC_MSG_WARN([Neither xsltproc nor xmlto works: I will not build man pages.])
1015         AC_MSG_WARN([To build man pages, install xsltproc/xsltlib or xmlto and run autogen.sh again.])
1016     fi
1017 fi
1018 AM_CONDITIONAL([HAVE_XSLT_PROCESSOR],
1019                [test x"$XMLPROC" != x])
1020 AM_CONDITIONAL([XMLTOSTDOUT], [test x"$XMLPROC" = x"xsltproc"])
1021 AC_SUBST(XMLPROC)
1022 AC_SUBST(MANTARGET)
1023 AC_SUBST(HTMLTARGET)
1024 AC_SUBST(XMLPROCFLAGS)
1025
1026 dnl Gentoo systems can have a problem with the Python path
1027 if test -e /etc/gentoo-release; then
1028     AC_MSG_WARN([This is a Gentoo system.])
1029     AC_MSG_WARN([Adjust your PYTHONPATH to see library directories under /usr/local/lib])
1030 fi 
1031
1032 dnl Output the configuration summary
1033 echo ""
1034 echo "=========================================="
1035 echo "$PACKAGE $VERSION"
1036 echo "------------------------------------------"
1037 dnl When you add a protocol here, don't forget the null-set check below
1038 echo "  Protocols"
1039 echo "  ---------"
1040 echo "Ashtech                 : $ac_ashtech"
1041 echo "Earthmate               : $ac_earthmate"
1042 echo "EverMore                : $ac_evermore"
1043 echo "FV-18                   : $ac_fv18"
1044 echo "Garmin                  : $ac_garmin"
1045 echo "Garmin Simple Text      : $ac_garmintxt"
1046 echo "iTrax                   : $ac_itrax"
1047 echo "NMEA                    : $ac_nmea"
1048 echo "NTRIP                   : $ac_ntrip"
1049 echo "Navcom                  : $ac_navcom"
1050 echo "OnCore                  : $ac_oncore"
1051 echo "RTCM104V2               : $ac_rtcm104v2"
1052 echo "RTCM104V3               : $ac_rtcm104v3"
1053 echo "SiRF                    : $ac_sirf"
1054 echo "SuperStarII             : $ac_superstar2"
1055 echo "Trimble TSIP            : $ac_tsip"
1056 echo "Tripmate                : $ac_tripmate"
1057 echo "True North              : $ac_tnt"
1058 echo "OceanServer             : $ac_oceanserver"
1059 echo "UBX                     : $ac_ubx"
1060 echo "GPSclock                : $ac_gpsclock"
1061 echo "AIVDM support           : $ac_aivdm"
1062 echo "Timing support          : $ac_timing"
1063 echo "Client debugging support: $ac_clientdebug"
1064 echo "MTK-3301                : $ac_mtk3301"
1065 dnl Below this line are non-protocol switches
1066 echo "  Daemon Features"
1067 echo "  ---------------"
1068 echo "NTP SHM                 : $ac_ntpshm"
1069 echo "NTP PPS                 : $ac_pps"
1070 echo -n "PPS input on            : " ; case $ac_ppsoncts in yes) echo "CTS" ;; no) echo "DCD" ;; *) echo "Not defined" ;; esac
1071 echo "Fixed port speed        : $ac_baud"
1072 echo "Priv-drop user          : $ac_user"
1073 echo "Enable shared libraries : $enable_shared"
1074 echo "Enable DBUS support     : $ac_dbus"
1075 echo "Enable BlueZ support    : $ac_bluetooth"
1076 echo "Enable IPv6 support     : $ac_ipv6"
1077 echo "Limited max clients     : $ac_maxclients"
1078 echo "Limited max devices     : $ac_maxdevices"
1079 echo "Allow device reconfig   : $ac_reconfigure"
1080 echo "Allow control send      : $ac_controlsend"
1081 echo "Squelch logging/hexdump : $ac_squelch"
1082 echo "Raw Measurements        : $ac_raw"
1083 echo "libusb device discovery : $ac_libusb"
1084 echo "  Client Features"
1085 echo "  ---------------"
1086 echo "Old protocol in libgps  : $ac_oldstyle"
1087 echo "Build ncurses programs  : $ac_ncurses"
1088 echo "Enable Python support   : $ac_python"
1089 echo "Enable C++ support      : $ac_libgpsmm"
1090 echo "Enable Qt support       : $ac_libQgpsmm"
1091 echo "------------------------------------------"
1092 echo ""
1093
1094 if test "xdummy" = "xdummy" -a \
1095     x"$ac_earthmate" = "xno" -a \
1096     x"$ac_evermore" = "xno" -a \
1097     x"$ac_fv18" = "xno" -a \
1098     x"$ac_garmin" = "xno" -a \
1099     x"$ac_garmintxt" = "xno" -a \
1100     x"$ac_itrax" = "xno" -a \
1101     x"$ac_navcom" = "xno" -a \
1102     x"$ac_nmea" = "xno" -a \
1103     x"$ac_ntrip" = "xno" -a \
1104     x"$ac_oncore" = "xno" -a \
1105     x"$ac_rtcm104v2" = "xno" -a \
1106     x"$ac_sirf" = "xno" -a \
1107     x"$ac_superstar2" = "xno" -a \
1108     x"$ac_tnt" = "xno" -a \
1109     x"$ac_oceanserver" = "xno" -a \
1110     x"$ac_tripmate" = "xno" -a \
1111     x"$ac_tsip" = "xno" -a \
1112     x"$ac_ubx" = "xno"; then
1113     AC_MSG_ERROR(Can't build gpsd with no protocols enabled)
1114 fi
1115 AC_OUTPUT(Makefile packaging/rpm/gpsd.spec libgps.pc libgpsd.pc
1116                    jsongen.py maskaudit.py
1117                    valgrind-audit,
1118                    [chmod +x jsongen.py maskaudit.py gpscat gpsfake gpsprof xgps valgrind-audit])
1119 echo "Configure finished, type 'make' to build."
1120