fix various loop-initiation faults
[ardour.git] / wscript
diff --git a/wscript b/wscript
index 2275296ac69235af0b9a176b7a01c49ddbf07e1a..59a8174cb0116616db0c186b2fb4902788f11d05 100644 (file)
--- a/wscript
+++ b/wscript
@@ -16,7 +16,7 @@ def fetch_git_revision ():
 
 def fetch_tarball_revision ():
     if not os.path.exists ('libs/ardour/revision.cc'):
-        print 'This tarball was not created correctly - it is missing libs/ardour/revision.cc'
+        print ('This tarball was not created correctly - it is missing libs/ardour/revision.cc')
         sys.exit (1)
     with open('libs/ardour/revision.cc') as f:
         content = f.readlines()
@@ -48,7 +48,7 @@ V = MAJOR + '.' + MINOR + '.' + MICRO
 # because if it is, it breaks waf somehow.
 #
 VERSION = V.encode ('ascii', 'ignore')
-APPNAME = 'Ardour' + MAJOR
+PROGRAM_VERSION = MAJOR.encode ('ascii', 'ignore')
 
 # Mandatory variables
 top = '.'
@@ -81,6 +81,7 @@ children = [
         # shared helper binaries (plugin-scanner, exec-wrapper)
         'libs/fst',
         'libs/vfork',
+        'libs/ardouralsautil',
 ]
 
 i18n_children = [
@@ -258,7 +259,7 @@ def set_compiler_flags (conf,opt):
     if conf.env['FPU_OPTIMIZATION']:
         if sys.platform == 'darwin':
             compiler_flags.append("-DBUILD_VECLIB_OPTIMIZATIONS");
-            linker_flags.append("-framework Accelerate")
+            conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'Accelerate'])
         elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64':
             compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
         if not build_host_supports_sse:
@@ -336,6 +337,9 @@ def set_compiler_flags (conf,opt):
                 "-fstrength-reduce"
                 ]
 
+    if opt.debug_symbols:
+        optimization_flags += [ '-g' ]
+
     if opt.stl_debug:
         cxx_flags.append("-D_GLIBCXX_DEBUG")
 
@@ -355,7 +359,7 @@ def set_compiler_flags (conf,opt):
     #
 
     compiler_flags.extend(
-            ('-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align'))
+            ('-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align', '-Wno-unused-parameter'))
 
     c_flags.extend(('-Wstrict-prototypes', '-Wmissing-prototypes'))
     cxx_flags.append('-Woverloaded-virtual')
@@ -376,6 +380,7 @@ def set_compiler_flags (conf,opt):
         compiler_flags.append('-DENABLE_NLS')
 
     compiler_flags.append ('-DPROGRAM_NAME="' + Options.options.program_name + '"')
+    compiler_flags.append ('-DPROGRAM_VERSION="' + PROGRAM_VERSION + '"')
 
     if opt.debug:
         conf.env.append_value('CFLAGS', debug_flags)
@@ -418,6 +423,8 @@ def options(opt):
                     help='Compile without support for AU Plugins with only CARBON UI (needed for 64bit)')
     opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
                     help='Compile with Boost shared pointer debugging')
+    opt.add_option('--debug-symbols', action='store_true', default=False, dest='debug_symbols',
+                    help='Add debug-symbols to optimized builds')
     opt.add_option('--depstack-root', type='string', default='~', dest='depstack_root',
                     help='Directory/folder where dependency stack trees (gtk, a3) can be found (defaults to ~)')
     opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
@@ -445,6 +452,8 @@ def options(opt):
     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('--no-lxvst', action='store_false', default=False, dest='lxvst',
+                    help='Compile without support for linuxVST plugins')
     opt.add_option('--nls', action='store_true', default=True, dest='nls',
                     help='Enable i18n (native language support) (default)')
     opt.add_option('--no-nls', action='store_false', dest='nls')
@@ -649,7 +658,7 @@ def configure(conf):
                   okmsg = 'ok',
                   errmsg = 'too old\nPlease install boost version 1.39 or higher.')
 
-    if re.search ("linux", sys.platform) != None:
+    if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
 
     autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True)
@@ -730,10 +739,10 @@ def configure(conf):
             conf.env['LXVST_SUPPORT'] = False
         elif Options.options.dist_target == 'mingw':
             conf.env['LXVST_SUPPORT'] = False
-       else:
-           conf.define('LXVST_SUPPORT', 1)
-           conf.env['LXVST_SUPPORT'] = True
-    conf.define('WINDOWS_KEY', opts.windows_key)
+        else:
+            conf.define('LXVST_SUPPORT', 1)
+            conf.env['LXVST_SUPPORT'] = True
+    conf.env['WINDOWS_KEY'] = opts.windows_key
     if opts.rt_alloc_debug:
         conf.define('DEBUG_RT_ALLOC', 1)
         conf.env['DEBUG_RT_ALLOC'] = True
@@ -788,6 +797,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('Library exports hidden', conf.is_defined('EXPORT_VISIBILITY_HIDDEN'))
 
     write_config_text('ALSA Backend',          opts.build_alsabackend)
+    write_config_text('ALSA DBus Reservation', conf.is_defined('HAVE_DBUS'))
     write_config_text('Architecture flags',    opts.arch)
     write_config_text('Aubio',                 conf.is_defined('HAVE_AUBIO'))
     write_config_text('AudioUnits',            conf.is_defined('AUDIOUNIT_SUPPORT'))
@@ -795,6 +805,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('Build target',          conf.env['build_target'])
     write_config_text('CoreAudio',             conf.is_defined('HAVE_COREAUDIO'))
     write_config_text('Debug RT allocations',  conf.is_defined('DEBUG_RT_ALLOC'))
+    write_config_text('Debug Symbols',         conf.is_defined('debug_symbols') or conf.env['DEBUG'])
     write_config_text('Dummy backend',         opts.build_dummy)
     write_config_text('Process thread timing', conf.is_defined('PT_TIMING'))
     write_config_text('Denormal exceptions',   conf.is_defined('DEBUG_DENORMAL_EXCEPTION'))
@@ -866,7 +877,7 @@ def build(bld):
     for i in children:
         bld.recurse(i)
 
-    bld.install_files (bld.env['SYSCONFDIR'], 'ardour_system.rc')
+    bld.install_files (bld.env['CONFDIR'], 'system_config')
 
     if bld.env['RUN_TESTS']:
         bld.add_post_fun(test)