prepare standalone VST scanner tool.. part one
[ardour.git] / wscript
diff --git a/wscript b/wscript
index 99743afc7c3fa772215da8bd515601761e7e83d4..12295f56c06a631cbaa690b29e02b0471809c09a 100644 (file)
--- a/wscript
+++ b/wscript
@@ -73,6 +73,8 @@ children = [
         'midi_maps',
         'mcp',
         'patchfiles',
+        'headless',
+        'libs/fst',
 ]
 
 i18n_children = [
@@ -168,11 +170,6 @@ def set_compiler_flags (conf,opt):
     if opt.gprofile:
         debug_flags = [ '-pg' ]
 
-    if opt.backtrace:
-        if opt.dist_target == 'auto':
-            if platform != 'darwin' and not is_clang:
-                debug_flags = [ '-rdynamic' ]
-
     # Autodetect
     if opt.dist_target == 'auto':
         if platform == 'darwin':
@@ -409,6 +406,10 @@ def set_compiler_flags (conf,opt):
         conf.env.append_value('CFLAGS', optimization_flags)
         conf.env.append_value('CXXFLAGS', optimization_flags)
 
+    if opt.backtrace:
+        if platform != 'darwin' and not is_clang:
+            linker_flags += [ '-rdynamic' ]
+
     conf.env.append_value('CFLAGS', compiler_flags)
     conf.env.append_value('CFLAGS', c_flags)
     conf.env.append_value('CXXFLAGS', compiler_flags)
@@ -440,6 +441,7 @@ def options(opt):
     opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
                     help='Build runtime checked assembler code (default)')
     opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
+    opt.add_option('--exports-hidden', action='store_true', default=False, dest='exports_hidden')
     opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
                     help='Install MIME type, icons and .desktop file as per freedesktop.org standards')
     opt.add_option('--freebie', action='store_true', default=False, dest='freebie',
@@ -456,6 +458,7 @@ def options(opt):
                     help='Compile with support for LV2 (if Lilv+Suil is available)')
     opt.add_option('--no-lv2', action='store_false', dest='lv2',
                     help='Do not compile with support for LV2')
+    opt.add_option('--lv2dir', type='string', help="install destination for builtin LV2 bundles [Default: LIBDIR/lv2]")
     opt.add_option('--lxvst', action='store_true', default=True, dest='lxvst',
                     help='Compile with support for linuxVST plugins')
     opt.add_option('--nls', action='store_true', default=True, dest='nls',
@@ -572,6 +575,13 @@ def configure(conf):
         conf.env.append_value ('CXXFLAGS', '-DNO_PLUGIN_STATE')
         conf.define ('NO_PLUGIN_STATE', 1)
 
+    if Options.options.lv2dir:
+        conf.env['LV2DIR'] = Options.options.lv2dir
+    else:
+        conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'lv2')
+
+    conf.env['LV2DIR'] = os.path.normpath(conf.env['LV2DIR'])
+
     if sys.platform == 'darwin':
 
         # this is required, potentially, for anything we link and then relocate into a bundle
@@ -669,7 +679,7 @@ def configure(conf):
         conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW')
         conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS')
         conf.env.append_value('CXXFLAGS', '-DCOMPILER_MINGW')
-        conf.env.append_value('LIB', 'pthreadGC2')
+        conf.env.append_value('LIB', 'pthread')
         # needed for at least libsmf
         conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32')
         conf.env.append_value('LIB', 'ws2_32')
@@ -697,15 +707,19 @@ def configure(conf):
 
     opts = Options.options
 
-    # Adopt Microsoft-like convention that makes all non-explicitly exported
+    # (optionally) Adopt Microsoft-like convention that makes all non-explicitly exported
     # symbols invisible (rather than doing this all over the wscripts in the src tree)
     #
     # This won't apply to MSVC but that hasn't been added as a target yet
     #
     # We can't do this till all tests are complete, since some fail if this is et.
-    if opts.internal_shared_libs:
-        conf.env.append_value ('CXXFLAGS', '-fvisibility=hidden')
-        conf.env.append_value ('CFLAGS', '-fvisibility=hidden')
+    if opts.exports_hidden:
+        conf.define ('EXPORT_VISIBILITY_HIDDEN', True)
+        if opts.internal_shared_libs:
+            conf.env.append_value ('CXXFLAGS', '-fvisibility=hidden')
+            conf.env.append_value ('CFLAGS', '-fvisibility=hidden')
+    else:
+        conf.define ('EXPORT_VISIBILITY_HIDDEN', False)
 
     # Set up waf environment and C defines
     if opts.phone_home:
@@ -786,6 +800,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('Strict compiler flags', conf.env['STRICT'])
     write_config_text('Internal Shared Libraries', conf.is_defined('INTERNAL_SHARED_LIBS'))
     write_config_text('Use External Libraries', conf.is_defined('USE_EXTERNAL_LIBS'))
+    write_config_text('Library exports hidden', conf.is_defined('EXPORT_VISIBILITY_HIDDEN'))
 
     write_config_text('Architecture flags',    opts.arch)
     write_config_text('Aubio',                 conf.is_defined('HAVE_AUBIO'))