Browse Source

Imported Upstream version 2.90

master
Bernd Zeimetz 11 years ago
parent
commit
99474f494d
100 changed files with 23220 additions and 22945 deletions
  1. +49
    -26
      INSTALL
  2. +239
    -123
      Makefile.am
  3. +882
    -521
      Makefile.in
  4. +16
    -2
      NEWS
  5. +2
    -1
      README
  6. +30
    -26
      TODO
  7. +4
    -2
      Tachometer.c
  8. +357
    -181
      aclocal.m4
  9. +144
    -0
      ais_json.c
  10. +2
    -2
      autogen.sh
  11. +3
    -4
      bits.c
  12. +16
    -16
      bits.h
  13. +610
    -656
      cgps.c
  14. +7682
    -13563
      configure
  15. +210
    -94
      configure.ac
  16. +0
    -28
      contrib/Makefile
  17. +0
    -459
      contrib/Makefile.in
  18. +0
    -45
      contrib/README
  19. +0
    -172
      contrib/ashctl.c
  20. +0
    -78
      contrib/binlog.c
  21. +0
    -167
      contrib/binreplay.c
  22. +0
    -101
      contrib/lla2ecef.c
  23. +0
    -42
      contrib/maxsats.pl
  24. +0
    -209
      contrib/motosend.c
  25. +0
    -264
      contrib/skyview.php
  26. +390
    -513
      driver_aivdm.c
  27. +97
    -72
      driver_evermore.c
  28. +101
    -78
      driver_garmin.c
  29. +78
    -51
      driver_garmin_txt.c
  30. +156
    -83
      driver_italk.c
  31. +4
    -1
      driver_italk.h
  32. +201
    -193
      driver_navcom.c
  33. +353
    -202
      driver_nmea.c
  34. +496
    -0
      driver_oncore.c
  35. +128
    -84
      driver_proto.c
  36. +113
    -294
      driver_rtcm2.c
  37. +11
    -8
      driver_rtcm3.c
  38. +506
    -267
      driver_sirf.c
  39. +236
    -122
      driver_superstar2.c
  40. +360
    -122
      driver_tsip.c
  41. +165
    -117
      driver_ubx.c
  42. +82
    -33
      driver_zodiac.c
  43. +313
    -333
      drivers.c
  44. +1
    -2
      geoid.c
  45. +38
    -27
      gps.1
  46. +457
    -172
      gps.h
  47. +407
    -271
      gps.py
  48. +8
    -13
      gps.xml
  49. +32
    -0
      gps_json.h
  50. +477
    -242
      gpscap.ini
  51. +21
    -11
      gpscap.py
  52. +8
    -13
      gpscat
  53. +17
    -9
      gpscat.1
  54. +129
    -0
      gpscat.in
  55. +136
    -0
      gpscat.xml
  56. +18
    -10
      gpsctl.1
  57. +95
    -56
      gpsctl.c
  58. +1
    -1
      gpsctl.xml
  59. +1245
    -75
      gpsd.8
  60. +1382
    -802
      gpsd.c
  61. +2
    -2
      gpsd.h-head
  62. +164
    -93
      gpsd.h-tail
  63. +6
    -4
      gpsd.hotplug
  64. +37
    -0
      gpsd.hotplug.wrapper
  65. +10
    -8
      gpsd.rules
  66. +990
    -127
      gpsd.xml
  67. +378
    -0
      gpsd_config.h
  68. +45
    -15
      gpsd_config.h.in
  69. +9
    -5
      gpsd_dbus.c
  70. +1341
    -0
      gpsd_json.c
  71. +1
    -2
      gpsd_report.c
  72. +3
    -1
      gpsdclient.c
  73. +2
    -2
      gpsdclient.h
  74. +54
    -27
      gpsdecode.1
  75. +361
    -99
      gpsdecode.c
  76. +57
    -38
      gpsdecode.xml
  77. +55
    -47
      gpsfake
  78. +22
    -14
      gpsfake.1
  79. +194
    -0
      gpsfake.in
  80. +15
    -10
      gpsfake.py
  81. +11
    -7
      gpsfake.xml
  82. +0
    -74
      gpsflash.1
  83. +0
    -689
      gpsflash.c
  84. +0
    -65
      gpsflash.h
  85. +0
    -108
      gpsflash.xml
  86. +30
    -14
      gpsmon.1
  87. +63
    -79
      gpsmon.c
  88. +13
    -8
      gpsmon.xml
  89. +4
    -13
      gpspacket.c
  90. +17
    -11
      gpspipe.1
  91. +98
    -66
      gpspipe.c
  92. +0
    -3
      gpspipe.xml
  93. +103
    -88
      gpsprof
  94. +23
    -23
      gpsprof.1
  95. +481
    -0
      gpsprof.in
  96. +5
    -20
      gpsprof.xml
  97. +82
    -67
      gpsutils.c
  98. +26
    -49
      gpxlogger.c
  99. +6
    -5
      hex.c
  100. +4
    -3
      isgps.c

+ 49
- 26
INSTALL View File

@@ -1,16 +1,39 @@
Here are the steps for installing gpsd and verifying its performance:

0. The only prerequisites you will absolutely need to build the suite
are C and C++ compilers: C for the gpsd daemon itself and its client C
library, C++ for the C++ client-library wrapper. Having the following
optional components on your system will enable various additional
capabilities and extensions:
0. gpsd has a core set of prerequisites that are required for any
configuration of the package, and then additional features and tests
have additional prerequisites.

Necessary components for any build:

C compiler -> gpsd and client library are written in C

The code depends on one non-C99 feature: anonymous unions. We could
eliminate these, but the cost would be source-level interface breakage
if we have to move structure members in and out of unions.

Having the following optional components on your system will enable
various additional capabilities and extensions:

C++ compiler -> libgpsmm C++ wrapper for the library
pthreads library -> support for PPS timekeeping on serial GPSes
DBUS -> gpsd will issue DBUS notifications
X windows + lesstif -> two test clients depend on this
ncurses -> two more test clients depend on this
Python -> most of the test and profiling tools are in Python

Python 2.6 or 2.4+ & simplejson. The Python code in GPSD is 2.4-compatible
except that you need either the json library module from 2.6 or the
functionally equivalent simplejson backport.

For building from SVN, the following are necessary:
autoconf 2.61 or later
automake 1.10 or later
libtool 2.26 or later
Python -> code is generated from python scripts

For working with DBUS, you'll need the DBUS development
headers and libraries installed. Under Debian/Ubuntu these
are the packages ibdbus-1-dev and libdbus-glib-1-dev.

For building from SVN, or if you change the man page source, xslt and
docbook xsl style files are used to generate nroff -man source from
@@ -22,6 +45,11 @@ docbook-xsl -> style file for xml to man translation
The build degrades gracefully in the absence of any of these. You should
be able to tell from configure messages which extensions you will get.

Under Ubuntu and most other Debian-derived, an easy way to pick up
the prerequisites is: "apt-get build-dep gpsd"

Once you have fetched the software prerequisites:

1. Start by making sure you can get data from your GPS, otherwise the later
steps will be very frustrating. In this command

@@ -36,14 +64,17 @@ have the wrong device. Look again.

2. Ensure that device permissions will enable gpsd to read from and
write to GPS devices even after it drops root privileges. If you are
running Fedora Core you can skip this step, as the stock configuration
has the right properties.
running Fedora Core or Ubuntu you can skip this step, as the stock
configuration has the right properties.

gpsd requires two things: (1) that GPS devices have group read and
write enabled, and (2) all of them are have the same group ID as a
prototypical device, typically /dev/ttyS0 under Linux or /dev/tty00
under *BSD. It does not actually matter what the owning group is,
as gpsd will look this up on startup.
as gpsd will look this up on startup. Alternatively, (3), you can
set a fallback group with the enable-gpsd-group in case the prototype
is not found: this should be the "dialout" group (or functional equivalent)
that has write access to serial devices.

Before dropping privileges, gpsd will ensure that it has access to
devices given to it on the command line by forcing their group read
@@ -83,7 +114,7 @@ need to do "./autogen.sh --x-includes=/usr/X11R6/include"
Note: if you are going to use the RTCM-104 support, you should compile
with gcc4; if you don't have it installed as your default
compiler, do this by specifying CC=gcc4 before the autogen.sh
command. The rtcm.c file confuses the gcc-3.4.[23] optimizer
command. The rtcm2.c file confuses the gcc-3.4.[23] optimizer
at -O2 level, making it generate incorrect code.

Then run make: libgps.so, gpsd, xgps, and xgpsspeed will be
@@ -93,23 +124,15 @@ home directory or to the system-wide X app-defaults directory.
4. Start gpsd. You'll need to give it as an argument a path to
a serial or USB port with a GPS attached to it.

5. Once gpsd is running, telnet to port 2947. Type 'f' to see what
device it will query. If you need to change the device, use 'f='
to do so (see the manual page for details). Now plug in your GPS.

6. Type "wr" to start raw and watcher modes. You should see NMEA data
(text lines beginning with $) spewing out. You will also see lines
with a GPSD prefix; these are sentence translations in GPSD protocol.

Note that until your GPS has acquired a fix, typing "p" to get position
will only return this:

GPSD,P=?
5. Once gpsd is running, telnet to port 2947. You should see a
greeting line that's a JSON object describing GPSD's version.
Now plug in your GPS (or AIS receiver, or RTCM2 receiver).

This response does not mean that gpsd is broken or that the GPS is not
sending data, merely that gpsd has not yet seen any *valid* position data.
You will have to wait for the GPS to acquire satellite lock. If you have
raw or watcher mode on, it should be obvious when you get a lock.
6. Type '?WATCH={"raw:1"};' to start raw and watcher modes. You
should see NMEA data (text lines beginning with $) spewing out. You
will also see lines beginning with '{' that are JSON objects
representing reports from your GPS; these are packet translations in
GPSD protocol.

7. Start the xgps client. Calling it with no arguments should do the right
thing. You should see a GUI panel with position/velocity-time information,


