Remove tools/sanity_check dir from build in mingw cross compile
[ardour.git] / wscript
diff --git a/wscript b/wscript
index 8599b411481c6de5c0da222d96beec84b15dfca5..b96c8932f4aa8b6e590501a431bb82104ebab3a2 100644 (file)
--- a/wscript
+++ b/wscript
@@ -8,7 +8,7 @@ import subprocess
 import sys
 
 MAJOR = '3'
-MINOR = '2'
+MINOR = '3'
 VERSION = MAJOR + '.' + MINOR
 
 APPNAME = 'Ardour' + MAJOR
@@ -47,10 +47,8 @@ i18n_children = [
 ]
 
 if sys.platform == 'linux2':
-    children += [ 'tools/sanity_check' ]
     lxvst_default = True
 elif sys.platform == 'darwin':
-    children += [ 'libs/appleutility' ]
     lxvst_default = False
 else:
     lxvst_default = False
@@ -109,6 +107,22 @@ def set_compiler_flags (conf,opt):
 
     # waf adds -O0 -g itself. thanks waf!
     is_clang = conf.env['CXX'][0].endswith('clang++')
+    
+    if conf.options.cxx11:
+        conf.check_cxx(cxxflags=["-std=c++11"])
+        conf.env.append_unique('CXXFLAGS', ['-std=c++11'])
+        if platform == "darwin":
+            conf.env.append_unique('CXXFLAGS', ['-stdlib=libc++'])
+            conf.env.append_unique('LINKFLAGS', ['-lc++'])
+            # Prevents visibility issues in standard headers
+            conf.define("_DARWIN_C_SOURCE", 1)
+
+    if is_clang and platform == "darwin":
+        # Silence warnings about the non-existing osx clang compiler flags
+        # -compatibility_version and -current_version.  These are Waf
+        # generated and not needed with clang
+        conf.env.append_unique ("CXXFLAGS", ["-Qunused-arguments"])
+        
     if opt.gprofile:
         debug_flags = [ '-pg' ]
 
@@ -453,6 +467,8 @@ def options(opt):
                     help='directory where Wine\'s Windows header files can be found')
     opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm',
                     help='Do not ask questions that require confirmation during the build')
+    opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11',
+                    help='Turn on c++11 compiler flags (-std=c++11)')
     for i in children:
         opt.recurse(i)
 
@@ -590,13 +606,6 @@ def configure(conf):
 
     autowaf.check_header(conf, 'cxx', 'jack/session.h', define="JACK_SESSION", mandatory = False)
 
-    conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
-                  execute = "1",
-                  mandatory = True,
-                  msg = 'Checking for boost library >= 1.39',
-                  okmsg = 'ok',
-                  errmsg = 'too old\nPlease install boost version 1.39 or higher.')
-
     autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
     autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0')
@@ -607,6 +616,10 @@ def configure(conf):
 
     if Options.options.dist_target == 'mingw':
         Options.options.fpu_optimization = False
+        conf.env.append_value('CFLAGS', '-DPLATFORM_WINDOWS')
+        conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW')
+        conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS')
+        conf.env.append_value('CXXFLAGS', '-DCOMPILER_MINGW')
         conf.env.append_value('LIB', 'pthreadGC2')
         # needed for at least libsmf
         conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32')
@@ -621,6 +634,13 @@ def configure(conf):
     if Options.options.dist_target != 'mingw':
         conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
 
+        conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
+                      execute = "1",
+                      mandatory = True,
+                      msg = 'Checking for boost library >= 1.39',
+                      okmsg = 'ok',
+                      errmsg = 'too old\nPlease install boost version 1.39 or higher.')
+
     # Tell everyone that this is a waf build
 
     conf.env.append_value('CFLAGS', '-DWAF_BUILD')