build.adoc 28 KB

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