+ 239
- 123
Makefile.am View File

@@ -1,5 +1,22 @@
# Automake description for gpsd
# $Id: Makefile.am 5494 2009-03-18 15:16:41Z esr $
# $Id: Makefile.am 6709 2009-12-04 20:41:03Z esr $

CLEANFILES =

# For a detailed explanation of what this ugly code is doing, see
# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
MULTIOUT_RECOVER_DELETED = \
if test -f '$@'; then :; else \
trap "rm -rf '$$WITNESS.lock' '$$WITNESS'" HUP INT PIPE TERM; \
if mkdir "$$WITNESS.lock" 2>/dev/null; then \
rm -f "$$WITNESS"; \
$(MAKE) $(AM_MAKEFLAGS) "$$WITNESS"; \
result=$$?; rm -rf "$$WITNESS.lock"; exit $$result; \
else \
while test -d "$$WITNESS.lock"; do sleep 1; done; \
test -f "$$WITNESS"; \
fi; \
fi

#SUBDIRS = contrib

@@ -22,26 +39,33 @@ if HAVE_DBUS
INCLUDES = $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1
endif

RTCM104PAGES_DIST = gpsdecode.1
if HAVE_RTCM104V2
RTCM104PROGS = gpsdecode
RTCM104PAGES = gpsdecode.1
RTCM104PAGES = $(RTCM104PAGES_DIST)
endif

bin_PROGRAMS = $(MOTIF_PROGS) $(XAW_PROGS) $(RTCM104PROGS) $(CURSESPROGS) gpsctl gpspipe gpsflash gpxlogger lcdgps
bin_PROGRAMS = $(MOTIF_PROGS) $(XAW_PROGS) $(RTCM104PROGS) $(CURSESPROGS) gpsctl gpspipe gpxlogger lcdgps
sbin_PROGRAMS = gpsd
check_PROGRAMS = test_bits test_gpsmm test_packet test_mkgmtime test_geoid

check_PROGRAMS = test_float test_bits test_packet test_mkgmtime test_geoid test_json
if LIBGPSMM_ENABLE
check_PROGRAMS += test_gpsmm
endif

PYTHONPAGES_DIST = gpsprof.1 gpsfake.1 gpscat.1
if HAVE_PYTHON
dist_bin_SCRIPTS = gpsprof gpsfake gpscat
python_PYTHON = gps.py gpsfake.py gpscap.py
nodist_python_PYTHON = gpspacket.so gpslib.so
PYTHONPAGES = gpsprof.1 gpsfake.1 gpscat.1
PYTHONPAGES = $(PYTHONPAGES_DIST)
endif

#
# Build xgps
#
xgps_SOURCES = xgps.c
xgps_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XM_LIBS) $(XT_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)
xgps_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XM_LIBS) $(XT_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm

#
# Build xgpsspeed
@@ -97,7 +121,8 @@ lcdgps_LDADD = $(LIBM) libgps.la -lm
# Build gpsmon
#
gpsmon_SOURCES = gpsmon.c monitor_nmea.c monitor_sirf.c \
monitor_italk.c monitor_ubx.c monitor_superstar2.c
monitor_italk.c monitor_ubx.c monitor_superstar2.c \
monitor_oncore.c
gpsmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD)

#
@@ -106,37 +131,38 @@ gpsmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD)
gpsdecode_SOURCES = gpsdecode.c
gpsdecode_LDADD = $(LIBM) libgps.la -lm $(LIBPTHREAD)

#
# Build gpsflash
#
gpsflash_SOURCES = gpsflash.c gpsflash.h sirfflash.c
gpsflash_LDADD = $(LIBM) libgps.la -lm

#
# Build shared libraries
#
libgps_la_LDFLAGS = -version-number 18:0:0
libgps_la_LDFLAGS = -version-number 19:0:0
lib_LTLIBRARIES = libgps.la

libgpsd_c_sources = \
ais_json.c \
bits.c \
bsd-base64.c \
crc24q.c \
dgnss.c \
dgpsip.c \
gpsd_report.c \
gpsutils.c \
geoid.c \
gpsd_json.c \
hex.c \
isgps.c \
libgps.c \
json.c \
libgps_core.c \
libgps_json.c \
gpsdclient.c \
libgpsd_core.c \
maskdump.c \
net_dgpsip.c \
net_gnss_dispatch.c \
net_ntrip.c \
netlib.c \
ntpshm.c \
ntrip.c \
packet.c \
pseudonmea.c \
serial.c \
rtcm2_json.c \
srecord.c \
strl.c \
subframe.c \
@@ -148,6 +174,7 @@ libgpsd_c_sources = \
driver_italk.c \
driver_navcom.c \
driver_nmea.c \
driver_oncore.c \
driver_rtcm2.c \
driver_rtcm3.c \
driver_sirf.c \
@@ -162,20 +189,48 @@ libgpsd_h_sources = \
bits.h \
crc24q.h

BUILT_SOURCES = packet_names.h gpsd.h
BUILT_SOURCES = packet_names.h gpsd.h revision.h ais_json.i maskdump.c

packet_names.h: packet_states.h
sed -e '/^ *\([A-Z][A-Z0-9_]*\),/s// "\1",/' -e '/_states/s//_names/' < `test -f 'packet_states.h' || echo '$(srcdir)/'`packet_states.h > packet_names.h
rm -f packet_names.h && \
sed -e '/^ *\([A-Z][A-Z0-9_]*\),/s// "\1",/' -e '/_states/s//_names/' < `test -f 'packet_states.h' || echo '$(srcdir)/'`packet_states.h > packet_names.h && \
chmod a-w packet_names.h

gpsd.h: gpsd.h-head gpsd.h-tail gpsd_config.h
cat $(srcdir)/gpsd.h-head >gpsd.h
grep VERSION gpsd_config.h >>gpsd.h
grep ENABLE gpsd_config.h >>gpsd.h
cat $(srcdir)/gpsd.h-tail >>gpsd.h
rm -f gpsd.h && \
echo "/* This file is generated. Do not hand-hack it! */" >gpsd.h && \
cat $(srcdir)/gpsd.h-head >>gpsd.h && \
cat $(srcdir)/gpsd_config.h >>gpsd.h && \
cat $(srcdir)/gpsd.h-tail >>gpsd.h && \
chmod a-w gpsd.h

ais_json.i: jsongen.py
rm -f ais_json.i && \
$(PYTHON) jsongen.py --ais --target=parser >ais_json.i && \
chmod a-w ais_json.i

revision.h: Makefile
@rm -f revision.h && \
echo '#define' REVISION '"svn'`svnversion -n`'"' >revision.h && \
chmod a-w revision.h

maskdump.c: gpsd.h-tail maskaudit.py
rm -f maskdump.c && \
$(PYTHON) maskaudit.py -c >maskdump.c && \
chmod a-w maskdump.c

libgps_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
driver_rtcm2.h libgpsmm.cpp packet_states.h
nodist_libgps_la_SOURCES = packet_names.h
driver_rtcm2.h packet_states.h

# Warning: This overrides autoconf's normal link-line generatyion process
if LIBGPSMM_ENABLE
libgps_la_SOURCES += libgpsmm.cpp
libgps_la_LINK = /bin/sh ./libtool --tag=CXX --mode=link g++ $(libgps_la_LDFLAGS) -o $@
else
libgps_la_LINK = /bin/sh ./libtool --tag=CC --mode=link gcc $(libgps_la_LDFLAGS) -o $@
endif

nodist_libgps_la_SOURCES = packet_names.h ais_json.i
libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)

#
@@ -187,18 +242,51 @@ if HAVE_PYTHON
PYEXTENSIONS = gpspacket.so gpslib.so
noinst_SCRIPTS = gpspacket.so gpslib.so setup.py

gpspacket.so gpslib.so: gpspacket.c gpslib.c libgps.la
(pwd="`pwd`"; cd $(srcdir) && $(PYTHON) setup.py build_ext --build-lib "$$pwd" --build-temp "$$pwd/build" --include-dirs "$$pwd")
# Multiple-outputs hack. See
# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
$(PYEXTENSIONS): stamp-python-modules
+@WITNESS=stamp-python-modules; $(MULTIOUT_RECOVER_DELETED)
# TODO: Should the dependency on libgps.la be enforced inside
# setup.py? (See the variable 'needed_files' in setup.py.)
stamp-python-modules: gpspacket.c gpslib.c libgps.la setup.py
@rm -f '$@' '$@.tmp'
@echo 'timestamp for $@' > '$@.tmp'
(cd '$(srcdir)' && \
env abs_builddir='$(abs_builddir)' \
MAKE='$(MAKE)' \
$(PYTHON) setup.py build_ext \
--build-lib '$(srcdir)' \
--build-temp '$(srcdir)/build' \
--include-dirs '$(srcdir):.'\
--mangenerator '$(MANGENERATOR)') && \
mv -f '$@.tmp' '$@'
CLEANFILES += stamp-python-modules stamp-python-modules.tmp
endif
# Clean up after Python
clean-local:
rm -rf build

if LIBGPSMM_ENABLE
TESTBINS = test_float test_gpsmm test_bits test_packet test_geoid \
test_mkgmtime test_json
else
TESTBINS = test_float test_bits test_packet test_geoid \
test_mkgmtime test_json
endif

#
# Build test_float
#
test_float_SOURCES = test_float.c
test_float_LDADD = $(LIBC) libgps.la -lm

if LIBGPSMM_ENABLE
#
# Build test_gpsmm
#
test_gpsmm_SOURCES = test_gpsmm.cpp
test_gpsmm_LDADD = $(LIBC) libgps.la -lm
endif

#
# Build test_bits tester
@@ -224,31 +312,43 @@ test_geoid_LDADD = $(LIBC) libgps.la -lm
test_mkgmtime_SOURCES = test_mkgmtime.c
test_mkgmtime_LDADD = $(LIBC) libgps.la -lm

