X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=e9fb579dc9018b05cb9f88cd0556b109d1b7eb94;hb=39bdde42504984b7367a0709789c4785e37bf6ea;hp=2b1c9d3a5dae099172ee4e1b1092d34eb2278f21;hpb=68ec0d23c960638d3c11e799fd6cd654e0af1308;p=ardour.git diff --git a/wscript b/wscript index 2b1c9d3a5d..e9fb579dc9 100644 --- a/wscript +++ b/wscript @@ -384,6 +384,12 @@ int main() { return 0; }''', cxx_flags.append('-fno-omit-frame-pointer') linker_flags.append('-fsanitize=address') + if conf.options.tsan: + conf.check_cxx(cxxflags=["-fsanitize=thread", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=thread"]) + c_flags.extend(('-fsanitize=thread', '-fno-omit-frame-pointer')) + cxx_flags.extend(('-fsanitize=thread', '-fno-omit-frame-pointer')) + linker_flags.append('-fsanitize=thread') + if opt.gprofile: debug_flags = [ flags_dict['gprofile'] ] @@ -828,6 +834,8 @@ def options(opt): help='use libc++ instead of default or auto-detected stdlib') opt.add_option('--address-sanitizer', action='store_true', default=False, dest='asan', help='Turn on AddressSanitizer (requires GCC >= 4.8 or clang >= 3.1)') + opt.add_option('--thread-sanitizer', action='store_true', default=False, dest='tsan', + help='Turn on ThreadSanitizer (requires GCC >= 4.8 or clang, and 64bit CPU)') opt.add_option('--ptformat', action='store_true', default=False, dest='ptformat', help='Turn on PT session import option') opt.add_option('--no-threaded-waveviews', action='store_true', default=False, dest='no_threaded_waveviews', @@ -871,8 +879,7 @@ def configure(conf): # but first make sure that all build-hosts (incl. OSX-10.5/PPC) have that python lib. # lazy approach: just use major version 2.X.X if itstool != "itstool" or version[0] < "2": - print("--freedesktop requires itstool > 2.0.0 to translate files.") - sys.exit(-1) + conf.fatal("--freedesktop requires itstool > 2.0.0 to translate files.") conf.env['VERSION'] = VERSION conf.env['MAJOR'] = MAJOR @@ -1033,12 +1040,12 @@ def configure(conf): else: conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL') - conf.check_cxx(fragment = "#include \n#if !defined (BOOST_VERSION) || BOOST_VERSION < 103900\n#error boost >= 1.39 is not available\n#endif\nint main(void) { return 0; }\n", + conf.check_cxx(fragment = "#include \n#if !defined (BOOST_VERSION) || BOOST_VERSION < 105600\n#error boost >= 1.56 is not available\n#endif\nint main(void) { return 0; }\n", execute = False, mandatory = True, - msg = 'Checking for boost library >= 1.39', + msg = 'Checking for boost library >= 1.56', okmsg = 'ok', - errmsg = 'too old\nPlease install boost version 1.39 or higher.') + errmsg = 'too old\nPlease install boost version 1.56 or higher.') if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw': autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA') @@ -1222,8 +1229,7 @@ int main () { return 0; } backends += ['dummy'] if not backends: - print("Must configure and build at least one backend") - sys.exit(1) + conf.fatal("Must configure and build at least one backend") conf.env['BACKENDS'] = backends conf.env['BUILD_JACKBACKEND'] = any('jack' in b for b in backends) @@ -1235,38 +1241,32 @@ int main () { return 0; } if (Options.options.use_lld): if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw' and conf.env['BUILD_PABACKEND']: - print("lld is only for Linux builds") - sys.exit(1) + conf.fatal("lld is only for Linux builds") else: conf.find_program ('lld') conf.env.append_value('LINKFLAGS', '-fuse-ld=lld') 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") - sys.exit(1) + conf.fatal("PortAudio Backend is not for Linux") if sys.platform != 'darwin' and conf.env['BUILD_CORECRAPPITA']: - print("Coreaudio backend is only available for OSX") - sys.exit(1) + conf.fatal("Coreaudio backend is only available for OSX") if re.search ("linux", sys.platform) == None and conf.env['BUILD_ALSABACKEND']: - print("ALSA Backend is only available on Linux") - sys.exit(1) + conf.fatal("ALSA Backend is only available on Linux") if re.search ("linux", sys.platform) == None and conf.env['BUILD_PULSEAUDIO']: - print("Pulseaudio Backend is only available on Linux") - sys.exit(1) + conf.fatal("Pulseaudio Backend is only available on Linux") if conf.env['BUILD_PULSEAUDIO'] and not conf.is_defined('HAVE_PULSEAUDIO'): - print("Pulseaudio Backend requires libpulse-dev") - sys.exit(1) + conf.fatal("Pulseaudio Backend requires libpulse-dev") set_compiler_flags (conf, Options.options) if conf.env['build_host'] not in [ 'mojave', 'catalina']: conf.env.append_value('CXXFLAGS_OSX', '-F/System/Library/Frameworks') - print "**** YES ADDING FRAMEOWKRS"; + print("**** YES ADDING FRAMEWORKS") conf.env.append_value('CXXFLAGS_OSX', '-F/Library/Frameworks')