Browse Source

Imported Upstream version 2.93

master
Bernd Zeimetz 10 years ago
parent
commit
8bae0d114d
100 changed files with 10778 additions and 8506 deletions
  1. +10
    -4
      COPYING
  2. +48
    -19
      INSTALL
  3. +188
    -92
      Makefile.am
  4. +255
    -187
      Makefile.in
  5. +23
    -2
      NEWS
  6. +0
    -2
      README
  7. +45
    -118
      TODO
  8. +3
    -1
      Tachometer.c
  9. +4
    -1
      Tachometer.h
  10. +4
    -1
      TachometerP.h
  11. +35
    -29
      ais_json.c
  12. +32
    -0
      ais_json.i
  13. +0
    -1
      autogen.sh
  14. +17
    -12
      bits.c
  15. +5
    -4
      bits.h
  16. +170
    -170
      bsd-base64.c
  17. +4
    -1
      bsd-base64.h
  18. +254
    -199
      cgps.c
  19. +43
    -8
      config.guess
  20. +41
    -13
      config.sub
  21. +108
    -27
      configure
  22. +61
    -9
      configure.ac
  23. +76
    -81
      crc24q.c
  24. +5
    -2
      crc24q.h
  25. +164
    -56
      depcomp
  26. +3
    -0
      do-tests
  27. +42
    -32
      driver_aivdm.c
  28. +260
    -216
      driver_evermore.c
  29. +600
    -512
      driver_garmin.c
  30. +213
    -172
      driver_garmin_txt.c
  31. +160
    -136
      driver_italk.c
  32. +4
    -1
      driver_italk.h
  33. +382
    -335
      driver_navcom.c
  34. +531
    -490
      driver_nmea.c
  35. +190
    -168
      driver_oncore.c
  36. +47
    -25
      driver_proto.c
  37. +193
    -177
      driver_rtcm2.c
  38. +6
    -4
      driver_rtcm2.h
  39. +641
    -498
      driver_rtcm3.c
  40. +635
    -535
      driver_sirf.c
  41. +246
    -219
      driver_superstar2.c
  42. +4
    -1
      driver_superstar2.h
  43. +511
    -470
      driver_tsip.c
  44. +402
    -371
      driver_ubx.c
  45. +4
    -1
      driver_ubx.h
  46. +153
    -115
      driver_zodiac.c
  47. +246
    -237
      drivers.c
  48. +72
    -56
      geoid.c
  49. +4
    -4
      gps.1
  50. +79
    -64
      gps.h
  51. +7
    -1
      gps.xml
  52. +8
    -0
      gps/__init__.py
  53. BIN
      gps/__init__.pyc
  54. BIN
      gps/client.so
  55. +2
    -2
      gps/fake.py
  56. BIN
      gps/fake.pyc
  57. +53
    -197
      gps/gps.py
  58. BIN
      gps/gps.pyc
  59. BIN
      gps/packet.so
  60. +15
    -4
      gps_json.h
  61. +4
    -5
      gps_maskdump.c
  62. +50
    -21
      gpscap.ini
  63. +2
    -0
      gpscap.py
  64. +0
    -132
      gpscat
  65. +4
    -9
      gpscat.1
  66. +3
    -3
      gpscat.in
  67. +7
    -8
      gpscat.xml
  68. +3
    -1
      gpsclient.c
  69. +4
    -4
      gpsctl.1
  70. +8
    -6
      gpsctl.c
  71. +7
    -1
      gpsctl.xml
  72. +541
    -40
      gpsd.8
  73. +650
    -634
      gpsd.c
  74. +100
    -27
      gpsd.h
  75. +5
    -2
      gpsd.h-head
  76. +74
    -22
      gpsd.h-tail
  77. +4
    -1
      gpsd.hotplug
  78. +3
    -1
      gpsd.hotplug.wrapper
  79. +126
    -153
      gpsd.php
  80. +3
    -1
      gpsd.rules
  81. +3
    -1
      gpsd.usermap
  82. +424
    -54
      gpsd.xml
  83. +21
    -3
      gpsd_config.h
  84. +18
    -0
      gpsd_config.h.in
  85. +37
    -31
      gpsd_dbus.c
  86. +4
    -1
      gpsd_dbus.h
  87. +536
    -467
      gpsd_json.c
  88. +56
    -0
      gpsd_maskdump.c
  89. +7
    -3
      gpsd_report.c
  90. +44
    -41
      gpsdclient.c
  91. +7
    -2
      gpsdclient.h
  92. +4
    -4
      gpsdecode.1
  93. +151
    -130
      gpsdecode.c
  94. +7
    -1
      gpsdecode.xml
  95. +0
    -194
      gpsfake
  96. +4
    -4
      gpsfake.1
  97. +80
    -66
      gpsfake.in
  98. +7
    -1
      gpsfake.xml
  99. +8
    -6
      gpsmon.1
  100. +454
    -344
      gpsmon.c

+ 10
- 4
COPYING View File

@@ -1,8 +1,14 @@
BSD LICENSE
COPYRIGHTS

Compilation copyright is held by the GPSD project. All rights reserved.

The GPSD code is Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 by
Remco Treffkorn. Portions of it are also Copyright (c) 2005 by Eric S.
Raymond. All rights reserved.
GPSD project copyrights are assigned to the project lead, currently
Eric S. Raymond. Other portions of the GPSD code are Copyright (c)
1997, 1998, 1999, 2000, 2001, 2002 by Remco Treffkorn, and others
Copyright (c) 2005 by Eric S. Raymond. For other copyrights, see
individual files.

BSD LICENSE

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions


+ 48
- 19
INSTALL View File

@@ -18,14 +18,17 @@ 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
X windows -> two test clients depend on this
ncurses -> two more test clients depend on this
Qt + qmake -> libQgpsmm depends on this

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.
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. Note
that while Python is required to *build* GPSD (the build uses some code
generators in Python), it is not required to *run* GPSD.

For building from SVN, the following are necessary:
For building from the source tree, the following are necessary:
autoconf 2.61 or later
automake 1.10 or later
libtool 2.26 or later
@@ -35,9 +38,10 @@ 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
docbook xml. The following packages are used in this process:
For building from the source tree, or if you change the man page
source, xslt and docbook xsl style files are used to generate nroff
-man source from docbook xml. The following packages are used in this
process:

libxslt -> xsltproc is used to build man pages from xml
docbook-xsl -> style file for xml to man translation
@@ -103,7 +107,7 @@ resembling "Xm/Xm.h: No such file or directory". If you're on a Linux
system, you may already have LessTif. Source code is available
from <http://www.lesstif.org/>.

Under Ubuntu, you will require libmotif-dev, libxp-dev and libxaw7-dev
Under Ubuntu, you will require libxp-dev and libxaw7-dev
in addition to the standard build-support packages. You can get
all the build prerequisites intalled with "apt-get build-dep gpsd".

@@ -128,11 +132,12 @@ a serial or USB port with a GPS attached to it.
greeting line that's a JSON object describing GPSD's version.
Now plug in your GPS (or AIS receiver, or RTCM2 receiver).

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.
6. Type '?WATCH={"enable":true,"json":true,"raw":1};' to start raw and
watcher modes. You should see NMEA data (text lines beginning with $)
spewing out (if you have a non-NMEA device you may see long strings of
hex instead). 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,
@@ -161,9 +166,6 @@ hardware already supported.
11. Note for small embedded systems and those without threading. It is
possible to build gpsd without thread support if you configure with
--disable-pps. You'll lose support for updating the clock from PPS pulses.
It's also possible to build without Python via --disable-python, in which
case you'd build won't make Python libraries and "make install" won't
try to install Python tools.

12. Note for systems using DBUS: gpsd includes support for shipping fixes
as DBUS notifications, but it is not compiled in by default. Configure
@@ -177,8 +179,35 @@ file called 'gpsd_config.inc' containing configuration information;
edit to taste. Note that for the Google Maps feature work you need
to set a valid Google API key in your config file.

14. There are regression tests to verify proper operation of gpsd, and
14. libQgpsmm is a Qt version of the libgps/libgpsmm pair. Thanks to
the multi-platform approach of Qt, it allows the gpsd client library
to be available on all the Qt supported platforms. Please see
http://qt.nokia.com/doc/4.6/supported-platforms.html for a status of
Qt supported platforms as of version 4.6.

