2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
9 import platform as PLATFORM
10 from waflib.Tools import winres
11 from waflib.Build import Context
12 from waflib.Build import BuildContext
14 class i18n(BuildContext):
18 class i18n_pot(BuildContext):
22 class i18n_po(BuildContext):
26 class i18n_mo(BuildContext):
30 def is_tracks_build(self, *k, **kw):
31 return self.env['PROGRAM_NAME'] == 'Tracks Live'
33 Context.Context.is_tracks_build = is_tracks_build
35 compiler_flags_dictionaries= {
37 # Flags required when building a debug build
38 'debuggable' : [ '-g' ],
39 # Flags required for the linker (if any) when building a debug build
40 'linker-debuggable' : '',
41 # Flags required when building a non-debug optimized build
42 'nondebuggable' : '-DNDEBUG',
43 # Flags required to enable profiling at runtime with optimized builds
44 'profile' : [ '-fno-omit-frame-pointer' ],
45 # Flags required to enable gprofile profiling
47 # Flags required to disable warnings about unused arguments to function calls
48 'silence-unused-arguments' : '',
49 # Flags required to use SSE unit for general math
51 # Flags required to use SSE unit for floating point math
52 'fpmath-sse' : '-mfpmath=sse',
53 # Flags required to use XMM Intrinsics
54 'xmmintrinsics' : '-DUSE_XMMINTRIN',
55 # Flags to use posix pipes between compiler stages
57 # Flags for maximally optimized build
58 'full-optimization' : [ '-O3', '-fomit-frame-pointer', '-ffast-math', '-fstrength-reduce', ],
59 # Flag to ensure that compiler error output includes column/line numbers
60 'show-column' : '-fshow-column',
61 # Flags required to build for x86 only (OS X feature)
63 # Flags required to build for PowerPC only (OS X feature)
65 # All flags required to get basic warnings to be generated by the compiler
66 'basic-warnings' : [ '-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align', '-Wno-unused-parameter' ],
67 # Any additional flags for warnings that are specific to C (not C++)
68 'extra-c-warnings' : [ '-Wstrict-prototypes', '-Wmissing-prototypes' ],
69 # Any additional flags for warnings that are specific to C++ (not C)
70 'extra-cxx-warnings' : [ '-Woverloaded-virtual', '-Wno-unused-local-typedefs' ],
71 # Flags used for "strict" compilation, C and C++ (i.e. compiler will warn about language issues)
72 'strict' : ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings', '-Wunsafe-loop-optimizations', '-Wlogical-op' ],
73 # Flags used for "strict" compilation, C only (i.e. compiler will warn about language issues)
74 'c-strict' : ['-std=c99', '-pedantic', '-Wshadow'],
75 # Flags used for "strict" compilation, C++ only (i.e. compiler will warn about language issues)
76 'cxx-strict' : [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-fstrict-overflow' ],
77 # Flags required for whatever consider the strictest possible compilation
78 'ultra-strict' : ['-Wredundant-decls', '-Wstrict-prototypes', '-Wmissing-prototypes'],
79 # Flag to turn on C99 compliance by itself
81 # Flag to enable AT&T assembler syntax
82 'attasm': '-masm=att',
83 # Flags to make AVX instructions/intrinsics available
85 # Flags to generate position independent code, when needed to build a shared object
87 # Flags required to compile C code with anonymous unions (only part of C11)
88 'c-anonymous-union': '-fms-extensions',
91 'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'],
92 'linker-debuggable' : ['/DEBUG', '/INCREMENTAL' ],
93 'nondebuggable' : ['/DNDEBUG', '/Ob1', '/MD', '/Gd', '/EHsc'],
96 'silence-unused-arguments' : '',
101 'full-optimization' : '/O2',
102 'no-frame-pointer' : '',
104 'strength-reduce' : '',
108 'basic-warnings' : '',
109 'extra-c-warnings' : '',
110 'extra-cxx-warnings' : '',
119 'c-anonymous-union': '',
123 # Copy, edit and insert variants on gcc dict for gcc-darwin and clang
125 gcc_darwin_dict = compiler_flags_dictionaries['gcc'].copy()
126 gcc_darwin_dict['extra-cxx-warnings'] = [ '-Woverloaded-virtual' ]
127 gcc_darwin_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual' ]
128 gcc_darwin_dict['strict'] = ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings' ]
129 gcc_darwin_dict['generic-x86'] = [ '-arch', 'i386' ]
130 gcc_darwin_dict['generic-ppc'] = [ '-arch', 'ppc' ]
131 compiler_flags_dictionaries['gcc-darwin'] = gcc_darwin_dict;
133 clang_dict = compiler_flags_dictionaries['gcc'].copy();
134 clang_dict['sse'] = ''
135 clang_dict['fpmath-sse'] = ''
136 clang_dict['xmmintrinsics'] = ''
137 clang_dict['silence-unused-arguments'] = '-Qunused-arguments'
138 clang_dict['extra-cxx-warnings'] = [ '-Woverloaded-virtual', '-Wno-mismatched-tags' ]
139 clang_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-fstrict-overflow' ]
140 clang_dict['strict'] = ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings' ]
141 clang_dict['generic-x86'] = [ '-arch', 'i386' ]
142 compiler_flags_dictionaries['clang'] = clang_dict;
144 clang_darwin_dict = compiler_flags_dictionaries['clang'].copy();
145 clang_darwin_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', ]
146 clang_darwin_dict['full-optimization'] = [ '-O3', '-ffast-math', '-fstrength-reduce' ]
147 compiler_flags_dictionaries['clang-darwin'] = clang_darwin_dict;
149 def fetch_git_revision ():
150 cmd = "git describe HEAD | sed 's/^[A-Za-z]*+//'"
151 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
152 rev = output[0].decode ('utf-8')
155 def fetch_tarball_revision ():
156 if not os.path.exists ('libs/ardour/revision.cc'):
157 print ('This tarball was not created correctly - it is missing libs/ardour/revision.cc')
159 with open('libs/ardour/revision.cc') as f:
160 content = f.readlines()
161 remove_punctuation_map = dict((ord(char), None) for char in '";')
162 return content[1].decode('utf-8').strip().split(' ')[7].translate (remove_punctuation_map)
164 if os.path.isdir (os.path.join(os.getcwd(), '.git')):
165 rev = fetch_git_revision ()
167 rev = fetch_tarball_revision ()
170 # rev is now of the form MAJOR.MINOR[-rcX]-rev-commit
171 # or, if right at the same rev as a release, MAJOR.MINOR[-rcX]
174 parts = rev.split ('.', 1)
176 other = parts[1].split('-', 1)
179 MICRO = other[1].rsplit('-',1)[0].replace('-','.')
183 V = MAJOR + '.' + MINOR + '.' + MICRO
184 # Ensure that these are not unicode, which
185 # can cause odd problems elsewhere. Note that
186 # in python3, encode and decode do not return
187 # strings, so we have to force the type.
188 VERSION = V.encode ('ascii', 'ignore').decode ("utf-8")
189 PROGRAM_VERSION = MAJOR.encode ('ascii', 'ignore').decode ("utf-8")
191 if len (sys.argv) > 1 and sys.argv[1] == 'dist':
192 if not 'APPNAME' in os.environ:
193 print ("You must define APPNAME in the environment when running ./waf dist")
195 APPNAME = os.environ['APPNAME'];
197 # Mandatory variables
202 # optionally external libraries
208 # core ardour libraries
220 'libs/plugins/reasonablesynth.lv2',
229 # shared helper binaries (plugin-scanner, exec-wrapper)
232 'libs/ardouralsautil',
245 def fetch_gcc_version (CC):
246 cmd = "%s --version" % CC
247 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
248 o = output[0].decode('utf-8')
249 version = o.split(' ')[2].split('.')
252 def create_stored_revision():
254 if os.path.exists('.git'):
255 rev = fetch_git_revision();
256 print("Git version: " + rev + "\n")
257 elif os.path.exists('libs/ardour/revision.cc'):
258 print("Using packaged revision")
261 print("Missing libs/ardour/revision.cc. Blame the packager.")
266 # if you change the format of this, be sure to fix fetch_tarball_revision() above
267 # so that it still works.
269 text = '#include "ardour/revision.h"\n'
270 text += 'namespace ARDOUR { const char* revision = \"%s\"; }\n' % rev
271 print('Writing revision info to libs/ardour/revision.cc using ' + rev)
272 o = open('libs/ardour/revision.cc', 'w')
276 print('Could not open libs/ardour/revision.cc for writing\n')
279 def set_compiler_flags (conf,opt):
281 # Compiler flags and other system-dependent stuff
283 build_host_supports_sse = False
285 # Flags necessary for building
286 compiler_flags = [] # generic
287 c_flags = [] # C-specific
288 cxx_flags = [] # C++-specific
291 # Optimization flags (overridable)
292 optimization_flags = []
297 u = PLATFORM.uname ()
299 platform = u[0].lower()
302 # waf adds -O0 -g itself. thanks waf!
303 is_clang = conf.check_cxx(fragment = '''
307 int main() { return 0; }''',
311 msg = 'Checking for clang')
314 if platform == 'darwin':
315 compiler_name = 'clang-darwin'
317 compiler_name = 'clang'
318 elif conf.env['MSVC_COMPILER']:
319 compiler_name = 'msvc'
321 if platform == 'darwin':
322 compiler_name = 'gcc-darwin'
324 compiler_name = 'gcc'
326 flags_dict = compiler_flags_dictionaries[compiler_name]
327 # Save the compiler flags because we need them at build time
328 # when we need to add compiler specific flags in certain
330 conf.env['compiler_flags_dict'] = flags_dict;
332 autowaf.set_basic_compiler_flags (conf,flags_dict)
334 if conf.options.asan:
335 conf.check_cxx(cxxflags=["-fsanitize=address", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=address"])
336 cxx_flags.append('-fsanitize=address')
337 cxx_flags.append('-fno-omit-frame-pointer')
338 linker_flags.append('-fsanitize=address')
341 debug_flags = [ flags_dict['gprofile'] ]
344 if platform == 'darwin':
345 if re.search ("^13[.]", version) != None:
346 conf.env['build_host'] = 'mavericks'
347 elif re.search ("^14[.]", version) != None:
348 conf.env['build_host'] = 'yosemite'
349 elif re.search ("^15[.]", version) != None:
350 conf.env['build_host'] = 'el_capitan'
352 conf.env['build_host'] = 'irrelevant'
355 if opt.dist_target == 'auto':
356 if platform == 'darwin':
357 # The [.] matches to the dot after the major version, "." would match any character
358 if re.search ("^[0-7][.]", version) != None:
359 conf.env['build_target'] = 'panther'
360 elif re.search ("^8[.]", version) != None:
361 conf.env['build_target'] = 'tiger'
362 elif re.search ("^9[.]", version) != None:
363 conf.env['build_target'] = 'leopard'
364 elif re.search ("^10[.]", version) != None:
365 conf.env['build_target'] = 'snowleopard'
366 elif re.search ("^11[.]", version) != None:
367 conf.env['build_target'] = 'lion'
368 elif re.search ("^12[.]", version) != None:
369 conf.env['build_target'] = 'mountainlion'
370 elif re.search ("^13[.]", version) != None:
371 conf.env['build_target'] = 'mavericks'
372 elif re.search ("^14[.]", version) != None:
373 conf.env['build_target'] = 'yosemite'
375 conf.env['build_target'] = 'el_capitan'
378 "(?P<cpu>i[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)",
381 conf.env['build_target'] = match.group("cpu")
382 if re.search("i[0-5]86", conf.env['build_target']):
383 conf.env['build_target'] = "i386"
385 conf.env['build_target'] = 'none'
387 conf.env['build_target'] = opt.dist_target
389 if conf.env['build_target'] == 'snowleopard':
391 # stupid OS X 10.6 has a bug in math.h that prevents llrint and friends
392 # from being visible.
394 compiler_flags.append ('-U__STRICT_ANSI__')
396 if opt.use_libcpp or conf.env['build_host'] in [ 'el_capitan' ]:
397 cxx_flags.append('--stdlib=libc++')
398 linker_flags.append('--stdlib=libc++')
400 if conf.options.cxx11 or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan' ]:
401 conf.check_cxx(cxxflags=["-std=c++11"])
402 cxx_flags.append('-std=c++11')
403 if platform == "darwin":
404 # Mavericks and later changed the syntax to be used when including Carbon headers,
405 # from requiring a full path to requiring just the header name.
406 cxx_flags.append('-DCARBON_FLAT_HEADERS')
408 if not opt.use_libcpp and not conf.env['build_host'] in [ 'el_capitan' ]:
409 cxx_flags.append('--stdlib=libstdc++')
410 linker_flags.append('--stdlib=libstdc++')
411 # Prevents visibility issues in standard headers
412 conf.define("_DARWIN_C_SOURCE", 1)
414 cxx_flags.append('-DBOOST_NO_AUTO_PTR')
417 if (is_clang and platform == "darwin") or conf.env['build_host'] in ['mavericks', 'yosemite', 'el_capitan']:
418 # Silence warnings about the non-existing osx clang compiler flags
419 # -compatibility_version and -current_version. These are Waf
420 # generated and not needed with clang
421 c_flags.append("-Qunused-arguments")
422 cxx_flags.append("-Qunused-arguments")
424 if (re.search ("(i[0-9]86|x86_64|AMD64)", cpu) != None) and conf.env['build_target'] != 'none':
427 # ARCH_X86 means anything in the x86 family from i386 to x86_64
428 # the compile-time presence of the macro _LP64 is used to
429 # distingush 32 and 64 bit assembler
432 compiler_flags.append ("-DARCH_X86")
434 if platform == 'linux' :
437 # determine processor flags via /proc/cpuinfo
440 if conf.env['build_target'] != 'i386':
442 flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
443 x86_flags = flag_line.split (": ")[1:][0].split ()
445 if "mmx" in x86_flags:
446 compiler_flags.append ("-mmmx")
447 if "sse" in x86_flags:
448 build_host_supports_sse = True
449 if "3dnow" in x86_flags:
450 compiler_flags.append ("-m3dnow")
453 compiler_flags.append ("-march=i586")
455 compiler_flags.append ("-march=i686")
457 if not is_clang and ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse:
458 compiler_flags.extend ([ flags_dict['sse'], flags_dict['fpmath-sse'], flags_dict['xmmintrinsics'] ])
460 if (conf.env['build_target'] == 'mingw'):
461 if (re.search ("(x86_64|AMD64)", cpu) != None):
462 # on Windows sse is supported by 64 bit platforms only
463 build_host_supports_sse = True
465 # mingw GCC compiler to uses at&t (Unix specific) assembler dialect by default
466 # compiler_flags.append (["--mmnemonic=att", "msyntax=att")
468 compiler_flags.extend ([ flags_dict['sse'], flags_dict['fpmath-sse'], flags_dict['xmmintrinsics'], flags_dict['attasm'] ])
470 # end of processor-specific section
472 # optimization section
473 if conf.env['FPU_OPTIMIZATION']:
474 if sys.platform == 'darwin':
475 compiler_flags.append("-DBUILD_VECLIB_OPTIMIZATIONS");
476 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'Accelerate'])
477 elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64':
478 compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
479 elif conf.env['build_target'] == 'mingw':
480 # usability of the 64 bit windows assembler depends on the compiler target,
481 # not the build host, which in turn can only be inferred from the name
483 if re.search ('x86_64-w64', str(conf.env['CC'])) != None:
484 compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
485 if not build_host_supports_sse:
486 print("\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)")
488 # end optimization section
494 if conf.env['build_target'] == 'x86_64' and opt.windows_vst:
495 print("\n\n==================================================")
496 print("64bit Windows VST support on 64bit Linux is experimental.")
497 print("(This version of ardour will not load 32bit VSTs)")
498 print("==================================================\n\n")
500 if conf.env['LXVST_SUPPORT'] == True:
501 if conf.env['build_target'] == 'x86_64':
502 compiler_flags.append("-DLXVST_64BIT")
504 compiler_flags.append("-DLXVST_32BIT")
507 # a single way to test if we're on OS X
510 if conf.env['build_target'] in ['panther', 'tiger', 'leopard' ]:
511 # force tiger or later, to avoid issues on PPC which defaults
512 # back to 10.1 if we don't tell it otherwise.
514 compiler_flags.extend(
515 ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1040",
516 '-mmacosx-version-min=10.4'))
518 elif conf.env['build_target'] in [ 'snowleopard' ]:
519 compiler_flags.extend(
520 ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1060",
521 '-mmacosx-version-min=10.6'))
523 elif conf.env['build_target'] in [ 'lion', 'mountainlion' ]:
524 compiler_flags.extend(
525 ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1070",
526 '-mmacosx-version-min=10.7'))
528 elif conf.env['build_target'] in [ 'mavericks', 'yosemite', 'el_capitan' ]:
529 compiler_flags.extend(
530 ("-DMAC_OS_X_VERSION_MAX_ALLOWED=1090",
531 "-mmacosx-version-min=10.8"))
534 # save off CPU element in an env
536 conf.define ('CONFIG_ARCH', cpu)
539 # ARCH="..." overrides all
543 optimization_flags = opt.arch.split()
546 # prepend boiler plate optimization flags that work on all architectures
549 optimization_flags[:0] = [flags_dict['pipe']]
551 # don't prepend optimization flags if "-O<something>" is present
552 prepend_opt_flags = True
553 for flag in optimization_flags:
554 if flag.startswith("-O"):
555 prepend_opt_flags = False
558 if prepend_opt_flags:
559 optimization_flags[:0] = flags_dict['full-optimization']
561 if opt.debug_symbols:
562 optimization_flags += flags_dict['debuggable']
565 optimization_flags += flags_dict['profile']
568 cxx_flags.append("-D_GLIBCXX_DEBUG")
570 if conf.env['DEBUG_RT_ALLOC']:
571 compiler_flags.append('-DDEBUG_RT_ALLOC')
572 linker_flags.append('-ldl')
574 if conf.env['DEBUG_DENORMAL_EXCEPTION']:
575 compiler_flags.append('-DDEBUG_DENORMAL_EXCEPTION')
578 compiler_flags.extend(flags_dict['generic-x86'])
579 linker_flags.extend(flags_dict['generic-x86'])
582 compiler_flags.extend(flags_dict['generic-ppc'])
583 linker_flags.extend(flags_dict['generic-ppc'])
589 compiler_flags.extend(flags_dict['basic-warnings'])
591 c_flags.extend(flags_dict['extra-c-warnings'])
592 cxx_flags.extend (flags_dict['extra-cxx-warnings'])
598 # need ISOC9X for llabs()
599 compiler_flags.extend(
600 ('-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE',
601 '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64'))
603 ('-D__STDC_LIMIT_MACROS', '-D__STDC_FORMAT_MACROS',
604 '-DCANVAS_COMPATIBILITY', '-DCANVAS_DEBUG'))
607 compiler_flags.append('-DENABLE_NLS')
609 # use sparingly, prefer runtime profile
610 if Options.options.program_name.lower() == "mixbus":
611 compiler_flags.append ('-DMIXBUS')
613 compiler_flags.append ('-DPROGRAM_NAME="' + Options.options.program_name + '"')
614 compiler_flags.append ('-DPROGRAM_VERSION="' + PROGRAM_VERSION + '"')
616 conf.env['PROGRAM_NAME'] = Options.options.program_name
619 conf.env.append_value('CFLAGS', debug_flags)
620 conf.env.append_value('CXXFLAGS', debug_flags)
622 conf.env.append_value('CFLAGS', optimization_flags)
623 conf.env.append_value('CXXFLAGS', optimization_flags)
626 if platform != 'darwin' and not is_clang and not Options.options.dist_target == 'mingw':
627 linker_flags += [ '-rdynamic' ]
629 conf.env.append_value('CFLAGS', compiler_flags)
630 conf.env.append_value('CFLAGS', c_flags)
631 conf.env.append_value('CXXFLAGS', compiler_flags)
632 conf.env.append_value('CXXFLAGS', cxx_flags)
633 conf.env.append_value('LINKFLAGS', linker_flags)
635 def is_tracks_build (conf):
636 return conf.env['PROGRAM_NAME'] == 'Tracks Live'
638 #----------------------------------------------------------------
643 opt.load('compiler_c')
644 opt.load('compiler_cxx')
645 autowaf.set_options(opt, debug_by_default=True)
646 opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name',
647 help='The user-visible name of the program being built')
648 opt.add_option('--arch', type='string', action='store', dest='arch',
649 help='Architecture-specific compiler FLAGS')
650 opt.add_option('--with-backends', type='string', action='store', default='jack', dest='with_backends',
651 help='Specify which backend modules are to be included(jack,alsa,dummy,portaudio,coreaudio)')
652 opt.add_option('--backtrace', action='store_true', default=False, dest='backtrace',
653 help='Compile with -rdynamic -- allow obtaining backtraces from within Ardour')
654 opt.add_option('--no-carbon', action='store_true', default=False, dest='nocarbon',
655 help='Compile without support for AU Plugins with only CARBON UI (needed for 64bit)')
656 opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
657 help='Compile with Boost shared pointer debugging')
658 opt.add_option('--debug-symbols', action='store_true', default=False, dest='debug_symbols',
659 help='Add debug-symbols to optimized builds')
660 opt.add_option('--depstack-root', type='string', default='~', dest='depstack_root',
661 help='Directory/folder where dependency stack trees (gtk, a3) can be found (defaults to ~)')
662 opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
663 help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,tiger,leopard,mingw,msvc]')
664 opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
665 help='Build runtime checked assembler code (default)')
666 opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
667 opt.add_option('--exports-hidden', action='store_true', default=False, dest='exports_hidden')
668 opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
669 help='Build MIME type and .desktop files as per freedesktop.org standards (will be placed in build/gtk2_ardour)')
670 opt.add_option('--freebie', action='store_true', default=False, dest='freebie',
671 help='Build a version suitable for distribution as a zero-cost binary')
672 opt.add_option('--profile', action='store_true', default=False, dest='profile',
673 help='Compile for use with profiling tools requiring a frame pointer')
674 opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile',
675 help='Compile for use with gprofile')
676 opt.add_option('--libjack', type='string', default="auto", dest='libjack_link',
677 help='libjack link mode [auto|link|weak]')
678 opt.add_option('--internal-shared-libs', action='store_true', default=True, dest='internal_shared_libs',
679 help='Build internal libs as shared libraries')
680 opt.add_option('--internal-static-libs', action='store_false', dest='internal_shared_libs',
681 help='Build internal libs as static libraries')
682 opt.add_option('--use-external-libs', action='store_true', default=False, dest='use_external_libs',
683 help='Use external/system versions of some bundled libraries')
684 opt.add_option('--lv2', action='store_true', default=True, dest='lv2',
685 help='Compile with support for LV2 (if Lilv+Suil is available)')
686 opt.add_option('--no-lv2', action='store_false', dest='lv2',
687 help='Do not compile with support for LV2')
688 opt.add_option('--lv2dir', type='string', help="install destination for builtin LV2 bundles [Default: LIBDIR/lv2]")
689 opt.add_option('--lxvst', action='store_true', default=True, dest='lxvst',
690 help='Compile with support for linuxVST plugins')
691 opt.add_option('--no-lxvst', action='store_false', dest='lxvst',
692 help='Compile without support for linuxVST plugins')
693 opt.add_option('--no-lrdf', action='store_true', dest='no_lrdf',
694 help='Compile without support for LRDF LADSPA data even if present')
695 opt.add_option('--nls', action='store_true', default=True, dest='nls',
696 help='Enable i18n (native language support) (default)')
697 opt.add_option('--no-nls', action='store_false', dest='nls')
698 opt.add_option('--phone-home', action='store_true', default=True, dest='phone_home',
699 help='Contact ardour.org at startup for new announcements')
700 opt.add_option('--no-phone-home', action='store_false', dest='phone_home',
701 help='Do not contact ardour.org at startup for new announcements')
702 opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
703 help='Build with debugging for the STL')
704 opt.add_option('--rt-alloc-debug', action='store_true', default=False, dest='rt_alloc_debug',
705 help='Build with debugging for memory allocation in the real-time thread')
706 opt.add_option('--pt-timing', action='store_true', default=False, dest='pt_timing',
707 help='Build with logging of timing in the process thread(s)')
708 opt.add_option('--denormal-exception', action='store_true', default=False, dest='denormal_exception',
709 help='Raise a floating point exception if a denormal is detected')
710 opt.add_option('--test', action='store_true', default=False, dest='build_tests',
711 help="Build unit tests")
712 opt.add_option('--run-tests', action='store_true', default=False, dest='run_tests',
713 help="Run tests after build")
714 opt.add_option('--single-tests', action='store_true', default=False, dest='single_tests',
715 help="Build a single executable for each unit test")
716 #opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport',
717 # help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
718 opt.add_option('--generic', action='store_true', default=False, dest='generic',
719 help='Compile with -arch i386 (OS X ONLY)')
720 opt.add_option('--ppc', action='store_true', default=False, dest='ppc',
721 help='Compile with -arch ppc (OS X ONLY)')
722 opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
723 help='Add revision information to executable name inside the build directory')
724 opt.add_option('--windows-vst', action='store_true', default=False, dest='windows_vst',
725 help='Compile with support for Windows VST')
726 opt.add_option('--windows-key', type='string', action='store', dest='windows_key', default='Mod4><Super',
727 help='X Modifier(s) (Mod1,Mod2, etc) for the Windows key (X11 builds only). ' +
728 'Multiple modifiers must be separated by \'><\'')
729 opt.add_option('--boost-include', type='string', action='store', dest='boost_include', default='',
730 help='directory where Boost header files can be found')
731 opt.add_option('--also-include', type='string', action='store', dest='also_include', default='',
732 help='additional include directory where header files can be found (split multiples with commas)')
733 opt.add_option('--also-libdir', type='string', action='store', dest='also_libdir', default='',
734 help='additional include directory where shared libraries can be found (split multiples with commas)')
735 opt.add_option('--wine-include', type='string', action='store', dest='wine_include', default='/usr/include/wine/windows',
736 help='directory where Wine\'s Windows header files can be found')
737 opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm',
738 help='Do not ask questions that require confirmation during the build')
739 opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11',
740 help='Turn on c++11 compiler flags (-std=c++11)')
741 opt.add_option('--use-libc++', action='store_true', default=False, dest='use_libcpp',
742 help='use libc++ instead of default or auto-detected stdlib')
743 opt.add_option('--address-sanitizer', action='store_true', default=False, dest='asan',
744 help='Turn on AddressSanitizer (requires GCC >= 4.8 or clang >= 3.1)')
745 opt.add_option('--ptformat', action='store_true', default=False, dest='ptformat',
746 help='Turn on PT session import option')
747 opt.add_option('--no-threaded-waveviews', action='store_true', default=False, dest='no_threaded_waveviews',
748 help='Disable threaded waveview rendering')
753 def sub_config_and_use(conf, name, has_objects = True):
755 autowaf.set_local_lib(conf, name, has_objects)
758 conf.load('compiler_c')
759 conf.load('compiler_cxx')
760 if Options.options.dist_target == 'mingw':
763 if Options.options.dist_target == 'msvc':
764 conf.env['MSVC_VERSIONS'] = ['msvc 10.0', 'msvc 9.0', 'msvc 8.0', 'msvc 7.1', 'msvc 7.0', 'msvc 6.0', ]
765 conf.env['MSVC_TARGETS'] = ['x64']
768 if Options.options.debug:
769 # Nuke user CFLAGS/CXXFLAGS if debug is set (they likely contain -O3, NDEBUG, etc)
770 conf.env['CFLAGS'] = []
771 conf.env['CXXFLAGS'] = []
773 # freedesktop translations needs itstool > 1.0.3 (-j option)
774 if Options.options.freedesktop:
775 output = subprocess.Popen("itstool --version", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
776 o = output[0].decode('utf-8')
777 itstool = o.split(' ')[0]
778 version = o.split(' ')[1].split('.')
779 # use distutils.version.StrictVersion or something python to check >= 1.0.4
780 # but first make sure that all build-hosts (incl. OSX-10.5/PPC) have that python lib.
781 # lazy approach: just use major version 2.X.X
782 if itstool != "itstool" or version[0] < "2":
783 print("--freedesktop requires itstool > 2.0.0 to translate files.")
786 conf.env['VERSION'] = VERSION
787 conf.env['MAJOR'] = MAJOR
788 conf.env['MINOR'] = MINOR
789 conf.env['MICRO'] = MICRO
791 autowaf.set_recursive()
792 autowaf.configure(conf)
793 autowaf.display_header('Ardour Configuration')
795 # systems with glibc have libintl builtin. systems without require explicit
796 # linkage against libintl.
799 pkg_config_path = os.getenv('PKG_CONFIG_PATH')
800 user_gtk_root = os.path.expanduser (Options.options.depstack_root + '/gtk/inst')
802 if pkg_config_path is not None and pkg_config_path.find (user_gtk_root) >= 0:
803 # told to search user_gtk_root
804 prefinclude = ''.join ([ '-I', user_gtk_root + '/include'])
805 preflib = ''.join ([ '-L', user_gtk_root + '/lib'])
806 conf.env.append_value('CFLAGS', [ prefinclude ])
807 conf.env.append_value('CXXFLAGS', [prefinclude ])
808 conf.env.append_value('LINKFLAGS', [ preflib ])
809 autowaf.display_msg(conf, 'Will build against private GTK dependency stack in ' + user_gtk_root, 'yes')
811 autowaf.display_msg(conf, 'Will build against private GTK dependency stack', 'no')
813 if sys.platform == 'darwin':
814 conf.define ('NEED_INTL', 1)
815 autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ' + user_gtk_root, 'yes')
817 # libintl is part of the system, so use it
818 autowaf.display_msg(conf, 'Will rely on libintl built into libc', 'yes')
820 user_ardour_root = os.path.expanduser (Options.options.depstack_root + '/a3/inst')
821 if pkg_config_path is not None and pkg_config_path.find (user_ardour_root) >= 0:
822 # told to search user_ardour_root
823 prefinclude = ''.join ([ '-I', user_ardour_root + '/include'])
824 preflib = ''.join ([ '-L', user_ardour_root + '/lib'])
825 conf.env.append_value('CFLAGS', [ prefinclude ])
826 conf.env.append_value('CXXFLAGS', [prefinclude ])
827 conf.env.append_value('LINKFLAGS', [ preflib ])
828 autowaf.display_msg(conf, 'Will build against private Ardour dependency stack in ' + user_ardour_root, 'yes')
830 autowaf.display_msg(conf, 'Will build against private Ardour dependency stack', 'no')
832 if Options.options.freebie:
833 conf.env.append_value ('CFLAGS', '-DSILENCE_AFTER')
834 conf.env.append_value ('CXXFLAGS', '-DSILENCE_AFTER')
835 conf.define ('FREEBIE', 1)
837 if Options.options.lv2dir:
838 conf.env['LV2DIR'] = Options.options.lv2dir
840 conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'ardour' + str(conf.env['MAJOR']), 'LV2')
842 conf.env['LV2DIR'] = os.path.normpath(conf.env['LV2DIR'])
844 if sys.platform == 'darwin':
846 # this is required, potentially, for anything we link and then relocate into a bundle
847 conf.env.append_value('LINKFLAGS', [ '-Xlinker', '-headerpad_max_install_names' ])
849 conf.define ('HAVE_COREAUDIO', 1)
850 conf.define ('AUDIOUNIT_SUPPORT', 1)
852 conf.define ('TOP_MENUBAR',1)
854 # It would be nice to be able to use this to force back-compatibility with 10.4
855 # but even by the time of 11, the 10.4 SDK is no longer available in any normal
858 #conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
859 #conf.env.append_value('CFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
860 #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
861 #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
863 conf.env.append_value('CXXFLAGS_OSX', "-msse")
864 conf.env.append_value('CFLAGS_OSX', "-msse")
865 conf.env.append_value('CXXFLAGS_OSX', "-msse2")
866 conf.env.append_value('CFLAGS_OSX', "-msse2")
868 # TODO: The previous sse flags NEED to be based
869 # off processor type. Need to add in a check
872 conf.env.append_value('CXXFLAGS_OSX', '-F/System/Library/Frameworks')
873 conf.env.append_value('CXXFLAGS_OSX', '-F/Library/Frameworks')
875 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'AppKit'])
876 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudio'])
877 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudioKit'])
878 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreFoundation'])
879 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreServices'])
881 conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'dynamic_lookup' ])
882 conf.env.append_value('LINKFLAGS_OSX', ['-flat_namespace'])
884 conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DAUDIOUNIT_SUPPORT")
885 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'AudioToolbox', '-framework', 'AudioUnit'])
886 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Cocoa'])
889 # osx up to and including 10.6 (uname 10.X.X)
890 (re.search ("^[1-9][0-9]\.", os.uname()[2]) == None or not re.search ("^10\.", os.uname()[2]) == None)
891 and (Options.options.generic or Options.options.ppc)
892 and not Options.options.nocarbon
894 conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DWITH_CARBON")
895 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Carbon'])
897 print ('No Carbon support available for this build\n')
900 if Options.options.internal_shared_libs:
901 conf.define('INTERNAL_SHARED_LIBS', 1)
903 if Options.options.use_external_libs:
904 conf.define('USE_EXTERNAL_LIBS', 1)
906 if Options.options.boost_include != '':
907 conf.env.append_value('CXXFLAGS', '-I' + Options.options.boost_include)
909 if Options.options.also_include != '':
910 conf.env.append_value('CXXFLAGS', '-I' + Options.options.also_include)
911 conf.env.append_value('CFLAGS', '-I' + Options.options.also_include)
913 if Options.options.also_libdir != '':
914 conf.env.append_value('LDFLAGS', '-L' + Options.options.also_libdir)
916 if Options.options.boost_sp_debug:
917 conf.env.append_value('CXXFLAGS', '-DBOOST_SP_ENABLE_DEBUG_HOOKS')
919 # executing a test program is n/a when cross-compiling
920 if Options.options.dist_target != 'mingw':
921 if Options.options.dist_target != 'msvc':
922 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
923 conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
926 msg = 'Checking for boost library >= 1.39',
928 errmsg = 'too old\nPlease install boost version 1.39 or higher.')
930 if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
931 autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
933 autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.28', mandatory=True)
934 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2', mandatory=True)
935 autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0', mandatory=True)
936 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18', mandatory=True)
937 autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2', mandatory=True)
938 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0', mandatory=True)
939 autowaf.check_pkg(conf, 'liblo', uselib_store='LO', atleast_version='0.26', mandatory=True)
940 autowaf.check_pkg(conf, 'taglib', uselib_store='TAGLIB', atleast_version='1.6', mandatory=True)
941 autowaf.check_pkg(conf, 'vamp-sdk', uselib_store='VAMPSDK', atleast_version='2.1', mandatory=True)
942 autowaf.check_pkg(conf, 'vamp-hostsdk', uselib_store='VAMPHOSTSDK', atleast_version='2.1', mandatory=True)
943 autowaf.check_pkg(conf, 'rubberband', uselib_store='RUBBERBAND', mandatory=True)
945 have_rf64_riff_support = conf.check_cc(fragment = '''
947 int main () { int x = SFC_RF64_AUTO_DOWNGRADE; return 0; }
953 msg = 'Checking for sndfile RF64=>RIFF support',
955 errmsg = 'Not found, no RF64-to-WAV support')
957 if have_rf64_riff_support:
958 conf.env.append_value('CXXFLAGS', "-DHAVE_RF64_RIFF")
959 conf.env.append_value('CFLAGS', "-DHAVE_RF64_RIFF")
961 if Options.options.dist_target == 'mingw':
962 Options.options.fpu_optimization = True
963 conf.env.append_value('CFLAGS', '-DPLATFORM_WINDOWS')
964 conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW')
965 conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS')
966 conf.env.append_value('CXXFLAGS', '-DCOMPILER_MINGW')
967 conf.env.append_value('LIB', 'pthread')
968 # needed for at least libsmf
969 conf.check_cc(function_name='htonl', header_name='winsock2.h', lib='ws2_32')
970 conf.env.append_value('LIB', 'ws2_32')
971 conf.env.append_value('LIB', 'winmm')
972 # needed for mingw64 packages, not harmful on normal mingw build
973 conf.env.append_value('LIB', 'intl')
974 conf.check_cc(function_name='regcomp', header_name='regex.h',
975 lib='regex', uselib_store="REGEX", define_name='HAVE_REGEX_H')
976 # TODO put this only where it is needed
977 conf.env.append_value('LIB', 'regex')
978 # TODO this should only be necessary for a debug build
979 conf.env.append_value('LIB', 'dbghelp')
981 # work around GdkDrawable BitBlt performance issue on windows
982 # see http://gareus.org/wiki/ardour_windows_gdk_and_cairo
983 conf.env.append_value('CFLAGS', '-DUSE_CAIRO_IMAGE_SURFACE')
984 conf.env.append_value('CXXFLAGS', '-DUSE_CAIRO_IMAGE_SURFACE')
985 conf.define ('WINDOWS', 1)
987 have_ptw_semaphore = conf.check_cc(fragment = '''
989 #include <semaphore.h>
990 int main () { return 0; }
995 msg = 'Checking for pthread posix semaphore',
997 errmsg = 'Not found, falling back to Windows Semaphore.')
999 #if have_ptw_semaphore:
1000 # conf.define('USE_PTW32_SEMAPHORE', 1)
1001 # conf.env.append_value('CFLAGS', '-DUSE_PTW32_SEMAPHORE')
1002 # conf.env.append_value('CXXFLAGS', '-DUSE_PTW32_SEMAPHORE')
1004 if Options.options.dist_target == 'msvc':
1005 conf.env.append_value('CFLAGS', '-DPLATFORM_WINDOWS')
1006 conf.env.append_value('CFLAGS', '-DCOMPILER_MSVC')
1007 conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS')
1008 conf.env.append_value('CXXFLAGS', '-DCOMPILER_MSVC')
1009 # work around GdkDrawable BitBlt performance issue on windows
1010 # see http://gareus.org/wiki/ardour_windows_gdk_and_cairo
1011 conf.env.append_value('CFLAGS', '-DUSE_CAIRO_IMAGE_SURFACE')
1012 conf.env.append_value('CXXFLAGS', '-DUSE_CAIRO_IMAGE_SURFACE')
1013 # MORE STUFF PROBABLY NEEDED HERE
1014 conf.define ('WINDOWS', 1)
1016 # Tell everyone that this is a waf build
1018 conf.env.append_value('CFLAGS', '-DWAF_BUILD')
1019 conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
1021 opts = Options.options
1023 # (optionally) Adopt Microsoft-like convention that makes all non-explicitly exported
1024 # symbols invisible (rather than doing this all over the wscripts in the src tree)
1026 # This won't apply to MSVC but that hasn't been added as a target yet
1028 # We can't do this till all tests are complete, since some fail if this is et.
1029 if opts.exports_hidden:
1030 conf.define ('EXPORT_VISIBILITY_HIDDEN', True)
1031 if opts.internal_shared_libs:
1032 conf.env.append_value ('CXXFLAGS', '-fvisibility=hidden')
1033 conf.env.append_value ('CFLAGS', '-fvisibility=hidden')
1035 conf.define ('EXPORT_VISIBILITY_HIDDEN', False)
1037 # Set up waf environment and C defines
1039 conf.define('PHONE_HOME', 1)
1040 conf.env['PHONE_HOME'] = True
1041 if opts.fpu_optimization:
1042 conf.env['FPU_OPTIMIZATION'] = True
1043 if opts.freedesktop:
1044 conf.env['FREEDESKTOP'] = True
1046 conf.define('ENABLE_NLS', 1)
1047 conf.env['ENABLE_NLS'] = True
1048 if opts.build_tests:
1049 conf.env['BUILD_TESTS'] = True
1050 conf.env['RUN_TESTS'] = opts.run_tests
1051 if opts.single_tests:
1052 conf.env['SINGLE_TESTS'] = opts.single_tests
1054 # conf.env['TRANZPORT'] = 1
1055 if opts.windows_vst:
1056 conf.define('WINDOWS_VST_SUPPORT', 1)
1057 conf.env['WINDOWS_VST_SUPPORT'] = True
1058 if not Options.options.dist_target == 'mingw':
1059 conf.env.append_value('CFLAGS', '-I' + Options.options.wine_include)
1060 conf.env.append_value('CXXFLAGS', '-I' + Options.options.wine_include)
1061 autowaf.check_header(conf, 'cxx', 'windows.h', mandatory = True)
1063 if sys.platform == 'darwin':
1064 conf.env['LXVST_SUPPORT'] = False
1065 elif Options.options.dist_target == 'mingw':
1066 conf.env['LXVST_SUPPORT'] = False
1068 conf.define('LXVST_SUPPORT', 1)
1069 conf.env['LXVST_SUPPORT'] = True
1070 conf.env['WINDOWS_KEY'] = opts.windows_key
1071 if opts.rt_alloc_debug:
1072 conf.define('DEBUG_RT_ALLOC', 1)
1073 conf.env['DEBUG_RT_ALLOC'] = True
1075 conf.define('PT_TIMING', 1)
1076 conf.env['PT_TIMING'] = True
1077 if opts.denormal_exception:
1078 conf.define('DEBUG_DENORMAL_EXCEPTION', 1)
1079 conf.env['DEBUG_DENORMAL_EXCEPTION'] = True
1080 if opts.build_tests:
1081 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=True)
1083 conf.define('PTFORMAT', 1)
1084 conf.env['PTFORMAT'] = True
1085 if opts.no_threaded_waveviews:
1086 conf.define('NO_THREADED_WAVEVIEWS', 1)
1087 conf.env['NO_THREADED_WAVEVIEWS'] = True
1089 backends = opts.with_backends.split(',')
1092 print("Must configure and build at least one backend")
1095 conf.env['BACKENDS'] = backends
1096 conf.env['BUILD_JACKBACKEND'] = any('jack' in b for b in backends)
1097 conf.env['BUILD_ALSABACKEND'] = any('alsa' in b for b in backends)
1098 conf.env['BUILD_DUMMYBACKEND'] = any('dummy' in b for b in backends)
1099 conf.env['BUILD_PABACKEND'] = any('portaudio' in b for b in backends)
1100 conf.env['BUILD_CORECRAPPITA'] = any('coreaudio' in b for b in backends)
1102 if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw' and conf.env['BUILD_PABACKEND']:
1103 print("PortAudio Backend is not for Linux")
1106 if sys.platform != 'darwin' and conf.env['BUILD_CORECRAPPITA']:
1107 print("Coreaudio backend is only available for OSX")
1110 if re.search ("linux", sys.platform) == None and conf.env['BUILD_ALSABACKEND']:
1111 print("ALSA Backend is only available on Linux")
1114 set_compiler_flags (conf, Options.options)
1116 if sys.platform == 'darwin':
1117 sub_config_and_use(conf, 'libs/appleutility')
1118 elif Options.options.dist_target != 'mingw':
1119 sub_config_and_use(conf, 'tools/sanity_check')
1120 sub_config_and_use(conf, 'tools/gccabicheck')
1122 sub_config_and_use(conf, 'libs/clearlooks-newer')
1125 sub_config_and_use(conf, i)
1127 # Fix utterly braindead FLAC include path to not smash assert.h
1128 conf.env['INCLUDES_FLAC'] = []
1130 config_text = open('libs/ardour/config_text.cc', "w")
1131 config_text.write('''#include "ardour/ardour.h"
1133 const char* const ardour_config_info = "\\n\\
1136 def write_config_text(title, val):
1137 autowaf.display_msg(conf, title, val)
1138 config_text.write(title + ': ')
1139 config_text.write(str(val).replace ('"', '\\"'))
1140 config_text.write("\\n\\\n")
1142 write_config_text('Build documentation', conf.env['DOCS'])
1143 write_config_text('Debuggable build', conf.env['DEBUG'])
1144 write_config_text('Export all symbols (backtrace)', opts.backtrace)
1145 write_config_text('Install prefix', conf.env['PREFIX'])
1146 write_config_text('Strict compiler flags', conf.env['STRICT'])
1147 write_config_text('Internal Shared Libraries', conf.is_defined('INTERNAL_SHARED_LIBS'))
1148 write_config_text('Use External Libraries', conf.is_defined('USE_EXTERNAL_LIBS'))
1149 write_config_text('Library exports hidden', conf.is_defined('EXPORT_VISIBILITY_HIDDEN'))
1151 write_config_text('ALSA DBus Reservation', conf.is_defined('HAVE_DBUS'))
1152 write_config_text('Architecture flags', opts.arch)
1153 write_config_text('Aubio', conf.is_defined('HAVE_AUBIO'))
1154 write_config_text('AudioUnits', conf.is_defined('AUDIOUNIT_SUPPORT'))
1155 write_config_text('Free/Demo copy', conf.is_defined('FREEBIE'))
1156 write_config_text('Build target', conf.env['build_target'])
1157 write_config_text('CoreAudio', conf.is_defined('HAVE_COREAUDIO'))
1158 write_config_text('CoreAudio 10.5 compat', conf.is_defined('COREAUDIO105'))
1159 write_config_text('Debug RT allocations', conf.is_defined('DEBUG_RT_ALLOC'))
1160 write_config_text('Debug Symbols', conf.is_defined('debug_symbols') or conf.env['DEBUG'])
1161 write_config_text('Process thread timing', conf.is_defined('PT_TIMING'))
1162 write_config_text('Denormal exceptions', conf.is_defined('DEBUG_DENORMAL_EXCEPTION'))
1163 write_config_text('FLAC', conf.is_defined('HAVE_FLAC'))
1164 write_config_text('FPU optimization', opts.fpu_optimization)
1165 write_config_text('Freedesktop files', opts.freedesktop)
1166 write_config_text('Libjack linking', conf.env['libjack_link'])
1167 write_config_text('Libjack metadata', conf.is_defined ('HAVE_JACK_METADATA'))
1168 write_config_text('LV2 UI embedding', conf.is_defined('HAVE_SUIL'))
1169 write_config_text('LV2 support', conf.is_defined('LV2_SUPPORT'))
1170 write_config_text('LXVST support', conf.is_defined('LXVST_SUPPORT'))
1171 write_config_text('OGG', conf.is_defined('HAVE_OGG'))
1172 write_config_text('Phone home', conf.is_defined('PHONE_HOME'))
1173 write_config_text('Program name', opts.program_name)
1174 write_config_text('Samplerate', conf.is_defined('HAVE_SAMPLERATE'))
1175 write_config_text('PT format', conf.is_defined('PTFORMAT'))
1176 write_config_text('PTW32 Semaphore', conf.is_defined('USE_PTW32_SEMAPHORE'))
1177 # write_config_text('Soundtouch', conf.is_defined('HAVE_SOUNDTOUCH'))
1178 write_config_text('Translation', opts.nls)
1179 # write_config_text('Tranzport', opts.tranzport)
1180 write_config_text('Unit tests', conf.env['BUILD_TESTS'])
1181 write_config_text('Mac i386 Architecture', opts.generic)
1182 write_config_text('Mac ppc Architecture', opts.ppc)
1183 write_config_text('Windows VST support', opts.windows_vst)
1184 write_config_text('Wiimote support', conf.is_defined('BUILD_WIIMOTE'))
1185 write_config_text('Windows key', opts.windows_key)
1187 print ('\nBackends:')
1189 write_config_text('PortAudio Backend', conf.env['BUILD_PABACKEND'])
1190 write_config_text('CoreAudio/Midi Backend',conf.env['BUILD_CORECRAPPITA'])
1191 write_config_text('ALSA Backend', conf.env['BUILD_ALSABACKEND'])
1192 write_config_text('Dummy backend', conf.env['BUILD_DUMMYBACKEND'])
1193 write_config_text('JACK Backend', conf.env['BUILD_JACKBACKEND'])
1197 write_config_text('C compiler flags', conf.env['CFLAGS'])
1198 write_config_text('C++ compiler flags', conf.env['CXXFLAGS'])
1199 write_config_text('Linker flags', conf.env['LINKFLAGS'])
1201 config_text.write ('";\n}\n')
1202 config_text.close ()
1206 create_stored_revision()
1208 # add directories that contain only headers, to workaround an issue with waf
1210 if not bld.is_defined('USE_EXTERNAL_LIBS'):
1211 bld.path.find_dir ('libs/libltc/ltc')
1212 bld.path.find_dir ('libs/evoral/evoral')
1213 bld.path.find_dir ('libs/surfaces/control_protocol/control_protocol')
1214 bld.path.find_dir ('libs/timecode/timecode')
1215 bld.path.find_dir ('libs/gtkmm2ext/gtkmm2ext')
1216 bld.path.find_dir ('libs/ardour/ardour')
1217 bld.path.find_dir ('libs/pbd/pbd')
1219 # set up target directories
1220 lwrcase_dirname = 'ardour' + bld.env['MAJOR']
1222 if bld.is_tracks_build():
1223 bld.env.append_value ('CXXFLAGS', '-DUSE_TRACKS_CODE_FEATURES')
1224 bld.env.append_value ('CFLAGS', '-DUSE_TRACKS_CODE_FEATURES')
1225 lwrcase_dirname = 'trx'
1227 # configuration files go here
1228 bld.env['CONFDIR'] = os.path.join(bld.env['SYSCONFDIR'], lwrcase_dirname)
1229 # data files loaded at run time go here
1230 bld.env['DATADIR'] = os.path.join(bld.env['DATADIR'], lwrcase_dirname)
1231 # shared objects loaded at runtime go here (two aliases)
1232 bld.env['DLLDIR'] = os.path.join(bld.env['LIBDIR'], lwrcase_dirname)
1233 bld.env['LIBDIR'] = bld.env['DLLDIR']
1234 bld.env['LOCALEDIR'] = os.path.join(bld.env['DATADIR'], 'locale')
1235 bld.env['lwrcase_dirname'] = lwrcase_dirname;
1237 autowaf.set_recursive()
1239 if sys.platform == 'darwin':
1240 bld.recurse('libs/appleutility')
1241 elif bld.env['build_target'] != 'mingw':
1242 bld.recurse('tools/sanity_check')
1243 bld.recurse('tools/gccabicheck')
1245 bld.recurse('libs/clearlooks-newer')
1250 bld.install_files (bld.env['CONFDIR'], 'system_config')
1252 if bld.env['RUN_TESTS']:
1253 bld.add_post_fun(test)
1257 bld.recurse (i18n_children)
1260 bld.recurse (i18n_children)
1263 bld.recurse (i18n_children)
1266 bld.recurse (i18n_children)
1269 create_stored_revision()
1272 subprocess.call("gtk2_ardour/artest")