Fix up some inconsistencies in handling of region sync points.
[ardour.git] / wscript
diff --git a/wscript b/wscript
index f7fe4adee0ebb75ec521f725c78fb9fc38ec0885..4570280d4b88dd4d7f6ff47342c48926e55e70a6 100644 (file)
--- a/wscript
+++ b/wscript
@@ -44,6 +44,12 @@ def fetch_svn_revision (path):
        cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'"
        return commands.getoutput(cmd)
 
+def fetch_gcc_version ():
+       cmd = "LANG= gcc --version"
+       output = commands.getoutput(cmd).splitlines()
+        version = output[0].split(' ')[2].split('.')
+       return version
+
 def fetch_git_revision (path):
        cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
        output = commands.getoutput(cmd).splitlines()
@@ -322,7 +328,7 @@ def set_options(opt):
        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('--audiounits', action='store_true', default=False, dest='audiounits',
-                       help='Compile with Apple\'s AudioUnit library (experimental)')
+                       help='Compile with Apple\'s AudioUnit library')
        opt.add_option('--coreaudio', action='store_true', default=False, dest='coreaudio',
                        help='Compile with Apple\'s CoreAudio library')
        opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
@@ -345,6 +351,7 @@ def set_options(opt):
        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')
+       opt.add_option('--phone-home', action='store_false', default=True, dest='phone_home')
        opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
                        help='Build with debugging for the STL')
        opt.add_option('--test', action='store_true', default=False, dest='build_tests', 
@@ -375,7 +382,13 @@ def configure(conf):
         conf.env['VERSION'] = VERSION
        autowaf.set_recursive()
        autowaf.configure(conf)
-       
+
+       gcc_versions = fetch_gcc_version()
+        if not Options.options.debug and gcc_versions[0] == '4' and gcc_versions[1] > '4':
+                print 'Version 4.5 of gcc is not ready for use when compiling Ardour with optimization.'
+                print 'Please use a different version or re-configure with --debug'
+                exit (1)
+
        if sys.platform == 'darwin':
                #
                #       Define OSX as a uselib to use when compiling
@@ -485,13 +498,22 @@ def configure(conf):
        # Fix utterly braindead FLAC include path to not smash assert.h
        conf.env['CPPPATH_FLAC'] = []
 
+       conf.check_cc(function_name='dlopen', header_name='dlfcn.h', linkflags='-ldl', uselib_store='DL')
+       conf.check_cc(function_name='curl_global_init', header_name='curl/curl.h', linkflags='-lcurl', uselib_store='CURL')
+
        # Tell everyone that this is a waf build
 
        conf.env.append_value('CCFLAGS', '-DWAF_BUILD')
        conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
        
        autowaf.print_summary(conf)
+
+        # debug builds should not call home
+
        opts = Options.options
+        if opts.debug:
+                opts.phone_home = False;
+
        autowaf.display_header('Ardour Configuration')
        autowaf.display_msg(conf, 'Build Target', conf.env['build_target'])
        autowaf.display_msg(conf, 'Architecture flags', opts.arch)
@@ -502,6 +524,9 @@ def configure(conf):
                conf.define ('COREAUDIO', 1)
        if opts.audiounits:
                conf.define('AUDIOUNITS',1)
+       autowaf.display_msg(conf, 'Phone Home', opts.phone_home)
+       if opts.phone_home:
+               conf.env['PHONE_HOME'] = opts.phone_home
        autowaf.display_msg(conf, 'FPU Optimization', opts.fpu_optimization)
        if opts.fpu_optimization:
                conf.define('FPU_OPTIMIZATION', 1)
@@ -522,7 +547,7 @@ def configure(conf):
        autowaf.display_msg(conf, 'Tranzport', opts.tranzport)
        if opts.build_tests:
                conf.env['BUILD_TESTS'] = opts.build_tests
-               autowaf.display_msg(conf, 'Unit Tests', bool(conf.env['BUILD_TESTS']) and bool (conf.env['HAVE_CPPUNIT']))
+       autowaf.display_msg(conf, 'Unit Tests', bool(conf.env['BUILD_TESTS']) and bool (conf.env['HAVE_CPPUNIT']))
        if opts.tranzport:
                conf.define('TRANZPORT', 1)
        autowaf.display_msg(conf, 'Universal Binary', opts.universal)
@@ -534,8 +559,7 @@ def configure(conf):
        autowaf.display_msg(conf, 'Wiimote Support', opts.wiimote)
        if opts.wiimote:
                conf.define('WIIMOTE',1)
-       if opts.windows_key:
-               conf.define('WINDOWS_KEY', opts.windows_key)
+       conf.define('WINDOWS_KEY', opts.windows_key)
        autowaf.display_msg(conf, 'Windows Key', opts.windows_key)
         conf.env['PROGRAM_NAME'] = opts.program_name
         autowaf.display_msg(conf, 'Program Name', opts.program_name)
@@ -549,31 +573,33 @@ def configure(conf):
 
        config_text = open ('libs/ardour/config_text.cc',"w")
        config_text.write ('#include "ardour/ardour.h"\n\nnamespace ARDOUR {\nconst char* const ardour_config_info = "\\n\\\n')
-       config_text.write ("Install prefix "); config_text.write (str (conf.env['PREFIX'])); config_text.write ("\\n\\\n")
-       config_text.write ("Debuggable build "); config_text.write (str (str(conf.env['DEBUG']))); config_text.write ("\\n\\\n")
-       config_text.write ("Strict compiler flags "); config_text.write (str (str(conf.env['STRICT']))); config_text.write ("\\n\\\n")
-       config_text.write ("Build documentation "); config_text.write (str (str(conf.env['BUILD_DOCS']))); config_text.write ("\\n\\\n")
-       config_text.write ('Build Target '); config_text.write (str (conf.env['build_target'])); config_text.write ("\\n\\\n")
-       config_text.write ('Architecture flags '); config_text.write (str (opts.arch)); config_text.write ("\\n\\\n")
-       config_text.write ('Aubio '); config_text.write (str (bool(conf.env['HAVE_AUBIO']))); config_text.write ("\\n\\\n")
-       config_text.write ('AudioUnits '); config_text.write (str (opts.audiounits)); config_text.write ("\\n\\\n")
-       config_text.write ('CoreAudio '); config_text.write (str (bool(conf.env['HAVE_COREAUDIO']))); config_text.write ("\\n\\\n")
-       config_text.write ('FPU Optimization '); config_text.write (str (opts.fpu_optimization)); config_text.write ("\\n\\\n")
-       config_text.write ('Freedesktop Files '); config_text.write (str (opts.freedesktop)); config_text.write ("\\n\\\n")
-       config_text.write ('Freesound '); config_text.write (str (opts.freesound)); config_text.write ("\\n\\\n")
-       config_text.write ('GtkOSX '); config_text.write (str (opts.gtkosx)); config_text.write ("\\n\\\n")
-       config_text.write ('LV2 Support '); config_text.write (str (bool(conf.env['HAVE_SLV2']))); config_text.write ("\\n\\\n")
-       config_text.write ('Rubberband '); config_text.write (str (bool(conf.env['HAVE_RUBBERBAND']))); config_text.write ("\\n\\\n")
-       config_text.write ('Samplerate '); config_text.write (str (bool(conf.env['HAVE_SAMPLERATE']))); config_text.write ("\\n\\\n")
-       config_text.write ('Soundtouch '); config_text.write (str (bool(conf.env['HAVE_SOUNDTOUCH']))); config_text.write ("\\n\\\n")
-       config_text.write ('Translation '); config_text.write (str (opts.nls)); config_text.write ("\\n\\\n")
-       config_text.write ('Tranzport '); config_text.write (str (opts.tranzport)); config_text.write ("\\n\\\n")
-       config_text.write ('Universal Binary '); config_text.write (str (opts.universal)); config_text.write ("\\n\\\n")
-       config_text.write ('VST Support '); config_text.write (str (opts.vst)); config_text.write ("\\n\\\n")
-       config_text.write ('Wiimote Support '); config_text.write (str (opts.wiimote)); config_text.write ("\\n\\\n")
-       config_text.write ('Windows Key '); config_text.write (str (opts.windows_key)); config_text.write ("\\n\\\n")
-       config_text.write ('C Compiler flags '); config_text.write (str (conf.env['CCFLAGS'])); config_text.write ("\\n\\\n")
-       config_text.write ('C++ Compiler flags '); config_text.write (str (conf.env['CXXFLAGS'])); config_text.write ("\\n\\\n")
+       config_text.write ("Install prefix: "); config_text.write (str (conf.env['PREFIX'])); config_text.write ("\\n\\\n")
+       config_text.write ("Debuggable build: "); config_text.write (str (str(conf.env['DEBUG']))); config_text.write ("\\n\\\n")
+       config_text.write ("Strict compiler flags: "); config_text.write (str (str(conf.env['STRICT']))); config_text.write ("\\n\\\n")
+       config_text.write ("Build documentation: "); config_text.write (str (str(conf.env['BUILD_DOCS']))); config_text.write ("\\n\\\n")
+       config_text.write ('Build target: '); config_text.write (str (conf.env['build_target'])); config_text.write ("\\n\\\n")
+       config_text.write ('Architecture flags: '); config_text.write (str (opts.arch)); config_text.write ("\\n\\\n")
+       config_text.write ('Aubio: '); config_text.write (str (bool(conf.env['HAVE_AUBIO']))); config_text.write ("\\n\\\n")
+       config_text.write ('AudioUnits: '); config_text.write (str (opts.audiounits)); config_text.write ("\\n\\\n")
+       config_text.write ('CoreAudio: '); config_text.write (str (bool(conf.env['HAVE_COREAUDIO']))); config_text.write ("\\n\\\n")
+       config_text.write ('FPU optimization: '); config_text.write (str (opts.fpu_optimization)); config_text.write ("\\n\\\n")
+       config_text.write ('Freedesktop files: '); config_text.write (str (opts.freedesktop)); config_text.write ("\\n\\\n")
+       config_text.write ('Freesound: '); config_text.write (str (opts.freesound)); config_text.write ("\\n\\\n")
+       config_text.write ('GtkOSX: '); config_text.write (str (opts.gtkosx)); config_text.write ("\\n\\\n")
+       config_text.write ('LV2 support: '); config_text.write (str (bool(conf.env['HAVE_SLV2']))); config_text.write ("\\n\\\n")
+       config_text.write ('Rubberband: '); config_text.write (str (bool(conf.env['HAVE_RUBBERBAND']))); config_text.write ("\\n\\\n")
+       config_text.write ('Samplerate: '); config_text.write (str (bool(conf.env['HAVE_SAMPLERATE']))); config_text.write ("\\n\\\n")
+       config_text.write ('Soundtouch: '); config_text.write (str (bool(conf.env['HAVE_SOUNDTOUCH']))); config_text.write ("\\n\\\n")
+       config_text.write ('Translation: '); config_text.write (str (opts.nls)); config_text.write ("\\n\\\n")
+       config_text.write ('Tranzport: '); config_text.write (str (opts.tranzport)); config_text.write ("\\n\\\n")
+       config_text.write ('Universal binary: '); config_text.write (str (opts.universal)); config_text.write ("\\n\\\n")
+       config_text.write ('VST support: '); config_text.write (str (opts.vst)); config_text.write ("\\n\\\n")
+       config_text.write ('Wiimote support: '); config_text.write (str (opts.wiimote)); config_text.write ("\\n\\\n")
+       config_text.write ('Windows key: '); config_text.write (str (opts.windows_key)); config_text.write ("\\n\\\n")
+       config_text.write ('C compiler flags: '); config_text.write (str (conf.env['CCFLAGS'])); config_text.write ("\\n\\\n")
+       config_text.write ('C++ compiler flags: '); config_text.write (str (conf.env['CXXFLAGS'])); config_text.write ("\\n\\\n")
+       config_text.write ('Phone home: '); config_text.write (str (bool(conf.env['PHONE_HOME']))); config_text.write ("\\n\\\n")
+       config_text.write ('JACK session support: '); config_text.write (str (bool(conf.env['JACK_SESSION']))); config_text.write ("\\n\\\n")
        config_text.write ('";}\n')
        config_text.close ()