if HAVE_XSLT_PROCESSOR
#
# Create Manpages
#
BUILT_MANPAGES = \
# Build JSON parse tester
test_json_SOURCES = test_json.c
test_json_LDADD = $(LIBC) libgps.la -lm

MANPAGES_BASE = \
gpsd.8 \
gps.1 \
xgps.1 \
xgpsspeed.1 \
cgps.1 \
lcdgps.1 \
cgpxlogger.1 \
libgps.3 \
libgpsmm.3 \
libgpsd.3 \
gpsmon.1 \
$(RTCM104PAGES) \
$(PYTHONPAGES) \
gpsctl.1 \
gpspipe.1 \
gpsflash.1 \
rtcm-104.5 \
srec.5

if HAVE_XSLT_PROCESSOR
MANPAGES_DIST = \
$(MANPAGES_BASE) \
$(RTCM104PAGES_DIST) \
$(PYTHONPAGES_DIST)

man_MANS = \
$(BUILT_MANPAGES)
$(MANPAGES_BASE) \
$(RTCM104PAGES) \
$(PYTHONPAGES)

#
# Create Manpages
#
BUILT_MANPAGES = $(MANPAGES_DIST)

.xml.1:
$(MANGENERATOR) $(MANFLAGS) $(MANTARGET) $<
@@ -262,45 +362,34 @@ man_MANS = \
.xml.8:
$(MANGENERATOR) $(MANFLAGS) $(MANTARGET) $<

gpsd.8: gpsd.xml

gps.1 xgps.1 xgpsspeed.1 cgps.1 cgpxlogger.1: gps.xml

libgps.3: libgps.xml

libgpsmm.3: libgpsmm.xml

libgpsd.3: libgpsd.xml

gpsctl.1: gpsctl.xml

gpscat.1: gpsctl.xml

gpsprof.1: gpsprof.xml

gpsfake.1: gpsfake.xml

gpsmon.1: gpsmon.xml

gpspipe.1: gpspipe.xml

gpsdecode.1: gpsdecode.xml

rtcm-104.5: rtcm-104.xml

srec.5: srec.xml

gpsflash.1: gpsflash.xml

# Another instance of the multiple-outputs hack.
gps.1 xgps.1 xgpsspeed.1 cgps.1 lcdgps.1 cgpxlogger.1: stamp-gps-manpages
+@WITNESS=stamp-gps-manpages; $(MULTIOUT_RECOVER_DELETED)
stamp-gps-manpages: gps.xml
@rm -f '$@' '$@.tmp'
echo 'timestamp for $@' > '$@.tmp' && \
$(MANGENERATOR) $(MANFLAGS) $(MANTARGET) '$(srcdir)/gps.xml' && \
mv -f '$@.tmp' '$@'
CLEANFILES += stamp-gps-manpages stamp-gps-manpages.tmp
endif

noinst_HEADERS = driver_italk.h driver_rtcm2.h driver_superstar2.h \
driver_ubx.h gpsmon.h gpsdclient.h
noinst_HEADERS = gpsd_config.h \
driver_italk.h driver_rtcm2.h driver_superstar2.h \
driver_ubx.h gpsmon.h gpsdclient.h json.h gps_json.h \
revision.h

nodist_include_HEADERS = gpsd.h

if LIBGPSMM_ENABLE
include_HEADERS = gps.h libgpsmm.h
else
include_HEADERS = gps.h
endif

