gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] Enable building only libgps by making gpsd and gpsdcl


From: Rob Norris
Subject: [gpsd-dev] [PATCH] Enable building only libgps by making gpsd and gpsdclients optional.
Date: Thu, 17 Mar 2016 20:52:43 +0000

The default is still to build everything and ensure when minimal is specified 
that gpsd and client programs are generated.

TESTED:
scons minimal=True
  ==> still generates all programs + libraries as before

scons gpsd=False gpsdclients=False minimal=True
  ==> generates only libgps.a

scons shared=True gpsd=False gpsdclients=False minimal=True
  ==> generates only libgps.so

scons build-all check
  ==> still passes
---
 SConstruct | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/SConstruct b/SConstruct
index b304961..355a398 100644
--- a/SConstruct
+++ b/SConstruct
@@ -158,6 +158,8 @@ boolopts = (
     ("nofloats",      False, "float ops are expensive, suppress error 
estimates"),
     ("squelch",       False, "squelch gpsd_log/gpsd_hexdump to save cpu"),
     # Build control
+    ("gpsd",          True,  "gpsd itself"),
+    ("gpsdclients",   True,  "gspd client programs"),
     ("shared",        True,  "build shared libraries, not static"),
     ("implicit_link", imloads, "implicit linkage is supported in shared libs"),
     ("python",        True,  "build Python support and modules."),
@@ -244,7 +246,8 @@ env.SConsignFile(".sconsign.dblite")
 #  Minimal build turns off every option not set on the command line,
 if env['minimal']:
     for (name, default, help) in boolopts:
-        if default is True and not ARGUMENTS.get(name):
+        # Ensure gpsd and gpsdclients are always enabled unless explicitly 
turned off.
+        if default is True and not ARGUMENTS.get(name) and not (name is "gpsd" 
or name is "gpsdclients"):
             env[name] = False
 
 # NTPSHM requires NTP
@@ -1081,7 +1084,11 @@ ntpshmmon = env.Program('ntpshmmon', ['ntpshmmon.c'],
                         LIBS=['gpsd', 'gps_static'], LIBPATH='.',
                         parse_flags=gpsflags)
 
-binaries = [gpsd, gpsdecode, gpsctl, gpsdctl, gpspipe, gps2udp, gpxlogger, 
lcdgps, ntpshmmon]
+binaries = []
+if env["gpsd"]:
+    binaries += [gpsd]
+if env["gpsdclients"]:
+    binaries += [gpsdecode, gpsctl, gpsdctl, gpspipe, gps2udp, gpxlogger, 
lcdgps, ntpshmmon]
 if env["ncurses"]:
     binaries += [cgps, gpsmon]
 
-- 
2.7.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]