Centos build fixes.
authorCarl Hetherington <cth@carlh.net>
Sun, 13 Jul 2014 21:35:46 +0000 (22:35 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 15 Jul 2014 16:51:18 +0000 (17:51 +0100)
cscript
src/lib/wscript
src/wx/wscript
wscript

diff --git a/cscript b/cscript
index 9d1605b2fcd43f0d2256b4647fa3c58034bc7f03..7a61336455c9d5848c102db0c7badca2664f7a1e 100644 (file)
--- a/cscript
+++ b/cscript
@@ -169,7 +169,10 @@ def build(target, options):
             if target.version == 'unstable':
                 cmd += ' --debian-unstable'
         elif target.distro == 'centos':
-            cmd += ' --target-centos'
+            if target.version == '6.5':
+                cmd += ' --target-centos-6'
+            elif target.version == '7':
+                cmd += ' --target-centos-7'
 
     target.command(cmd)
     target.command('./waf')
index 9333687769fe1acd1ade6bbffd4e3adf4318092d..6d563f255ccb5c100496ec15d7152d43d54e5a00 100644 (file)
@@ -83,8 +83,8 @@ def build(bld):
     obj.uselib = """
                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE 
                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2
-                 SNDFILE OPENJPEG POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
-                 CURL ZIP QUICKMAIL
+                 SNDFILE OPENJPEG POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XMLPP
+                 CURL ZIP QUICKMAIL XMLSEC
                  """
 
     if bld.env.TARGET_OSX:
@@ -96,7 +96,7 @@ def build(bld):
         obj.uselib += ' WINSOCK2 BFD DBGHELP IBERTY SHLWAPI MSWSOCK BOOST_LOCALE'
         obj.source += ' stack.cpp'
     if bld.env.BUILD_STATIC:
-        obj.uselib += ' XML++'
+        obj.uselib += ' XMLPP'
 
     obj.target = 'dcpomatic'
 
index f26a91cbc5d30dfb16636417841157043f6b8f61..8bf2451c22cba584271a648c7037a7d2b909a0ca 100644 (file)
@@ -67,6 +67,9 @@ def configure(conf):
             conf.env.LIB_WXWIDGETS.append('Xxf86vm')
             conf.env.LIB_WXWIDGETS.append('Xext')
             conf.env.LIB_WXWIDGETS.append('X11')
+
+        if conf.env.TARGET_CENTOS_7:
+            conf.env.LIB_WXWIDGETS.append('Xxf86vm')
  
     conf.in_msg = 1
     wx_version = conf.check_cfg(package='', path=conf.options.wx_config, args='--version').strip()
diff --git a/wscript b/wscript
index a8cb05f7dfde43eefe8be2590b4176b103ea27a8..866d977b0e2d033db6a83e5e4b4eca69fce0add0 100644 (file)
--- a/wscript
+++ b/wscript
@@ -14,7 +14,8 @@ def options(opt):
     opt.add_option('--target-windows',    action='store_true', default=False, help='set up to do a cross-compile to make a Windows package')
     opt.add_option('--target-debian',     action='store_true', default=False, help='set up to compile for a Debian/Ubuntu package')
     opt.add_option('--debian-unstable',   action='store_true', default=False, help='add extra libraries to static-build correctly on Debian unstable')
-    opt.add_option('--target-centos',     action='store_true', default=False, help='set up to compile for a Centos package')
+    opt.add_option('--target-centos-6',   action='store_true', default=False, help='set up to compile for a Centos 6.5 package')
+    opt.add_option('--target-centos-7',   action='store_true', default=False, help='set up to compile for a Centos 7 package')
     opt.add_option('--magickpp-config',   action='store',      default='Magick++-config', help='path to Magick++-config')
     opt.add_option('--wx-config',         action='store',      default='wx-config', help='path to wx-config')
     opt.add_option('--address-sanitizer', action='store_true', default=False, help='build with address sanitizer')
@@ -165,12 +166,13 @@ def configure(conf):
     conf.env.DISABLE_GUI = conf.options.disable_gui
     conf.env.TARGET_DEBIAN = conf.options.target_debian
     conf.env.DEBIAN_UNSTABLE = conf.options.debian_unstable
-    conf.env.TARGET_CENTOS = conf.options.target_centos
+    conf.env.TARGET_CENTOS_6 = conf.options.target_centos_6
+    conf.env.TARGET_CENTOS_7 = conf.options.target_centos_7
     conf.env.VERSION = VERSION
     conf.env.TARGET_OSX = sys.platform == 'darwin'
     conf.env.TARGET_LINUX = not conf.env.TARGET_WINDOWS and not conf.env.TARGET_OSX
     # true if we should build dcpomatic/libdcpomatic/libdcpomatic-wx statically
-    conf.env.BUILD_STATIC = conf.options.target_debian or conf.options.target_centos
+    conf.env.BUILD_STATIC = conf.options.target_debian or conf.options.target_centos_6 or conf.options.target_centos_7
     if conf.options.install_prefix is None:
         conf.env.INSTALL_PREFIX = conf.env.PREFIX
     else:
@@ -218,8 +220,8 @@ def configure(conf):
     # POSIX
     if conf.env.TARGET_LINUX or conf.env.TARGET_OSX:
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_POSIX')
-        conf.env.append_value('CXXFLAGS', '-DPOSIX_LOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX'])
-        conf.env.append_value('CXXFLAGS', '-DPOSIX_ICON_PREFIX="%s/share/dcpomatic"' % conf.env['PREFIX'])
+        conf.env.append_value('CXXFLAGS', '-DPOSIX_LOCALE_PREFIX="%s/share/locale"' % conf.env['INSTALL_PREFIX'])
+        conf.env.append_value('CXXFLAGS', '-DPOSIX_ICON_PREFIX="%s/share/dcpomatic"' % conf.env['INSTALL_PREFIX'])
         boost_lib_suffix = ''
         boost_thread = 'boost_thread'
         conf.env.append_value('LINKFLAGS', '-pthread')