# Note: packaging/gpsd.spec is generated, but it needs to be in the
# tarball in order for 'make diat-rpm' to work.
EXTRA_DIST = \
revision.h \
autogen.sh \
README \
INSTALL \
@@ -308,6 +397,8 @@ EXTRA_DIST = \
TODO \
NEWS \
AUTHORS \
jsongen.py.in \
maskaudit.py.in \
dgpsip-servers \
test_float.c \
gpsd.php \
@@ -320,18 +411,19 @@ EXTRA_DIST = \
libgpsmm.xml \
gpsprof.xml \
gpsfake.xml \
gpscat.xml \
gpsctl.xml \
gpsmon.xml \
gpspipe.xml \
gpsdecode.xml \
rtcm-104.xml \
srec.xml \
gpsflash.xml \
$(man_MANS) \
$(MANPAGES_DIST) \
xgps.ad \
xgpsspeed.ad \
gpsd.rules \
gpsd.hotplug \
gpsd.hotplug.wrapper \
gpsd.usermap \
valgrind-audit \
valgrind-suppressions \
@@ -339,24 +431,30 @@ EXTRA_DIST = \
gpslib.c \
driver_proto.c \
monitor_proto.c \
logextract \
striplog \
setup.py \
packet_states.h \
libgps.pc.in \
libgpsd.pc.in \
gpscap.ini \
contrib/* \
packaging/*
packaging/gpsd.spec \
packaging/etc_default_gpsd \
packaging/etc_init.d_gpsd \
packaging/etc_init.d_gpsd_rpm

#dist-hook:
# $(MKDIR_P) '$(distdir)/contrib' && \
# cp -p '$(srcdir)/contrib/'* '$(distdir)/contrib'
#distclean-local:
# rm -rf '$(distdir)/contrib'

CLEANFILES = $(BUILT_SOURCES) test_float *.core $(PYEXTENSIONS) $(BUILT_MANPAGES)
CLEANFILES += $(BUILT_SOURCES) $(TESTBINS) *.core $(PYEXTENSIONS) $(BUILT_MANPAGES)

pkgconfig_DATA = libgps.pc libgpsd.pc
pkgconfigdir = $(libdir)/pkgconfig

# These are not distributed
libgps: libgps.c .libs/libgps.a
$(CC) $(CFLAGS) -o libgps -lm -DTESTMAIN $(LIBPTHREAD) -g libgps.c .libs/libgps.a
libgps: libgps_core.c .libs/libgps.a
$(CC) $(CFLAGS) -o libgps -lm -DTESTMAIN $(LIBPTHREAD) -g libgps_core.c .libs/libgps.a

# Report splint warnings
SPLINTOPTS = -I/usr/include/dbus-1.0/ +quiet
@@ -377,14 +475,27 @@ splint: gpsd.h packet_names.h
-splint $(SPLINTOPTS) $(gpspipe_SOURCES)
@echo "Running splint on gpsdecode..."
-splint $(SPLINTOPTS) -exportlocal gpsdecode.c
@echo "Running splint on gpsflash..."
-splint $(SPLINTOPTS) $(gpsflash_SOURCES)
@echo "Running splint on test_bits test harness..."
-splint $(SPLINTOPTS) $(test_bits_SOURCES)
@echo "Running splint on test_packet test harness..."
-splint $(SPLINTOPTS) $(test_packet_SOURCES)
@echo "Running splint on test_mkgmtime test harness..."
-splint $(SPLINTOPTS) $(test_mkgmtime_SOURCES)
@echo "Running splint on test_geoid test harness..."
-splint $(SPLINTOPTS) $(test_geoid_SOURCES)
@echo "Running splint on test_json test harness..."
-splint $(SPLINTOPTS) $(test_json_SOURCES)

# Re-indenting to a uniform style would be nice, and we leave this here
# as a rough guide to the project style, but it turns out that indent is
# an excessively blunt instrument. As of 2.2.10 it doesn't honor -nfca
# and produces loads of spurious changes to splint directives. Nor does
# it seem to honor -npcs.
indent:
chmod u+w maskdump.c
indent -i4 -br -cbi0 -bli0 -ncs -npcs -nfca $(gpsd_c_sources) $(libgpsd_c_sources)
chmod u-w maskdump.c
@echo "Diff lines:" `svn diff | wc -l`

# Bogon-checking the Python tools
pychecker:
@@ -405,21 +516,21 @@ version:

# Regression-test the daemon
gps-regress: gpsd
$(srcdir)/regress-driver -t $(srcdir)/test/stable/*.log
$(srcdir)/regress-driver -t $(srcdir)/test/daemon/*.log

# Test that super-raw mode works. Compare each logfile against itself
# dumped through the daemon running in R=2 mode. (This test is not
# included in the normal regressions.)
raw-regress:
$(srcdir)/regress-driver -r $(srcdir)/test/stable/*.log
$(srcdir)/regress-driver -r $(srcdir)/test/daemon/*.log

# Build the regression tests for the daemon.
gps-makeregress: gpsd
$(srcdir)/regress-driver -b $(srcdir)/test/stable/*.log
$(srcdir)/regress-driver -b $(srcdir)/test/daemon/*.log

# To build an individual test for a load named foo.log, put it in
# test/stable and do this:
# regress-driver -b test/stable/foo.log
# test/daemon and do this:
# regress-driver -b test/daemon/foo.log

# Regression-test the RTCM decoder.
rtcm-regress: gpsdecode
@@ -427,36 +538,40 @@ rtcm-regress: gpsdecode
@mkdir -p test
@for f in $(srcdir)/test/*.rtcm2; do \
echo "Testing $${f}..."; \
$(srcdir)/gpsdecode <$${f} >test/test.chk; \
diff -ub $${f}.chk test/test.chk; \
done; \
rm test/test.chk
$(srcdir)/gpsdecode <$${f} >$(srcdir)/test/test.chk; \
diff -ub $${f}.chk $(srcdir)/test/test.chk; \
done;
@echo "Testing idempotency of JSON dump/decode for RTCM2"
@gpsdecode -e -j <test/synthetic-rtcm2.json >$(srcdir)/test/test.chk
@grep -v '^#' test/synthetic-rtcm2.json | diff -ub - $(srcdir)/test/test.chk
@rm $(srcdir)/test/test.chk

# Rebuild the RTCM regression tests.
rtcm-makeregress: gpsdecode
@for f in $(srcdir)/test/*.rtcm2; do \
$(srcdir)/gpsdecode < $${f} > $${f}.chk; \
$(srcdir)/gpsdecode -j < $${f} > $${f}.chk; \
done


# Regression-test the AIVDM decoder.
aivdm-regress: gpsdecode
@echo "Testing AIVDM decoding..."
@mkdir -p test
@mkdir -p $(srcdir)/test
@for f in $(srcdir)/test/*.aivdm; do \
echo "Testing $${f}..."; \
$(srcdir)/gpsdecode <$${f} >test/test.chk; \
diff -ub $${f}.chk test/test.chk; \
done; \
rm test/test.chk
$(srcdir)/gpsdecode -u -c <$${f} >$(srcdir)/test/test.chk; \
diff -ub $${f}.chk $(srcdir)/test/test.chk; \
done;
@echo "Testing idempotency of JSON dump/decode for AIS"
@gpsdecode -e -j <test/synthetic-ais.json >$(srcdir)/test/test.chk
@grep -v '^#' test/synthetic-ais.json | diff -ub - $(srcdir)/test/test.chk
@rm $(srcdir)/test/test.chk

# Rebuild the AIVDM regression tests.
aivdm-makeregress: gpsdecode
@for f in $(srcdir)/test/*.aivdm; do \
$(srcdir)/gpsdecode < $${f} > $${f}.chk; \
$(srcdir)/gpsdecode -u -c <$${f} > $${f}.chk; \
done


# Regression-test the packet getter.
packet-regress: test_packet
@echo "Testing detection of invalid packets..."
@@ -464,8 +579,8 @@ packet-regress: test_packet

# Rebuild the packet-getter regression test
packet-makeregress: test_packet
@mkdir -p test
$(srcdir)/test_packet >test/packet.test.chk
@mkdir -p $(srcdir)/test
$(srcdir)/test_packet >$(srcdir)/test/packet.test.chk

# Regression-test the geoid tester.
geoid-regress: test_geoid
@@ -474,16 +589,8 @@ geoid-regress: test_geoid

# Rebuild the packet-getter regression test
geoid-makeregress: test_geoid
@mkdir -p test
$(srcdir)/test_geoid 37.371192 122.014965 >test/geoid.test.chk

# Test RTCM encoding using passthrough mode.
undump-regress: gpsdecode
@echo "Testing RTCM encoding..."
@mkdir -p test
@$(srcdir)/gpsdecode -p < $(srcdir)/test/undump.sample > test/undump.test
@diff -u $(srcdir)/test/undump.sample test/undump.test
@rm test/undump.test
@mkdir -p $(srcdir)/test
$(srcdir)/test_geoid 37.371192 122.014965 >$(srcdir)/test/geoid.test.chk

# Regression-test the calendar functions
time-regress: test_mkgmtime
@@ -491,24 +598,31 @@ time-regress: test_mkgmtime

# Regression test the unpacking code in libgps
unpack-regress: libgps
@echo "Testing the clent sentence unpacker..."
@$(srcdir)/libgps -u >test/test.chk
@diff -u test/unpack.chk test/test.chk
@echo "Testing the client-library sentence decoder..."
$(srcdir)/regress-driver -c -t $(srcdir)/test/clientlib/*.log

# Build the regressiuin test for the sentence unpacker
# Build the regression test for the sentence unpacker
unpack-makeregress: libgps
@echo "Rebuilding the clent sentence-unpacker test..."
@$(srcdir)/libgps -u >test/unpack.chk
@echo "Rebuilding the client sentence-unpacker tests..."
$(srcdir)/regress-driver -c -b $(srcdir)/test/clientlib/*.log

# Unit-test the JSON parsing
json-regress: test_json
test_json

# Unit-test the bitfield extractor - not in normal tests
bits-regress: test_bits
test_bits

# Do all normal regression tests
testregress: gps-regress rtcm-regress aivdm-regress packet-regress undump-regress time-regress unpack-regress
testregress: gps-regress rtcm-regress aivdm-regress packet-regress time-regress unpack-regress json-regress
@echo "Regressions complete."

# We would like "${MAKE} check" to run the regression tests. automake
# appears to have support for running programs, but not make targets.
# Perhaps the tests should be moved into scripts, but then it's not
# clear how to deal with $(srcdir).
# TESTS=testregress
# automake has support for running programs, but not make targets.
# However, TESTS_ENVIRONMENT can be used to specify an interpreter,
# which we use to re-invoke make.
TESTS_ENVIRONMENT = $(MAKE)
TESTS = gps-regress rtcm-regress aivdm-regress packet-regress time-regress unpack-regress json-regress

# Productions for setting up and performing udev tests.
#
@@ -551,7 +665,7 @@ dist-rpm: distdir
rpmbuild -ta $(distdir).tar.gz
$(am__remove_distdir)

# This is how to ship a release to Berlios incomoing.
# This is how to ship a release to Berlios incoming.
# It requires developer access verified via ssh.
#
upload-ftp: dist
@@ -568,6 +682,8 @@ svn-tag:
-m "Tagged for external release $(VERSION)"
#
# Ship a release, providing all regression tests pass.
# The clean is necessary so that dist will remake revision.h
# with the current revision level in it.
#
ship: testregress dist upload-ftp svn-tag
ship: testregress clean dist upload-ftp svn-tag


+ 882
- 521
Makefile.in
File diff suppressed because it is too large
View File


+ 16
- 2
NEWS View File

@@ -1,3 +1,17 @@
* Fri Dec 4 2009 Eric S. Raymond <esr@snark.thyrsus.com> - 2.90
GPSD-NG, the new JSON-based command protocol, is now deployed; as a
consequence, AIS is now fully supported in both daemon and client.
Detection of end of a fix-reporting cycle is now reliable;
accordingly data is accumulated from cycle start and the "J"
(nojitter) opoption on both server and client side is gone. We have
abandoned the gpsflash subproject since it has become apparent that
we can't do it without more vendor cooperation than we're likely to
get. Increase major version of shared library due to significant API
change. Added new driver for Motorola Oncore receivers, with help
from Håkan Johansson. gpsfake can now accept multiple logfiles,
interleaving test sentences from each. gpsd now accepts error
estimates from the NMEA $GPGBS sentence.

* Wed Mar 18 2009 Eric S. Raymond <esr@snark.thyrsus.com> - 2.39
Fixed potential core dump in C client handling of "K" responses.
Made device hotplugging work again; had been broken by changes in udev.
@@ -11,7 +25,7 @@
GPS chipset and adaptor can support it. Specfile and other packaging
paraphenalia now live in a packaging subdirectory. rtcmdecode becomes
gpsdecode and can now de-armor and dump AIDVM packets. The client
library now work correctly in locales where the decimal separator is
library now works correctly in locales where the decimal separator is
not a period.

* Tue Feb 10 2009 Eric S. Raymond <esr@snark.thyrsus.com> - 2.38
@@ -20,7 +34,7 @@
localhost only by default to avoid security problems; this can be
overridden with the -G command-line option. The packet-state machine
can now recognize RTCM3 packets, though support is not yet complete.
Added support for ublox5 and mkt-3301 devices. Add a wrapper around
Added support for ublox5 and mtk-3301 devices. Add a wrapper around
gpsd_hexdump to save CPU. Lots of little fixes to various packet
parsers. Always keep the device open: "-n" is not optional any more.
xgpsspeed no longer depends on Motif. gpsctl can now ship arbitrary


+ 2
- 1
README View File

@@ -1,4 +1,4 @@
$Id: README 4893 2009-01-05 17:13:19Z esr $
$Id: README 5566 2009-05-10 20:37:12Z esr $

COPYRIGHT
=========
@@ -98,6 +98,7 @@ modularized. His new features include:
rate to use and what the GPS's device type is.
* More new commands: 'I', 'U', 'E', 'B', 'Z'. See the docs.
* Support for SiRF binary mode.
* Support for RTCM104 and AIVDM.
* Support for multiple devices.
* Other test tools -- gpsfake, gpscat.



+ 30
- 26
TODO View File

@@ -1,4 +1,4 @@
$Id: TODO 5355 2009-03-04 15:07:01Z esr $
$Id: TODO 6705 2009-12-04 12:59:50Z esr $

This is the gpsd to-do list. If you're viewing it with Emacs, try
doing Ctl-C Ctl-t and browsing through the outline headers. Ctl-C Ctl-a
@@ -24,11 +24,29 @@ fix the driver yourself and send us the patch, contact Bill Powell
<bpowell@tntc.com> at True North Technologies and tell him he needs
to reverse his refusal to send us an eval unit.

*** Driver issues

**** bu303-nofix.log.ck:

Test returns a bogus altitude (large and negative) on NetBSD 5.0
i386, but not on Intel 64. This is probably a 32-vs.64-bit port problem.

**** navcom.chk:

This testfile triggers a numeric instability in the sin() and cos()
functions inside earth_distance(). The result is that epd is unstable.

** To do:

*** Ship a DEVICE notification on every driver change

There's a race condition where if you start cgps at just the right
time while an NMEA device is being probed, it may switch to a binary
type but never update the type display.

*** Complete and test the speed/parity/stopbit methods in the drivers

These are used for the 'B' command. All work for 8N1.
These are used for the '?DEVICE' (old 'B') command. All work for 8N1.

**** superstar2: not implemented (driver is unfinished)
**** italk: not implemented (but could be)
@@ -42,6 +60,12 @@ These are used for the 'B' command. All work for 8N1.
SiRF, UBX, TSIP, and even Zodiac can support non-8N1 modes; these need
to be tested.

*** Rewrite xgps

The Motif/Lesstif dependency is a pain in the butt, the code is a
maintainability problem, and we'd like to extend it to display AIS
messages. Probably the thing to do is write something pygtk-based.

*** Support the D-Bus signals recognized by libgypsy

Ian Holmes's Gypsy daemon is a pale shadow of GPSD, but his ideas
@@ -64,9 +88,8 @@ At the moment, when a gpsd client using libgps is connected to the
gpsd server, and the server is restarted, the client loses the
connection and do not update any more.

It would be nice if the gps_poll() and gps_query() would try to
reconnect to the server if the read() and write() calls on the tcp
socket fail.
It would be nice if gps_poll() would try to reconnect to the server if
the read() and write() calls on the tcp socket fail.

To test this, start gpsd first (/etc/init.d/gpsd start), xgps second,
and then restart gpsd (/etc/init.d/gpsd restart). The xgps client
@@ -99,11 +122,6 @@ This is Berlios FR #3789.

This would be useful for test code of all kinds.

*** New features for xgps.

Add J option checkbox. Maybe embed the speedometer widget from
xgpspeed in some of the unused space and nuke xgpsspeed.

*** Per-driver restore of changed config settings on exit.

This is a solved problem for generic NMEA, EverMore, TripMate,
@@ -140,20 +158,6 @@ GPSD_UNITS environment variable and chooses its UI mode depending on
whether or not it's running under X. There is controversy about this
proposal on the dev list.

*** SiRF firmware uploader

Chris Kuethe has shipped a 0.0 pre-alpha version. It is not yet
resolved whether SiRF Technology will allow us to ship the
binary loader code needed to actually use it.

*** uBlox firmware uploader

uBlox does make firmware updates available on their website and a cursory
inspection suggests that their flash process should plug directly in to
gpsflash - they use the same three stage process as SiRF: send a binary
command to enter programming mode, send a tiny reflash bootstrap program
and then send the actual firmware image.

*** Industry-standard format dumping of raw satellite data

It would be useful to be able to extract RINEX (or some other standard)
@@ -182,7 +186,7 @@ events, e.g. the world moving to RTCM3. We have support for analyzing
RTCM3 messages, but it's entirely theoretical - written from the
standard. We need to find a pair of files consisting of a
representative set of RTCM3 sentences and some sort of ASCII dump of
thgem so we can test whether our analyzer gets all the bitfield
them so we can test whether our analyzer gets all the bitfield
boundaries right.

*** Do the research to figure out just what is going on with status bits
@@ -229,7 +233,7 @@ include:
**** Detect IPv6 support and getaddrinfo(3) in configure.ac

This web page may be helpful, but is probably overkill - the world has
gotten simper since then:
gotten simpler since then:
http://cvs.deepspace6.net/view/example-ipv6-package/configure.ac?rev=1.2&content-type=text/vnd.viewcvs-markup

**** Change from one listening socket to N


+ 4
- 2
Tachometer.c View File

@@ -1,4 +1,4 @@
/* $Id: Tachometer.c 4427 2007-10-16 13:40:03Z esr $ */
/* $Id: Tachometer.c 6566 2009-11-20 03:51:06Z esr $ */
/*
* Tachometer Widget Implementation
*
@@ -12,7 +12,9 @@
#include <X11/StringDefs.h>
#include <TachometerP.h>
#include <math.h>
#include "gpsd_config.h" /* must define UNUSED */

