update canvas test tool
[ardour.git] / wscript
diff --git a/wscript b/wscript
index a4ee4ab59062f8c47eef108ef3588db0493341f7..83866424d2bf61bce2f16bc397587227b02edbcf 100644 (file)
--- a/wscript
+++ b/wscript
@@ -144,7 +144,7 @@ compiler_flags_dictionaries['clang'] = clang_dict;
 
 clang_darwin_dict = compiler_flags_dictionaries['clang'].copy();
 clang_darwin_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', ]
-clang_darwin_dict['full-optimization'] = [ '-O3', '-ffast-math', '-fstrength-reduce' ]
+clang_darwin_dict['full-optimization'] = [ '-O3', '-ffast-math']
 compiler_flags_dictionaries['clang-darwin'] = clang_darwin_dict;
 
 def fetch_git_revision ():
@@ -201,12 +201,13 @@ out = 'build'
 
 children = [
         # optionally external libraries
-        'libs/qm-dsp',
-        'libs/vamp-plugins',
-        'libs/libltc',
         'libs/fluidsynth',
+        'libs/hidapi',
+        'libs/libltc',
         'libs/lua',
         'libs/ptformat',
+        'libs/qm-dsp',
+        'libs/vamp-plugins',
         # core ardour libraries
         'libs/pbd',
         'libs/midi++2',
@@ -224,10 +225,12 @@ children = [
         'libs/plugins/a-delay.lv2',
         'libs/plugins/a-eq.lv2',
         'libs/plugins/a-reverb.lv2',
+        'libs/plugins/a-fluidsynth.lv2',
         'gtk2_ardour',
         'export',
         'midi_maps',
         'mcp',
+        'osc',
         'patchfiles',
         'scripts',
         'headless',
@@ -573,7 +576,7 @@ int main() { return 0; }''',
     if opt.stl_debug:
         cxx_flags.append("-D_GLIBCXX_DEBUG")
 
-    if re.search ("freebsd", sys.platform) != None:
+    if re.search ("freebsd", sys.platform) != None or re.search ("openbsd", sys.platform) != None:
         linker_flags.append('-lexecinfo')
 
     if conf.env['DEBUG_RT_ALLOC']:
@@ -706,6 +709,8 @@ def options(opt):
                    help='Use external/system versions of some bundled libraries')
     opt.add_option('--luadoc', action='store_true', default=False, dest='luadoc',
                     help='Compile Tool to dump LuaBindings (needs C++11)')
+    opt.add_option('--canvasui', action='store_true', default=False, dest='canvasui',
+                    help='Compile libcanvas test GUI')
     opt.add_option('--lv2', action='store_true', default=True, dest='lv2',
                     help='Compile with support for LV2 (if Lilv+Suil is available)')
     opt.add_option('--no-lv2', action='store_false', dest='lv2',
@@ -771,6 +776,10 @@ def options(opt):
                     help='Turn on PT session import option')
     opt.add_option('--no-threaded-waveviews', action='store_true', default=False, dest='no_threaded_waveviews',
                     help='Disable threaded waveview rendering')
+    opt.add_option(
+        '--qm-dsp-include', type='string', action='store',
+        dest='qm_dsp_include', default='/usr/include/qm-dsp',
+        help='directory where the header files of qm-dsp can be found')
 
     for i in children:
         opt.recurse(i)
@@ -874,6 +883,9 @@ def configure(conf):
         conf.define ('HAVE_COREAUDIO', 1)
         conf.define ('AUDIOUNIT_SUPPORT', 1)
 
+        if not Options.options.ppc:
+            conf.define('MACVST_SUPPORT', 1)
+
         conf.define ('TOP_MENUBAR',1)
 
         # It would be nice to be able to use this to force back-compatibility with 10.4
@@ -922,6 +934,10 @@ def configure(conf):
             print ('No Carbon support available for this build\n')
 
 
+    if Options.options.canvasui:
+        conf.env['CANVASTESTUI'] = True
+        conf.define ('CANVASTESTUI', 1)
+
     if Options.options.luadoc:
         conf.env['LUABINDINGDOC'] = True
         conf.define ('LUABINDINGDOC', 1)
@@ -931,6 +947,8 @@ def configure(conf):
 
     if Options.options.use_external_libs:
         conf.define('USE_EXTERNAL_LIBS', 1)
+        conf.env.append_value(
+            'CXXFLAGS', '-I' + Options.options.qm_dsp_include)
 
     if Options.options.boost_include != '':
         conf.env.append_value('CXXFLAGS', '-I' + Options.options.boost_include)
@@ -947,7 +965,7 @@ def configure(conf):
 
     # executing a test program is n/a when cross-compiling
     if Options.options.dist_target != 'mingw':
-        if Options.options.dist_target != 'msvc':
+        if Options.options.dist_target != 'msvc' and re.search ("openbsd", sys.platform) == None:
             if re.search ("freebsd", sys.platform) != None:
                 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', uselib_store='DL')
             else:
@@ -962,12 +980,16 @@ def configure(conf):
     if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
 
+    if re.search ("openbsd", sys.platform) != None:
+        conf.env.append_value('LDFLAGS', '-L/usr/X11R6/lib')
+
     autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.28', mandatory=True)
     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2', mandatory=True)
     autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0', mandatory=True)
     autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18', mandatory=True)
     autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2', mandatory=True)
     autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0', mandatory=True)
+    autowaf.check_pkg(conf, 'libarchive', uselib_store='ARCHIVE', atleast_version='3.0.0', mandatory=True)
     autowaf.check_pkg(conf, 'liblo', uselib_store='LO', atleast_version='0.26', mandatory=True)
     autowaf.check_pkg(conf, 'taglib', uselib_store='TAGLIB', atleast_version='1.6', mandatory=True)
     autowaf.check_pkg(conf, 'vamp-sdk', uselib_store='VAMPSDK', atleast_version='2.1', mandatory=True)
@@ -996,6 +1018,11 @@ int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; }
         conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW')
         conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS')
         conf.env.append_value('CXXFLAGS', '-DCOMPILER_MINGW')
+        if conf.options.cxx11:
+            conf.env.append_value('CFLAGS', '-D_USE_MATH_DEFINES')
+            conf.env.append_value('CXXFLAGS', '-D_USE_MATH_DEFINES')
+            conf.env.append_value('CFLAGS', '-DWIN32')
+            conf.env.append_value('CXXFLAGS', '-DWIN32')
         conf.env.append_value('LIB', 'pthread')
         # needed for at least libsmf
         conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32')
@@ -1117,8 +1144,10 @@ int main () { return 0; }
     if opts.no_threaded_waveviews:
         conf.define('NO_THREADED_WAVEVIEWS', 1)
         conf.env['NO_THREADED_WAVEVIEWS'] = True
-        
+
     backends = opts.with_backends.split(',')
+    if opts.build_tests and 'dummy' not in backends:
+        backends += ['dummy']
 
     if not backends:
         print("Must configure and build at least one backend")
@@ -1147,6 +1176,8 @@ int main () { return 0; }
 
     if sys.platform == 'darwin':
         sub_config_and_use(conf, 'libs/appleutility')
+    elif re.search ("openbsd", sys.platform) != None:
+        pass
     elif Options.options.dist_target != 'mingw':
         sub_config_and_use(conf, 'tools/sanity_check')
         sub_config_and_use(conf, 'tools/gccabicheck')
@@ -1186,6 +1217,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('AudioUnits',            conf.is_defined('AUDIOUNIT_SUPPORT'))
     write_config_text('Free/Demo copy',        conf.is_defined('FREEBIE'))
     write_config_text('Build target',          conf.env['build_target'])
+    write_config_text('Canvas Test UI',        conf.is_defined('CANVASTESTUI'))
     write_config_text('CoreAudio',             conf.is_defined('HAVE_COREAUDIO'))
     write_config_text('CoreAudio 10.5 compat', conf.is_defined('COREAUDIO105'))
     write_config_text('Debug RT allocations',  conf.is_defined('DEBUG_RT_ALLOC'))
@@ -1214,6 +1246,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('Unit tests',            conf.env['BUILD_TESTS'])
     write_config_text('Mac i386 Architecture', opts.generic)
     write_config_text('Mac ppc Architecture',  opts.ppc)
+    write_config_text('Mac VST support',       conf.is_defined('MACVST_SUPPORT'))
     write_config_text('Windows VST support',   opts.windows_vst)
     write_config_text('Wiimote support',       conf.is_defined('BUILD_WIIMOTE'))
     write_config_text('Windows key',           opts.windows_key)
@@ -1271,6 +1304,8 @@ def build(bld):
 
     if sys.platform == 'darwin':
         bld.recurse('libs/appleutility')
+    elif re.search ("openbsd", sys.platform) != None:
+        pass
     elif bld.env['build_target'] != 'mingw':
         bld.recurse('tools/sanity_check')
         bld.recurse('tools/gccabicheck')