diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-07 21:23:40 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-07 21:23:40 +0000 |
| commit | c09d415cac646bfd3067f359ca454dc5ea3679e5 (patch) | |
| tree | 5846cce350d1bf323bf9aaaed0bfaa9f6a69f0cd | |
| parent | b4ec9ce787c63b27c96c404b1bd44eccd56ab16e (diff) | |
Allow static builds.
| -rw-r--r-- | src/lib/wscript | 6 | ||||
| -rw-r--r-- | src/tools/wscript | 3 | ||||
| -rw-r--r-- | src/wx/wscript | 6 | ||||
| -rw-r--r-- | test/wscript | 2 | ||||
| -rw-r--r-- | wscript | 9 |
5 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/wscript b/src/lib/wscript index 0d3c7d99d..c1786bb81 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -1,5 +1,9 @@ def build(bld): - obj = bld(features = 'cxx cxxshlib') + if bld.env.STATIC: + obj = bld(features = 'cxx cxxstlib') + else: + obj = bld(features = 'cxx cxxshlib') + obj.name = 'libdvdomatic' obj.export_includes = ['.'] obj.uselib = 'AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE SNDFILE BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 OPENJPEG POSTPROC TIFF MAGICK SSH DCP GLIB' diff --git a/src/tools/wscript b/src/tools/wscript index 9c1ca7524..c8601ad1f 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -1,7 +1,7 @@ def build(bld): for t in ['makedcp', 'fixlengths', 'servomatic_cli']: obj = bld(features = 'cxx cxxprogram') - obj.uselib = 'BOOST_THREAD' + obj.uselib = 'BOOST_THREAD DCP' obj.includes = ['..'] obj.use = ['libdvdomatic'] obj.source = '%s.cc' % t @@ -10,6 +10,7 @@ def build(bld): if not bld.env.DISABLE_GUI: for t in ['dvdomatic', 'servomatic_gui']: obj = bld(features = 'cxx cxxprogram') + obj.uselib = 'DCP' obj.includes = ['..'] obj.use = ['libdvdomatic', 'libdvdomatic-wx'] obj.source = '%s.cc' % t diff --git a/src/wx/wscript b/src/wx/wscript index d425c3e05..4dbb04eea 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -2,7 +2,11 @@ def configure(conf): conf.check_cfg(package = '', path = 'wx-config', args = '--cppflags --cxxflags --libs', uselib_store = 'WXWIDGETS', mandatory = True) def build(bld): - obj = bld(features = 'cxx cxxshlib') + if bld.env.STATIC: + obj = bld(features = 'cxx cxxstlib') + else: + obj = bld(features = 'cxx cxxshlib') + obj.name = 'libdvdomatic-wx' obj.includes = [ '..' ] obj.export_includes = ['.'] diff --git a/test/wscript b/test/wscript index 8a9cb2292..3b809f939 100644 --- a/test/wscript +++ b/test/wscript @@ -8,7 +8,7 @@ def configure(conf): def build(bld): obj = bld(features = 'cxx cxxprogram') obj.name = 'unit-tests' - obj.uselib = 'BOOST_TEST' + obj.uselib = 'BOOST_TEST DCP' obj.use = 'libdvdomatic' obj.source = 'test.cc' obj.target = 'unit-tests' @@ -12,6 +12,7 @@ def options(opt): 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 Windows') + opt.add_option('--static', action='store_true', default = False, help = 'build statically, and link statically to libdcp and FFmpeg') def configure(conf): conf.load('compiler_cxx') @@ -19,6 +20,8 @@ def configure(conf): conf.load('winres') conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing', '-Wall', '-Wno-attributes']) + # libxml2 seems to be linked against this on Ubuntu, but it doesn't mention it in its .pc file + conf.env.append_value('LIB', 'lzma') if conf.options.target_windows: conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H']) @@ -39,6 +42,7 @@ def configure(conf): conf.env.TARGET_WINDOWS = conf.options.target_windows conf.env.DISABLE_GUI = conf.options.disable_gui + conf.env.STATIC = conf.options.static conf.env.VERSION = VERSION if conf.options.enable_debug: @@ -54,7 +58,10 @@ def configure(conf): conf.check_cfg(package = 'libswresample', args = '--cflags --libs', uselib_store = 'SWRESAMPLE', mandatory = False) conf.check_cfg(package = 'libpostproc', args = '--cflags --libs', uselib_store = 'POSTPROC', mandatory = True) conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True) - conf.check_cfg(package = 'libdcp', atleast_version = '0.33', args = '--cflags --libs', uselib_store = 'DCP', mandatory = True) + libdcp_args = '--cflags --libs' + if conf.options.static: + libdcp_args += ' --static' + conf.check_cfg(package = 'libdcp', atleast_version = '0.33', args = libdcp_args, uselib_store = 'DCP', mandatory = True) conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True) conf.check_cfg(package = '', path = 'Magick++-config', args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True) conf.check_cc(fragment = """ |