@@ -249,7 +251,7 @@ def configure(conf):
     if conf.env.TARGET_DEBIAN:
         conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags', uselib_store='CXML', mandatory=True)
         conf.env.STLIB_CXML = ['cxml']
-        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True)
+        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XMLPP', mandatory=True)
         conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True)
         conf.env.STLIB_QUICKMAIL = ['quickmail']
         static_ffmpeg(conf)
@@ -257,7 +259,8 @@ def configure(conf):
         static_dcp(conf, False, False, False, False)
         dynamic_boost(conf, boost_lib_suffix, boost_thread)
 
-    if conf.env.TARGET_CENTOS:
+    if conf.env.TARGET_CENTOS_6:
+        # Centos 6.5's boost is too old, so we build a new version statically in the chroot
         conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags --libs-only-L', uselib_store='CXML', mandatory=True)
         conf.env.STLIB_CXML = ['cxml', 'boost_filesystem']
         conf.check_cfg(package='libcurl', args='--cflags --libs-only-L', uselib_store='CURL', mandatory=True)
@@ -270,8 +273,22 @@ def configure(conf):
         static_dcp(conf, True, True, True, True)
         static_boost(conf, boost_lib_suffix)
 
+    if conf.env.TARGET_CENTOS_7:
+        # Centos 7's boost is ok so we link it dynamically
+        conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags', uselib_store='CXML', mandatory=True)
+        conf.env.STLIB_CXML = ['cxml']
+        conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True)
+        conf.env.STLIB_QUICKMAIL = ['quickmail']
+        conf.env.LIB_SSH = ['gssapi_krb5']
+        conf.env.LIB_XMLPP = ['xml2']
+        conf.env.LIB_XMLSEC = ['ltdl']
+        static_ffmpeg(conf)
+        static_openjpeg(conf)
+        static_dcp(conf, False, True, True, True)
+        dynamic_boost(conf, boost_lib_suffix, boost_thread)
+
     if conf.env.TARGET_WINDOWS:
-        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True)
+        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XMLPP', mandatory=True)
         conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True)
         conf.check_cxx(fragment="""
                                #include <boost/locale.hpp>\n
@@ -288,9 +305,9 @@ def configure(conf):
         dynamic_ssh(conf)
 
     # Not packaging; just a straight build
-    if not conf.env.TARGET_WINDOWS and not conf.env.TARGET_DEBIAN and not conf.env.TARGET_CENTOS:
+    if not conf.env.TARGET_WINDOWS and not conf.env.TARGET_DEBIAN and not conf.env.TARGET_CENTOS_6 and not conf.env.TARGET_CENTOS_7:
         conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags --libs', uselib_store='CXML', mandatory=True)
-        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True)
+        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XMLPP', mandatory=True)
         conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True)
         dynamic_quickmail(conf)
         dynamic_boost(conf, boost_lib_suffix, boost_thread)