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