Update GPL boilerplate and (C)
[ardour.git] / wscript
diff --git a/wscript b/wscript
index d6d75d56cafdf4b79b680a19c46795ee57b9bf24..3a90652701f34b27efb8479664365c0adc28979c 100644 (file)
--- a/wscript
+++ b/wscript
@@ -671,11 +671,12 @@ int main() { return 0; }''',
          '-DCANVAS_COMPATIBILITY', '-DCANVAS_DEBUG'))
 
     # use sparingly, prefer runtime profile
-    if Options.options.program_name.lower() == "mixbus":
+    if Options.options.program_name.lower().startswith('mixbus'):
         compiler_flags.append ('-DMIXBUS')
+        conf.define('MIXBUS', 1)
 
     if Options.options.program_name.lower() == "mixbus32c":
-        compiler_flags.append ('-DMIXBUS')
+        conf.define('MIXBUS32C', 1)
         compiler_flags.append ('-DMIXBUS32C')
 
     compiler_flags.append ('-DPROGRAM_NAME="' + Options.options.program_name + '"')
@@ -767,10 +768,6 @@ def options(opt):
                     help='Compile libcanvas test GUI')
     opt.add_option('--beatbox', action='store_true', default=False, dest='beatbox',
                     help='Compile beatbox test app')
-    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',
-                    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')
@@ -1047,6 +1044,9 @@ 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 ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
+        autowaf.check_pkg(conf, 'libpulse', uselib_store='PULSEAUDIO', atleast_version='10.0', mandatory=False)
+
     if re.search ("openbsd", sys.platform) != None:
         conf.env.append_value('LDFLAGS', '-L/usr/X11R6/lib')
 
@@ -1095,6 +1095,9 @@ int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; }
         conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32')
         conf.env.append_value('LIB', 'ws2_32')
         conf.env.append_value('LIB', 'winmm')
+        if Options.options.program_name.lower().startswith('mixbus'):
+            conf.env.append_value('LIB', 'ole32')
+            conf.env.append_value('LIB', 'uuid')
         # needed for mingw64 packages, not harmful on normal mingw build
         conf.env.append_value('LIB', 'intl')
         conf.check_cc(function_name='regcomp', header_name='regex.h',
@@ -1229,6 +1232,7 @@ int main () { return 0; }
     conf.env['BUILD_DUMMYBACKEND'] = any('dummy' in b for b in backends)
     conf.env['BUILD_PABACKEND'] = any('portaudio' in b for b in backends)
     conf.env['BUILD_CORECRAPPITA'] = any('coreaudio' in b for b in backends)
+    conf.env['BUILD_PULSEAUDIO'] = any('pulseaudio' in b for b in backends)
 
     if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw' and conf.env['BUILD_PABACKEND']:
         print("PortAudio Backend is not for Linux")
@@ -1242,6 +1246,14 @@ int main () { return 0; }
         print("ALSA Backend is only available on Linux")
         sys.exit(1)
 
+    if re.search ("linux", sys.platform) == None and conf.env['BUILD_PULSEAUDIO']:
+        print("Pulseaudio Backend is only available on Linux")
+        sys.exit(1)
+
+    if conf.env['BUILD_PULSEAUDIO'] and not conf.is_defined('HAVE_PULSEAUDIO'):
+        print("Pulseaudio Backend requires libpulse-dev")
+        sys.exit(1)
+
     set_compiler_flags (conf, Options.options)
 
     if sys.platform == 'darwin':
@@ -1327,6 +1339,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('ALSA Backend',          conf.env['BUILD_ALSABACKEND'])
     write_config_text('Dummy backend',         conf.env['BUILD_DUMMYBACKEND'])
     write_config_text('JACK Backend',          conf.env['BUILD_JACKBACKEND'])
+    write_config_text('Pulseaudio Backend',    conf.env['BUILD_PULSEAUDIO'])
     config_text.write("\\n\\\n")
     write_config_text('Buildstack', conf.env['DEPSTACK_REV'])
     write_config_text('Mac i386 Architecture', opts.generic)