build.adoc 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. = Building GPSD from source
  2. This is a guide to building GPSD from a bare source tree. It includes
  3. guidance on how to cross-build the package. This document overlaps and
  4. interweaves with INSTALL.adoc. INSTALL.adoc contains distribution
  5. specific advice.
  6. Some hints for people building binary packages are in
  7. packaging/README.PACKAGERS.
  8. (This file is marked up in asciidoc.)
  9. == Quick start
  10. You can download the most recent development snapshot from:
  11. https://gitlab.com/gpsd/gpsd/tree/master
  12. You can download the latest gpsd tarball from:
  13. http://download.savannah.gnu.org/releases/gpsd/
  14. Under Linux, assuming you have all your build prerequisites in place,
  15. these lines will do, and need to be run as root:
  16. tar -xzf gpsd-X.YY.tar.gz
  17. cd gpsd-X.YY
  18. scons && scons check && scons udev-install
  19. If you get any errors, you need to read the detailed instructions that follow.
  20. If 'scons' fails, it is possible that your target system has moved to
  21. Python 3 and removed the program 'python'. Python.org says that if
  22. you have an installed Python, there should be a program in your path
  23. called 'python'. This is specified in PEP 394. This rule is not always
  24. followed. You can work around this by linking python3 to python like
  25. this
  26. ln -s /usr/bin/python3 /usr/bin/python
  27. Both 'scons' and 'gpsd' work fine on either Python 2 or Python 3. Which
  28. python you have installed should be transparent to the user, if python
  29. is installed correctly.
  30. Occasionally, builds may fail in completely bizarre ways due to a
  31. corrupted scons database. This seems to relate to ^Cing the build at
  32. an inopportune moment. If you suspect that, see "Reverting to a clean
  33. state" below and then try again.
  34. == Supported platforms
  35. Native-build success should be expected on the following platforms,
  36. provided you have the prerequisites listed in the next section
  37. installed:
  38. * Any desktop or server Linux distribution.
  39. * OpenWRT and derivatives such as CeroWRT.
  40. * FreeBSD, NetBSD, OpenBSD
  41. * Android, using the official Google toolchain from the NDK
  42. We consider failure to build and function on any of these platforms a
  43. serious bug; if you encounter it, please complain on the development
  44. list <gpsd-dev@nongnu.org>.
  45. Port difficulty to any system conforming to POSIX-2001.1 should be minimal.
  46. A Cygwin port is in progress but not complete.
  47. Cross-compilation to embedded Linuxes (in addition to the OpenWRT family)
  48. is usually fairly straightforward. An illustrative build transcript
  49. is included at the end of this file.
  50. == Check your build prerequisites
  51. Necessary components for any build:
  52. |============================================================================
  53. |C compiler | gpsd and client library are written in C
  54. |scons | for executing the build recipe
  55. |Python2.x(x>=6) or 3.y(y>=2) | for scons and some helper scripts
  56. |============================================================================
  57. On Gentoo, a basic build only requires this package:
  58. |============================================================================
  59. |dev-util/scons | for executing the build recipe
  60. |============================================================================
  61. === C compiler
  62. C99 conformance is required in the compiler. The C code depends on one
  63. C11 feature (supported by GCC, clang, and pretty much any C compiler
  64. that also speaks C++): anonymous unions. We could eliminate these,
  65. but the cost would be source-level interface breakage if we have to
  66. move certain structure members in and out of unions.
  67. Some portions of the code using shared-memory segments are improved by
  68. the C11 stdatomic.h features for lockless concurrency. These are: the
  69. SHM export mode in shmexport.c, the code for writing clock corrections
  70. to NTP in ntpshmwrite.c, and the code for reading NTP corrections in
  71. ntpshmread.c. These features have been supported in GCC since 4.7 and
  72. clang since 3.1.
  73. GPSD is normally built and tested with GCC. Do not compile with a version
  74. older than 4.1.1; there are several known issues with older versions,
  75. including (a) non-standards-conformant floating-point generation that
  76. messes up regression testing, (b) a compiler bug affecting RTCM2 code
  77. generation, (c) the option -Wno-missing-field-initializers is
  78. unavailable, leading to a flood of warnings (this is due to generated
  79. code and cannot be fixed).
  80. clang produces a gpsd that passes all regression tests.
  81. If you get a build failure including the text "error adding symbols:
  82. DSO missing from command line" or the complaint "ERROR: CC doesn't
  83. work", you nay have tripped over stale data in the builder's
  84. configuration cache. Clean the directory with "scons -c" then manually
  85. remove .sconsign.*dblite and retry your build.
  86. === Python
  87. You will need Python 2.x at minor version 6 or later or Python 3 at
  88. at minor version 3 or later.
  89. While Python is required to build GPSD from source (the build uses
  90. some code generators in Python), it is not required to run the service
  91. daemon. In particular, you can cross-compile onto an embedded system
  92. without having to take Python with you.
  93. scons finds the python used for scons separately from the python that
  94. should be used for the target. It seems to look for the target python
  95. as "python", which as above is supposed to exist per python norms.
  96. However, some packaging systems avoid a bare python, preferring to
  97. bind a program to a particular release as it is built. On systems
  98. without a "python" command, invoking scons as:
  99. scons target_python=python3.7
  100. seems to help.
  101. You will need both basic Python and (if your package system makes the
  102. distinction) the Python development package used for building C
  103. extensions. Usually these are called "python" and "python-dev". You
  104. will know you are missing the latter if your compilation fails
  105. because of a missing Python.h.
  106. The xgps and xgpsspeed clients will only be installed if these Python
  107. extensions are installed:
  108. |===========================================================================
  109. |python-gi | Python bindings for gobject-introspection libraries
  110. |python-gi-cairo | Python bindings for Cairo toolkit under GI
  111. |===========================================================================
  112. On Gentoo systems those packages are named:
  113. |============================================================================
  114. |dev-python/pygobject
  115. |dev-python/pycairo
  116. |============================================================================
  117. The ubxtool and zerk clients will only be usable in direct-serial mode
  118. if this Python extension is installed:
  119. |===========================================================================
  120. |pyserial | Python Serial Port extension
  121. |===========================================================================
  122. On Gentoo systems that package is named:
  123. |============================================================================
  124. |dev-python/pyserial
  125. |============================================================================
  126. === Scons
  127. You will need scons version 2.3.0 (from 2013-03-02) or later to build the code.
  128. === Optional build components
  129. Having the following optional components on your system will enable
  130. various additional capabilities and extensions:
  131. |============================================================================
  132. |C++ compiler | allows building libgpsmm C++ wrapper for client library
  133. |Qt 4.53+ | allows building libQgpsmm C++ wrapper for client library
  134. |libcap | Capabilities library, improved security under Linux
  135. |(n)curses | curses screen-painting library, used by cgps and gpsmon
  136. |pps-tools | adds support for the KPPS API, for improved timing
  137. |libusb | Userspace access to USB devices
  138. |============================================================================
  139. On Gentoo systems those packages are named:
  140. |=============================================================================
  141. |dev-qt/qtcore | Basic Qt
  142. |dev-qt/qtnetwork | Qt network components
  143. |sys-libs/libcap | Capabilities library
  144. |sys-libs/ncurses | curses screen-painting library, used by cgps and gpsmon
  145. |net-misc/pps-tools | adds support for the KPPS API, for improved timing
  146. |virtual/libusb | Userspace access to USB devices
  147. |=============================================================================
  148. If you have libusb-1.0.0 or later, the GPSD build will autodetect
  149. this and use it to discover Garmin USB GPSes, rather than groveling
  150. through /proc/bus/usb/devices (which has been deprecated by the
  151. Linux kernel team).
  152. You can build libQgpsmm if you have Qt (specifically QtCore and
  153. QtNetwork modules) version 4.5.3 or higher. You will also need a C++
  154. compiler supported by Qt (tested on GCC 4.4.0/mingw on Windows and GCC
  155. 4.1.2 on linux). Please refer to Qt's documentation at
  156. http://qt.nokia.com/doc/4.6/platform-specific.html for platform
  157. specific building documentation
  158. For working with DBUS, you'll need the DBUS development
  159. headers and libraries installed. Under Debian/Ubuntu this
  160. is the package libdbus-1-dev.
  161. Under Ubuntu, the ncurses package you want is libncurses5-dev. Under
  162. Fedora, it's ncurses-devel. Depending on how your distribution
  163. packages ncurses you may also require libtinfo5, a separate terminfo
  164. library.
  165. On some older versions of Ubuntu (notably 11.10) there is a packaging
  166. defect that may cause your build to blow up in SCons. It's a missing
  167. package info file for the tinfo library. To fix this, install the file
  168. packaging/tinfo.pc in /usr/lib/pkgconfig/tinfo.pc. 13.10 fixed this.
  169. We've seen a report that compiling on the Raspberry Pi fails with
  170. a complaint about curses.h not being found. You need to install
  171. Raspbian's curses development library if this happens.
  172. If your kernel provides the RFC 2783 KPPS (kernel PPS) API, gpsd will
  173. use that for extra accuracy. Many Linux distributions have a package
  174. called "pps-tools" that will install KPPS support and the timepps.h
  175. header file. We recommend you do that. If your kernel is built in
  176. the normal modular way, this package installation will suffice.
  177. For building from the source tree, or if you change the man page
  178. source, xslt and docbook xsl style files are used to generate nroff
  179. -man source from docbook xml. The following packages are used in this
  180. process:
  181. |============================================================================
  182. |libxslt | xsltproc is used to build man pages from xml
  183. |docbook-xsl | style file for xml to man translation
  184. |xmlto | DocBook formatter program
  185. |asciidoctor | Documentation front end with light markup
  186. |============================================================================
  187. On Gentoo systems those packages are named:
  188. |================================================================================
  189. |app-text/xmlto | DocBook formatter program
  190. |app-text/asciidoctor | Documentation front end with light markup
  191. |================================================================================
  192. The build degrades gracefully in the absence of any of these. You should
  193. be able to tell from scons messages which extensions you will get.
  194. Under Ubuntu and most other Debian-derived distributions, an easy way
  195. to pick up the prerequisites is: "apt-get build-dep gpsd". Note
  196. that your sources.list will need "deb-src" lines for this, not
  197. just "deb" lines.
  198. If you are custom-building a Linux kernel for embedded deployment, you
  199. will need some subset of the following modules:
  200. |============================================================================
  201. |pl2303 | Prolific Technology, Inc. PL2303 Serial Port
  202. |ftdi_sio | FTDI 8U232AM / FT232
  203. |cypress_m8 | M8/CY7C64013
  204. |cp210x | Cygnal Integrated Products devices
  205. |garmin_gps | Garmin USB mice including GPS-18
  206. |cdc_am | USB Communication Device Class Abstract Control Model interface
  207. |pps-gpio | For KPPS support on ARM systems
  208. |pps-ldisc | For KPPS support with RS-232 ports
  209. |pps_parport | For KPPS support with a parallel port
  210. |============================================================================
  211. These are listed in rough order of devices covered as of 2013; the
  212. PL23203 by itself accounts for over 70% of deployed USB mice. We
  213. recommend building with pl2303, ftdi_sio, cypress_m8, and cp210x.
  214. We've received a bug report that suggests the Python test framework
  215. requires legacy PTY support (CONFIG_LEGACY_PTYS) from the Linux
  216. kernel. You should make sure you're in the 'dialout' group in order
  217. to have permission to use these devices.
  218. == How to build the software from source
  219. To build gpsd for your host platform from source, simply call 'scons'
  220. in a working-directory copy. (Cross-build is described in a later
  221. section.)
  222. To clean the built files, run 'scons -c' or 'scons --clean'.
  223. Run 'rm -f .sconsign.*dblite' to clear the scons
  224. database. Doing both should return your working directory to a
  225. near pristine state as far as building is concerned. Some user created
  226. files may remain, and source code changes will not have been reverted..
  227. When in doubt, restart with a clean copy of the source.
  228. You can specify the installation prefix, as for an autotools build, by
  229. running "scons prefix=<installation_root>". The default value is
  230. "/usr/local". The environment variable DESTDIR also works in the
  231. usual way.
  232. If your linker run fails with missing math symbols, see the FIXME
  233. comment relating to implicit_links in the scons recipe; you probably
  234. need to build with implicit_link=no. If this happens, please report
  235. your platform, ideally along with a way of identifying it from Python,
  236. to the GPSD maintainers.
  237. If, while building, you see a complaint that looks like this:
  238. --------------------------------------------------------------------
  239. I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
  240. --------------------------------------------------------------------
  241. it means the xmlto document formatter is failing to fetch a stylesheet it
  242. needs over the network. Probably this means you are doing a source
  243. build on a machine without live Internet access. The workaround
  244. for this is to temporarily remove xmlto from your command path so GPSD
  245. won't try building the documentation. The actual fix is to install
  246. DocBook on your machine so there will be a local copy of the
  247. stylesheet where xmlto can find it.
  248. After building, please run 'scons check' to test the correctness
  249. of the build. It is not necessary to install first. Python is
  250. required for regression tests. If any of the tests fail, you probably
  251. have a toolchain issue. The most common such problem is failures of
  252. strict C99 conformance in floating-point libraries.
  253. Once you have verified that the code is working, "scons install"
  254. will install it it in the system directories. "scons uninstall" will
  255. undo this. Note: because scons is a single-phase build system, this
  256. may recompile everything. If you want feature-configuration options,
  257. you need to specify them here.
  258. To enable hotplugging of USB GPSes under Linux, you may do 'scons
  259. udev-install' to put the appropriate udev rules and wrapper files in
  260. place.
  261. You will need php and php-gd installed to support the PHP web page
  262. generator included with the distribution. To install it, copy the file
  263. 'gpsd.php' to your HTML document directory. Then see the
  264. post-installation instructions in INSTALL.adoc for how to configure it.
  265. == Leap Seconds
  266. The header gpsd.h contains the value BUILD_LEAPSECONDS. This is set,
  267. at release time, to the leap second value current at that time.
  268. Ideally gpsd would be reading the standard leapseconds.cache file
  269. provided by most distributions for the current leap second.
  270. Most of the drivers supply the current leap second, after the GNSS
  271. receiver sends it in a message to gpsd. But none of the standard NMEA
  272. 0183 messages supply the current leap second. Thus the need for a fall
  273. back leap second value.
  274. The leap second value is mainly used to check for invalid UTC time from
  275. the GNSS receiver. If the receiver is affected by the GPS Week Number
  276. Roll Over (WKNO) bug, then the UTC time it reports will be off by 1024
  277. weeks.
  278. All GNSS receivers may be using the wrong leap second internally on
  279. startup. This may happen if it has been less than about 12 minutes since
  280. power-up; the receiver has not yet received the current leapsecond
  281. offset as part of the periodic almanac download. Page 18, subframe 4,
  282. of the almanac contains the leap second data.
  283. The gpsd daemon may be using the wrong leap second internally if
  284. the compiled in leap second is no longer valid, and the GNSS receiver
  285. has not reported the current leap second to gpsd.
  286. == Optional features
  287. By giving command-line options to scons you can configure certain rarely-used
  288. optional features in, or compile standard features out to reduce gpsd's
  289. footprint. "scons --help" will tell the story; look under "Local Options"
  290. and consult the source code if in doubt.
  291. Here are a few of the more important feature switches. Each description
  292. begins with the default for the switch.
  293. pps=yes: for small embedded systems and those without threading,
  294. it is possible to build gpsd without thread support if you build
  295. with pps=no. You'll lose support for updating the clock from PPS
  296. pulses.
  297. dbus_export=no: for systems using DBUS: gpsd includes support for
  298. shipping fixes as DBUS notifications, compiled in by default. This
  299. may lead to complaint messages during testing on systems that don't
  300. support DBUS. Build with the option "dbus_export=no" to disable it
  301. qt=yes: libQgpsmm is a Qt version of the libgps/libgpsmm
  302. pair. Thanks to the multi-platform approach of Qt, it allows the gpsd
  303. client library to be available on all the Qt supported platforms.
  304. Please see http://qt.nokia.com/doc/4.6/supported-platforms.html for a
  305. status of Qt supported platforms as of version 4.6.
  306. minimal=no: people building for extremely constrained environments
  307. may want to set this. It changes the default for all boolean (feature)
  308. options to false; thus, you get *only* the options you specify on the
  309. command line. Thus, for example, if you want to turn off all features
  310. except socket export and nmea0183,
  311. ------------------------------------------------
  312. scons minimal=yes socket_export=yes nmea0183=yes
  313. ------------------------------------------------
  314. will do that.
  315. -----------------------------------------------
  316. scons minimal=yes gpsd=False gpsdclients=False
  317. -----------------------------------------------
  318. generates only libgps.a
  319. -----------------------------------------------
  320. scons minimal=yes shared=True gpsd=False gpsdclients=False
  321. -----------------------------------------------
  322. generates only libgps.so
  323. == Port and toolchain testing
  324. 'scons check' will run a comprehensive regression-test suite. You
  325. should do this, at minimum, every time you build from source on a new
  326. machine type. GPSD does enough bit-twiddling and floating point that
  327. it is very sensitive to toolchain problems; you'll want to be sure
  328. those aren't going to bite you in production.
  329. So that the tests will run fast and be easy to do often, we make the test
  330. framework shove data through the pty and socket layers *way* faster
  331. than would ever occur in production. If you get regression-test
  332. failures that aren't repeatable and look like the test framework is
  333. sporadically failing to feed the last line or two of test loads, try
  334. using the slow=yes option with scons check. If that fails, try
  335. increasing the delay value via the WRITE_PAD environment variable
  336. (above the value reported in the test output). If you have to do this,
  337. please report your experience to the GPSD maintainers.
  338. Both the builds and the tests are highly parallelizable via the scons
  339. -j option, which can gain a substantial speedup on a multicore machine.
  340. Because the output from the various jobs is interleaved, it may be more
  341. difficult to understand error results with multiple jobs. In that event,
  342. simply rerun without the -j option for more straightforward output.
  343. If coveraging is enabled (coveraging=yes), then Python programs run
  344. during testing are run via Python coveraging. This prefixes the relevant
  345. commands with the content of the python_coverage option, whose default
  346. value of "coverage run" is appropriate if the standard Python coverage
  347. package is installed and accessible in the command path. It can be
  348. set to a different value if necessary, or set to the empty string to
  349. disable Python coveraging. The latter happens automatically (with a
  350. message) if the tool cannot be found. When running multiple jobs with
  351. "-j", if python_coverage has its default value, "--parallel" is automatically
  352. appended to the command. With a non-default setting, accommodating
  353. parallelism is the user's responsibility.
  354. For instructions on how to live-test the software, see the file INSTALL.adoc.
  355. == Reverting to a clean state
  356. The scons equivalent of 'make clean' is 'scons -c' or 'scons
  357. --clean'. This will revert your source tree to a clean state nearly as
  358. though you had just cloned or downloaded it; some scons housekeeping
  359. stuff is left in place.
  360. If you interrupted a regression test, 'scons testclean' will remove
  361. generated test programs.
  362. If you're building in a clone of the git repository, you can use
  363. "git clean -dxf" to remove all untracked files. Note, however, that
  364. this will remove any files you have created on your own, in addition
  365. to build products and scons temporaries. You can alternatively use
  366. "git clean -dxn" to see what would be removed without actually removing
  367. anything, or "git clean -dxi" to remove things selectively. Using
  368. "git clean" after "scons -c" usually results in a fairly short list.
  369. == Notes on Android:
  370. Samuel Cuella reports:
  371. I use the official google toolchain from the Android NDK (Native
  372. Development Kit). You can also use the toolchain from code sourcery I
  373. guess. I cross-compile from a "regular" (with GNU userland) linux box.
  374. People who port software from linux to android tend to use either the
  375. NDK or code sourcery's.
  376. If you are going to include "official" guidelines, I would go for
  377. recommending the official toolchain from the NDK.
  378. Here are the scons switches I use:
  379. scons wordsize=32 snapshot=off arch=arm sample=shell
  380. scons -j3 prefix=/usr libdir=$prefix/lib udevdir=/lib/udev
  381. gpsd_user=gpsd gpsd_group=uucp socket_export=1
  382. nmea0183=1 sirf=1
  383. With the following environment variables:
  384. TOOL_HOME=/home/samuel/android-official-last/
  385. export TOOL_PREFIX=${TOOL_HOME}/bin/arm-linux-androideabi
  386. export CXX=$TOOL_PREFIX-g++
  387. export AR=$TOOL_PREFIX-ar
  388. export RANLIB=$TOOL_PREFIX-ranlib
  389. export CC=$TOOL_PREFIX-gcc
  390. export LD=$TOOL_PREFIX-ld
  391. export CCFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfp"
  392. export ARM_TARGET_LIB=${TOOL_HOME}/sysroot
  393. scons wordsize=32 snapshot=off arch=arm sample=shell
  394. == Cross-building
  395. The scons recipe is intended to support cross-building, in particular
  396. for embedded deployment of the software. A session transcript
  397. illustrating how to do that, with some routine messages suppressed and
  398. replaced with [...], follows. The script assumes you're cloning from the
  399. GPSD project site or a mirror. Notes and explanation follow the transcript.
  400. ----
  401. $ git clone [...]
  402. Cloning into gpsd...
  403. [...]
  404. $ cd gpsd
  405. ----
  406. Edit .scons-options-cache (may not exist) and add lines, describing
  407. what your target architecture and build preferences are.
  408. ----
  409. $ cat .scons-option-cache
  410. libgpsmm = False
  411. libQgpsmm = False
  412. python = False
  413. prefix = '/work/buildroot/output/staging/usr/'
  414. sysroot = '/work/buildroot/output/staging/'
  415. target = 'arm-indigo-linux-gnueabi'
  416. $ scons
  417. scons: Reading SConscript files ...
  418. [...]
  419. Altered configuration variables:
  420. libgpsmm = False (default True): build C++ bindings
  421. libQgpsmm = False (default True): build QT bindings
  422. python = False (default True): build Python support and modules.
  423. prefix = /work/buildroot/output/staging/usr/ (default /usr/local): installation directory prefix
  424. sysroot = /work/buildroot/output/staging (default ): cross-development system root
  425. target = arm-indigo-linux-gnueabi (default ): cross-development target
  426. scons: done reading SConscript files.
  427. scons: Building targets ...
  428. substituter(["jsongen.py"], ["jsongen.py.in"])
  429. chmod -w jsongen.py
  430. chmod +x jsongen.py
  431. rm -f ais_json.i && /usr/bin/python jsongen.py --ais --target=parser > ais_json.i && chmod a-w ais_json.i
  432. Creating 'gpsd_config.h'
  433. arm-indigo-linux-gnueabi-gcc -o ais_json.os -c --sysroot=/work/buildroot/output/staging/ -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -O2 -fPIC ais_json.c
  434. arm-indigo-linux-gnueabi-gcc -o daemon.os -c --sysroot=/work/buildroot/output/staging/ -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -O2 -fPIC daemon.c
  435. Creating 'gpsd.h'
  436. [...]
  437. chmod -w maskaudit.py
  438. chmod +x maskaudit.py
  439. rm -f gps_maskdump.c && /usr/bin/python maskaudit.py -c . > gps_maskdump.c && chmod a-w gps_maskdump.c
  440. arm-indigo-linux-gnueabi-gcc -o gps_maskdump.os -c --sysroot=/work/buildroot/output/staging/ -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -O2 -fPIC gps_maskdump.c
  441. [..]
  442. scons: done building targets.
  443. $ file gpsd
  444. gpsd: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.36, not stripped
  445. ----
  446. The author of this transcript notes:
  447. The sysroot option tells the compiler and linker to use libraries and
  448. headers from the given path as if they were placed at / prefix. During
  449. this build the option allows linking with target ncurses (with the option
  450. of having more packages at the --sysroot path) and including correct
  451. headers without specifying -I and -L options.
  452. In the options cache file gpsd is configured to install to
  453. /work/buildroot/output/staging/usr path, so gpsd clients could be
  454. compiled against libgps.so using /work/buildroot/output/staging as
  455. sysroot option.
  456. "arm-indigo-linux-gnueabi" as target means that
  457. arm-indigo-linux-gnueabi-gcc and related tools are available in PATH;
  458. your cross-compiler is likely to have a different target prefix.
  459. You may also find it useful to set manbuild=no.
  460. == Autostarting the daemon
  461. The preferred way to start gpsd is on-demand by a hotplug script
  462. detecting USB device activations. Look at the gpsd.rules and
  463. gpsd.hotplug files to see how this is accomplished. Relevant
  464. productions in the build recipe are "udev-install" and
  465. "udev-uninstall"; relevant build options include "udevdir".
  466. If you for some reason need to start gpsd unconditionally at
  467. boot time (in particular, if you need to support RS232 devices)
  468. there's a model init.d script under packaging/deb and a systemd
  469. setup under systemd/.
  470. // end