You can build libQgpsmm if you have qmake and Qt (specifically the
(specifically QtCore and QtNetwork modules) version 4.5.3 or higher.
You will also need a C++ compiler supported by Qt (tested on GCC
4.4.0/mingw on Windows and GCC 4.1.2 on linux).

Building is done through a standard Qt .pro project file:
- Go to the libQgpsmm subdirectory of gpsd and execute "qmake"
to create the Makefiles
- execute "make" to build the library
- execute "make install" or equivalent to copy libgpsmm.h and the library
to the appropriate location for your platform.

Specifically for linux: You can specify the installation prefix by
running "qmake PREFIX=<installation_root>". Default value is
"/usr/local".

Please refer to Qt's documentation at
http://qt.nokia.com/doc/4.6/platform-specific.html for platform specific
building documentation

15. There are regression tests to verify proper operation of gpsd, and
it can be useful to run these to verify that all is well. To run the
regression tests, first build gpsd from sources, and then run "make
testregress". It is not necessary to install first. Python is
check". It is not necessary to install first, but you do need
to have "." in your $PATH to run regressions uninstalled. Python is
required for regression tests.

+ 188
- 92
Makefile.am View File

@@ -1,10 +1,14 @@
# Automake description for gpsd
# $Id: Makefile.am 7020 2010-03-03 01:42:28Z esr $
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
#

# Exclude Subversion state from the tarball. Needed because we
# Exclude version-control state from the tarball. Needed because we
# grab the test directory wholesale. Hack appropriately when and if we
# change version control systems.
am__tar += --exclude '*svn*'
# \bug This is non-portable and depends on GNU tar beyond-POSIX extensions.
am__tar += --exclude '*git*'

CLEANFILES =

@@ -37,19 +41,26 @@ if HAVE_XAW
XAW_PROGS = xgpsspeed
endif

# Conditional includes.
INCLUDES = $(INCUSB)
if HAVE_DBUS
INCLUDES = $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1
INCLUDES += $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1
endif

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

bin_PROGRAMS = $(MOTIF_PROGS) $(XAW_PROGS) $(RTCM104PROGS) $(CURSESPROGS) gpsctl gpspipe gpxlogger lcdgps
sbin_PROGRAMS = gpsd

# \todo Add programs to TESTS if not already. used.
check_PROGRAMS = test_float test_trig test_bits test_packet test_mkgmtime test_geoid test_json
if LIBGPSMM_ENABLE
check_PROGRAMS += test_gpsmm
@@ -57,9 +68,9 @@ endif

PYTHONPAGES_DIST = gpsprof.1 gpsfake.1 gpscat.1
if HAVE_PYTHON
dist_bin_SCRIPTS = gpsprof gpsfake gpscat xgps
python_PYTHON = gpscap.py
PYTHONPAGES = $(PYTHONPAGES_DIST)
export PYTHON
endif

#
@@ -73,7 +84,7 @@ xgpsspeed_c_sources = \
xgpsspeed_SOURCES = \
$(xgpsspeed_c_sources) \
xgpsspeed.icon
xgpsspeed_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XAW_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)
xgpsspeed_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XAW_LIBS) $(XT_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)

#
# Build cgps
@@ -92,7 +103,7 @@ gpxlogger_LDADD = $(DBUS_GLIB_LIBS) libgps.la -lm
#
gpsd_c_sources = gpsd_dbus.c gpsd.c
gpsd_SOURCES = $(gpsd_c_sources) gpsd_dbus.h
gpsd_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm $(LIBPTHREAD)
gpsd_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm $(LIBPTHREAD) $(LIBUSB)

#
# Build gpsctl
@@ -117,7 +128,7 @@ lcdgps_LDADD = $(LIBM) libgps.la -lm
#
gpsmon_SOURCES = gpsmon.c monitor_nmea.c monitor_sirf.c \
monitor_italk.c monitor_ubx.c monitor_superstar2.c \
monitor_oncore.c
monitor_oncore.c monitor_tnt.c
gpsmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD)

#
@@ -148,7 +159,8 @@ libgpsd_c_sources = \
libgps_json.c \
gpsdclient.c \
libgpsd_core.c \
maskdump.c \
gps_maskdump.c \
gpsd_maskdump.c \
net_dgpsip.c \
net_gnss_dispatch.c \
net_ntrip.c \
@@ -159,6 +171,7 @@ libgpsd_c_sources = \
serial.c \
rtcm2_json.c \
srecord.c \
shared_json.c \
strl.c \
subframe.c \
drivers.c \
@@ -185,7 +198,7 @@ libgpsd_h_sources = \
bits.h \
crc24q.h

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

packet_names.h: packet_states.h
rm -f packet_names.h && \
@@ -207,13 +220,18 @@ ais_json.i: jsongen.py

revision.h: Makefile
@rm -f revision.h && \
echo '#define' REVISION '"svn'`svnversion -n`'"' >revision.h && \
echo '#define' REVISION '"'`date -u +%Y-%m-%dT%H:%M:%S`'"' >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
gps_maskdump.c: gps.h maskaudit.py
rm -f gps_maskdump.c && \
$(PYTHON) maskaudit.py -c >gps_maskdump.c && \
chmod a-w gps_maskdump.c

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

libgps_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
driver_rtcm2.h packet_states.h
@@ -234,6 +252,9 @@ libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)
#
if HAVE_PYTHON
PYEXTENSIONS = gpspacket.so gpslib.so
# Having gpspacket.so gpslib.so in noinst_SCRIPTS forces copies to be dropped
# under gps. This is important, otherwise gpsfake will fail before
# make install.
noinst_SCRIPTS = gpspacket.so gpslib.so setup.py

# Multiple-outputs hack. See
@@ -250,7 +271,6 @@ stamp-python-modules: gpspacket.c gpsclient.c libgps.la setup.py
MAKE='$(MAKE)' \
$(PYTHON) setup.py build_ext \
--build-lib '$(srcdir)' \
--build-temp '$(srcdir)/build' \
--include-dirs '$(srcdir):.'\
--mangenerator '$(MANGENERATOR)') && \
mv -f '$@.tmp' '$@'
@@ -258,19 +278,11 @@ CLEANFILES += stamp-python-modules stamp-python-modules.tmp

# Clean up after Python
clean-local:
rm -rf build
rm -rf build gps/*.so

# Install Python modules
install-exec-local:
$(PYTHON) setup.py install --prefix=${prefix} # --root=$(DESTDIR)
endif

if LIBGPSMM_ENABLE
TESTBINS = test_float test_trig test_gpsmm test_bits test_packet test_geoid \
test_mkgmtime test_json
else
TESTBINS = test_float test_trig test_bits test_packet test_geoid \
test_mkgmtime test_json
$(PYTHON) setup.py install --prefix=${prefix} --root=$(DESTDIR)
endif

#
@@ -390,11 +402,27 @@ else
include_HEADERS = gps.h
endif

XML = \
gpsd.xml \
gps.xml \
libgps.xml \
libgpsmm.xml \
libgpsd.xml \
gpsmon.xml \
gpsdecode.xml \
gpsprof.xml \
gpsfake.xml \
gpsctl.xml \
gpscat.xml \
gpspipe.xml \
rtcm-104.xml \
srec.xml

# Note: packaging/gpsd.spec is generated, but it needs to be in the
# tarball in order for 'make diat-rpm' to work. The BUILT_SOURCES
# files are here in order to minimize build dependencies for package
# builders who never alter anything, especially the Python dependency.
# Alsoo note that the test and gps directories are here rather than
# Also note that the test and gps directories are here rather than
# being the contents of a SUBDIRS variable so that autconf won't
# go looking for makefiles in them.
EXTRA_DIST = \
@@ -415,19 +443,7 @@ EXTRA_DIST = \
gpsd.xml \
gpsd.h-head \
gpsd.h-tail \
gps.xml \
libgpsd.xml \
libgps.xml \
libgpsmm.xml \
gpsprof.xml \
gpsfake.xml \
gpscat.xml \
gpsctl.xml \
gpsmon.xml \
gpspipe.xml \
gpsdecode.xml \
rtcm-104.xml \
srec.xml \
$(XML) \
$(BUILT_SOURCES) \
$(MANPAGES_DIST) \
xgpsspeed.ad \
@@ -450,9 +466,13 @@ EXTRA_DIST = \
packaging/etc_default_gpsd \
packaging/etc_init.d_gpsd \
packaging/etc_init.d_gpsd_rpm \
do-tests \
regress-driver \
test \
gps
gps/__init__.py \
gps/client.so \
gps/fake.py \
gps/gps.py \
test

#dist-hook:
# $(MKDIR_P) '$(distdir)/contrib' && \
@@ -460,7 +480,7 @@ EXTRA_DIST = \
#distclean-local:
# rm -rf '$(distdir)/contrib'

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

pkgconfig_DATA = libgps.pc libgpsd.pc
pkgconfigdir = $(libdir)/pkgconfig
@@ -485,7 +505,9 @@ splint: gpsd.h packet_names.h
@echo "Running splint on gpspipe..."
-splint $(SPLINTOPTS) $(gpspipe_SOURCES)
@echo "Running splint on gpsdecode..."
-splint $(SPLINTOPTS) -exportlocal gpsdecode.c
-splint $(SPLINTOPTS) $(gpsdecode_SOURCES)
@echo "Running splint on gpxlogger..."
-splint $(SPLINTOPTS) $(gpxlogger_SOURCES)
@echo "Running splint on test_bits test harness..."
-splint $(SPLINTOPTS) $(test_bits_SOURCES)
@echo "Running splint on test_packet test harness..."
@@ -501,16 +523,34 @@ splint: gpsd.h packet_names.h
cppcheck: gpsd.h packet_names.h
cppcheck --template gcc --all --force .

# 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.
# Re-indent the codebase in aa uniform style for readability.
# FIXME: Except for xgpsspeed - Tachometer.c makes GNI indent lose it.
INDENT_FILES = $(gpsd_c_sources) $(libgpsd_c_sources) \
$(cgps_SOURCES) $(gpsmon_SOURCES) $(gpspipe_SOURCES) \
$(gpxlogger_SOURCES) $(gpsdecode_SOURCES) \
$(test_bits_SOURCES) $(test_packet_SOURCES) \
$(test_mkgmtime_SOURCES) $(test_geoid_SOURCES) $(test_json_SOURCES)
INDENT_OPTIONS = --indent-level4 \
--honour-newlines \
--dont-break-procedure-type \
--cuddle-else \
--braces-on-if-line \
--case-brace-indentation0 \
--brace-indent0 \
--no-space-after-casts \
--no-space-after-function-call-names \
--start-left-side-of-comments \
--dont-format-comments
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`
chmod u+w *maskdump.c
indent $(INDENT_OPTIONS) $(INDENT_FILES)
for f in $(INDENT_FILES); \
do \
sed <$${f} >/tmp/reindent$$$$ -e 's/@ \*/@*/' ; \
mv /tmp/reindent$$$$ $${f} ; \
done
chmod u-w *maskdump.c
@echo "Diff lines:" `git diff | wc -l`

