nominally add MIDI input support for AudioUnit plugins
[ardour2.git] / wscript
blobada116a13854c640ff6d167a6c7dbe8def3d70ba
1 #!/usr/bin/env python
2 import autowaf
3 import Options
4 import os
5 import re
6 import string
7 import subprocess
8 import sys
9 import glob
11 # Variables for 'waf dist'
12 VERSION = '3.0pre0'
13 APPNAME = 'Ardour'
15 # Mandatory variables
16 srcdir = '.'
17 blddir = 'build'
19 children = [
20 'libs/pbd',
21 'libs/midi++2',
22 'libs/evoral',
23 'libs/vamp-sdk',
24 'libs/vamp-plugins',
25 'libs/taglib',
26 'libs/rubberband',
27 'libs/surfaces',
28 'libs/ardour',
29 'libs/gtkmm2ext',
30 'libs/clearlooks-newer',
31 'libs/audiographer',
32 'gtk2_ardour'
35 i18n_children = [
36 'gtk2_ardour',
37 'libs/ardour'
40 # Version stuff
42 def fetch_svn_revision (path):
43 cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'"
44 return subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
46 def fetch_gcc_version ():
47 cmd = "LANG= gcc --version"
48 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
49 o = output[0].decode('utf-8')
50 version = o.split(' ')[2].split('.')
51 return version
53 def fetch_git_revision (path):
54 cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
55 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
56 o = output[0].decode('utf-8')
57 rev = o.replace ("commit", "git")[0:10]
58 for line in output:
59 try:
60 if "git-svn-id" in line:
61 line = line.split('@')[1].split(' ')
62 rev = line[0]
63 except:
64 pass
65 return rev
67 def fetch_bzr_revision (path):
68 cmd = subprocess.Popen("LANG= bzr log -l 1 " + path, stdout=subprocess.PIPE, shell=True)
69 out = cmd.communicate()[0]
70 svn = re.search('^svn revno: [0-9]*', out, re.MULTILINE)
71 str = svn.group(0)
72 chars = 'svnreio: '
73 return string.lstrip(str, chars)
75 def create_stored_revision():
76 rev = ""
77 if os.path.exists('.svn'):
78 rev = fetch_svn_revision('.');
79 elif os.path.exists('.git'):
80 rev = fetch_git_revision('.');
81 elif os.path.exists('.bzr'):
82 rev = fetch_bzr_revision('.');
83 print("Revision: %s", rev)
84 elif os.path.exists('libs/ardour/svn_revision.cc'):
85 print("Using packaged svn revision")
86 return
87 else:
88 print("Missing libs/ardour/svn_revision.cc. Blame the packager.")
89 sys.exit(-1)
91 try:
92 text = '#include "ardour/svn_revision.h"\n'
93 text += 'namespace ARDOUR { const char* svn_revision = \"%s\"; }\n' % rev
94 print('Writing svn revision info to libs/ardour/svn_revision.cc')
95 o = open('libs/ardour/svn_revision.cc', 'w')
96 o.write(text)
97 o.close()
98 except IOError:
99 print('Could not open libs/ardour/svn_revision.cc for writing\n')
100 sys.exit(-1)
102 def set_compiler_flags (conf,opt):
104 # Compiler flags and other system-dependent stuff
107 build_host_supports_sse = False
108 optimization_flags = []
109 debug_flags = []
111 # guess at the platform, used to define compiler flags
113 config_guess = os.popen("tools/config.guess").read()[:-1]
115 config_cpu = 0
116 config_arch = 1
117 config_kernel = 2
118 config_os = 3
119 config = config_guess.split ("-")
121 autowaf.display_msg(conf, "System Triple", config_guess)
123 if opt.gprofile:
124 debug_flags = [ '-pg' ]
125 else:
126 if config[config_arch] != 'apple':
127 debug_flags = [ '-rdynamic' ] # waf adds -O0 -g itself. thanks waf!
129 # Autodetect
130 if opt.dist_target == 'auto':
131 if config[config_arch] == 'apple':
132 # The [.] matches to the dot after the major version, "." would match any character
133 if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
134 conf.define ('build_target', 'panther')
135 elif re.search ("darwin8[.]", config[config_kernel]) != None:
136 conf.define ('build_target', 'tiger')
137 else:
138 conf.define ('build_target', 'leopard')
139 else:
140 if re.search ("x86_64", config[config_cpu]) != None:
141 conf.define ('build_target', 'x86_64')
142 elif re.search("i[0-5]86", config[config_cpu]) != None:
143 conf.define ('build_target', 'i386')
144 elif re.search("powerpc", config[config_cpu]) != None:
145 conf.define ('build_target', 'powerpc')
146 else:
147 conf.define ('build_target', 'i686')
148 else:
149 conf.define ('build_target', opt.dist_target)
151 if config[config_cpu] == 'powerpc' and conf.env['build_target'] != 'none':
153 # Apple/PowerPC optimization options
155 # -mcpu=7450 does not reliably work with gcc 3.*
157 if opt.dist_target == 'panther' or opt.dist_target == 'tiger':
158 if config[config_arch] == 'apple':
159 # optimization_flags.extend ([ "-mcpu=7450", "-faltivec"])
160 # to support g3s but still have some optimization for above
161 optimization_flags.extend ([ "-mcpu=G3", "-mtune=7450"])
162 else:
163 optimization_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
164 else:
165 optimization_flags.extend([ "-mcpu=750", "-mmultiple" ])
166 optimization_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
167 optimization_flags.extend (["-Os"])
169 elif ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None)) and conf.env['build_target'] != 'none':
173 # ARCH_X86 means anything in the x86 family from i386 to x86_64
174 # USE_X86_64_ASM is used to distingush 32 and 64 bit assembler
177 if (re.search ("(i[0-9]86|x86_64)", config[config_cpu]) != None):
178 debug_flags.append ("-DARCH_X86")
179 optimization_flags.append ("-DARCH_X86")
181 if config[config_kernel] == 'linux' :
184 # determine processor flags via /proc/cpuinfo
187 if conf.env['build_target'] != 'i386':
189 flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
190 x86_flags = flag_line.split (": ")[1:][0].split ()
192 if "mmx" in x86_flags:
193 optimization_flags.append ("-mmmx")
194 if "sse" in x86_flags:
195 build_host_supports_sse = True
196 if "3dnow" in x86_flags:
197 optimization_flags.append ("-m3dnow")
199 if config[config_cpu] == "i586":
200 optimization_flags.append ("-march=i586")
201 elif config[config_cpu] == "i686":
202 optimization_flags.append ("-march=i686")
204 if ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse:
205 optimization_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"])
206 debug_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"])
208 # end of processor-specific section
210 # optimization section
211 if conf.env['FPU_OPTIMIZATION']:
212 if conf.env['build_target'] == 'tiger' or conf.env['build_target'] == 'leopard':
213 optimization_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS");
214 debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS");
215 conf.env.append_value('LINKFLAGS', "-framework Accelerate")
216 elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64':
217 optimization_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
218 debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
219 elif conf.env['build_target'] == 'x86_64':
220 optimization_flags.append ("-DUSE_X86_64_ASM")
221 debug_flags.append ("-DUSE_X86_64_ASM")
222 if not build_host_supports_sse:
223 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)")
225 # check this even if we aren't using FPU optimization
226 if not conf.env['HAVE_POSIX_MEMALIGN']:
227 optimization_flags.append("-DNO_POSIX_MEMALIGN")
229 # end optimization section
232 # no VST on x86_64
235 if conf.env['build_target'] == 'x86_64' and opt.vst:
236 print("\n\n==================================================")
237 print("You cannot use VST plugins with a 64 bit host. Please run waf with --vst=0")
238 print("\nIt is theoretically possible to build a 32 bit host on a 64 bit system.")
239 print("However, this is tricky and not recommended for beginners.")
240 sys.exit (-1)
243 # a single way to test if we're on OS X
246 if conf.env['build_target'] in ['panther', 'tiger', 'leopard' ]:
247 conf.define ('IS_OSX', 1)
248 # force tiger or later, to avoid issues on PPC which defaults
249 # back to 10.1 if we don't tell it otherwise.
250 conf.env.append_value('CCFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1040")
252 else:
253 conf.define ('IS_OSX', 0)
256 # save off guessed arch element in an env
258 conf.define ('CONFIG_ARCH', config[config_arch])
261 # ARCH="..." overrides all
264 if opt.arch != None:
265 optimization_flags = opt.arch.split()
268 # prepend boiler plate optimization flags that work on all architectures
271 optimization_flags[:0] = [
272 "-O3",
273 "-fomit-frame-pointer",
274 "-ffast-math",
275 "-fstrength-reduce",
276 "-pipe"
279 if opt.debug:
280 conf.env.append_value('CCFLAGS', debug_flags)
281 conf.env.append_value('CXXFLAGS', debug_flags)
282 conf.env.append_value('LINKFLAGS', debug_flags)
283 else:
284 conf.env.append_value('CCFLAGS', optimization_flags)
285 conf.env.append_value('CXXFLAGS', optimization_flags)
286 conf.env.append_value('LINKFLAGS', optimization_flags)
288 if opt.stl_debug:
289 conf.env.append_value('CXXFLAGS', "-D_GLIBCXX_DEBUG")
291 if opt.universal:
292 conf.env.append_value('CCFLAGS', "-arch i386 -arch ppc")
293 conf.env.append_value('CXXFLAGS', "-arch i386 -arch ppc")
294 conf.env.append_value('LINKFLAGS', "-arch i386 -arch ppc")
297 # warnings flags
300 conf.env.append_value('CCFLAGS', "-Wall")
301 conf.env.append_value('CXXFLAGS', [ '-Wall', '-Woverloaded-virtual'])
303 if opt.extra_warn:
304 flags = [ '-Wextra' ]
305 conf.env.append_value('CCFLAGS', flags )
306 conf.env.append_value('CXXFLAGS', flags )
310 # more boilerplate
313 conf.env.append_value('CCFLAGS', '-D_LARGEFILE64_SOURCE')
314 conf.env.append_value('CCFLAGS', '-D_FILE_OFFSET_BITS=64')
315 conf.env.append_value('CXXFLAGS', '-D_LARGEFILE64_SOURCE')
316 conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
318 conf.env.append_value('CXXFLAGS', '-D__STDC_LIMIT_MACROS')
319 conf.env.append_value('CXXFLAGS', '-D__STDC_FORMAT_MACROS')
321 if opt.nls:
322 conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
323 conf.env.append_value('CCFLAGS', '-DENABLE_NLS')
326 #----------------------------------------------------------------
328 # Waf stages
330 def set_options(opt):
331 autowaf.set_options(opt)
332 opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name',
333 help='The user-visible name of the program being built')
334 opt.add_option('--arch', type='string', action='store', dest='arch',
335 help='Architecture-specific compiler flags')
336 opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
337 help='Compile with Boost shared pointer debugging')
338 opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
339 help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,powerpc,tiger,leopard]')
340 opt.add_option('--extra-warn', action='store_true', default=False, dest='extra_warn',
341 help='Build with even more compiler warning flags')
342 opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
343 help='Build runtime checked assembler code (default)')
344 opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
345 opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
346 help='Install MIME type, icons and .desktop file as per freedesktop.org standards')
347 opt.add_option('--freesound', action='store_true', default=False, dest='freesound',
348 help='Include Freesound database lookup')
349 opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile',
350 help='Compile for use with gprofile')
351 opt.add_option('--lv2', action='store_true', default=False, dest='lv2',
352 help='Compile with support for LV2 (if slv2 is available)')
353 opt.add_option('--nls', action='store_true', default=True, dest='nls',
354 help='Enable i18n (native language support) (default)')
355 opt.add_option('--no-nls', action='store_false', dest='nls')
356 opt.add_option('--phone-home', action='store_false', default=True, dest='phone_home')
357 opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
358 help='Build with debugging for the STL')
359 opt.add_option('--test', action='store_true', default=False, dest='build_tests',
360 help="Build unit tests")
361 opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport',
362 help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
363 opt.add_option('--universal', action='store_true', default=False, dest='universal',
364 help='Compile as universal binary (requires that external libraries are universal)')
365 opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
366 help='Add revision information to executable name inside the build directory')
367 opt.add_option('--vst', action='store_true', default=False, dest='vst',
368 help='Compile with support for VST')
369 opt.add_option('--wiimote', action='store_true', default=False, dest='wiimote',
370 help='Build the wiimote control surface')
371 opt.add_option('--windows-key', type='string', action='store', dest='windows_key', default='Mod4><Super',
372 help='X Modifier(s) (Mod1,Mod2, etc) for the Windows key (X11 builds only). ' +
373 'Multiple modifiers must be separated by \'><\'')
374 opt.add_option('--boost-include', type='string', action='store', dest='boost_include', default='',
375 help='directory where Boost header files can be found')
376 for i in children:
377 opt.sub_options(i)
379 def sub_config_and_use(conf, name, has_objects = True):
380 conf.sub_config(name)
381 autowaf.set_local_lib(conf, name, has_objects)
383 def configure(conf):
384 create_stored_revision()
385 conf.env['VERSION'] = VERSION
386 conf.line_just = 52
387 autowaf.set_recursive()
388 autowaf.configure(conf)
389 autowaf.display_header('Ardour Configuration')
391 gcc_versions = fetch_gcc_version()
392 if not Options.options.debug and gcc_versions[0] == '4' and gcc_versions[1] > '4':
393 print('Version 4.5 of gcc is not ready for use when compiling Ardour with optimization.')
394 print('Please use a different version or re-configure with --debug')
395 exit (1)
397 if sys.platform == 'darwin':
399 conf.define ('AUDIOUNITS', 1)
400 conf.define ('AU_STATE_SUPPORT', 1)
401 conf.define ('COREAUDIO', 1)
402 conf.define ('GTKOSX', 1)
403 conf.define ('TOP_MENUBAR',1)
404 conf.define ('GTKOSX',1)
406 conf.env.append_value('CXXFLAGS_APPLEUTILITY', '-I../libs')
408 # Define OSX as a uselib to use when compiling
409 # on Darwin to add all applicable flags at once
411 conf.env.append_value('CXXFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
412 conf.env.append_value('CCFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
413 conf.env.append_value('CXXFLAGS_OSX', '-mmacosx-version-min=10.4')
414 conf.env.append_value('CCFLAGS_OSX', '-mmacosx-version-min=10.4')
416 #conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
417 #conf.env.append_value('CCFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
418 #conf.env.append_value('LINKFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
420 #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
422 conf.env.append_value('CXXFLAGS_OSX', "-msse")
423 conf.env.append_value('CCFLAGS_OSX', "-msse")
424 conf.env.append_value('CXXFLAGS_OSX', "-msse2")
425 conf.env.append_value('CCFLAGS_OSX', "-msse2")
427 # TODO: The previous sse flags NEED to be based
428 # off processor type. Need to add in a check
429 # for that.
431 conf.env.append_value('CXXFLAGS_OSX', '-F/System/LibraryFrameworks')
432 conf.env.append_value('CXXFLAGS_OSX', '-F/Library/Frameworks')
434 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'AppKit'])
435 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudio'])
436 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreFoundation'])
437 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreServices'])
439 conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'suppress' ])
440 conf.env.append_value('LINKFLAGS_OSX', '-flat_namespace')
442 conf.env.append_value('LINKFLAGS_GTKOSX', [ '-Xlinker', '-headerpad'])
443 conf.env.append_value('LINKFLAGS_GTKOSX', ['-Xlinker', '2048'])
444 conf.env.append_value('CPPPATH_GTKOSX', "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/")
446 conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DHAVE_AUDIOUNITS")
447 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Audiotoolbox', '-framework', 'AudioUnit'])
449 if Options.options.boost_include != '':
450 conf.env.append_value('CPPPATH', Options.options.boost_include)
452 autowaf.check_header(conf, 'boost/signals2.hpp', mandatory = True)
454 if Options.options.boost_sp_debug:
455 conf.env.append_value('CXXFLAGS_BOOST', '-DBOOST_SP_ENABLE_DEBUG_HOOKS')
457 autowaf.check_header(conf, 'jack/session.h', define="JACK_SESSION")
459 conf.check_cc(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
460 execute = "1",
461 mandatory = True,
462 msg = 'Checking for boost library >= 1.39',
463 okmsg = 'ok',
464 errmsg = 'too old\nPlease install boost version 1.39 or higher.')
466 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
467 autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
468 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
469 autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
470 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
472 if sys.platform == 'darwin':
473 sub_config_and_use(conf, 'libs/appleutility')
474 for i in children:
475 sub_config_and_use(conf, i)
477 # Fix utterly braindead FLAC include path to not smash assert.h
478 conf.env['CPPPATH_FLAC'] = []
480 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', linkflags='-ldl', uselib_store='DL')
481 conf.check_cc(function_name='curl_global_init', header_name='curl/curl.h', linkflags='-lcurl', uselib_store='CURL')
483 # Tell everyone that this is a waf build
485 conf.env.append_value('CCFLAGS', '-DWAF_BUILD')
486 conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
488 # debug builds should not call home
490 opts = Options.options
491 if opts.debug:
492 opts.phone_home = False;
494 autowaf.display_msg(conf, 'Build Target', conf.env['build_target'])
495 autowaf.display_msg(conf, 'Architecture flags', opts.arch)
496 autowaf.display_msg(conf, 'Aubio', bool(conf.env['HAVE_AUBIO']))
497 autowaf.display_msg(conf, 'CoreAudio', bool(conf.env['HAVE_COREAUDIO']))
498 autowaf.display_msg(conf, 'FLAC', bool(conf.env['HAVE_FLAC']))
499 autowaf.display_msg(conf, 'Phone Home', opts.phone_home)
500 if opts.phone_home:
501 conf.env['PHONE_HOME'] = opts.phone_home
502 autowaf.display_msg(conf, 'FPU Optimization', opts.fpu_optimization)
503 if opts.fpu_optimization:
504 conf.define('FPU_OPTIMIZATION', 1)
505 autowaf.display_msg(conf, 'Freedesktop Files', opts.freedesktop)
506 autowaf.display_msg(conf, 'Freesound', opts.freesound)
507 if opts.freesound:
508 conf.define('FREESOUND',1)
509 autowaf.display_msg(conf, 'LV2 Support', bool(conf.env['HAVE_SLV2']))
510 autowaf.display_msg(conf, 'OGG', bool(conf.env['HAVE_OGG']))
511 autowaf.display_msg(conf, 'Rubberband', bool(conf.env['HAVE_RUBBERBAND']))
512 autowaf.display_msg(conf, 'Samplerate', bool(conf.env['HAVE_SAMPLERATE']))
513 autowaf.display_msg(conf, 'Soundtouch', bool(conf.env['HAVE_SOUNDTOUCH']))
514 autowaf.display_msg(conf, 'Translation', opts.nls)
515 if opts.nls:
516 conf.define ('ENABLE_NLS', 1)
517 autowaf.display_msg(conf, 'Tranzport', opts.tranzport)
518 if opts.build_tests:
519 conf.env['BUILD_TESTS'] = opts.build_tests
520 autowaf.display_msg(conf, 'Unit Tests', bool(conf.env['BUILD_TESTS']) and bool (conf.env['HAVE_CPPUNIT']))
521 if opts.tranzport:
522 conf.define('TRANZPORT', 1)
523 autowaf.display_msg(conf, 'Universal Binary', opts.universal)
524 autowaf.display_msg(conf, 'VST Support', opts.vst)
525 if opts.vst:
526 conf.define('VST_SUPPORT', 1)
527 if bool(conf.env['JACK_SESSION']):
528 conf.define ('HAVE_JACK_SESSION', 1)
529 autowaf.display_msg(conf, 'Wiimote Support', opts.wiimote)
530 if opts.wiimote:
531 conf.define('WIIMOTE',1)
532 conf.define('WINDOWS_KEY', opts.windows_key)
533 autowaf.display_msg(conf, 'Windows Key', opts.windows_key)
534 conf.env['PROGRAM_NAME'] = opts.program_name
535 autowaf.display_msg(conf, 'Program Name', opts.program_name)
537 set_compiler_flags (conf, Options.options)
539 autowaf.display_msg(conf, 'C Compiler flags', conf.env['CCFLAGS'])
540 autowaf.display_msg(conf, 'C++ Compiler flags', conf.env['CXXFLAGS'])
541 print()
543 # and dump the same stuff to a file for use in the build
545 config_text = open ('libs/ardour/config_text.cc',"w")
546 config_text.write ('#include "ardour/ardour.h"\n\nnamespace ARDOUR {\nconst char* const ardour_config_info = "\\n\\\n')
547 config_text.write ("Install prefix: "); config_text.write (str (conf.env['PREFIX'])); config_text.write ("\\n\\\n")
548 config_text.write ("Debuggable build: "); config_text.write (str (str(conf.env['DEBUG']))); config_text.write ("\\n\\\n")
549 config_text.write ("Strict compiler flags: "); config_text.write (str (str(conf.env['STRICT']))); config_text.write ("\\n\\\n")
550 config_text.write ("Build documentation: "); config_text.write (str (str(conf.env['DOCS']))); config_text.write ("\\n\\\n")
551 config_text.write ('Build target: '); config_text.write (str (conf.env['build_target'])); config_text.write ("\\n\\\n")
552 config_text.write ('Architecture flags: '); config_text.write (str (opts.arch)); config_text.write ("\\n\\\n")
553 config_text.write ('Aubio: '); config_text.write (str (bool(conf.env['HAVE_AUBIO']))); config_text.write ("\\n\\\n")
554 config_text.write ('FPU optimization: '); config_text.write (str (opts.fpu_optimization)); config_text.write ("\\n\\\n")
555 config_text.write ('Freedesktop files: '); config_text.write (str (opts.freedesktop)); config_text.write ("\\n\\\n")
556 config_text.write ('Freesound: '); config_text.write (str (opts.freesound)); config_text.write ("\\n\\\n")
557 config_text.write ('LV2 support: '); config_text.write (str (bool(conf.env['HAVE_SLV2']))); config_text.write ("\\n\\\n")
558 config_text.write ('Rubberband: '); config_text.write (str (bool(conf.env['HAVE_RUBBERBAND']))); config_text.write ("\\n\\\n")
559 config_text.write ('Samplerate: '); config_text.write (str (bool(conf.env['HAVE_SAMPLERATE']))); config_text.write ("\\n\\\n")
560 config_text.write ('Soundtouch: '); config_text.write (str (bool(conf.env['HAVE_SOUNDTOUCH']))); config_text.write ("\\n\\\n")
561 config_text.write ('Translation: '); config_text.write (str (opts.nls)); config_text.write ("\\n\\\n")
562 config_text.write ('Tranzport: '); config_text.write (str (opts.tranzport)); config_text.write ("\\n\\\n")
563 config_text.write ('Universal binary: '); config_text.write (str (opts.universal)); config_text.write ("\\n\\\n")
564 config_text.write ('VST support: '); config_text.write (str (opts.vst)); config_text.write ("\\n\\\n")
565 config_text.write ('Wiimote support: '); config_text.write (str (opts.wiimote)); config_text.write ("\\n\\\n")
566 config_text.write ('Windows key: '); config_text.write (str (opts.windows_key)); config_text.write ("\\n\\\n")
567 config_text.write ('C compiler flags: '); config_text.write (str (conf.env['CCFLAGS'])); config_text.write ("\\n\\\n")
568 config_text.write ('C++ compiler flags: '); config_text.write (str (conf.env['CXXFLAGS'])); config_text.write ("\\n\\\n")
569 config_text.write ('Phone home: '); config_text.write (str (bool(conf.env['PHONE_HOME']))); config_text.write ("\\n\\\n")
570 config_text.write ('JACK session support: '); config_text.write (str (bool(conf.env['JACK_SESSION']))); config_text.write ("\\n\\\n")
571 config_text.write ('";}\n')
572 config_text.close ()
574 def build(bld):
575 autowaf.set_recursive()
576 if sys.platform == 'darwin':
577 bld.add_subdirs('libs/appleutility')
578 for i in children:
579 bld.add_subdirs(i)
581 # ideally, we'd like to use the OS-provided MIDI API
582 # for default ports. that doesn't work on at least
583 # Fedora (Nov 9th, 2009) so use JACK MIDI on linux.
585 if sys.platform == 'darwin':
586 rc_subst_dict = {
587 'MIDITAG' : 'control',
588 'MIDITYPE' : 'coremidi',
589 'JACK_INPUT' : 'auditioner'
591 else:
592 rc_subst_dict = {
593 'MIDITAG' : 'control',
594 'MIDITYPE' : 'jack',
595 'JACK_INPUT' : 'auditioner'
598 obj = bld.new_task_gen('subst')
599 obj.source = 'ardour.rc.in'
600 obj.target = 'ardour_system.rc'
601 obj.dict = rc_subst_dict
602 obj.install_path = '${CONFIGDIR}/ardour3'
604 def i18n(bld):
605 bld.recurse (i18n_children)