Fix hang on session going away when there is nothing to process. Fixes #3284.
[ardour.git] / wscript
diff --git a/wscript b/wscript
index 75cf78ce7f4c96885c5ac1209601f25683aca15a..9b41223a847ece4806ead97fbad1990808bb6bdb 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()
@@ -301,7 +307,9 @@ def set_compiler_flags (conf,opt):
        #
 
        conf.env.append_value('CCFLAGS', [ '-D_LARGEFILE64_SOURCE', '-D_LARGEFILE_SOURCE' ])
+       conf.env.append_value('CCFLAGS', [ '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64' ])
        conf.env.append_value('CXXFLAGS', [ '-D_LARGEFILE64_SOURCE', '-D_LARGEFILE_SOURCE' ])
+       conf.env.append_value('CXXFLAGS', [ '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64' ])
        if opt.nls:
                conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
                conf.env.append_value('CCFLAGS', '-DENABLE_NLS')
@@ -370,9 +378,16 @@ def sub_config_and_use(conf, name, has_objects = True):
 
 def configure(conf):
        create_stored_revision()
+        conf.env['VERSION'] = VERSION
        autowaf.set_recursive()
        autowaf.configure(conf)
-       
+
+       gcc_versions = fetch_gcc_version()
+        if 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
@@ -461,6 +476,8 @@ def configure(conf):
 
        autowaf.check_header(conf, 'boost/signals2.hpp', mandatory = True)
 
+       autowaf.check_header(conf, 'jack/session.h', define="JACK_SESSION")
+
        conf.check_cc(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
                      execute = "1",
                      mandatory = True,
@@ -524,6 +541,8 @@ def configure(conf):
        autowaf.display_msg(conf, 'VST Support', opts.vst)
        if opts.vst:
                conf.define('VST_SUPPORT', 1)
+       if bool(conf.env['JACK_SESSION']):
+               conf.define ('HAVE_JACK_SESSION', 1)
        autowaf.display_msg(conf, 'Wiimote Support', opts.wiimote)
        if opts.wiimote:
                conf.define('WIIMOTE',1)