X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=3a90652701f34b27efb8479664365c0adc28979c;hb=4050ca5633dda03679f9aa9fab87d3bbf517395b;hp=28339cc20011d37f0f7da5767917c4aeaef1e5bd;hpb=7036b2825a7c3fb2113c269b37cddbb0eb6f02cb;p=ardour.git diff --git a/wscript b/wscript index 28339cc200..3a90652701 100644 --- a/wscript +++ b/wscript @@ -135,7 +135,7 @@ clang_dict['sse'] = '' clang_dict['fpmath-sse'] = '' clang_dict['xmmintrinsics'] = '' clang_dict['silence-unused-arguments'] = '-Qunused-arguments' -clang_dict['extra-cxx-warnings'] = [ '-Woverloaded-virtual', '-Wno-mismatched-tags', '-Wno-cast-align', '-Wno-unused-local-typedefs' ] +clang_dict['extra-cxx-warnings'] = [ '-Woverloaded-virtual', '-Wno-mismatched-tags', '-Wno-cast-align', '-Wno-unused-local-typedefs', '-Wunneeded-internal-declaration' ] clang_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-fstrict-overflow' ] clang_dict['strict'] = ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings' ] clang_dict['generic-x86'] = [ '-arch', 'i386' ] @@ -147,25 +147,35 @@ clang_darwin_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded clang_darwin_dict['full-optimization'] = [ '-O3', '-ffast-math'] compiler_flags_dictionaries['clang-darwin'] = clang_darwin_dict; -def fetch_git_revision (): - cmd = "git describe HEAD | sed 's/^[A-Za-z0-9]*+//'" - output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines() - rev = output[0].decode ('utf-8') - return rev +def fetch_git_revision_date (): + cmd = ["git", "describe", "HEAD"] + output = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines() + rev = re.sub(r"^[A-Za-z0-9]*\+", "", output[0].decode('utf-8')) + + cmd = ["git", "log", "-1", "--pretty=format:%ci", "HEAD"] + output = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines() + date = output[0].decode('utf-8').split(None, 2)[0] + + return rev, date -def fetch_tarball_revision (): +def fetch_tarball_revision_date(): if not os.path.exists ('libs/ardour/revision.cc'): print ('This tarball was not created correctly - it is missing libs/ardour/revision.cc') sys.exit (1) with open('libs/ardour/revision.cc', 'rb') as f: content = f.readlines() remove_punctuation_map = dict((ord(char), None) for char in '";') - return content[1].decode('utf-8').strip().split(' ')[7].translate (remove_punctuation_map) + + raw_line_tokens = content[1].decode('utf-8').strip().split(' ') + rev = raw_line_tokens[7].translate(remove_punctuation_map) + date = raw_line_tokens[12].translate(remove_punctuation_map) + + return rev, date if os.path.isdir (os.path.join(os.getcwd(), '.git')): - rev = fetch_git_revision () + rev, rev_date = fetch_git_revision_date() else: - rev = fetch_tarball_revision () + rev, rev_date = fetch_tarball_revision_date() # # rev is now of the form MAJOR.MINOR[-rcX]-rev-commit @@ -226,6 +236,7 @@ children = [ 'libs/qm-dsp', 'libs/vamp-plugins', 'libs/zita-resampler', + 'libs/zita-convolver', # core ardour libraries 'libs/pbd', 'libs/midi++2', @@ -242,6 +253,7 @@ children = [ 'libs/waveview', 'libs/plugins/reasonablesynth.lv2', 'libs/plugins/a-comp.lv2', + 'libs/plugins/a-exp.lv2', 'libs/plugins/a-delay.lv2', 'libs/plugins/a-eq.lv2', 'libs/plugins/a-reverb.lv2', @@ -252,6 +264,7 @@ children = [ 'mcp', 'osc', 'patchfiles', + 'plugin_metadata', 'scripts', 'headless', 'session_utils', @@ -280,7 +293,7 @@ def fetch_gcc_version (CC): def create_stored_revision(): rev = "" if os.path.exists('.git'): - rev = fetch_git_revision(); + rev, rev_date = fetch_git_revision_date(); print("Git version: " + rev + "\n") elif os.path.exists('libs/ardour/revision.cc'): print("Using packaged revision") @@ -291,12 +304,15 @@ def create_stored_revision(): try: # - # if you change the format of this, be sure to fix fetch_tarball_revision() above - # so that it still works. + # if you change the format of this, be sure to fix fetch_tarball_revision_date() + # above so that it still works. # text = '#include "ardour/revision.h"\n' - text += 'namespace ARDOUR { const char* revision = \"%s\"; }\n' % rev - print('Writing revision info to libs/ardour/revision.cc using ' + rev) + text += ( + 'namespace ARDOUR { const char* revision = \"%s\"; ' + 'const char* date = \"%s\"; }\n' + ) % (rev, rev_date) + print('Writing revision info to libs/ardour/revision.cc using ' + rev + ', ' + rev_date) o = open('libs/ardour/revision.cc', 'w') o.write(text) o.close() @@ -385,6 +401,8 @@ int main() { return 0; }''', conf.env['build_host'] = 'el_capitan' elif re.search ("^16[.]", version) != None: conf.env['build_host'] = 'sierra' + elif re.search ("^17[.]", version) != None: + conf.env['build_host'] = 'high_sierra' else: conf.env['build_host'] = 'irrelevant' @@ -410,8 +428,10 @@ int main() { return 0; }''', conf.env['build_target'] = 'yosemite' elif re.search ("^15[.]", version) != None: conf.env['build_target'] = 'el_capitan' - else: + elif re.search ("^16[.]", version) != None: conf.env['build_target'] = 'sierra' + else: + conf.env['build_target'] = 'high_sierra' else: match = re.search( "(?Pi[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)", @@ -432,11 +452,11 @@ int main() { return 0; }''', # compiler_flags.append ('-U__STRICT_ANSI__') - if opt.use_libcpp or conf.env['build_host'] in [ 'el_capitan', 'sierra' ]: + if opt.use_libcpp or conf.env['build_host'] in [ 'el_capitan', 'sierra', 'high_sierra' ]: cxx_flags.append('--stdlib=libc++') linker_flags.append('--stdlib=libc++') - if conf.options.cxx11 or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan', 'sierra' ]: + if conf.options.cxx11 or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan', 'sierra', 'high_sierra' ]: conf.check_cxx(cxxflags=["-std=c++11"]) cxx_flags.append('-std=c++11') if platform == "darwin": @@ -444,7 +464,7 @@ int main() { return 0; }''', # from requiring a full path to requiring just the header name. cxx_flags.append('-DCARBON_FLAT_HEADERS') - if not opt.use_libcpp and not conf.env['build_host'] in [ 'el_capitan', 'sierra' ]: + if not opt.use_libcpp and not conf.env['build_host'] in [ 'el_capitan', 'sierra', 'high_sierra' ]: cxx_flags.append('--stdlib=libstdc++') linker_flags.append('--stdlib=libstdc++') # Prevents visibility issues in standard headers @@ -453,7 +473,7 @@ int main() { return 0; }''', cxx_flags.append('-DBOOST_NO_AUTO_PTR') - if (is_clang and platform == "darwin") or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan', 'sierra' ]: + if (is_clang and platform == "darwin") or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan', 'sierra', 'high_sierra' ]: # Silence warnings about the non-existing osx clang compiler flags # -compatibility_version and -current_version. These are Waf # generated and not needed with clang @@ -569,7 +589,7 @@ int main() { return 0; }''', ("-DMAC_OS_X_VERSION_MAX_ALLOWED=1090", "-mmacosx-version-min=10.8")) - elif conf.env['build_target'] in ['el_capitan', 'sierra' ]: + elif conf.env['build_target'] in ['el_capitan', 'sierra', 'high_sierra' ]: compiler_flags.extend( ("-DMAC_OS_X_VERSION_MAX_ALLOWED=1090", "-mmacosx-version-min=10.9")) @@ -650,15 +670,13 @@ int main() { return 0; }''', ('-D__STDC_LIMIT_MACROS', '-D__STDC_FORMAT_MACROS', '-DCANVAS_COMPATIBILITY', '-DCANVAS_DEBUG')) - if opt.nls: - compiler_flags.append('-DENABLE_NLS') - # use sparingly, prefer runtime profile - if Options.options.program_name.lower() == "mixbus": + if Options.options.program_name.lower().startswith('mixbus'): compiler_flags.append ('-DMIXBUS') + conf.define('MIXBUS', 1) if Options.options.program_name.lower() == "mixbus32c": - compiler_flags.append ('-DMIXBUS') + conf.define('MIXBUS32C', 1) compiler_flags.append ('-DMIXBUS32C') compiler_flags.append ('-DPROGRAM_NAME="' + Options.options.program_name + '"') @@ -750,10 +768,6 @@ def options(opt): help='Compile libcanvas test GUI') opt.add_option('--beatbox', action='store_true', default=False, dest='beatbox', help='Compile beatbox test app') - opt.add_option('--lv2', action='store_true', default=True, dest='lv2', - help='Compile with support for LV2 (if Lilv+Suil is available)') - opt.add_option('--no-lv2', action='store_false', dest='lv2', - help='Do not compile with support for LV2') opt.add_option('--lv2dir', type='string', help="install destination for builtin LV2 bundles [Default: LIBDIR/lv2]") opt.add_option('--lxvst', action='store_true', default=True, dest='lxvst', help='Compile with support for linuxVST plugins') @@ -1030,6 +1044,9 @@ def configure(conf): if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw': autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA') + if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw': + autowaf.check_pkg(conf, 'libpulse', uselib_store='PULSEAUDIO', atleast_version='10.0', mandatory=False) + if re.search ("openbsd", sys.platform) != None: conf.env.append_value('LDFLAGS', '-L/usr/X11R6/lib') @@ -1078,6 +1095,9 @@ int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; } conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32') conf.env.append_value('LIB', 'ws2_32') conf.env.append_value('LIB', 'winmm') + if Options.options.program_name.lower().startswith('mixbus'): + conf.env.append_value('LIB', 'ole32') + conf.env.append_value('LIB', 'uuid') # needed for mingw64 packages, not harmful on normal mingw build conf.env.append_value('LIB', 'intl') conf.check_cc(function_name='regcomp', header_name='regex.h', @@ -1154,6 +1174,9 @@ int main () { return 0; } if opts.nls: conf.define('ENABLE_NLS', 1) conf.env['ENABLE_NLS'] = True + else: + conf.define('ENABLE_NLS', 0) + conf.env['ENABLE_NLS'] = False if opts.build_tests: conf.env['BUILD_TESTS'] = True conf.env['RUN_TESTS'] = opts.run_tests @@ -1209,6 +1232,7 @@ int main () { return 0; } conf.env['BUILD_DUMMYBACKEND'] = any('dummy' in b for b in backends) conf.env['BUILD_PABACKEND'] = any('portaudio' in b for b in backends) conf.env['BUILD_CORECRAPPITA'] = any('coreaudio' in b for b in backends) + conf.env['BUILD_PULSEAUDIO'] = any('pulseaudio' in b for b in backends) 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") @@ -1222,6 +1246,14 @@ int main () { return 0; } print("ALSA Backend is only available on Linux") sys.exit(1) + if re.search ("linux", sys.platform) == None and conf.env['BUILD_PULSEAUDIO']: + print("Pulseaudio Backend is only available on Linux") + sys.exit(1) + + if conf.env['BUILD_PULSEAUDIO'] and not conf.is_defined('HAVE_PULSEAUDIO'): + print("Pulseaudio Backend requires libpulse-dev") + sys.exit(1) + set_compiler_flags (conf, Options.options) if sys.platform == 'darwin': @@ -1307,6 +1339,7 @@ const char* const ardour_config_info = "\\n\\ write_config_text('ALSA Backend', conf.env['BUILD_ALSABACKEND']) write_config_text('Dummy backend', conf.env['BUILD_DUMMYBACKEND']) write_config_text('JACK Backend', conf.env['BUILD_JACKBACKEND']) + write_config_text('Pulseaudio Backend', conf.env['BUILD_PULSEAUDIO']) config_text.write("\\n\\\n") write_config_text('Buildstack', conf.env['DEPSTACK_REV']) write_config_text('Mac i386 Architecture', opts.generic) @@ -1326,6 +1359,8 @@ const char* const ardour_config_info = "\\n\\ def build(bld): create_stored_revision() + bld.env['DATE'] = rev_date + # add directories that contain only headers, to workaround an issue with waf if not bld.is_defined('USE_EXTERNAL_LIBS'):