summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-02-09 17:17:04 -0800
committerEric S. Raymond <esr@thyrsus.com>2016-02-09 21:53:23 -0500
commit389ad5707da955706f171ae1940ac48d08fc6fe3 (patch)
tree74b215f6565984a919895b0bf7bbb8c61adf0ed7 /SConstruct
parent85bb6ad9eebb139a16265ab2d775b10df15d9b04 (diff)
downloadgpsd-389ad5707da955706f171ae1940ac48d08fc6fe3.tar.gz
Adds SConstruct option to support versioned Qt libraries.
As of Qt5, the Qt library names have the major version number built into the library names (e.g. Qt5Network). This change adds a new "qt_versioned" option which can be used to pass the proper version number into the appropriate commands. The default value is null, which is compatible with the unversioned naming used in Qt4. This change also makes the CheckPKG call for the Qt library conditional on Qt support being enabled. Aside from avoiding a useless pkg-config invocation in the non-Qt case, this also makes it possible to distinguish between explictly and implicitly disabled Qt support in the build output. TESTED: Builds without Qt and with Qt4 have been successfully performed under all OSX versions from 10.5 through 10.11. Builds with Qt5 have been successfully performed under OSX versions from 10.8 (the earliest version officially supported by Qt5) through 10.11.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct14
1 files changed, 9 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index 6f36ff21..4c67d73f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -194,6 +194,7 @@ nonboolopts = (
("fixed_stop_bits", 0, "fixed serial port stop bits"),
("target", "", "cross-development target"),
("sysroot", "", "cross-development system root"),
+ ("qt_versioned", "", "version for versioned Qt"),
)
for (name, default, help) in nonboolopts:
opts.Add(name, help, default)
@@ -801,9 +802,11 @@ int clock_gettime(clockid_t, struct timespec *);
src_suffix=".xml", suffix=".html")
# Determine if Qt network libraries are present, and if not, force qt to off
- qt_network = config.CheckPKG('QtNetwork')
- if not qt_network:
- env["qt"] = False
+ if env["qt"]:
+ qt_net_name = 'Qt%sNetwork' % env["qt_versioned"]
+ qt_network = config.CheckPKG(qt_net_name)
+ if not qt_network:
+ env["qt"] = False
env = config.Finish()
@@ -829,9 +832,10 @@ int clock_gettime(clockid_t, struct timespec *);
qt_env.MergeFlags('-DUSE_QT')
qt_env.Append(OBJPREFIX='qt-')
try:
- qt_env.MergeFlags(pkg_config('QtNetwork'))
+ qt_env.MergeFlags(pkg_config(qt_net_name))
except OSError:
- announce("pkg_config is confused about the state of QtNetwork.")
+ announce("pkg_config is confused about the state of %s."
+ % qt_net_name)
qt_env = None
else:
qt_env = None