summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-18 22:00:22 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-18 22:00:22 -0400
commit3de982519334edc22a4337c65b1218e2bef5f666 (patch)
treeddf02a43d4d73b2084bec7d7bcd6c688a4bcef0c
parentaf7f50bdeaffae1e922b022fb132d2f8abf5b311 (diff)
downloadgpsd-3de982519334edc22a4337c65b1218e2bef5f666.tar.gz
libgps.a splits in half, becomes libgps.a + libgpsd.a
This is so client apps don't have to carrry around libusb and all the driver-level stuff. I finally caught on to one of the implications of shared libraries that had somewhow escaped me before.
-rw-r--r--Makefile.am53
-rw-r--r--NEWS4
-rw-r--r--libgps.xml15
-rw-r--r--libgpsd.xml14
-rw-r--r--packaging/gpsd.spec.in3
5 files changed, 42 insertions, 47 deletions
diff --git a/Makefile.am b/Makefile.am
index 0880ec6c..d54a9b7c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -102,13 +102,13 @@ gpxlogger_LDADD = $(DBUS_GLIB_LIBS) libgps.la -lm $(LIBUSB)
#
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) $(LIBUSB)
+gpsd_LDADD = $(DBUS_LIBS) $(LIBM) libgpsd.la libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
#
# Build gpsctl
#
gpsctl_SOURCES = gpsctl.c
-gpsctl_LDADD = $(LIBM) libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
+gpsctl_LDADD = $(LIBM) libgpsd.la libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
#
# Build gpspipe
@@ -128,50 +128,52 @@ lcdgps_LDADD = $(LIBM) libgps.la -lm $(LIBUSB)
gpsmon_SOURCES = gpsmon.c monitor_nmea.c monitor_sirf.c \
monitor_italk.c monitor_ubx.c monitor_superstar2.c \
monitor_oncore.c monitor_tnt.c
-gpsmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
+gpsmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgpsd.la libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
#
# Build gpsdecode
#
gpsdecode_SOURCES = gpsdecode.c
-gpsdecode_LDADD = $(LIBM) libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
+gpsdecode_LDADD = $(LIBM) libgpsd.la libgps.la -lm $(LIBPTHREAD) $(LIBUSB)
#
# Build shared libraries
#
libgps_la_LDFLAGS = -version-number 19:0:0
-lib_LTLIBRARIES = libgps.la
+lib_LTLIBRARIES = libgps.la libgpsd.la
-libgpsd_c_sources = \
+libgps_c_sources = \
ais_json.c \
- bits.c \
- bsd-base64.c \
- crc24q.c \
gpsd_report.c \
gpsutils.c \
geoid.c \
- gpsd_json.c \
+ gpsdclient.c \
+ gps_maskdump.c \
hex.c \
- isgps.c \
json.c \
libgps_core.c \
libgps_json.c \
- gpsdclient.c \
- libgpsd_core.c \
- gps_maskdump.c \
+ netlib.c \
+ rtcm2_json.c \
+ shared_json.c \
+ strl.c
+
+libgpsd_c_sources = \
+ bits.c \
+ bsd-base64.c \
+ crc24q.c \
+ gpsd_json.c \
+ isgps.c \
gpsd_maskdump.c \
+ libgpsd_core.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 \
@@ -232,7 +234,9 @@ gpsd_maskdump.c: gpsd.h-tail maskaudit.py
$(PYTHON) maskaudit.py -d >gpsd_maskdump.c && \
chmod a-w gpsd_maskdump.c
-libgps_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
+libgps_la_SOURCES = $(libgps_c_sources)
+
+libgpsd_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
driver_rtcm2.h packet_states.h
# Warning: This overrides autoconf's normal link-line generation process
@@ -243,8 +247,9 @@ 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
+nodist_libgpsd_la_SOURCES = packet_names.h ais_json.i
libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)
+libgpsd_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)
#
# Build Python binding
@@ -314,7 +319,7 @@ test_bits_LDADD = $(LIBC) libgps.la $(LIBUSB)
# Build packets tester
#
test_packet_SOURCES = test_packet.c
-test_packet_LDADD = $(LIBC) libgps.la -lm $(LIBUSB)
+test_packet_LDADD = $(LIBC) libgpsd.la libgps.la -lm $(LIBUSB)
#
# Build geoid model tester
@@ -489,10 +494,10 @@ libgps: libgps_core.c gps.h .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
+SPLINTOPTS = -I/usr/include/dbus-1.0/ $(INCUSB) +quiet
splint: gpsd.h packet_names.h
@echo "Running splint on daemon and libraries..."
- -splint $(SPLINTOPTS) -exportlocal -redef $(gpsd_c_sources) $(libgpsd_c_sources)
+ -splint $(SPLINTOPTS) -exportlocal -redef $(gpsd_c_sources) $(libgpsd_c_sources) $(libgps_c_sources)
@echo "Running splint on cgps..."
-splint $(SPLINTOPTS) -exportlocal $(cgps_SOURCES)
@echo "Running splint on xgpsspeed..."
@@ -524,7 +529,7 @@ cppcheck: gpsd.h packet_names.h
# 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) \
+INDENT_FILES = $(gpsd_c_sources) $(libgpsd_c_sources) $(libgps_c_sources) \
$(cgps_SOURCES) $(gpsmon_SOURCES) $(gpspipe_SOURCES) \
$(gpxlogger_SOURCES) $(gpsdecode_SOURCES) \
$(test_bits_SOURCES) $(test_packet_SOURCES) \
diff --git a/NEWS b/NEWS
index b6c819cb..214ac26d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
* Sun Apr 18 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.94~dev
Error-checking in the 50bps aubframe code has been greatly improved.
The Garmin GPS driver can now use libusb, if it is present, to do
- device discovery.
+ device discovery. The libgps library has been split apart; the
+ service functions used by the daemon now live in libgpsd. This
+ will shave some code volume from GPSD client applications.
* 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,
diff --git a/libgps.xml b/libgps.xml
index 3167d879..ed7342aa 100644
--- a/libgps.xml
+++ b/libgps.xml
@@ -95,17 +95,8 @@ del session
<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>libgps</emphasis> is a service library which
-supports querying GPS devices; link it with the linker option
--lgps. There are two interfaces supported in it; one high-level
-interface that goes through
-<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-and is intended for concurrent use by several applications, and one
-low-level interface that speaks directly with the serial or USB device
-to which the GPS is attached. This page describes the high-level
-interface that is safe for multiple applications to use simultaneously; it
-is probably the one you want. The low-level interface is documented
-at
-<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
+supports communicating with an instance of the
+<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>; link it with the linker option -lgps.</para>
<warning><para>Take care to conditionalize your code on the major and
minor API version symbols in <filename>gps.h</filename>; ideally,
@@ -338,7 +329,7 @@ the GPSD wire protocol. It is not recommended.</para>
<para>
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
<citerefentry><refentrytitle>libgpsmm</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
</refsect1>
diff --git a/libgpsd.xml b/libgpsd.xml
index 15d93e15..0e7956b5 100644
--- a/libgpsd.xml
+++ b/libgpsd.xml
@@ -64,16 +64,10 @@ C:
</refsynopsisdiv>
<refsect1 id='description'><title>DESCRIPTION</title>
-<para><emphasis remap='B'>libgps</emphasis>
+<para><emphasis remap='B'>libgpsd</emphasis>
is a service library which supports querying GPS devices; link it with
-the linker option -lgps. There are
-two interfaces supported in it; one high-level interface that
-goes through
-<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-and is intended for concurrent use by several applications, and one
-low-level interface that speaks directly with the serial or USB device
-to which the GPS is attached. This page describes the low-level
-interface, which
+the linker option -lgpsd. It is a set of low-level
+device-handling calls, which
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
itself uses. See
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>
@@ -161,7 +155,7 @@ a mutex.</para>
<para>
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
</refsect1>
diff --git a/packaging/gpsd.spec.in b/packaging/gpsd.spec.in
index 5978b978..04cd44a7 100644
--- a/packaging/gpsd.spec.in
+++ b/packaging/gpsd.spec.in
@@ -111,6 +111,9 @@ cp packaging/etc_init.d_gpsd_rpm "$RPM_BUILD_ROOT"/etc/rc.d/init.d/gpsd
%{_libdir}/libgps.la
%{_libdir}/libgps.so*
%{_libdir}/libgps.a
+%{_libdir}/libgpsd.la
+%{_libdir}/libgpsd.so*
+%{_libdir}/libgpsd.a
%{_mandir}/man8/gpsd.8*
%{_mandir}/man1/gpsprof.1*
%{_mandir}/man1/gpsmon.1*