Explicitly link with GTK when doing Linux static builds.
authorCarl Hetherington <cth@carlh.net>
Mon, 1 Jul 2013 13:35:00 +0000 (13:35 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 1 Jul 2013 13:35:00 +0000 (13:35 +0000)
src/tools/wscript
wscript

index 386aa452e20bb7c942a6fbb1f8d94c64805bd515..20a92cad2f4adb38df59f88394426b4f0306853b 100644 (file)
@@ -16,6 +16,8 @@ def build(bld):
         for t in ['dvdomatic', 'dvdomatic_batch', 'servomatic_gui']:
             obj = bld(features = 'cxx cxxprogram')
             obj.uselib = 'DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML WXWIDGETS'
+            if bld.env.STATIC:
+                obj.uselib += ' GTK'
             obj.includes = ['..']
             obj.use    = ['libdvdomatic', 'libdvdomatic-wx']
             obj.source = '%s.cc' % t
diff --git a/wscript b/wscript
index e8f6240d3e61338da3756f0808c2a3ee87e9304f..a98d6089491d1302a5a8d8e69f02058796fdb342 100644 (file)
--- a/wscript
+++ b/wscript
@@ -112,8 +112,11 @@ def configure(conf):
 
     if conf.env.TARGET_LINUX:
         conf.check_cfg(package='liblzma', args='--cflags --libs', uselib_store='LZMA', mandatory=True)
-        # On Linux we need to be able to include <gtk/gtk.h> to check GTK's version
-        conf.check_cfg(package='gtk+-2.0', args='--cflags', uselib_store='GTK', mandatory=True)
+        if conf.env.STATIC:
+            conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
+        else:
+            # On Linux we need to be able to include <gtk/gtk.h> to check GTK's version
+            conf.check_cfg(package='gtk+-2.0', args='--cflags', uselib_store='GTK', mandatory=True)
 
     conf.check_cfg(package = '', path = conf.options.magickpp_config, args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True)