X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=1568e0a3b16fd86338f066fb6fd78cd94e77d598;hb=c06c15596b65b253b1a3d6156f02aad593c7f826;hp=79a5a9a92cfe17009e98d25a6be6b30ab3461656;hpb=2bdf9e447f7341febc06bf6ad9c19bb4489fb885;p=ardour.git diff --git a/wscript b/wscript index 79a5a9a92c..1568e0a3b1 100644 --- a/wscript +++ b/wscript @@ -148,8 +148,16 @@ def set_compiler_flags (conf,opt): version = u[2] # waf adds -O0 -g itself. thanks waf! - is_clang = conf.env['CXX'][0].endswith('clang++') - + is_clang = conf.check_cxx(fragment = ''' +#ifndef __clang__ +#error +#endif +int main() { return 0; }''', + features = 'cxx', + mandatory = False, + execute = False, + msg = 'Checking for clang') + if conf.options.asan: conf.check_cxx(cxxflags=["-fsanitize=address", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=address"]) cxx_flags.append('-fsanitize=address') @@ -387,7 +395,9 @@ def set_compiler_flags (conf,opt): c_flags.extend(('-Wstrict-prototypes', '-Wmissing-prototypes')) cxx_flags.append('-Woverloaded-virtual') if (not is_clang and not platform == "darwin"): - cxx_flags.extend('-Wno-unused-local-typedefs') + cxx_flags.append('-Wno-unused-local-typedefs') + if is_clang: + cxx_flags.append('-Wno-mismatched-tags') # # more boilerplate @@ -437,13 +447,9 @@ def options(opt): opt.add_option ('--trx', action='store_true', default=False, dest='trx_build', help='Whether to build for TRX') opt.add_option('--arch', type='string', action='store', dest='arch', - help='Architecture-specific compiler flags') - opt.add_option('--with-dummy', action='store_true', default=False, dest='build_dummy', - help='Build the dummy backend (no audio/MIDI I/O, useful for profiling)') - opt.add_option('--with-alsabackend', action='store_true', default=False, dest='build_alsabackend', - help='Build the ALSA backend') - opt.add_option('--with-wavesbackend', action='store_true', default=False, dest='build_wavesbackend', - help='Build the Waves/Portaudio backend') + help='Architecture-specific compiler FLAGS') + opt.add_option('--with-backends', type='string', action='store', default='jack', dest='with_backends', + help='Specify which backend modules are to be included(jack,alsa,wavesaudio,dummy)') opt.add_option('--backtrace', action='store_true', default=True, dest='backtrace', help='Compile with -rdynamic -- allow obtaining backtraces from within Ardour') opt.add_option('--no-carbon', action='store_true', default=False, dest='nocarbon', @@ -698,13 +704,13 @@ def configure(conf): autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True) autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2', mandatory=True) autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0', mandatory=True) - autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18, mandatory=True') + autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18', mandatory=True) autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2', mandatory=True) autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0', mandatory=True) autowaf.check_pkg(conf, 'liblo', uselib_store='LO', atleast_version='0.26', mandatory=True) autowaf.check_pkg(conf, 'taglib', uselib_store='TAGLIB', atleast_version='1.6', mandatory=True) - autowaf.check_pkg(conf, 'vamp-sdk', uselib_store='VAMPSDK', atleast_version='2.4', mandatory=True) - autowaf.check_pkg(conf, 'vamp-hostsdk', uselib_store='VAMPHOSTSDK', atleast_version='2.4', mandatory=True) + autowaf.check_pkg(conf, 'vamp-sdk', uselib_store='VAMPSDK', atleast_version='2.1', mandatory=True) + autowaf.check_pkg(conf, 'vamp-hostsdk', uselib_store='VAMPHOSTSDK', atleast_version='2.1', mandatory=True) autowaf.check_pkg(conf, 'rubberband', uselib_store='RUBBERBAND', mandatory=True) if Options.options.dist_target == 'mingw': @@ -793,12 +799,17 @@ def configure(conf): conf.env['DEBUG_DENORMAL_EXCEPTION'] = True if opts.build_tests: autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=True) - if opts.build_alsabackend: - conf.env['BUILD_ALSABACKEND'] = True - if opts.build_dummy: - conf.env['BUILD_DUMMYBACKEND'] = True - if opts.build_wavesbackend: - conf.env['BUILD_WAVESBACKEND'] = True + + backends = opts.with_backends.split(',') + if not backends: + print("Must configure and build at least one backend") + sys.exit(1) + + conf.env['BACKENDS'] = backends + conf.env['BUILD_JACKBACKEND'] = any('jack' in b for b in backends) + conf.env['BUILD_ALSABACKEND'] = any('alsa' in b for b in backends) + conf.env['BUILD_DUMMYBACKEND'] = any('dummy' in b for b in backends) + conf.env['BUILD_WAVESBACKEND'] = any('wavesaudio' in b for b in backends) set_compiler_flags (conf, Options.options) @@ -836,7 +847,7 @@ const char* const ardour_config_info = "\\n\\ write_config_text('Use External Libraries', conf.is_defined('USE_EXTERNAL_LIBS')) write_config_text('Library exports hidden', conf.is_defined('EXPORT_VISIBILITY_HIDDEN')) - write_config_text('ALSA Backend', opts.build_alsabackend) + write_config_text('ALSA Backend', conf.env['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')) @@ -846,12 +857,13 @@ const char* const ardour_config_info = "\\n\\ 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('Dummy backend', conf.env['BUILD_DUMMYBACKEND']) write_config_text('Process thread timing', conf.is_defined('PT_TIMING')) write_config_text('Denormal exceptions', conf.is_defined('DEBUG_DENORMAL_EXCEPTION')) write_config_text('FLAC', conf.is_defined('HAVE_FLAC')) write_config_text('FPU optimization', opts.fpu_optimization) write_config_text('Freedesktop files', opts.freedesktop) + write_config_text('JACK Backend', conf.env['BUILD_JACKBACKEND']) write_config_text('Libjack linking', conf.env['libjack_link']) write_config_text('LV2 UI embedding', conf.is_defined('HAVE_SUIL')) write_config_text('LV2 support', conf.is_defined('LV2_SUPPORT')) @@ -866,7 +878,7 @@ const char* const ardour_config_info = "\\n\\ write_config_text('Unit tests', conf.env['BUILD_TESTS']) write_config_text('Mac i386 Architecture', opts.generic) write_config_text('Mac ppc Architecture', opts.ppc) - write_config_text('Waves Backend', opts.build_wavesbackend) + write_config_text('Waves Backend', conf.env['BUILD_WAVESBACKEND']) write_config_text('Windows VST support', opts.windows_vst) write_config_text('Wiimote support', conf.is_defined('BUILD_WIIMOTE')) write_config_text('Windows key', opts.windows_key) @@ -906,6 +918,7 @@ def build(bld): # shared objects loaded at runtime go here (two aliases) bld.env['DLLDIR'] = os.path.join(bld.env['LIBDIR'], lwrcase_dirname) bld.env['LIBDIR'] = bld.env['DLLDIR'] + bld.env['LOCALEDIR'] = os.path.join(bld.env['DATADIR'], 'locale') autowaf.set_recursive()