summaryrefslogtreecommitdiff
path: root/build.txt
diff options
context:
space:
mode:
Diffstat (limited to 'build.txt')
-rw-r--r--build.txt114
1 files changed, 114 insertions, 0 deletions
diff --git a/build.txt b/build.txt
new file mode 100644
index 00000000..1eaae313
--- /dev/null
+++ b/build.txt
@@ -0,0 +1,114 @@
+= Building GPSD from source ==
+
+This is a guide to building GPSD from a bare source tree. It includes
+guidance on how to cross-build the package.
+
+== Check your build prerequisites ==
+
+Necessary components for any build:
+
+C compiler -> gpsd and client library are written in C
+Python -> some code is generated from python scripts
+scons -> for the build recipe
+
+C99 conformance is required in the compiler. The C 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.
+
+GPSD is normally built and tested with GCC. The shared-memory
+interface relies on one GCCism, but the code is otherwise pretty
+compiler-agnostic. It is reported that clang produces a gpsd that
+passes all regression tests. If -Wmissing-field-initializers or
+its non-gcc equivalent is set you will get a lot of warnings;
+this is due to generated code and cannot be fixed.
+
+You will need scons version 1.2.0 or later to build the code. The
+autotools build from 2.96 and earlier versions has been dropped.
+
+Having the following optional components on your system will enable
+various additional capabilities and extensions:
+
+C++ compiler -> libgpsmm C++ wrapper for the library
+chrpath -> prevents a potential security hole in built binaries
+
+If you have libusb-1.0.0 or later, the GPSD build will autodetect
+this and use it to discover Garmin USB GPSes, rather than groveling
+through /proc/bus/usb/devices (which has been deprecated by the
+Linux kernel team).
+
+For working with DBUS, you'll need the DBUS development
+headers and libraries installed. Under Debian/Ubuntu these
+are the packages libdbus-1-dev and libdbus-glib-1-dev.
+
+Under Ubuntu, the ncurses package you want is libncurses5-dev.
+
+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
+
+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 distributions, an easy way
+to pick up the prerequisites is: "apt-get build-dep gpsd"
+
+== How to build the software from source ==
+
+To build gpsd from source, simply call 'scons' in a working-directory
+copy.
+
+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 configure
+command. The rtcm2.c file confuses the gcc-3.4.[23] optimizer
+at -O2 level, making it generate incorrect code.
+
+Note: If your scons fails with the complaint "No tool named 'textfile'",
+you need to upgrade it. This feature was introduced during the long
+interval after the 1.2.0 release; 1.2.1 and later versions will have it.
+
+By giving command-line options to scons you can configure certain rarely-used
+optional features in, or compile standard features out to reduce gpsd's
+footprint. "scons --help" will tell the story; look under "Local Options"
+and consult the source code if in doubt.
+
+In particular, small embedded systems and those without threading. It is
+possible to build gpsd without thread support if you configure with
+pps=no. You'll lose support for updating the clock from PPS pulses.
+
+Also, for systems using DBUS: gpsd includes support for shipping fixes
+as DBUS notifications, but it is not compiled in by default. Configure
+with the option "dbus=yes" to get it working.
+
+If your linker run fails with missing math symbols, see the FIXME comment
+relating to implicit_links in the scons recipe; you probably need to
+build with implicit_link=no. And report your platform, ideally along
+with a way of identifying it from Python, to the gpsd maintainers.
+
+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 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).
+
+Specifically for linux: You can specify the installation prefix by
+running "scons 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
+
+After building, run 'scons testregress' to test the correctness of the
+build.
+