Thomas Petazzoni
2012-07-24 20:16:48 UTC
By default, gpsd's SConstruct looks in the PATH to find
ncurses5-config. However, in cross-compiling environments, we may need
to tell the SConstruct script to use another ncurses5-config script.
The following implements the equivalent of the
ac_cv_prog_ncurses5_config variable that exists to solve the same
problem in autoconf configure scripts.
The path to the ncurses5-config script can be passed using the
ncurses_config= variable. If no value is passed, the existing behavior
is preserved.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/***@public.gmane.org>
Index: b/SConstruct
===================================================================
--- a/SConstruct
+++ b/SConstruct
@@ -172,6 +172,7 @@
("fixed_stop_bits", 0, "fixed serial port stop bits"),
("target", "", "cross-development target"),
("sysroot", "", "cross-development system root"),
+ ("ncurses_config", "", "ncurses5-config path"),
)
for (name, default, help) in nonboolopts:
opts.Add(name, help, default)
@@ -447,6 +448,11 @@
else:
pkg_config = lambda pkg: ['!%s --cflags --libs --static %s' %(env['PKG_CONFIG'], pkg, )]
+if env['ncurses_config']:
+ ncurses_config = env['ncurses_config']
+else:
+ ncurses_config = "ncurses5-config"
+
# The actual distinction here is whether the platform has ncurses in the
# 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
@@ -455,8 +461,8 @@
if env['ncurses']:
if config.CheckPKG('ncurses'):
ncurseslibs = pkg_config('ncurses')
- elif config.CheckExecutable('ncurses5-config --version', 'ncurses5-config'):
- ncurseslibs = ['!ncurses5-config --libs --cflags']
+ elif config.CheckExecutable('%s --version' % ncurses_config, 'ncurses5-config'):
+ ncurseslibs = ['!%s --libs --cflags' % ncurses_config]
elif sys.platform.startswith('freebsd'):
ncurseslibs= [ '-lncurses' ]
elif sys.platform.startswith('openbsd'):
ncurses5-config. However, in cross-compiling environments, we may need
to tell the SConstruct script to use another ncurses5-config script.
The following implements the equivalent of the
ac_cv_prog_ncurses5_config variable that exists to solve the same
problem in autoconf configure scripts.
The path to the ncurses5-config script can be passed using the
ncurses_config= variable. If no value is passed, the existing behavior
is preserved.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/***@public.gmane.org>
Index: b/SConstruct
===================================================================
--- a/SConstruct
+++ b/SConstruct
@@ -172,6 +172,7 @@
("fixed_stop_bits", 0, "fixed serial port stop bits"),
("target", "", "cross-development target"),
("sysroot", "", "cross-development system root"),
+ ("ncurses_config", "", "ncurses5-config path"),
)
for (name, default, help) in nonboolopts:
opts.Add(name, help, default)
@@ -447,6 +448,11 @@
else:
pkg_config = lambda pkg: ['!%s --cflags --libs --static %s' %(env['PKG_CONFIG'], pkg, )]
+if env['ncurses_config']:
+ ncurses_config = env['ncurses_config']
+else:
+ ncurses_config = "ncurses5-config"
+
# The actual distinction here is whether the platform has ncurses in the
# 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
@@ -455,8 +461,8 @@
if env['ncurses']:
if config.CheckPKG('ncurses'):
ncurseslibs = pkg_config('ncurses')
- elif config.CheckExecutable('ncurses5-config --version', 'ncurses5-config'):
- ncurseslibs = ['!ncurses5-config --libs --cflags']
+ elif config.CheckExecutable('%s --version' % ncurses_config, 'ncurses5-config'):
+ ncurseslibs = ['!%s --libs --cflags' % ncurses_config]
elif sys.platform.startswith('freebsd'):
ncurseslibs= [ '-lncurses' ]
elif sys.platform.startswith('openbsd'):
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com