#include "gpsd_config.h"
#include "gps.h"

#define D2R 0.0174532925199432957692369076848861271 /* radians = pi/180 */



+ 357
- 181
aclocal.m4
File diff suppressed because it is too large
View File


+ 144
- 0
ais_json.c View File

@@ -0,0 +1,144 @@
/****************************************************************************

NAME
ais_json.c - deserialize AIS JSON

DESCRIPTION
This module uses the generic JSON parser to get data from AIS
representations to libgps structures.

***************************************************************************/

#include <math.h>
#include <assert.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>

#include "gpsd.h"
#include "gps_json.h"

/*@ -mustdefine @*/
static void lenhex_unpack(const char *from,
size_t *plen, /*@out@*/char *to, size_t maxlen)
{
char *colon = strchr(from, ':');

*plen = (size_t)atoi(from);
if (colon != NULL)
(void)gpsd_hexpack(colon+1, to, maxlen);
}
/*@ +mustdefine @*/

int json_ais_read(const char *buf,
char *path, size_t pathlen,
struct ais_t *ais,
/*@null@*/const char **endptr)
{
/*@-compdef@*//* splint is confused by storage declared in the .i file */
/*@-nullstate@*/

#define AIS_HEADER \
{"class", check, .dflt.check = "AIS"}, \
{"type", uinteger, .addr.uinteger = &ais->type}, \
{"device", string, .addr.string = path, \
.len = pathlen}, \
{"repeat", uinteger, .addr.uinteger = &ais->repeat}, \
{"mmsi", uinteger, .addr.uinteger = &ais->mmsi}

int status;

#include "ais_json.i" /* JSON parser template structures */

#undef AIS_HEADER

memset(ais, '\0', sizeof(struct ais_t));

if (strstr(buf, "\"type\":1,")!=NULL || strstr(buf, "\"type\":2,")!=NULL || strstr(buf, "\"type\":3,")!=NULL) {
status = json_read_object(buf, json_ais1, endptr);
} else if (strstr(buf, "\"type\":4,") != NULL || strstr(buf, "\"type\":11,")!=NULL) {
status = json_read_object(buf, json_ais4, endptr);
if (status == 0) {
ais->type4.year = AIS_YEAR_NOT_AVAILABLE;
ais->type4.month = AIS_MONTH_NOT_AVAILABLE;
ais->type4.day = AIS_DAY_NOT_AVAILABLE;
ais->type4.hour = AIS_HOUR_NOT_AVAILABLE;
ais->type4.minute = AIS_MINUTE_NOT_AVAILABLE;
ais->type4.second = AIS_SECOND_NOT_AVAILABLE;
(void)sscanf(timestamp, "%4u-%02u-%02uT%02u:%02u:%02uZ",
&ais->type4.year,
&ais->type4.month,
&ais->type4.day,
&ais->type4.hour,
&ais->type4.minute,
&ais->type4.second);
}
} else if (strstr(buf, "\"type\":5,") != NULL) {
status = json_read_object(buf, json_ais5, endptr);
if (status == 0) {
ais->type5.month = AIS_MONTH_NOT_AVAILABLE;
ais->type5.day = AIS_DAY_NOT_AVAILABLE;
ais->type5.hour = AIS_HOUR_NOT_AVAILABLE;
ais->type5.minute = AIS_MINUTE_NOT_AVAILABLE;
(void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
&ais->type5.month,
&ais->type5.day,
&ais->type5.hour,
&ais->type5.minute);
}
} else if (strstr(buf, "\"type\":6,") != NULL) {
status = json_read_object(buf, json_ais6, endptr);
if (status == 0)
lenhex_unpack(data, &ais->type6.bitcount,
ais->type6.bitdata, sizeof(ais->type6.bitdata));
} else if (strstr(buf, "\"type\":7,") != NULL || strstr(buf, "\"type\":13,") != NULL) {
status = json_read_object(buf, json_ais7, endptr);
} else if (strstr(buf, "\"type\":8,") != NULL) {
status = json_read_object(buf, json_ais8, endptr);
if (status == 0)
lenhex_unpack(data, &ais->type8.bitcount,
ais->type8.bitdata, sizeof(ais->type8.bitdata));
} else if (strstr(buf, "\"type\":9,") != NULL) {
status = json_read_object(buf, json_ais9, endptr);
} else if (strstr(buf, "\"type\":10,") != NULL) {
status = json_read_object(buf, json_ais10, endptr);
} else if (strstr(buf, "\"type\":12,") != NULL) {
status = json_read_object(buf, json_ais12, endptr);
} else if (strstr(buf, "\"type\":14,") != NULL) {
status = json_read_object(buf, json_ais14, endptr);
} else if (strstr(buf, "\"type\":15,") != NULL) {
status = json_read_object(buf, json_ais15, endptr);
} else if (strstr(buf, "\"type\":16,") != NULL) {
status = json_read_object(buf, json_ais16, endptr);
} else if (strstr(buf, "\"type\":17,") != NULL) {
status = json_read_object(buf, json_ais17, endptr);
if (status == 0)
lenhex_unpack(data, &ais->type17.bitcount,
ais->type17.bitdata, sizeof(ais->type17.bitdata));
} else if (strstr(buf, "\"type\":18,") != NULL) {
status = json_read_object(buf, json_ais18, endptr);
} else if (strstr(buf, "\"type\":18,") != NULL) {
status = json_read_object(buf, json_ais17, endptr);
} else if (strstr(buf, "\"type\":19,") != NULL) {
status = json_read_object(buf, json_ais19, endptr);
} else if (strstr(buf, "\"type\":20,") != NULL) {
status = json_read_object(buf, json_ais20, endptr);
} else if (strstr(buf, "\"type\":21,") != NULL) {
status = json_read_object(buf, json_ais21, endptr);
} else if (strstr(buf, "\"type\":22,") != NULL) {
status = json_read_object(buf, json_ais23, endptr);
} else if (strstr(buf, "\"type\":23,") != NULL) {
status = json_read_object(buf, json_ais22, endptr);
} else if (strstr(buf, "\"type\":24,") != NULL) {
status = json_read_object(buf, json_ais24, endptr);
} else {
if (endptr != NULL)
*endptr = NULL;
return JSON_ERR_MISC;
}
/*@+compdef +nullstate@*/
return status;
}

/* ais_json.c ends here */

+ 2
- 2
autogen.sh View File

@@ -1,5 +1,5 @@
#!/bin/sh
# $Id: autogen.sh 5000 2009-01-13 20:43:34Z ckuethe $
# $Id: autogen.sh 5510 2009-03-24 15:36:51Z esr $

# Automakeversion
AM_1=1
@@ -107,4 +107,4 @@ aclocal \
&& autoconf --force \
&& echo Now running configure to configure gpsd \
&& echo "./configure $@" \
&& ./configure $@
&& ./configure "$@"

+ 3
- 4
bits.c View File

@@ -1,8 +1,8 @@
/* $Id: bits.c 5498 2009-03-18 17:37:53Z esr $ */
/* $Id: bits.c 6566 2009-11-20 03:51:06Z esr $ */
/*
* Bitfield extraction functions. In each, start is a bit index (not
* a byte index) and width is a bit width. The width bounded above by
* the bit width of a long long, which s 64 bits in all standard data
* the bit width of a long long, which is 64 bits in all standard data
* models for 32- and 64-bit processors.
*
* The sbits() function assumes twos-complement arithmetic.
@@ -12,14 +12,13 @@
#include "bits.h"
#ifdef DEBUG
#include <stdio.h>
#include "gpsd_config.h"
#include "gpsd.h"
#endif /* DEBUG */

