gpsd-dev
[Top][All Lists]
Advanced

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

[gpsd-dev] [PATCH 1/3] Adds SConstruct option to support versioned Qt li


From: Fred Wright
Subject: [gpsd-dev] [PATCH 1/3] Adds SConstruct option to support versioned Qt libraries.
Date: Tue, 9 Feb 2016 17:17:04 -0800

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.
---
 SConstruct | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/SConstruct b/SConstruct
index 0c2da08..3141805 100644
--- a/SConstruct
+++ b/SConstruct
@@ -191,6 +191,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)
@@ -798,9 +799,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()
 
@@ -826,9 +829,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
-- 
2.7.0




reply via email to

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