Merge master.
[dcpomatic.git] / wscript
diff --git a/wscript b/wscript
index 425bfee20f4dbdbca5538d8bcca8ec8fae08fb3d..86cddf7f2a39ff4d355d9ea8ebbe721566b12d78 100644 (file)
--- a/wscript
+++ b/wscript
@@ -3,21 +3,21 @@ import os
 import sys
 
 APPNAME = 'dcpomatic'
-VERSION = '1.64.3devel'
+VERSION = '1.64.11devel'
 
 def options(opt):
     opt.load('compiler_cxx')
     opt.load('winres')
 
-    opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
-    opt.add_option('--disable-gui', action='store_true', default=False, help='disable building of GUI tools')
-    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('--target-centos', action='store_true', default=False, help='set up to compile for a Centos 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('--enable-debug',      action='store_true', default=False, help='build with debugging information and without optimisation')
+    opt.add_option('--disable-gui',       action='store_true', default=False, help='disable building of GUI tools')
+    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('--target-centos',     action='store_true', default=False, help='set up to compile for a Centos 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')
-    opt.add_option('--install-prefix', default=None, help='prefix of where DCP-o-matic will be installed')
+    opt.add_option('--install-prefix',                         default=None,  help='prefix of where DCP-o-matic will be installed')
 
 def static_ffmpeg(conf):
     conf.check_cfg(package='libavformat', args='--cflags', uselib_store='AVFORMAT', mandatory=True)
@@ -50,6 +50,10 @@ def static_openjpeg(conf):
     conf.check_cfg(package='libopenjpeg', args='--cflags', max_version='1.5.1', mandatory=True)
     conf.env.STLIB_OPENJPEG = ['openjpeg']
 
+def dynamic_openjpeg(conf):
+    conf.check_cfg(package='libopenjpeg', args='--cflags --libs', atleast_version='1.5.0', uselib_store='OPENJPEG', mandatory=True)
+    conf.check_cfg(package='libopenjpeg', args='--cflags --libs', max_version='1.5.1', mandatory=True)
+
 def static_dcp(conf, static_boost, static_xmlpp, static_xmlsec, static_ssh):
     conf.check_cfg(package='libdcp', atleast_version='0.92', args='--cflags', uselib_store='DCP', mandatory=True)
     conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP]
@@ -76,8 +80,6 @@ def static_dcp(conf, static_boost, static_xmlpp, static_xmlsec, static_ssh):
     else:
         conf.env.LIB_DCP.append('ssh')
 
-
-
 def dynamic_dcp(conf):
     conf.check_cfg(package='libdcp', atleast_version='0.92', args='--cflags --libs', uselib_store='DCP', mandatory=True)
     conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP]
@@ -223,9 +225,8 @@ def configure(conf):
         # libxml2 seems to be linked against this on Ubuntu but it doesn't mention it in its .pc file
         conf.check_cfg(package='liblzma', args='--cflags --libs', uselib_store='LZMA', mandatory=True)
         
-    if not conf.env.DISABLE_GUI:
-        if conf.env.TARGET_DEBIAN or conf.env.TARGET_CENTOS:
-            conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
+    if not conf.env.DISABLE_GUI and conf.env.TARGET_LINUX:
+        conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
 
     # OSX
     if conf.env.TARGET_OSX:
@@ -274,6 +275,7 @@ def configure(conf):
         dynamic_quickmail(conf)
         dynamic_boost(conf, boost_lib_suffix, boost_thread)
         dynamic_ffmpeg(conf)
+        dynamic_openjpeg(conf)
         dynamic_dcp(conf)
         dynamic_ssh(conf)
 
@@ -286,6 +288,7 @@ def configure(conf):
         dynamic_boost(conf, boost_lib_suffix, boost_thread)
         dynamic_ffmpeg(conf)
         dynamic_dcp(conf)
+        dynamic_openjpeg(conf)
         dynamic_ssh(conf)
 
     # Dependencies which are always dynamically linked
@@ -293,6 +296,8 @@ def configure(conf):
     conf.check_cfg(package='glib-2.0', args='--cflags --libs', uselib_store='GLIB', mandatory=True)
     conf.check_cfg(package= '', path=conf.options.magickpp_config, args='--cppflags --cxxflags --libs', uselib_store='MAGICK', mandatory=True)
     conf.check_cfg(package='libzip', args='--cflags --libs', uselib_store='ZIP', mandatory=True)
+    conf.check_cfg(package='pangomm-1.4', args='--cflags --libs', uselib_store='PANGOMM', mandatory=True)
+    conf.check_cfg(package='cairomm-1.0', args='--cflags --libs', uselib_store='CAIROMM', mandatory=True)
 
     conf.check_cc(fragment="""
                            #include <glib.h>