#define BITS_PER_BYTE 8

unsigned long long ubits(char buf[], unsigned int start, unsigned int width)
/* extract a bitfield from the buffer as an unsigned big-endian long long */
/* extract a (zero-origin) bitfield from the buffer as an unsigned big-endian long long */
{
unsigned long long fld = 0;
unsigned int i;


+ 16
- 16
bits.h View File

@@ -1,4 +1,4 @@
/* $Id: bits.h 4794 2008-08-03 16:42:57Z ckuethe $ */
/* $Id: bits.h 6396 2009-10-12 00:15:01Z esr $ */
#ifndef _GPSD_BITS_H_
#define _GPSD_BITS_H_

@@ -41,30 +41,30 @@ union long_double {

/* these are independent of byte order */
#define getsb(buf, off) ((int8_t)buf[(off)-(GET_ORIGIN)])
#define getub(buf, off) ((u_int8_t)buf[(off)-(GET_ORIGIN)])
#define getub(buf, off) ((uint8_t)buf[(off)-(GET_ORIGIN)])
#define putbyte(buf,off,b) do {buf[(off)-(PUT_ORIGIN)] = (unsigned char)(b);} while (0)

/* little-endian access */
#define getlesw(buf, off) ((int16_t)(((u_int16_t)getub((buf), (off)+1) << 8) | (u_int16_t)getub((buf), (off))))
#define getleuw(buf, off) ((u_int16_t)(((u_int16_t)getub((buf), (off)+1) << 8) | (u_int16_t)getub((buf), (off))))
#define getlesl(buf, off) ((int32_t)(((u_int16_t)getleuw((buf), (off)+2) << 16) | (u_int16_t)getleuw((buf), (off))))
#define getleul(buf, off) ((u_int32_t)(((u_int16_t)getleuw((buf),(off)+2) << 16) | (u_int16_t)getleuw((buf), (off))))
#define getlesw(buf, off) ((int16_t)(((uint16_t)getub((buf), (off)+1) << 8) | (uint16_t)getub((buf), (off))))
#define getleuw(buf, off) ((uint16_t)(((uint16_t)getub((buf), (off)+1) << 8) | (uint16_t)getub((buf), (off))))
#define getlesl(buf, off) ((int32_t)(((uint16_t)getleuw((buf), (off)+2) << 16) | (uint16_t)getleuw((buf), (off))))
#define getleul(buf, off) ((uint32_t)(((uint16_t)getleuw((buf),(off)+2) << 16) | (uint16_t)getleuw((buf), (off))))

#define putleword(buf, off, w) do {putbyte(buf, (off)+1, (w) >> 8); putbyte(buf, (off), (w));} while (0)
#define putlelong(buf, off, l) do {putleword(buf, (off)+2, (l) >> 16); putleword(buf, (off), (l));} while (0)
#define getlesL(buf, off) ((int64_t)(((u_int64_t)getleul(buf, (off)+4) << 32) | getleul(buf, (off))))
#define getleuL(buf, off) ((u_int64_t)(((u_int64_t)getleul(buf, (off)+4) << 32) | getleul(buf, (off))))
#define putleword(buf, off, w) do {putbyte(buf, (off)+1, (uint)(w) >> 8); putbyte(buf, (off), (w));} while (0)
#define putlelong(buf, off, l) do {putleword(buf, (off)+2, (uint)(l) >> 16); putleword(buf, (off), (l));} while (0)
#define getlesL(buf, off) ((int64_t)(((uint64_t)getleul(buf, (off)+4) << 32) | getleul(buf, (off))))
#define getleuL(buf, off) ((uint64_t)(((uint64_t)getleul(buf, (off)+4) << 32) | getleul(buf, (off))))

#define getlef(buf, off) (i_f.i = getlesl(buf, off), i_f.f)
#define getled(buf, off) (l_d.l = getlesL(buf, off), l_d.d)

/* SiRF and most other GPS protocols use big-endian (network byte order) */
#define getbesw(buf, off) ((int16_t)(((u_int16_t)getub(buf, (off)) << 8) | (u_int16_t)getub(buf, (off)+1)))
#define getbeuw(buf, off) ((u_int16_t)(((u_int16_t)getub(buf, (off)) << 8) | (u_int16_t)getub(buf, (off)+1)))
#define getbesl(buf, off) ((int32_t)(((u_int16_t)getbeuw(buf, (off)) << 16) | getbeuw(buf, (off)+2)))
#define getbeul(buf, off) ((u_int32_t)(((u_int16_t)getbeuw(buf, (off)) << 16) | getbeuw(buf, (off)+2)))
#define getbesL(buf, off) ((int64_t)(((u_int64_t)getbeul(buf, (off)) << 32) | getbeul(buf, (off)+4)))
#define getbeuL(buf, off) ((u_int64_t)(((u_int64_t)getbeul(buf, (off)) << 32) | getbeul(buf, (off)+4)))
#define getbesw(buf, off) ((int16_t)(((uint16_t)getub(buf, (off)) << 8) | (uint16_t)getub(buf, (off)+1)))
#define getbeuw(buf, off) ((uint16_t)(((uint16_t)getub(buf, (off)) << 8) | (uint16_t)getub(buf, (off)+1)))
#define getbesl(buf, off) ((int32_t)(((uint16_t)getbeuw(buf, (off)) << 16) | getbeuw(buf, (off)+2)))
#define getbeul(buf, off) ((uint32_t)(((uint16_t)getbeuw(buf, (off)) << 16) | getbeuw(buf, (off)+2)))
#define getbesL(buf, off) ((int64_t)(((uint64_t)getbeul(buf, (off)) << 32) | getbeul(buf, (off)+4)))
#define getbeuL(buf, off) ((uint64_t)(((uint64_t)getbeul(buf, (off)) << 32) | getbeul(buf, (off)+4)))

#define putbeword(buf,off,w) do {putbyte(buf, (off) ,(w) >> 8); putbyte(buf, (off)+1, (w));} while (0)
#define putbelong(buf,off,l) do {putbeword(buf, (off) ,(l) >> 16); putbeword(buf, (off)+2, (l));} while (0)


+ 610
- 656
cgps.c
File diff suppressed because it is too large
View File


+ 7682
- 13563
configure
File diff suppressed because it is too large
View File


+ 210
- 94
configure.ac View File

@@ -1,83 +1,91 @@
dnl $Id: configure.ac 5502 2009-03-18 21:09:31Z esr $
dnl $Id: configure.ac 6710 2009-12-04 20:45:44Z esr $
AC_INIT
AM_INIT_AUTOMAKE(gpsd, 2.39)
AM_INIT_AUTOMAKE(gpsd, 2.90)
dnl AC_PREFIX_PROGRAM(gcc)
AM_CONFIG_HEADER(gpsd_config.h)
AC_LANG([C])

AC_ARG_ENABLE(python,
AC_HELP_STRING([--disable-python],
[disable python scripts and library bindings]),
[try_python="$enableval"], [try_python="yes"])
if test "x$try_python" = "xyes"; then
AM_PATH_PYTHON
ac_python=yes
if test "x$PYTHON" = "x"; then
AC_PATH_PROG(PYTHON, python, none)
fi
# ACREQUIRE_BUGFIX
# ----------------
# Due to a longstanding Autoconf bug (Autoconf 2.50 to at least 2.63),
# any macro that is AC_REQUIREd at any point must be AC_REQUIREd
# *before* it is directly expanded. The macros below were being
# directly expanded before being AC_REQUIREd, so we AC_REQUIRE them
# early to prevent out-of-order expansion problems. See the threads
# at:
# http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00039.html
# http://lists.gnu.org/archive/html/autoconf-patches/2008-12/msg00058.html
# http://lists.gnu.org/archive/html/bug-autoconf/2009-01/msg00019.html
# http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00247.html
AC_DEFUN_ONCE([ACREQUIRE_BUGFIX],
[
AC_REQUIRE([AC_PROG_CPP])
AC_REQUIRE([AC_PROG_EGREP])
AC_REQUIRE([AC_PROG_CC])
])
ACREQUIRE_BUGFIX
# ACREQUIRE_BUGFIX done

dnl AM_PATH_PYTHON provided with automake can be too old. Look
dnl for newer python first, and include 2.6 on the list.
m4_define([_AM_PYTHON_INTERPRETER_LIST],
[python3.0 python2.6 python2.5 python2.4 python])
AM_PATH_PYTHON([2.4])
ac_python=yes
if test "x$PYTHON" = "x"; then
AC_PATH_PROG(PYTHON, python, none)
fi

if test "x$PYTHON" = "xnone"; then
AC_MSG_WARN([*** Python interpreter not found, Python support disabled.])
ac_python=no
fi
if test "x$PYTHON" = "xnone"; then
AC_MSG_WARN([*** Python interpreter not found, Python support disabled.])
ac_python=no
fi

if test "x$ac_python" = "xyes"; then
AC_MSG_CHECKING(Python version and location)
PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
PYTHON_VERSION_MAJOR=[`$PYTHON -c "import sys; print '%d' % (sys.version_info[0]);"`]
PYTHON_VERSION_MINOR=[`$PYTHON -c "import sys; print '%d' % (sys.version_info[1]);"`]
PYTHON_VERSION="${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
AC_MSG_RESULT([$PYTHON, $PYTHON_VERSION, $PYTHON_PREFIX])

AC_MSG_CHECKING(whether Python is at least 2.4)
if test $PYTHON_VERSION_MAJOR -lt 2 -o $PYTHON_VERSION_MAJOR -eq 2 -a $PYTHON_VERSION_MINOR -lt 3; then
AC_MSG_RESULT(no)
AC_MSG_WARN([*** GPSD requires at least Python 2.3, Python support disabled.])
ac_python=no
fi
if test "x$ac_python" = "xyes"; then
AC_MSG_RESULT(yes)
if test "x$ac_python" = "xyes"; then
AC_MSG_CHECKING(Python version and location)
PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
PYTHON_VERSION_MAJOR=[`$PYTHON -c "import sys; print '%d' % (sys.version_info[0]);"`]
PYTHON_VERSION_MINOR=[`$PYTHON -c "import sys; print '%d' % (sys.version_info[1]);"`]
PYTHON_VERSION="${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
AC_MSG_RESULT([$PYTHON, $PYTHON_VERSION, $PYTHON_PREFIX])

PYTHON_CFLAGS="-DHAVE_PYTHON -I$PYTHON_PREFIX/include/python$PYTHON_VERSION"
PYTHON_CFLAGS="-DHAVE_PYTHON -I$PYTHON_PREFIX/include/python$PYTHON_VERSION"

OLD_CPPFLAGS="$CPPFLAGS"
OLD_CXXFLAGS="$CXXFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
CXXFLAGS="$CXXFLAGS $PYTHON_CFLAGS"
OLD_CPPFLAGS="$CPPFLAGS"
OLD_CXXFLAGS="$CXXFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
CXXFLAGS="$CXXFLAGS $PYTHON_CFLAGS"

AC_CHECK_HEADERS([Python.h],
[],
[AC_MSG_WARN([*** Python include files not found! You should install the Python development package. Python support disabled]); ac_python=no])
CPPFLAGS="$OLD_CPPFLAGS"
CXXFLAGS="$OLD_CXXFLAGS"
AC_CHECK_HEADERS([Python.h],
[],
[AC_MSG_WARN([*** Python include files not found! You should install the Python development package. Python support disabled]); ac_python=no])
CPPFLAGS="$OLD_CPPFLAGS"
CXXFLAGS="$OLD_CXXFLAGS"

if test "x$ac_python" = "xyes"; then
AC_SUBST([PYTHON_CFLAGS])

ac_python=no
for pylibpath in '/usr/lib' $PYTHON_PREFIX/lib $PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
eval `echo unset ac_cv_lib_python$PYTHON_VERSION'___'Py_Finalize | tr '.' '_'`

save_LIBS=$LIBS
LIBS="$LIBS -L$pylibpath $PYTHON_LIBS"
AC_CHECK_LIB(python$PYTHON_VERSION, Py_Finalize, PYTHON_LIBS="-L$pylibpath -lpython$PYTHON_VERSION $PYTHON_DEPS"; ac_python=yes,,$PYTHON_DEPS)
LIBS=$save_LIBS
if test "x$ac_python" = "xyes"; then
break
fi
done

if test "x$ac_python" != "xyes"; then
AC_MSG_WARN(*** Python development libraries required, Python support disabled)
fi
AC_SUBST([PYTHON_LIBS])

AC_SUBST(pkgpythondir)
if test "x$python_install" = "xyes"; then
pkgpythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION"/site-packages/gpsd"
fi
if test "x$ac_python" = "xyes"; then
AC_SUBST([PYTHON_CFLAGS])

ac_python=no
for pylibpath in '/usr/lib' $PYTHON_PREFIX/lib $PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
eval `echo unset ac_cv_lib_python$PYTHON_VERSION'___'Py_Finalize | tr '.' '_'`

save_LIBS=$LIBS
LIBS="$LIBS -L$pylibpath $PYTHON_LIBS"
AC_CHECK_LIB(python$PYTHON_VERSION, Py_Finalize, PYTHON_LIBS="-L$pylibpath -lpython$PYTHON_VERSION $PYTHON_DEPS"; ac_python=yes,,$PYTHON_DEPS)
LIBS=$save_LIBS
if test "x$ac_python" = "xyes"; then
break
fi
done

if test "x$ac_python" != "xyes"; then
AC_MSG_WARN(*** Python development libraries required, Python support disabled)
fi
AC_SUBST([PYTHON_LIBS])

AC_SUBST(pkgpythondir)
if test "x$python_install" = "xyes"; then
pkgpythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION"/site-packages/gpsd"
fi
fi
fi
@@ -153,7 +161,7 @@ if eval "test x$GCC = xyes"; then
dnl -Wcast-qual -W
fi

AC_CHECK_HEADERS(sys/termios.h sys/select.h sys/time.h sys/modem.h sys/ipc.h sys/shm.h sys/socket.h)
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)
AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/tcp.h)
AC_CHECK_HEADERS([netinet/ip.h], [], [],
[[#if HAVE_NETINET_IN_SYSTM_H && HAVE_NETINET_IN_H
@@ -219,25 +227,21 @@ AC_CHECK_LIB(pthread, pthread_setcancelstate,
AC_SUBST(LIBPTHREAD)

AH_VERBATIM([_GNU_SOURCE],
[/* Macro for declaring function arguments unused. */
#if defined(__GNUC__)
# define UNUSED __attribute__((unused)) /* Flag variable as unused */
#else /* not __GNUC__ */
# define UNUSED
#endif

/* Some libc's don't have strlcat/strlcpy. Local copies are provided */
[/* Some libc's don't have strlcat/strlcpy. Local copies are provided */
#ifndef HAVE_STRLCAT
size_t strlcat(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);
#endif
#ifndef HAVE_STRLCPY
size_t strlcpy(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);
#endif])
#endif

#define GPSD_CONFIG_H])

dnl Check for X libraries
ac_x="no"
if test x"$with_x" != "xno" -a x"$have_x" != "xdisabled"
then
X_LIBS=-lX11
AC_CHECK_HEADERS(X11/xpm.h xpm.h)
if test x"$ac_cv_header_X11_xpm_h" = "xno" &&
test x"$ac_cv_header_xpm_h" = "xno"; then
@@ -250,7 +254,6 @@ if test x"$with_x" != "xno" -a x"$have_x" != "xdisabled"
LIBS="$LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
AC_SUBST(X_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(X_PRE_LIBS)
@@ -352,6 +355,19 @@ else
AC_MSG_RESULT([no])
fi

dnl check for OnCore support
AC_ARG_ENABLE(oncore,
AC_HELP_STRING([--disable-oncore],
[disable Motorola OnCore chipset support]),
[ac_oncore=$enableval], [ac_oncore=yes])
AC_MSG_CHECKING([for Motorola OnCore support])
if test x"$ac_oncore" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ONCORE_ENABLE], 1, [Motorola OnCore chipset support])
else
AC_MSG_RESULT([no])
fi

dnl check for SiRF support
AC_ARG_ENABLE(sirf,
AC_HELP_STRING([--disable-sirf],
@@ -488,7 +504,7 @@ dnl check for Garmin Simple Text support
AC_ARG_ENABLE(garmintxt,
AC_HELP_STRING([--enable-garmintxt],
[enable Garmin Simple Text support]),
[ac_garmintxt=$enableval], [ac_garmintxt=no])
[ac_garmintxt=$enableval], [ac_garmintxt=yes])
AC_MSG_CHECKING([for Garmin Simple Text support])
if test x"$ac_garmintxt" = "xyes"; then
AC_MSG_RESULT([yes])
@@ -553,17 +569,17 @@ else
AC_MSG_RESULT([no])
fi

dnl check for MKT-3301 support
AC_ARG_ENABLE(mkt3301,
AC_HELP_STRING([--disable-mkt3301],
[disable MKT-3301 support]),
[ac_mkt3301=$enableval], [ac_mkt3301=yes])
AC_MSG_CHECKING([for MKT-3301 support])
if test x"$ac_mkt3301" = "xyes"; then
dnl check for MTK-3301 support
AC_ARG_ENABLE(mtk3301,
AC_HELP_STRING([--disable-mtk3301],
[disable MTK-3301 support]),
[ac_mtk3301=$enableval], [ac_mtk3301=yes])
AC_MSG_CHECKING([for MTK-3301 support])
if test x"$ac_mtk3301" = "xyes"; then
ac_nmea=yes
AC_MSG_RESULT([yes])
AC_DEFINE([MKT3301_ENABLE], 1, [MKT-3301 support])
AC_DEFINE([NMEA_ENABLE], 1, [MKT-3301 requires NMEA support])
AC_DEFINE([MTK3301_ENABLE], 1, [MTK-3301 support])
AC_DEFINE([NMEA_ENABLE], 1, [MTK-3301 requires NMEA support])
else
AC_MSG_RESULT([no])
fi
@@ -645,6 +661,47 @@ else
AC_MSG_RESULT([no])
fi

dnl check for latency timing support
AC_ARG_ENABLE(timing,
AC_HELP_STRING([--disable-timing],
[disable latency timing support]),
[ac_timing=$enableval], [ac_timing=yes])
AC_MSG_CHECKING([for latency timing support])
if test x"$ac_timing" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([TIMING_ENABLE], 1, [latency timing support)])
else
AC_MSG_RESULT([no])
fi

dnl check for client debugging support
AC_ARG_ENABLE(clientdebug,
AC_HELP_STRING([--disable-clientdebug],
[disable client debugging support]),
[ac_clientdebug=$enableval], [ac_clientdebug=yes])
AC_MSG_CHECKING([for client debugging support])
if test x"$ac_clientdebug" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([CLIENTDEBUG_ENABLE], 1, [client debugging support)])
else
AC_MSG_RESULT([no])
fi

AM_CONDITIONAL([CLIENTDEBUG_ENABLE], [test x"$ac_clientdebug" = x"yes"])

dnl check for support for oldstyle protocol
AC_ARG_ENABLE(oldstyle,
AC_HELP_STRING([--disable-oldstyle],
[disable oldstyle (pre-JSON) protocol support]),
[ac_oldstyle=$enableval], [ac_oldstyle=yes])
AC_MSG_CHECKING([for oldstyle support])
if test x"$ac_oldstyle" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([OLDSTYLE_ENABLE], 1, [oldstyle (pre-JSON) protocol support])
else
AC_MSG_RESULT([no])
fi

dnl check for profiling support
AC_ARG_ENABLE(profiling,
AC_HELP_STRING([--enable-profiling],
@@ -700,16 +757,27 @@ fi
dnl check for privilege revocation user at compile-time
AC_ARG_ENABLE(gpsd-user,
AC_HELP_STRING([--enable-gpsd-user=username],
[GPSD privilege revokation user]),
[GPSD privilege revocation user]),
[ac_user=$enableval], [ac_user=nobody])
AC_MSG_CHECKING([privilege revokation user])
AC_MSG_CHECKING([privilege revocation user])
if test x"$ac_user" != "xnobody"; then
AC_MSG_RESULT([$ac_user])
AC_DEFINE_UNQUOTED([GPSD_USER], "$ac_user", [GPSD privilege revokation user])
AC_DEFINE_UNQUOTED([GPSD_USER], "$ac_user", [GPSD privilege revocation user])
else
AC_MSG_RESULT([nobody])
fi

dnl check for privilege revocation group at compile-time
AC_ARG_ENABLE(gpsd-group,
AC_HELP_STRING([--enable-gpsd-group=groupname],
[GPSD privilege revocation group, use if /dev/ttyS0 not found]),
[ac_group=$enableval])
AC_MSG_CHECKING([privilege revokation group])
if test x"$ac_user" != "xnobody"; then
AC_MSG_RESULT([$ac_group])
AC_DEFINE_UNQUOTED([GPSD_GROUP], "$ac_group", [GPSD privilege revokation group])
fi

dnl check for port speed fixed at compile-time
AC_ARG_ENABLE(fixed-port-speed,
AC_HELP_STRING([--enable-fixed-port-speed=nnn],
@@ -792,7 +860,7 @@ fi
dnl allow tools to use control_send method
AC_ARG_ENABLE(controlsend,
AC_HELP_STRING([--disable-controlsend],
[do not allow gpsd to change device settings]),
[do not allow gpsctl/gpsmon to change device settings]),
[ac_controlsend=$enableval], [ac_controlsend=yes])
AC_MSG_CHECKING([if control sending is allowed])
if test x"$ac_controlsend" != "xno"; then
@@ -802,6 +870,19 @@ else
AC_MSG_RESULT([no])
fi

dnl enable raw measurements
AC_ARG_ENABLE(raw,
AC_HELP_STRING([--enable-raw],
[enable raw measurement processing]),
[ac_raw=$enableval], [ac_raw=yes])
AC_MSG_CHECKING([for Raw Measurement support])
if test x"$ac_raw" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([RAW_ENABLE], 1, [Raw Measurement support])
else
AC_MSG_RESULT([no])
fi

dnl Automatic check for DBUS.
dnl It's broken -- leads to bad compiles on systems with DBUS libraies
dnl but no DBUS headers.
@@ -845,6 +926,29 @@ else
AC_MSG_RESULT([no])
fi

dnl C++ bindings
if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
(test "X$CXX" != "Xg++"))) ; then
ISCXX="yes"
else
ISCXX="no"
fi

AC_ARG_ENABLE(libgpsmm,
AC_HELP_STRING([--disable-libgpsmm],
[don't build C++ bindings]),
[ac_libgpsmm=$enableval], [ac_libgpsmm=$ISCXX])
AC_MSG_CHECKING([for C++ support])
if test x"$ac_libgpsmm" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([LIBGPSMM_ENABLE], 1, [C++ support])
else
AC_MSG_RESULT([no])
fi

AM_CONDITIONAL([LIBGPSMM_ENABLE], [test x"$ac_libgpsmm" = x"yes"])

dnl Test for XSLT processor (xsltproc or xmlto)
AC_CHECK_PROG(WITH_XSLTPROC,[xsltproc],[yes],[no])
MANGENERATOR=
@@ -912,6 +1016,7 @@ echo "iTrax : $ac_itrax"
echo "NMEA : $ac_nmea"
echo "NTRIP : $ac_ntrip"
echo "Navcom : $ac_navcom"
echo "OnCore : $ac_oncore"
echo "RTCM104V2 : $ac_rtcm104v2"
echo "RTCM104V3 : $ac_rtcm104v3"
echo "SiRF : $ac_sirf"
@@ -923,10 +1028,14 @@ echo "OceanServer : $ac_oceanserver"
echo "UBX : $ac_ubx"
echo "GPSclock : $ac_gpsclock"
echo "AIVDM support : $ac_aivdm"
echo "MKT-3301 : $ac_mkt3301"
echo "Timing support : $ac_timing"
echo "Client debugging support: $ac_clientdebug"
echo "MTK-3301 : $ac_mtk3301"
dnl Below this line are non-protocol switches
echo " Daemon Features"
echo " ---------------"
echo "GPSD-NG : $ac_gpsdng"
echo "Old protocol : $ac_oldstyle"
echo "NTP SHM : $ac_ntpshm"
echo "NTP PPS : $ac_pps"
echo -n "PPS input on : " ; case $ac_ppsoncts in yes) echo "CTS" ;; no) echo "DCD" ;; *) echo "Not defined" ;; esac
@@ -939,12 +1048,15 @@ echo "Limited max devices : $ac_maxdevices"
echo "Allow device reconfig : $ac_reconfigure"
echo "Allow control send : $ac_controlsend"
echo "Squelch logging/hexdump : $ac_squelch"
echo "Raw Measurements : $ac_raw"
echo " Client Features"
echo " ---------------"
echo "Build ncurses programs : $ac_ncurses"
echo "Enable X11 support : $ac_x"
echo "Enable Python support : $ac_python"
echo "Enable C++ support : $ac_libgpsmm"
echo "------------------------------------------"
echo ""

if test "xdummy" = "xdummy" -a \
x"$ac_earthmate" = "xno" -a \
@@ -956,6 +1068,7 @@ if test "xdummy" = "xdummy" -a \
x"$ac_navcom" = "xno" -a \
x"$ac_nmea" = "xno" -a \
x"$ac_ntrip" = "xno" -a \
x"$ac_oncore" = "xno" -a \
x"$ac_rtcm104v2" = "xno" -a \
x"$ac_sirf" = "xno" -a \
x"$ac_superstar2" = "xno" -a \
@@ -966,6 +1079,9 @@ if test "xdummy" = "xdummy" -a \
x"$ac_ubx" = "xno"; then
AC_MSG_ERROR(Can't build gpsd with no protocols enabled)
fi
AC_OUTPUT(Makefile packaging/gpsd.spec libgps.pc libgpsd.pc)
AC_OUTPUT(Makefile packaging/gpsd.spec libgps.pc libgpsd.pc
jsongen.py maskaudit.py
gpscat gpsfake gpsprof valgrind-audit,
[chmod +x jsongen.py maskaudit.py gpscat gpsfake gpsprof valgrind-audit])
echo "Configure finished, type 'make' to build."


+ 0
- 28
contrib/Makefile View File

@@ -1,28 +0,0 @@
# This is a skeleton makefile to simplify building some of these little
# utilities. They probably won't be useful to many users, and they probably
# won't get used on a daily basis, but someone might find them useful for
# tinkering with their gear.

PROGS= ashctl binlog binreplay lla2ecef motosend

ADDOBJS=../strl.o

all: $(PROGS)

ashctl: ashctl.c
$(CC) $(CFLAGS) $(ADDOBJS) -o ashctl ashctl.c

binlog: binlog.c
$(CC) $(CFLAGS) $(ADDOBJS) -o binlog binlog.c

binreplay: binreplay.c
$(CC) $(CFLAGS) $(ADDOBJS) -o binreplay binreplay.c -lutil

lla2ecef: lla2ecef.c
$(CC) $(CFLAGS) $(ADDOBJS) -o lla2ecef lla2ecef.c -lm

motosend: motosend.c
$(CC) $(CFLAGS) $(ADDOBJS) -o motosend motosend.c

clean:
rm -f $(PROGS) *.o *.core

+ 0
- 459
contrib/Makefile.in View File

@@ -1,459 +0,0 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@
SOURCES = $(gpxlogger_SOURCES)

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
check_PROGRAMS = $(am__EXEEXT_1)
subdir = contrib
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__EXEEXT_1 = gpxlogger$(EXEEXT)
am_gpxlogger_OBJECTS = gpxlogger.$(OBJEXT)
gpxlogger_OBJECTS = $(am_gpxlogger_OBJECTS)
am__DEPENDENCIES_1 =
gpxlogger_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(gpxlogger_SOURCES)
DIST_SOURCES = $(gpxlogger_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_LIBS = @DBUS_LIBS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@
HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@
HAVE_MOTIF_FALSE = @HAVE_MOTIF_FALSE@
HAVE_MOTIF_TRUE = @HAVE_MOTIF_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBC = @LIBC@
LIBM = @LIBM@
LIBNSL = @LIBNSL@
LIBOBJS = @LIBOBJS@
LIBPTHREAD = @LIBPTHREAD@
LIBS = @LIBS@
LIBSOCKET = @LIBSOCKET@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
X11_LIBS = @X11_LIBS@
XAW_LIBS = @XAW_LIBS@
XEXT_LIBS = @XEXT_LIBS@
XM_LIBS = @XM_LIBS@
XPM_LIBS = @XPM_LIBS@
XP_LIBS = @XP_LIBS@
XT_LIBS = @XT_LIBS@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_prefix_program = @ac_prefix_program@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@

#if HAVE_DBUS
DBUS_PROGS = gpxlogger
INCLUDES = \
$(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE \
$(GLIB_CFLAGS)

gpxlogger_LDADD = \
$(DBUS_GLIB_LIBS) \
$(GLIB_LIBS)

gpxlogger_SOURCES = \
gpxlogger.c

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign contrib/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
gpxlogger$(EXEEXT): $(gpxlogger_OBJECTS) $(gpxlogger_DEPENDENCIES)
@rm -f gpxlogger$(EXEEXT)
$(LINK) $(gpxlogger_LDFLAGS) $(gpxlogger_OBJECTS) $(gpxlogger_LDADD) $(LIBS)