Attempt to fix built with new glibmm automatically rather than having to be told.
authorCarl Hetherington <cth@carlh.net>
Sat, 10 Oct 2015 16:09:25 +0000 (17:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 10 Oct 2015 16:09:25 +0000 (17:09 +0100)
wscript

diff --git a/wscript b/wscript
index 6ae1e995d52e3fd867e160d1a32740d353094a97..867b0385ecd12160c5545b461065ca5d25467b9a 100644 (file)
--- a/wscript
+++ b/wscript
@@ -23,7 +23,7 @@ import sys
 import glob
 import distutils
 import distutils.spawn
-from waflib import Logs
+from waflib import Logs, Context
 
 APPNAME = 'dcpomatic'
 VERSION = '2.4.6devel'
@@ -372,6 +372,15 @@ def configure(conf):
                        lib=['boost_regex%s' % boost_lib_suffix],
                        uselib_store='BOOST_REGEX')
 
+    # libxml++ requires glibmm and versions of glibmm 2.45.31 and later
+    # must be built with -std=c++11 as they use c++11
+    # features and c++11 is not (yet) the default in gcc.
+    glibmm_version = conf.cmd_and_log(['pkg-config', '--modversion', 'glibmm-2.4'], output=Context.STDOUT, quiet=Context.BOTH)
+    s = glibmm_version.split('.')
+    v = (int(s[0]) << 16) | (int(s[1]) << 8) | int(s[2])
+    if v >= 0x022D1F:
+        conf.env.append_value('CXXFLAGS', '-std=c++11')
+
     # Other stuff
 
     conf.find_program('msgfmt', var='MSGFMT')