version:
@echo $(VERSION)
@@ -525,9 +565,20 @@ version:
# apparently increases the accuracy of computation in a way that affects
# the low-order digits of the track field in the O response.

# Our regression tests are make targets, while automake expects
# programs. Thus, our approach is to construct the test
# infrastructure our way, with make targets, and to have one TEST from
# automake's viewpoint: a trivial shell script to invoke make with our
# top-level regression target.

# One might think that using TESTS_ENVIRONMENT=$(MAKE) would work
# around this, but because the generated rule (check-TESTS) both
# depends on each TEST as well as invokes it (with TESTS_ENVIRONMENT)
# the entire list of tests is run twice.

# Regression-test the daemon
gps-regress: gpsd
$(srcdir)/regress-driver -t $(srcdir)/test/daemon/*.log
$(srcdir)/regress-driver $(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
@@ -549,13 +600,13 @@ rtcm-regress: gpsdecode
@mkdir -p test
@for f in $(srcdir)/test/*.rtcm2; do \
echo "Testing $${f}..."; \
$(srcdir)/gpsdecode <$${f} >$(srcdir)/test/test.chk; \
diff -ub $${f}.chk $(srcdir)/test/test.chk; \
$(srcdir)/gpsdecode <$${f} >/tmp/test-$$$$.chk; \
diff -ub $${f}.chk /tmp/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
@$(srcdir)/gpsdecode -e -j <test/synthetic-rtcm2.json >/tmp/test-$$$$.chk; \
grep -v '^#' test/synthetic-rtcm2.json | diff -ub - /tmp/test-$$$$.chk; \
rm /tmp/test-$$$$.chk

# Rebuild the RTCM regression tests.
rtcm-makeregress: gpsdecode
@@ -565,17 +616,17 @@ rtcm-makeregress: gpsdecode

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

# Rebuild the AIVDM regression tests.
aivdm-makeregress: gpsdecode
@@ -605,12 +656,12 @@ geoid-makeregress: test_geoid

# Regression-test the calendar functions
time-regress: test_mkgmtime
./test_mkgmtime
$(srcdir)/test_mkgmtime

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

# Build the regression test for the sentence unpacker
unpack-makeregress: libgps
@@ -619,21 +670,77 @@ unpack-makeregress: libgps

# Unit-test the JSON parsing
json-regress: test_json
test_json
$(srcdir)/test_json

# Unit-test the bitfield extractor - not in normal tests
bits-regress: test_bits
test_bits
$(srcdir)/test_bits

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

# 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
# do-tests is a shell script that invokes make with target testregress.
# This works around automake's lack of support for make targets as tests.
TESTS_ENVIRONMENT = MAKE=$(MAKE)
TESTS = do-tests

# The website directory
#
# None of these productions are fired by 'make all'.

# FIXME: Needs to be replaced by a $(MANGENERATOR) rule
%.html: %.xml
xmlto xhtml-nochunks $<

website: $(XML:.xml=.html) \
www/AIVDM.html www/NMEA.html \
www/protocol-evolution.html www/protocol-transition.html \
www/client-howto.html www/writing-a-driver.html \
www/index.html www/hardware.html \
www/performance/performance.html \
www/internals.html
@cp $(XML:.xml=.html) www

www/AIVDM.html: www/AIVDM.txt
asciidoc -a toc -o www/AIVDM.html www/AIVDM.txt

www/NMEA.html: www/NMEA.txt
asciidoc -a toc -o www/NMEA.html NMEA.txt

www/protocol-evolution.html: www/protocol-evolution.txt
asciidoc -a toc -o www/protocol-evolution.html www/protocol-evolution.txt

www/protocol-transition.html: www/protocol-transition.txt
asciidoc -a toc -o www/protocol-transition.html www/protocol-transition.txt

www/client-howto.html: www/client-howto.txt
asciidoc -a toc -o www/client-howto.html www/client-howto.txt

www/writing-a-driver.html: www/writing-a-driver.xml
xmlto xhtml-nochunks www/writing-a-driver.xml; mv writing-a-driver.html www

www/index.html: www/index.html.in
sed -e "/@DATE@/s//`date '+%B %d, %Y'`/" <www/index.html.in >www/index.html

www/hardware.html: www/hardware-head.html gpscap.ini www/hardware-tail.html
(cat www/hardware-head.html; python gpscap.py; cat www/hardware-tail.html) >www/hardware.html

www/performance/performance.html: www/performance/performance.xml
(cd www/performance; xmlto xhtml-nochunks performance.xml)

www/internals.html: $(shell ls doc/*.xml)
cd doc; xmlto xhtml-nochunks explanation.xml; cp explanation.html ../www/internals.html

# Experimenting with pydoc. Not yet fired by any other productions.

pydoc: www/pydoc/index.html

www/pydoc/index.html: gps gpsfake gpscat gpsprof
mkdir -p www/pydoc
epydoc -v -q --html --graph all -n GPSD gps gpsfake gpscat gpsprof -o www/pydoc

.PHONY: pydoc

# Productions for setting up and performing udev tests.
#
@@ -656,17 +763,6 @@ udev-uninstall:
udev-test:
$(srcdir)/gpsd -N -F /var/run/gpsd.sock -D 4

#
# Productions for testing unstable drivers.
#

unstable-regress: gpsd
./regress-driver -t $(srcdir)/test/unstable/*.log

unstable-makeregress: gpsd
./regress-driver -b $(srcdir)/test/unstable/*.log


# Release machinery begins here
#

@@ -684,17 +780,17 @@ upload-ftp: dist
lftp -c "open ftp://ftp.berlios.de/incoming; mput gpsd-$(VERSION).tar.gz gpsd.sum"

#
# This is how to tag a release for the SVN repository.
# This is how to tag a release.
# It requires developer access verified via ssh.
#
REPO=https://svn.berlios.de/svnroot/repos/gpsd
svn-tag:
svn copy $(REPO)/trunk $(REPO)/tags/release-$(VERSION) \
-m "Tagged for external release $(VERSION)"
release-tag:
git tag -s -m "Tagged for external release $(VERSION)" HEAD
git push --tags
#
# 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 clean dist upload-ftp svn-tag
ship: testregress clean dist upload-ftp release-tag


+ 255
- 187
Makefile.in View File

@@ -16,7 +16,10 @@
@SET_MAKE@

# Automake description for gpsd
# $Id: Makefile.am 7020 2010-03-03 01:42:28Z esr $
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
#



@@ -41,6 +44,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@HAVE_DBUS_TRUE@am__append_1 = $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1
bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
gpsctl$(EXEEXT) gpspipe$(EXEEXT) gpxlogger$(EXEEXT) \
lcdgps$(EXEEXT)
@@ -48,15 +52,14 @@ sbin_PROGRAMS = gpsd$(EXEEXT)
check_PROGRAMS = test_float$(EXEEXT) test_trig$(EXEEXT) \
test_bits$(EXEEXT) test_packet$(EXEEXT) test_mkgmtime$(EXEEXT) \
test_geoid$(EXEEXT) test_json$(EXEEXT) $(am__EXEEXT_4)
@LIBGPSMM_ENABLE_TRUE@am__append_1 = test_gpsmm
@LIBGPSMM_ENABLE_TRUE@am__append_2 = test_gpsmm

# Warning: This overrides autoconf's normal link-line generation process
@LIBGPSMM_ENABLE_TRUE@am__append_2 = libgpsmm.cpp
@HAVE_PYTHON_TRUE@am__append_3 = stamp-python-modules stamp-python-modules.tmp
@HAVE_XSLT_PROCESSOR_TRUE@am__append_4 = stamp-gps-manpages stamp-gps-manpages.tmp
@LIBGPSMM_ENABLE_TRUE@am__append_3 = libgpsmm.cpp
@HAVE_PYTHON_TRUE@am__append_4 = stamp-python-modules stamp-python-modules.tmp
@HAVE_XSLT_PROCESSOR_TRUE@am__append_5 = stamp-gps-manpages stamp-gps-manpages.tmp
subdir = .
DIST_COMMON = README $(am__configure_deps) \
$(am__dist_bin_SCRIPTS_DIST) $(am__include_HEADERS_DIST) \
DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \
$(am__python_PYTHON_DIST) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/gpscat.in $(srcdir)/gpsd_config.h.in \
@@ -100,11 +103,11 @@ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(pythondir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" \
"$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pythondir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
"$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" \
"$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libgps_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@@ -113,26 +116,28 @@ libgps_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
am__libgps_la_SOURCES_DIST = ais_json.c bits.c bsd-base64.c crc24q.c \
gpsd_report.c gpsutils.c geoid.c gpsd_json.c hex.c isgps.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 packet.c pseudonmea.c serial.c rtcm2_json.c \
srecord.c strl.c subframe.c drivers.c driver_aivdm.c \
driver_evermore.c driver_garmin.c driver_garmin_txt.c \
driver_italk.c driver_navcom.c driver_nmea.c driver_oncore.c \
driver_rtcm2.c driver_rtcm3.c driver_sirf.c \
driver_superstar2.c driver_tsip.c driver_ubx.c driver_zodiac.c \
sockaddr.h bsd-base64.h timebase.h bits.h crc24q.h \
driver_rtcm2.h packet_states.h libgpsmm.cpp
gps_maskdump.c gpsd_maskdump.c net_dgpsip.c \
net_gnss_dispatch.c net_ntrip.c netlib.c ntpshm.c packet.c \
pseudonmea.c serial.c rtcm2_json.c srecord.c shared_json.c \
strl.c subframe.c drivers.c driver_aivdm.c driver_evermore.c \
driver_garmin.c driver_garmin_txt.c driver_italk.c \
driver_navcom.c driver_nmea.c driver_oncore.c driver_rtcm2.c \
driver_rtcm3.c driver_sirf.c driver_superstar2.c driver_tsip.c \
driver_ubx.c driver_zodiac.c sockaddr.h bsd-base64.h \
timebase.h bits.h crc24q.h driver_rtcm2.h packet_states.h \
libgpsmm.cpp
am__objects_1 = ais_json.lo bits.lo bsd-base64.lo crc24q.lo \
gpsd_report.lo gpsutils.lo geoid.lo gpsd_json.lo hex.lo \
isgps.lo json.lo libgps_core.lo libgps_json.lo gpsdclient.lo \
libgpsd_core.lo maskdump.lo net_dgpsip.lo net_gnss_dispatch.lo \
net_ntrip.lo netlib.lo ntpshm.lo packet.lo pseudonmea.lo \
serial.lo rtcm2_json.lo srecord.lo strl.lo subframe.lo \
drivers.lo driver_aivdm.lo driver_evermore.lo driver_garmin.lo \
driver_garmin_txt.lo driver_italk.lo driver_navcom.lo \
driver_nmea.lo driver_oncore.lo driver_rtcm2.lo \
driver_rtcm3.lo driver_sirf.lo driver_superstar2.lo \
driver_tsip.lo driver_ubx.lo driver_zodiac.lo
libgpsd_core.lo gps_maskdump.lo gpsd_maskdump.lo net_dgpsip.lo \
net_gnss_dispatch.lo net_ntrip.lo netlib.lo ntpshm.lo \
packet.lo pseudonmea.lo serial.lo rtcm2_json.lo srecord.lo \
shared_json.lo strl.lo subframe.lo drivers.lo driver_aivdm.lo \
driver_evermore.lo driver_garmin.lo driver_garmin_txt.lo \
driver_italk.lo driver_navcom.lo driver_nmea.lo \
driver_oncore.lo driver_rtcm2.lo driver_rtcm3.lo \
driver_sirf.lo driver_superstar2.lo driver_tsip.lo \
driver_ubx.lo driver_zodiac.lo
am__objects_2 =
@LIBGPSMM_ENABLE_TRUE@am__objects_3 = libgpsmm.lo
am_libgps_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
@@ -141,7 +146,7 @@ nodist_libgps_la_OBJECTS =
libgps_la_OBJECTS = $(am_libgps_la_OBJECTS) \
$(nodist_libgps_la_OBJECTS)
@HAVE_XAW_TRUE@am__EXEEXT_1 = xgpsspeed$(EXEEXT)
@HAVE_RTCM104V2_TRUE@am__EXEEXT_2 = gpsdecode$(EXEEXT)
@HAVE_AIVDM_TRUE@@HAVE_RTCM104V2_TRUE@@HAVE_RTCM104V3_TRUE@am__EXEEXT_2 = gpsdecode$(EXEEXT)
@HAVE_NCURSES_TRUE@am__EXEEXT_3 = cgps$(EXEEXT) gpsmon$(EXEEXT)
@LIBGPSMM_ENABLE_TRUE@am__EXEEXT_4 = test_gpsmm$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
@@ -158,7 +163,7 @@ am__objects_4 = gpsd_dbus.$(OBJEXT) gpsd.$(OBJEXT)
am_gpsd_OBJECTS = $(am__objects_4)
gpsd_OBJECTS = $(am_gpsd_OBJECTS)
gpsd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
libgps.la $(am__DEPENDENCIES_1)
libgps.la $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_gpsdecode_OBJECTS = gpsdecode.$(OBJEXT)
gpsdecode_OBJECTS = $(am_gpsdecode_OBJECTS)
gpsdecode_DEPENDENCIES = $(am__DEPENDENCIES_1) libgps.la \
@@ -166,7 +171,7 @@ gpsdecode_DEPENDENCIES = $(am__DEPENDENCIES_1) libgps.la \
am_gpsmon_OBJECTS = gpsmon.$(OBJEXT) monitor_nmea.$(OBJEXT) \
monitor_sirf.$(OBJEXT) monitor_italk.$(OBJEXT) \
monitor_ubx.$(OBJEXT) monitor_superstar2.$(OBJEXT) \
monitor_oncore.$(OBJEXT)
monitor_oncore.$(OBJEXT) monitor_tnt.$(OBJEXT)
gpsmon_OBJECTS = $(am_gpsmon_OBJECTS)
gpsmon_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
libgps.la $(am__DEPENDENCIES_1)
@@ -212,9 +217,9 @@ xgpsspeed_OBJECTS = $(am_xgpsspeed_OBJECTS)
xgpsspeed_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) libgps.la $(am__DEPENDENCIES_1)
am__dist_bin_SCRIPTS_DIST = gpsprof gpsfake gpscat xgps
SCRIPTS = $(dist_bin_SCRIPTS) $(noinst_SCRIPTS)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libgps.la \
$(am__DEPENDENCIES_1)
SCRIPTS = $(noinst_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -313,6 +318,7 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INCUSB = @INCUSB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -328,6 +334,7 @@ LIBPTHREAD = @LIBPTHREAD@
LIBS = @LIBS@
LIBSOCKET = @LIBSOCKET@
LIBTOOL = @LIBTOOL@
LIBUSB = @LIBUSB@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -387,10 +394,11 @@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@

# Exclude Subversion state from the tarball. Needed because we
# Exclude version-control state from the tarball. Needed because we
# grab the test directory wholesale. Hack appropriately when and if we
# change version control systems.
am__tar = @am__tar@ --exclude '*svn*'
# \bug This is non-portable and depends on GNU tar beyond-POSIX extensions.
am__tar = @am__tar@ --exclude '*git*'
am__untar = @am__untar@
bindir = @bindir@
build = @build@
@@ -443,8 +451,8 @@ top_srcdir = @top_srcdir@
# cp -p '$(srcdir)/contrib/'* '$(distdir)/contrib'
#distclean-local:
# rm -rf '$(distdir)/contrib'
CLEANFILES = $(am__append_3) $(am__append_4) $(BUILT_SOURCES) \
$(TESTBINS) *.core $(PYEXTENSIONS) $(BUILT_MANPAGES)
CLEANFILES = $(am__append_4) $(am__append_5) $(BUILT_SOURCES) *.core \
$(PYEXTENSIONS) $(BUILT_MANPAGES)

# For a detailed explanation of what this ugly code is doing, see
# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
@@ -470,12 +478,13 @@ XMLTO = xmlto
#
@HAVE_NCURSES_TRUE@CURSESPROGS = cgps gpsmon
@HAVE_XAW_TRUE@XAW_PROGS = xgpsspeed
@HAVE_DBUS_TRUE@INCLUDES = $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1

# Conditional includes.
INCLUDES = $(INCUSB) $(am__append_1)
RTCM104PAGES_DIST = gpsdecode.1
@HAVE_RTCM104V2_TRUE@RTCM104PROGS = gpsdecode
@HAVE_RTCM104V2_TRUE@RTCM104PAGES = $(RTCM104PAGES_DIST)
@HAVE_AIVDM_TRUE@@HAVE_RTCM104V2_TRUE@@HAVE_RTCM104V3_TRUE@RTCM104PROGS = gpsdecode
@HAVE_AIVDM_TRUE@@HAVE_RTCM104V2_TRUE@@HAVE_RTCM104V3_TRUE@RTCM104PAGES = $(RTCM104PAGES_DIST)
PYTHONPAGES_DIST = gpsprof.1 gpsfake.1 gpscat.1
@HAVE_PYTHON_TRUE@dist_bin_SCRIPTS = gpsprof gpsfake gpscat xgps
@HAVE_PYTHON_TRUE@python_PYTHON = gpscap.py
@HAVE_PYTHON_TRUE@PYTHONPAGES = $(PYTHONPAGES_DIST)

@@ -492,7 +501,7 @@ xgpsspeed_SOURCES = \
$(xgpsspeed_c_sources) \
xgpsspeed.icon

xgpsspeed_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XAW_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)
xgpsspeed_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XAW_LIBS) $(XT_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)

#
# Build cgps
@@ -511,7 +520,7 @@ gpxlogger_LDADD = $(DBUS_GLIB_LIBS) libgps.la -lm
#
gpsd_c_sources = gpsd_dbus.c gpsd.c
gpsd_SOURCES = $(gpsd_c_sources) gpsd_dbus.h
gpsd_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm $(LIBPTHREAD)
gpsd_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm $(LIBPTHREAD) $(LIBUSB)

#
# Build gpsctl
@@ -536,7 +545,7 @@ lcdgps_LDADD = $(LIBM) libgps.la -lm
#
gpsmon_SOURCES = gpsmon.c monitor_nmea.c monitor_sirf.c \
monitor_italk.c monitor_ubx.c monitor_superstar2.c \
monitor_oncore.c
monitor_oncore.c monitor_tnt.c

gpsmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD)

@@ -567,7 +576,8 @@ libgpsd_c_sources = \
libgps_json.c \
gpsdclient.c \
libgpsd_core.c \
maskdump.c \
gps_maskdump.c \
gpsd_maskdump.c \
net_dgpsip.c \
net_gnss_dispatch.c \
net_ntrip.c \
@@ -578,6 +588,7 @@ libgpsd_c_sources = \
serial.c \
rtcm2_json.c \
srecord.c \
shared_json.c \
strl.c \
subframe.c \
drivers.c \
@@ -604,9 +615,9 @@ libgpsd_h_sources = \
bits.h \
crc24q.h

BUILT_SOURCES = packet_names.h gpsd.h revision.h ais_json.i maskdump.c
BUILT_SOURCES = packet_names.h gpsd.h revision.h ais_json.i gps_maskdump.c gpsd_maskdump.c
libgps_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
driver_rtcm2.h packet_states.h $(am__append_2)
driver_rtcm2.h packet_states.h $(am__append_3)
@LIBGPSMM_ENABLE_FALSE@libgps_la_LINK = /bin/sh ./libtool --tag=CC --mode=link gcc $(libgps_la_LDFLAGS) -o $@
@LIBGPSMM_ENABLE_TRUE@libgps_la_LINK = /bin/sh ./libtool --tag=CXX --mode=link g++ $(libgps_la_LDFLAGS) -o $@
nodist_libgps_la_SOURCES = packet_names.h ais_json.i
@@ -616,13 +627,10 @@ libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)
# Build Python binding
#
@HAVE_PYTHON_TRUE@PYEXTENSIONS = gpspacket.so gpslib.so
# Having gpspacket.so gpslib.so in noinst_SCRIPTS forces copies to be dropped
# under gps. This is important, otherwise gpsfake will fail before
# make install.
@HAVE_PYTHON_TRUE@noinst_SCRIPTS = gpspacket.so gpslib.so setup.py
@LIBGPSMM_ENABLE_FALSE@TESTBINS = test_float test_trig test_bits test_packet test_geoid \
@LIBGPSMM_ENABLE_FALSE@ test_mkgmtime test_json

@LIBGPSMM_ENABLE_TRUE@TESTBINS = test_float test_trig test_gpsmm test_bits test_packet test_geoid \
@LIBGPSMM_ENABLE_TRUE@ test_mkgmtime test_json


#
# Build test_float
@@ -709,12 +717,28 @@ noinst_HEADERS = gpsd_config.h \
nodist_include_HEADERS = gpsd.h
@LIBGPSMM_ENABLE_FALSE@include_HEADERS = gps.h
@LIBGPSMM_ENABLE_TRUE@include_HEADERS = gps.h libgpsmm.h
XML = \
gpsd.xml \
gps.xml \
libgps.xml \
libgpsmm.xml \
libgpsd.xml \
gpsmon.xml \
gpsdecode.xml \
gpsprof.xml \
gpsfake.xml \
gpsctl.xml \
gpscat.xml \
gpspipe.xml \
rtcm-104.xml \
srec.xml


# Note: packaging/gpsd.spec is generated, but it needs to be in the
# tarball in order for 'make diat-rpm' to work. The BUILT_SOURCES
# files are here in order to minimize build dependencies for package
# builders who never alter anything, especially the Python dependency.
# Alsoo note that the test and gps directories are here rather than
# Also note that the test and gps directories are here rather than
# being the contents of a SUBDIRS variable so that autconf won't
# go looking for makefiles in them.
EXTRA_DIST = \
@@ -735,19 +759,7 @@ EXTRA_DIST = \
gpsd.xml \
gpsd.h-head \
gpsd.h-tail \
gps.xml \
libgpsd.xml \
libgps.xml \
libgpsmm.xml \
gpsprof.xml \
gpsfake.xml \
gpscat.xml \
gpsctl.xml \
gpsmon.xml \
gpspipe.xml \
gpsdecode.xml \
rtcm-104.xml \
srec.xml \
$(XML) \
$(BUILT_SOURCES) \
$(MANPAGES_DIST) \
xgpsspeed.ad \
@@ -770,9 +782,13 @@ EXTRA_DIST = \
packaging/etc_default_gpsd \
packaging/etc_init.d_gpsd \
packaging/etc_init.d_gpsd_rpm \
do-tests \
regress-driver \
test \
gps
gps/__init__.py \
gps/client.so \
gps/fake.py \
gps/gps.py \
test

pkgconfig_DATA = libgps.pc libgpsd.pc
pkgconfigdir = $(libdir)/pkgconfig
@@ -780,17 +796,31 @@ pkgconfigdir = $(libdir)/pkgconfig
# Report splint warnings
SPLINTOPTS = -I/usr/include/dbus-1.0/ +quiet

# 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

#
# This is how to tag a release for the SVN repository.
# It requires developer access verified via ssh.
#
REPO = https://svn.berlios.de/svnroot/repos/gpsd
# Re-indent the codebase in aa uniform style for readability.
# FIXME: Except for xgpsspeed - Tachometer.c makes GNI indent lose it.
INDENT_FILES = $(gpsd_c_sources) $(libgpsd_c_sources) \
$(cgps_SOURCES) $(gpsmon_SOURCES) $(gpspipe_SOURCES) \
$(gpxlogger_SOURCES) $(gpsdecode_SOURCES) \
$(test_bits_SOURCES) $(test_packet_SOURCES) \
$(test_mkgmtime_SOURCES) $(test_geoid_SOURCES) $(test_json_SOURCES)

INDENT_OPTIONS = --indent-level4 \
--honour-newlines \
--dont-break-procedure-type \
--cuddle-else \
--braces-on-if-line \
--case-brace-indentation0 \
--brace-indent0 \
--no-space-after-casts \
--no-space-after-function-call-names \
--start-left-side-of-comments \
--dont-format-comments


# do-tests is a shell script that invokes make with target testregress.
# This works around automake's lack of support for make targets as tests.
TESTS_ENVIRONMENT = MAKE=$(MAKE)
TESTS = do-tests
all: $(BUILT_SOURCES) gpsd_config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

@@ -1044,40 +1074,6 @@ test_trig$(EXEEXT): $(test_trig_OBJECTS) $(test_trig_DEPENDENCIES)
xgpsspeed$(EXEEXT): $(xgpsspeed_OBJECTS) $(xgpsspeed_DEPENDENCIES)
@rm -f xgpsspeed$(EXEEXT)
$(LINK) $(xgpsspeed_OBJECTS) $(xgpsspeed_LDADD) $(LIBS)
install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done

uninstall-dist_binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files

mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1108,10 +1104,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_zodiac.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drivers.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geoid.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gps_maskdump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsctl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsd_dbus.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsd_json.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsd_maskdump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsd_report.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsdclient.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpsdecode.Po@am__quote@
@@ -1127,12 +1125,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgps_json.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpsd_core.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpsmm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maskdump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_italk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_nmea.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_oncore.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_sirf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_superstar2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_tnt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor_ubx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_dgpsip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_gnss_dispatch.Plo@am__quote@
@@ -1143,6 +1141,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pseudonmea.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtcm2_json.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serial.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shared_json.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srecord.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subframe.Plo@am__quote@
@@ -1770,7 +1769,7 @@ all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \
install-binPROGRAMS: install-libLTLIBRARIES

installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -1836,8 +1835,8 @@ install-dvi: install-dvi-am

install-dvi-am:

install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS \
install-exec-local install-libLTLIBRARIES install-sbinPROGRAMS
install-exec-am: install-binPROGRAMS install-exec-local \
install-libLTLIBRARIES install-sbinPROGRAMS

install-html: install-html-am

@@ -1879,11 +1878,10 @@ ps: ps-am

ps-am:

uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS \
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-man uninstall-nodist_includeHEADERS \
uninstall-pkgconfigDATA uninstall-pythonPYTHON \
uninstall-sbinPROGRAMS
uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES uninstall-man \
uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA \
uninstall-pythonPYTHON uninstall-sbinPROGRAMS

uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \
uninstall-man8
@@ -1899,24 +1897,25 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dist_binSCRIPTS install-dvi \
install-dvi-am install-exec install-exec-am install-exec-local \
install-html install-html-am install-includeHEADERS \
install-info install-info-am install-libLTLIBRARIES \
install-man install-man1 install-man3 install-man5 \
install-man8 install-nodist_includeHEADERS install-pdf \
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-exec-local install-html \
install-html-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man \
install-man1 install-man3 install-man5 install-man8 \
install-nodist_includeHEADERS install-pdf install-pdf-am \
install-pkgconfigDATA install-ps install-ps-am \
install-pythonPYTHON install-sbinPROGRAMS install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-dist_binSCRIPTS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \
uninstall-man3 uninstall-man5 uninstall-man8 \
uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA \
uninstall-pythonPYTHON uninstall-sbinPROGRAMS
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-man uninstall-man1 uninstall-man3 uninstall-man5 \
uninstall-man8 uninstall-nodist_includeHEADERS \
uninstall-pkgconfigDATA uninstall-pythonPYTHON \
uninstall-sbinPROGRAMS

@HAVE_PYTHON_TRUE@export PYTHON

packet_names.h: packet_states.h
rm -f packet_names.h && \
@@ -1938,13 +1937,18 @@ ais_json.i: jsongen.py

revision.h: Makefile
@rm -f revision.h && \
echo '#define' REVISION '"svn'`svnversion -n`'"' >revision.h && \
echo '#define' REVISION '"'`date -u +%Y-%m-%dT%H:%M:%S`'"' >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
gps_maskdump.c: gps.h maskaudit.py
rm -f gps_maskdump.c && \
$(PYTHON) maskaudit.py -c >gps_maskdump.c && \
chmod a-w gps_maskdump.c

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

# Multiple-outputs hack. See
# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
@@ -1960,18 +1964,17 @@ maskdump.c: gpsd.h-tail maskaudit.py
@HAVE_PYTHON_TRUE@ MAKE='$(MAKE)' \
@HAVE_PYTHON_TRUE@ $(PYTHON) setup.py build_ext \
@HAVE_PYTHON_TRUE@ --build-lib '$(srcdir)' \
@HAVE_PYTHON_TRUE@ --build-temp '$(srcdir)/build' \
@HAVE_PYTHON_TRUE@ --include-dirs '$(srcdir):.'\
@HAVE_PYTHON_TRUE@ --mangenerator '$(MANGENERATOR)') && \
@HAVE_PYTHON_TRUE@ mv -f '$@.tmp' '$@'

# Clean up after Python
@HAVE_PYTHON_TRUE@clean-local:
@HAVE_PYTHON_TRUE@ rm -rf build
@HAVE_PYTHON_TRUE@ rm -rf build gps/*.so

# Install Python modules
@HAVE_PYTHON_TRUE@install-exec-local:
@HAVE_PYTHON_TRUE@ $(PYTHON) setup.py install --prefix=${prefix} # --root=$(DESTDIR)
@HAVE_PYTHON_TRUE@ $(PYTHON) setup.py install --prefix=${prefix} --root=$(DESTDIR)

@HAVE_XSLT_PROCESSOR_TRUE@.xml.1:
@HAVE_XSLT_PROCESSOR_TRUE@ $(MANGENERATOR) $(MANFLAGS) $(MANTARGET) $<
@@ -2011,7 +2014,9 @@ splint: gpsd.h packet_names.h
@echo "Running splint on gpspipe..."
-splint $(SPLINTOPTS) $(gpspipe_SOURCES)
@echo "Running splint on gpsdecode..."
-splint $(SPLINTOPTS) -exportlocal gpsdecode.c
-splint $(SPLINTOPTS) $(gpsdecode_SOURCES)
@echo "Running splint on gpxlogger..."
-splint $(SPLINTOPTS) $(gpxlogger_SOURCES)
@echo "Running splint on test_bits test harness..."
-splint $(SPLINTOPTS) $(test_bits_SOURCES)
@echo "Running splint on test_packet test harness..."
@@ -2026,17 +2031,16 @@ splint: gpsd.h packet_names.h
# Report cppcheck warnings. Requires 1.40 or later.
cppcheck: gpsd.h packet_names.h
cppcheck --template gcc --all --force .

# 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`
chmod u+w *maskdump.c
indent $(INDENT_OPTIONS) $(INDENT_FILES)
for f in $(INDENT_FILES); \
do \
sed <$${f} >/tmp/reindent$$$$ -e 's/@ \*/@*/' ; \
mv /tmp/reindent$$$$ $${f} ; \
done
chmod u-w *maskdump.c
@echo "Diff lines:" `git diff | wc -l`

