summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-03-06 13:51:14 -0800
committerJon Schlueter <jon.schlueter@gmail.com>2016-03-07 06:25:25 -0500
commit4eaab70905b9bd4a5df474f591f27ffdfcd26c43 (patch)
tree8719a147f67d755cb38362047b3f266f94ef3450 /SConstruct
parent98ac74b6bfb954d8c3f5936edd01fab504de16d3 (diff)
downloadgpsd-4eaab70905b9bd4a5df474f591f27ffdfcd26c43.tar.gz
Disables ncurses when library not found.
When none of the entries in the elif chain is able to find a library for [n]curses, this turns off the option (with a message), similar to the way some other options are treated. It also clarifies the CheckPKG messages by showing that the "check" is via pkg-config. Otherwise one may see (e.g. on OpenBSD) the confusing scenario where "ncurses... no" is followed by a working build with [n]curses. TESTED: Ran build-all on OSX, Linux, FreeBSD, OpenBSD, and NetBSD, verifying that ncurses was enabled and built successfully on all but NetBSD (see NetBSD, of course). Also verified expected "Checking..." messages.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct7
1 files changed, 5 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index a2969390..f6781453 100644
--- a/SConstruct
+++ b/SConstruct
@@ -396,7 +396,7 @@ values can be listed with 'scons -h'.
def CheckPKG(context, name):
- context.Message('Checking for %s... ' % name)
+ context.Message('Checking pkg-config for %s... ' % name)
ret = context.TryAction('%s --exists \'%s\'' % (env['PKG_CONFIG'], name))[0]
context.Result(ret)
return ret
@@ -559,7 +559,6 @@ else:
# base system or not. If it does, pkg-config is not likely to tell us
# anything useful. FreeBSD does, Linux doesn't. Most likely other BSDs
# are like FreeBSD.
- ncurseslibs = []
if env['ncurses']:
if config.CheckPKG('ncurses'):
ncurseslibs = pkg_config('ncurses')
@@ -577,6 +576,10 @@ else:
ncurseslibs = ['-lcurses']
elif sys.platform.startswith('darwin'):
ncurseslibs = ['-lcurses']
+ else:
+ ncurseslibs = []
+ announce('Turning off ncurses support, library not found.')
+ env['ncurses'] = False
if env['usb']:
# In FreeBSD except version 7, USB libraries are in the base system