version:
@echo $(VERSION)
@@ -2051,9 +2055,20 @@ version:
# apparently increases the accuracy of computation in a way that affects
# the low-order digits of the track field in the O response.

# Our regression tests are make targets, while automake expects
# programs. Thus, our approach is to construct the test
# infrastructure our way, with make targets, and to have one TEST from
# automake's viewpoint: a trivial shell script to invoke make with our
# top-level regression target.

# One might think that using TESTS_ENVIRONMENT=$(MAKE) would work
# around this, but because the generated rule (check-TESTS) both
# depends on each TEST as well as invokes it (with TESTS_ENVIRONMENT)
# the entire list of tests is run twice.

# Regression-test the daemon
gps-regress: gpsd
$(srcdir)/regress-driver -t $(srcdir)/test/daemon/*.log
$(srcdir)/regress-driver $(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
@@ -2075,13 +2090,13 @@ rtcm-regress: gpsdecode
@mkdir -p test
@for f in $(srcdir)/test/*.rtcm2; do \
echo "Testing $${f}..."; \
$(srcdir)/gpsdecode <$${f} >$(srcdir)/test/test.chk; \
diff -ub $${f}.chk $(srcdir)/test/test.chk; \
$(srcdir)/gpsdecode <$${f} >/tmp/test-$$$$.chk; \
diff -ub $${f}.chk /tmp/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
@$(srcdir)/gpsdecode -e -j <test/synthetic-rtcm2.json >/tmp/test-$$$$.chk; \
grep -v '^#' test/synthetic-rtcm2.json | diff -ub - /tmp/test-$$$$.chk; \
rm /tmp/test-$$$$.chk

# Rebuild the RTCM regression tests.
rtcm-makeregress: gpsdecode
@@ -2091,17 +2106,17 @@ rtcm-makeregress: gpsdecode

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

# Rebuild the AIVDM regression tests.
aivdm-makeregress: gpsdecode
@@ -2131,12 +2146,12 @@ geoid-makeregress: test_geoid

# Regression-test the calendar functions
time-regress: test_mkgmtime
./test_mkgmtime
$(srcdir)/test_mkgmtime

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

# Build the regression test for the sentence unpacker
unpack-makeregress: libgps
@@ -2145,16 +2160,73 @@ unpack-makeregress: libgps

# Unit-test the JSON parsing
json-regress: test_json
test_json
$(srcdir)/test_json

# Unit-test the bitfield extractor - not in normal tests
bits-regress: test_bits
test_bits
$(srcdir)/test_bits

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

# The website directory
#
# None of these productions are fired by 'make all'.

# FIXME: Needs to be replaced by a $(MANGENERATOR) rule
%.html: %.xml
xmlto xhtml-nochunks $<

website: $(XML:.xml=.html) \
www/AIVDM.html www/NMEA.html \
www/protocol-evolution.html www/protocol-transition.html \
www/client-howto.html www/writing-a-driver.html \
www/index.html www/hardware.html \
www/performance/performance.html \
www/internals.html
@cp $(XML:.xml=.html) www

www/AIVDM.html: www/AIVDM.txt
asciidoc -a toc -o www/AIVDM.html www/AIVDM.txt

www/NMEA.html: www/NMEA.txt
asciidoc -a toc -o www/NMEA.html NMEA.txt

www/protocol-evolution.html: www/protocol-evolution.txt
asciidoc -a toc -o www/protocol-evolution.html www/protocol-evolution.txt

www/protocol-transition.html: www/protocol-transition.txt
asciidoc -a toc -o www/protocol-transition.html www/protocol-transition.txt

www/client-howto.html: www/client-howto.txt
asciidoc -a toc -o www/client-howto.html www/client-howto.txt

www/writing-a-driver.html: www/writing-a-driver.xml
xmlto xhtml-nochunks www/writing-a-driver.xml; mv writing-a-driver.html www

www/index.html: www/index.html.in
sed -e "/@DATE@/s//`date '+%B %d, %Y'`/" <www/index.html.in >www/index.html

www/hardware.html: www/hardware-head.html gpscap.ini www/hardware-tail.html
(cat www/hardware-head.html; python gpscap.py; cat www/hardware-tail.html) >www/hardware.html

www/performance/performance.html: www/performance/performance.xml
(cd www/performance; xmlto xhtml-nochunks performance.xml)

www/internals.html: $(shell ls doc/*.xml)
cd doc; xmlto xhtml-nochunks explanation.xml; cp explanation.html ../www/internals.html

# Experimenting with pydoc. Not yet fired by any other productions.

pydoc: www/pydoc/index.html

www/pydoc/index.html: gps gpsfake gpscat gpsprof
mkdir -p www/pydoc
epydoc -v -q --html --graph all -n GPSD gps gpsfake gpscat gpsprof -o www/pydoc

.PHONY: pydoc

# Productions for setting up and performing udev tests.
#
# Requires root. Do "udev-install", then "tail -f /var/run/syslog" in
@@ -2176,16 +2248,6 @@ udev-uninstall:
udev-test:
$(srcdir)/gpsd -N -F /var/run/gpsd.sock -D 4

#
# Productions for testing unstable drivers.
#

unstable-regress: gpsd
./regress-driver -t $(srcdir)/test/unstable/*.log

unstable-makeregress: gpsd
./regress-driver -b $(srcdir)/test/unstable/*.log

# Release machinery begins here
#

@@ -2201,15 +2263,21 @@ dist-rpm: distdir
upload-ftp: dist
shasum gpsd-$(VERSION).tar.gz >gpsd.sum
lftp -c "open ftp://ftp.berlios.de/incoming; mput gpsd-$(VERSION).tar.gz gpsd.sum"
svn-tag:
svn copy $(REPO)/trunk $(REPO)/tags/release-$(VERSION) \
-m "Tagged for external release $(VERSION)"

#
# This is how to tag a release.
# It requires developer access verified via ssh.
#
release-tag:
git tag -s -m "Tagged for external release $(VERSION)" HEAD
git push --tags

#
# 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 clean dist upload-ftp svn-tag
ship: testregress clean dist upload-ftp release-tag

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.


+ 23
- 2
NEWS View File

@@ -1,5 +1,26 @@
* Tue Mar 2 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.92
Fix a packaging error. The new Python library moduke was
* Fri Apr 16 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.93
Support for JSON dumping and parsing of AIS message types 25 and 26,
not yet observed in the wild on AISHub. Fix Debian bug #569703. by
removing non-streaming mode from the Python exerciser. Fix Debian
bug #572900 by unsetting the appropriate in-use flag in the device
array. Change the libgps default from old protocol to JSON. Add a
close() method to the C++ binding. Try to recover better from
sporadic cases of false matches to Trimble packet format from a SiRF
binary datastream. gps_poll() now returns -1 with errno not set when
the gpsd socket closes. TPV now refrains from reporting fields the
fix quality won't support. gpsmon option for listing device types is
now -L to -l can be used to enable logging (to stay consistent with
the l command). There is new FAQ material on improving fix and time
reference accuracy. New sections have been added to NMEA.txt on
error status indications and satellite IDs. New POLL command brings
back polling-mode operation. A Client-HOWTO has been added to the
documentation. gpsd no longer eats CPU when a device is unexpectedly
unplugged. Support for the TNT revolution is back (run mode only).
There is now a gpsdfake diagnostic tool that fakes being gpsd shipping
arbitrary specified data to clients.

* Wed Mar 3 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.92
Fix a packaging error. The new Python library module was
inadvertently omitted from the 2.91 tarball. Also, improve the json
import test slightly.



+ 0
- 2
README View File

@@ -1,5 +1,3 @@
$Id: README 5566 2009-05-10 20:37:12Z esr $

COPYRIGHT
=========



+ 45
- 118
TODO View File

@@ -1,5 +1,3 @@
$Id: TODO 7011 2010-03-01 02:22:09Z 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
will unfold them again.
@@ -10,49 +8,65 @@ For contribution guidelines and internals documentation, please see
The list of bugs exposed by gpsd in other software has moved to
<http://gpsd.berlios.de/upstream-bugs.html>.

See also the GPSD bug tracker at
<https://developer.berlios.de/bugs/?group_id=2116>

** Bugs in gpsd and its clients:

*** Support for the True North magnetic compass is currently broken
*** Tracker bugs

Massimo Burcheri reported that it broke somewhere between rev 3654 and
3722. We think this is a shallow bug, but we can't fix it without
test hardware. If TNT support is a problem for you, and you can't
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.
See the GPSD bug tracker at https://developer.berlios.de/bugs/?group_id=2116
but don't be surprised if it's empty or very sparse. Our rate of new defects
per month is quite low.

*** Driver issues

**** Geodetic fix computation is numerically unstable:
**** gpsctl -b should work on UBX, but does not.

Presently this means there's no way to kick a UBX into returning
binary data.

In the bu303-nofix.log test, the expected-correct output has an
altitude of -6378137m, about earth radius, with lat/lon of 180,0. On
NetBSD 5.0/i386, the altitude is -6378253m, on NetBSD 5.0/amd64 it is
-6378253m, and on NetBSD 5.0/sparc64 it is -6378171m. On Linux/i386,
it is -6378143m.
*** gpsmon failures

Altitude is computed by geoid.c:ecef_to_wgs84fix(), which is a pile of
trig calculations. As usual, sin() and cos() aren't guaranteed to be
cross-architecture stable throughout their range. Note that bu303 logs
with valid fixes have not been problematic. It is not clear that
anyone has hand-validated the expected output.
There have been persistent reports of gpsmon failing with 0-length
reads or select(2) failures, in both daemon-mediated and
direct-to-device modes. Cause is unknown, but is related to
zero-length reads somehow.

(amd64 is what NetBSD labels all implementations of AMD's 64-bit
architecture; the machine in question above is an Intel CPU under
Xen.)
** Ports

**** superstar2.chk:
*** Qt port

Packet detection appears to fail completely on big-endian machines.
Greg Troxel reports this from netbsd-5/sparc64. Output at
<http://www.lexort.com/gpsd/>. The problem is very likely in the
packet-checksum computation, which looks a bit dodgy.
Nearly done. Chase Chris Browet <cbro@semperpax.com> about this

*** Windows port

Partially complete. David Ludlow <dave@adsllc.com> is working on it.

** To do:

*** Write advanced features for TNT Revolution device

The baud-rate switcher in the TNT driver needs to be tested.

gpsmon could support a number of TNT configuration commands, including
unit changes. See http://gpsd.googlecode.com/truenorth-reference.pdf
for possibilities.

Jon Schlueter has one of these on a flock machine, so testing
shouldn't be difficult.

*** Python interface rework

The Python client interface is buggy and overcomplicated and needs a
rethink. (Much of the complication is a hangover from old protocol.)

** Detect old-protocol daeemons from the library.

Might be possible using read-with-timeout. If so, maybe we don't
deep-six old protocol support in 3.0 after all.

** Autodetect old-protocol daemons from library and leave in support?

Might be possible to do this using a read-with-timeout.

*** Finish gpssim

It's blocked on skyview computation.
@@ -73,13 +87,6 @@ These are used for the '?DEVICE' (old 'B') command. All work for 8N1.
SiRF, UBX, TSIP, and even Zodiac can support non-8N1 modes; these need
to be tested.

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

Ian Holmes's Gypsy daemon is a pale shadow of GPSD, but his ideas
about signalling D-Bus client apps only on fix changes are good. We
should support the signal set described here:
<http://gypsy.freedesktop.org/why-not-gpsd.html>.

*** Command to ship RTCM corrections to a specified device

At the moment, if a GPS accepts RTCM corrections and they are
@@ -147,76 +154,6 @@ representative set of RTCM3 sentences and some sort of ASCII dump of
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

NMEA actually has *four* kinds of validity bits: Mode, Status, the
Active/Void bit (some sources interpret 'V' as 'Navigation receiver
warning'), and in later versions the FAA indicator mode. Sentences
that have an Active/Void send V when there is no fix, so the position
data is no good.

Let's look at which sentences send what:

GPRMC GPGLL GPGGA GPGSA
Returns fix Yes Yes Yes No
Returns status No Yes Yes No
Returns mode No No No Yes
Returns A/V Yes Yes No No

In addition, some sentences use empty fields to signify invalid data.

My first conclusion from looking at this table is that the designers
of NMEA 0183 should be hung for galloping incompetence. But never mind that.
What are we to make of this mess?

The fact that the FV18 sends GPRMC/GPGLL/GPGGA but not GPGSA
argues that GPGSA is optional. I don't see how it can be, since it
seems to be the only status bit that applies to altitude. Just how are
we supposed to know when altitude is valid if it doesn't ship GSA?
Can a receiver ever ship a non-empty but invalid altitude?

Which of these override which other bits? I don't think status is ever
nonzero when mode is zero. So status overrides mode. What other such
relationships are there?

News flash: it develops that the "Navigation receiver warning" is
supposed to indicate a valid fix that has a DOP too high or fails
an elevation test.

*** IPv6 Support

gpsd should have support for IPv6. Steps to get to full IPv6 support
include:

**** Detect IPv6 support and getaddrinfo(3) in configure.ac

This web page may be helpful, but is probably overkill - the world has
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

Having multiple sockets will also support future changes to listen on
specific addresses, rather than the -G option for INADDR_ANY instead
of INADDR_LOCAL.

**** If v6 support is present, open both AF_INET and AF_INET6.

If either fails, just skip it. gpsd should run on systems without
"options INET" but with only "options INET6" (BSD) or the Linux
equivalent.

**** In libgps, if getaddrinfo is present, use it instead of gethostbyname.

Loop through all the returned addresses until one works. See telnet
in NetBSD for an example (src/usr.bin/telnet/commands.c).

**** (perhaps) Add a flag to connection libraries to force v4 or v6.

Also add command line flags to force the library flags. Perhaps this
is not necessary; telnet and ntp have this feature but postfix and
sendmail don't seem to.

** Future features (?)

*** Support for more survey / professional / up-scale receivers.
@@ -300,16 +237,6 @@ http://www.twinsun.com/tz/tz-link.htm
Free time-zone maps of the U.S.
http://www.manifold.net/download/freemaps.html

** Documentation

*** GeoClue

Figure out how gpsd should relate to GeoClue and explain this. A
particular question is the dbus interface to gpsd and the GeoClue
provider interface. There is quite possibly nothing to do; GeoClue
using gpsd's published interfaces seems sensible.
http://www.freedesktop.org/wiki/Software/GeoClue

Local variables:
mode: outline
paragraph-separate: "[ ]*$"


+ 3
- 1
Tachometer.c View File

@@ -1,4 +1,3 @@
/* $Id: Tachometer.c 6566 2009-11-20 03:51:06Z esr $ */
/*
* Tachometer Widget Implementation
*
@@ -6,6 +5,9 @@
* Revised by Shinji Sumimoto, 1989/9 (xtachos)
* Modifications : ilham@mit.edu (July 10 '90)
* Cleaned up and simplified by Eric S. Raymond, December 2004.
*
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
#include <sys/types.h>
#include <X11/IntrinsicP.h>


+ 4
- 1
Tachometer.h View File

@@ -1,4 +1,7 @@
/* $Id: Tachometer.h 4794 2008-08-03 16:42:57Z ckuethe $ */
/*
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
#ifndef _GPSD_TACHOMETER_H_
#define _GPSD_TACHOMETER_H_



+ 4
- 1
TachometerP.h View File

@@ -1,4 +1,7 @@
/* $Id: TachometerP.h 4794 2008-08-03 16:42:57Z ckuethe $ */
/*
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
#ifndef _GPSD_TACHOMETERP_H_
#define _GPSD_TACHOMETERP_H_



+ 35
- 29
ais_json.c View File

@@ -20,21 +20,21 @@ representations to libgps structures.
#include "gps_json.h"

/*@ -mustdefine @*/
static void lenhex_unpack(const char *from,
size_t *plen, /*@out@*/char *to, size_t maxlen)
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);
*plen = (size_t) atoi(from);
if (colon != NULL)
(void)gpsd_hexpack(colon+1, to, maxlen);
(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)
int json_ais_read(const char *buf,
char *path, size_t pathlen, struct ais_t *ais,
/*@null@*/ const char **endptr)
{
/* collected but not actually used yet */
bool scaled;
@@ -53,21 +53,24 @@ int json_ais_read(const char *buf,

int status;

#include "ais_json.i" /* JSON parser template structures */
#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) {
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) {
} 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.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",
@@ -75,34 +78,33 @@ int json_ais_read(const char *buf,
&ais->type4.month,
&ais->type4.day,
&ais->type4.hour,
&ais->type4.minute,
&ais->type4.second);
&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.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);
&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) {
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));
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) {
@@ -118,8 +120,8 @@ int json_ais_read(const char *buf,
} 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));
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) {
@@ -136,6 +138,10 @@ int json_ais_read(const char *buf,
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 (strstr(buf, "\"type\":25,") != NULL) {
status = json_read_object(buf, json_ais25, endptr);
} else if (strstr(buf, "\"type\":26,") != NULL) {
status = json_read_object(buf, json_ais26, endptr);
} else {