Fix, or at least improve, automation line drawing behaviour with MIDI regions.
[ArdourMidi.git] / wscript
blobf7fe4adee0ebb75ec521f725c78fb9fc38ec0885
1 #!/usr/bin/env python
2 import autowaf
3 import Options
4 import os
5 import commands
6 import re
7 import string
8 import subprocess
9 import sys
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'
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 commands.getoutput(cmd)
47 def fetch_git_revision (path):
48 cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
49 output = commands.getoutput(cmd).splitlines()
50 rev = output[0].replace ("commit", "git")[0:10]
51 for line in output:
52 try:
53 if "git-svn-id" in line:
54 line = line.split('@')[1].split(' ')
55 rev = line[0]
56 except:
57 pass
58 return rev
60 def fetch_bzr_revision (path):
61 cmd = subprocess.Popen("LANG= bzr log -l 1 " + path, stdout=subprocess.PIPE, shell=True)
62 out = cmd.communicate()[0]
63 svn = re.search('^svn revno: [0-9]*', out, re.MULTILINE)
64 str = svn.group(0)
65 chars = 'svnreio: '
66 return string.lstrip(str, chars)
68 def create_stored_revision():
69 rev = ""
70 if os.path.exists('.svn'):
71 rev = fetch_svn_revision('.');
72 elif os.path.exists('.git'):
73 rev = fetch_git_revision('.');
74 elif os.path.exists('.bzr'):
75 rev = fetch_bzr_revision('.');
76 print "Revision: " + rev;
77 elif os.path.exists('libs/ardour/svn_revision.cc'):
78 print "Using packaged svn revision"
79 return
80 else:
81 print "Missing libs/ardour/svn_revision.cc. Blame the packager."
82 sys.exit(-1)
84 try:
85 text = '#include "ardour/svn_revision.h"\n'
86 text += 'namespace ARDOUR { const char* svn_revision = \"' + rev + '\"; }\n'
87 print 'Writing svn revision info to libs/ardour/svn_revision.cc'
88 o = file('libs/ardour/svn_revision.cc', 'w')
89 o.write(text)
90 o.close()
91 except IOError:
92 print 'Could not open libs/ardour/svn_revision.cc for writing\n'
93 sys.exit(-1)
95 def set_compiler_flags (conf,opt):
97 # Compiler flags and other system-dependent stuff
100 build_host_supports_sse = False
101 optimization_flags = []
102 if opt.gprofile:
103 debug_flags = [ '-pg' ]
104 else:
105 debug_flags = [ ] # waf adds -O0 -g itself. thanks waf!
107 # guess at the platform, used to define compiler flags
109 config_guess = os.popen("tools/config.guess").read()[:-1]
111 config_cpu = 0
112 config_arch = 1
113 config_kernel = 2
114 config_os = 3
115 config = config_guess.split ("-")
117 print "system triple: " + config_guess
119 # Autodetect
120 if opt.dist_target == 'auto':
121 if config[config_arch] == 'apple':
122 # The [.] matches to the dot after the major version, "." would match any character
123 if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
124 conf.define ('build_target', 'panther')
125 elif re.search ("darwin8[.]", config[config_kernel]) != None:
126 conf.define ('build_target', 'tiger')
127 else:
128 conf.define ('build_target', 'leopard')
129 else:
130 if re.search ("x86_64", config[config_cpu]) != None:
131 conf.define ('build_target', 'x86_64')
132 elif re.search("i[0-5]86", config[config_cpu]) != None:
133 conf.define ('build_target', 'i386')
134 elif re.search("powerpc", config[config_cpu]) != None:
135 conf.define ('build_target', 'powerpc')
136 else:
137 conf.define ('build_target', 'i686')
138 else:
139 conf.define ('build_target', opt.dist_target)
141 if config[config_cpu] == 'powerpc' and conf.env['build_target'] != 'none':
143 # Apple/PowerPC optimization options
145 # -mcpu=7450 does not reliably work with gcc 3.*
147 if opt.dist_target == 'panther' or opt.dist_target == 'tiger':
148 if config[config_arch] == 'apple':
149 # optimization_flags.extend ([ "-mcpu=7450", "-faltivec"])
150 # to support g3s but still have some optimization for above
151 optimization_flags.extend ([ "-mcpu=G3", "-mtune=7450"])
152 else:
153 optimization_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
154 else:
155 optimization_flags.extend([ "-mcpu=750", "-mmultiple" ])
156 optimization_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
157 optimization_flags.extend (["-Os"])
159 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':
163 # ARCH_X86 means anything in the x86 family from i386 to x86_64
164 # USE_X86_64_ASM is used to distingush 32 and 64 bit assembler
167 if (re.search ("(i[0-9]86|x86_64)", config[config_cpu]) != None):
168 debug_flags.append ("-DARCH_X86")
169 optimization_flags.append ("-DARCH_X86")
171 if config[config_kernel] == 'linux' :
174 # determine processor flags via /proc/cpuinfo
177 if conf.env['build_target'] != 'i386':
179 flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
180 x86_flags = flag_line.split (": ")[1:][0].split ()
182 if "mmx" in x86_flags:
183 optimization_flags.append ("-mmmx")
184 if "sse" in x86_flags:
185 build_host_supports_sse = True
186 if "3dnow" in x86_flags:
187 optimization_flags.append ("-m3dnow")
189 if config[config_cpu] == "i586":
190 optimization_flags.append ("-march=i586")
191 elif config[config_cpu] == "i686":
192 optimization_flags.append ("-march=i686")
194 if ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse:
195 optimization_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"])
196 debug_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"])
198 # end of processor-specific section
200 # optimization section
201 if conf.env['FPU_OPTIMIZATION']:
202 if conf.env['build_target'] == 'tiger' or conf.env['build_target'] == 'leopard':
203 optimization_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS");
204 debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS");
205 conf.env.append_value('LINKFLAGS', "-framework Accelerate")
206 elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64':
207 optimization_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
208 debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
209 elif conf.env['build_target'] == 'x86_64':
210 optimization_flags.append ("-DUSE_X86_64_ASM")
211 debug_flags.append ("-DUSE_X86_64_ASM")
212 if not build_host_supports_sse:
213 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)"
215 # check this even if we aren't using FPU optimization
216 if conf.check_cc(function_name='posix_memalign', header_name='stdlib.h', ccflags='-D_XOPEN_SOURCE=600') == False:
217 optimization_flags.append("-DNO_POSIX_MEMALIGN")
219 # end optimization section
222 # no VST on x86_64
225 if conf.env['build_target'] == 'x86_64' and opt.vst:
226 print "\n\n=================================================="
227 print "You cannot use VST plugins with a 64 bit host. Please run waf with --vst=0"
228 print "\nIt is theoretically possible to build a 32 bit host on a 64 bit system."
229 print "However, this is tricky and not recommended for beginners."
230 sys.exit (-1)
233 # a single way to test if we're on OS X
236 if conf.env['build_target'] in ['panther', 'tiger', 'leopard' ]:
237 conf.define ('IS_OSX', 1)
238 # force tiger or later, to avoid issues on PPC which defaults
239 # back to 10.1 if we don't tell it otherwise.
240 conf.env.append_value('CCFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1040")
242 else:
243 conf.define ('IS_OSX', 0)
246 # save off guessed arch element in an env
248 conf.define ('CONFIG_ARCH', config[config_arch])
251 # ARCH="..." overrides all
254 if opt.arch != None:
255 optimization_flags = opt.arch.split()
258 # prepend boiler plate optimization flags that work on all architectures
261 optimization_flags[:0] = [
262 "-O3",
263 "-fomit-frame-pointer",
264 "-ffast-math",
265 "-fstrength-reduce",
266 "-pipe"
269 if opt.debug:
270 conf.env.append_value('CCFLAGS', debug_flags)
271 conf.env.append_value('CXXFLAGS', debug_flags)
272 conf.env.append_value('LINKFLAGS', debug_flags)
273 else:
274 conf.env.append_value('CCFLAGS', optimization_flags)
275 conf.env.append_value('CXXFLAGS', optimization_flags)
276 conf.env.append_value('LINKFLAGS', optimization_flags)
278 if opt.stl_debug:
279 conf.env.append_value('CXXFLAGS', "-D_GLIBCXX_DEBUG")
281 if opt.universal:
282 conf.env.append_value('CCFLAGS', "-arch i386 -arch ppc")
283 conf.env.append_value('CXXFLAGS', "-arch i386 -arch ppc")
284 conf.env.append_value('LINKFLAGS', "-arch i386 -arch ppc")
287 # warnings flags
290 conf.env.append_value('CCFLAGS', "-Wall")
291 conf.env.append_value('CXXFLAGS', [ '-Wall', '-Woverloaded-virtual'])
293 if opt.extra_warn:
294 flags = [ '-Wextra' ]
295 conf.env.append_value('CCFLAGS', flags )
296 conf.env.append_value('CXXFLAGS', flags )
300 # more boilerplate
303 conf.env.append_value('CCFLAGS', [ '-D_LARGEFILE64_SOURCE', '-D_LARGEFILE_SOURCE' ])
304 conf.env.append_value('CCFLAGS', [ '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64' ])
305 conf.env.append_value('CXXFLAGS', [ '-D_LARGEFILE64_SOURCE', '-D_LARGEFILE_SOURCE' ])
306 conf.env.append_value('CXXFLAGS', [ '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64' ])
307 if opt.nls:
308 conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
309 conf.env.append_value('CCFLAGS', '-DENABLE_NLS')
312 #----------------------------------------------------------------
314 # Waf stages
316 def set_options(opt):
317 autowaf.set_options(opt)
318 opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name',
319 help='The user-visible name of the program being built')
320 opt.add_option('--arch', type='string', action='store', dest='arch',
321 help='Architecture-specific compiler flags')
322 opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
323 help='Compile with Boost shared pointer debugging')
324 opt.add_option('--audiounits', action='store_true', default=False, dest='audiounits',
325 help='Compile with Apple\'s AudioUnit library (experimental)')
326 opt.add_option('--coreaudio', action='store_true', default=False, dest='coreaudio',
327 help='Compile with Apple\'s CoreAudio library')
328 opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
329 help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,powerpc,tiger,leopard]')
330 opt.add_option('--extra-warn', action='store_true', default=False, dest='extra_warn',
331 help='Build with even more compiler warning flags')
332 opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
333 help='Build runtime checked assembler code (default)')
334 opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
335 opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
336 help='Install MIME type, icons and .desktop file as per freedesktop.org standards')
337 opt.add_option('--freesound', action='store_true', default=False, dest='freesound',
338 help='Include Freesound database lookup')
339 opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile',
340 help='Compile for use with gprofile')
341 opt.add_option('--gtkosx', action='store_true', default=False, dest='gtkosx',
342 help='Compile for use with GTK-OSX, not GTK-X11')
343 opt.add_option('--lv2', action='store_true', default=False, dest='lv2',
344 help='Compile with support for LV2 (if slv2 is available)')
345 opt.add_option('--nls', action='store_true', default=True, dest='nls',
346 help='Enable i18n (native language support) (default)')
347 opt.add_option('--no-nls', action='store_false', dest='nls')
348 opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
349 help='Build with debugging for the STL')
350 opt.add_option('--test', action='store_true', default=False, dest='build_tests',
351 help="Build unit tests")
352 opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport',
353 help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
354 opt.add_option('--universal', action='store_true', default=False, dest='universal',
355 help='Compile as universal binary (requires that external libraries are universal)')
356 opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
357 help='Add revision information to executable name inside the build directory')
358 opt.add_option('--vst', action='store_true', default=False, dest='vst',
359 help='Compile with support for VST')
360 opt.add_option('--wiimote', action='store_true', default=False, dest='wiimote',
361 help='Build the wiimote control surface')
362 opt.add_option('--windows-key', type='string', action='store', dest='windows_key', default='Mod4><Super',
363 help='X Modifier(s) (Mod1,Mod2, etc) for the Windows key (X11 builds only). ' +
364 'Multiple modifiers must be separated by \'><\'')
366 for i in children:
367 opt.sub_options(i)
369 def sub_config_and_use(conf, name, has_objects = True):
370 conf.sub_config(name)
371 autowaf.set_local_lib(conf, name, has_objects)
373 def configure(conf):
374 create_stored_revision()
375 conf.env['VERSION'] = VERSION
376 autowaf.set_recursive()
377 autowaf.configure(conf)
379 if sys.platform == 'darwin':
381 # Define OSX as a uselib to use when compiling
382 # on Darwin to add all applicable flags at once
384 conf.env.append_value('CXXFLAGS_OSX', "-mmacosx-version-min=10.4")
385 conf.env.append_value('CCFLAGS_OSX', "-mmacosx-version-min=10.4")
386 conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
387 conf.env.append_value('CCFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
388 conf.env.append_value('LINKFLAGS_OSX', "-mmacosx-version-min=10.4")
389 conf.env.append_value('LINKFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
391 conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
392 conf.env.append_value('LINKFLAGS_OSX', "-F/System/Library/Frameworks")
394 conf.env.append_value('CXXFLAGS_OSX', "-msse")
395 conf.env.append_value('CCFLAGS_OSX', "-msse")
396 conf.env.append_value('CXXFLAGS_OSX', "-msse2")
397 conf.env.append_value('CCFLAGS_OSX', "-msse2")
399 # TODO: The previous sse flags NEED to be based
400 # off processor type. Need to add in a check
401 # for that.
404 conf.env.append_value('CPPPATH_OSX', "/System/Library/Frameworks/")
405 conf.env.append_value('CPPPATH_OSX', "/usr/include/")
406 conf.env.append_value('CPPPATH_OSX', "/usr/include/c++/4.0.0")
407 conf.env.append_value('CPPPATH_OSX', "/usr/include/c++/4.0.0/i686-apple-darwin8/")
409 # TODO: Fix the above include path, it needs to be
410 # defined based off what is read in the configuration
411 # stage about the machine(PPC, X86, X86_64, etc.)
413 conf.env.append_value('CPPPATH_OSX', "/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/")
415 # TODO: Likewise this needs to be defined not only
416 # based off the machine characteristics, but also
417 # based off the version of GCC being used.
420 conf.env.append_value('FRAMEWORK_OSX', ['CoreFoundation'])
422 conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'suppress'])
423 conf.env.append_value('LINKFLAGS_OSX', "-flat_namespace")
425 # The previous 2 flags avoid circular dependencies
426 # between libardour and libardour_cp on OS X.
427 # ld reported -undefined suppress as an unknown option
428 # in one of the tests ran, removing it for the moment
430 conf.env.append_value('CXXFLAGS_OSX', "-F/System/Library/Frameworks")
431 conf.env.append_value('CCFLAGS_OSX', "-F/System/Library/Frameworks")
433 # GTKOSX only builds on darwin anyways
434 if Options.options.gtkosx:
436 # Define Include Paths for GTKOSX
438 conf.env.append_value('CXXFLAGS_GTKOSX', '-DTOP_MENUBAR')
439 conf.env.append_value('CXXFLAGS_GTKOSX', '-DGTKOSX')
440 conf.env.append_value('LINKFLAGS_GTKOSX', "-framework AppKit")
441 conf.env.append_value('LINKFLAGS_GTKOSX', "-Xlinker -headerpad")
442 conf.env.append_value('LINKFLAGS_GTKOSX', "-Xlinker 2048")
443 conf.env.append_value('CPPPATH_GTKOSX', "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/")
445 if Options.options.coreaudio:
446 conf.check_cc (header_name = '/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h',
447 define_name = 'HAVE_COREAUDIO', linkflags = ['-framework CoreAudio'],
448 uselib_store="COREAUDIO")
449 conf.check_cxx (header_name = '/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h',
450 linkflags = [ '-framework AudioToolbox' ], uselib_store="COREAUDIO")
451 conf.check_cc (header_name = '/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h',
452 linkflags = ['-framework CoreServices'], uselib_store="COREAUDIO")
454 if Options.options.audiounits:
455 #conf.env.append_value('CXXFLAGS_AUDIOUNIT', "-DHAVE_AUDIOUNITS")
456 conf.env.append_value('FRAMEWORK_AUDIOUNIT', ['AudioToolbox'])
457 conf.env.append_value('FRAMEWORK_AUDIOUNIT', ['CoreServices'])
458 conf.check_cc (header_name = '/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h',
459 define_name = 'HAVE_AUDIOUNITS', linkflags = [ '-framework AudioUnit' ],
460 uselib_store="AUDIOUNIT")
462 if Options.options.boost_sp_debug:
463 conf.env.append_value('CXXFLAGS', '-DBOOST_SP_ENABLE_DEBUG_HOOKS')
465 autowaf.check_header(conf, 'boost/signals2.hpp', mandatory = True)
467 autowaf.check_header(conf, 'jack/session.h', define="JACK_SESSION")
469 conf.check_cc(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
470 execute = "1",
471 mandatory = True,
472 msg = 'Checking for boost library >= 1.39',
473 okmsg = 'ok',
474 errmsg = 'too old\nPlease install boost version 1.39 or higher.')
476 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
477 autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
478 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
479 autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
480 if sys.platform == 'darwin':
481 sub_config_and_use(conf, 'libs/appleutility')
482 for i in children:
483 sub_config_and_use(conf, i)
485 # Fix utterly braindead FLAC include path to not smash assert.h
486 conf.env['CPPPATH_FLAC'] = []
488 # Tell everyone that this is a waf build
490 conf.env.append_value('CCFLAGS', '-DWAF_BUILD')
491 conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
493 autowaf.print_summary(conf)
494 opts = Options.options
495 autowaf.display_header('Ardour Configuration')
496 autowaf.display_msg(conf, 'Build Target', conf.env['build_target'])
497 autowaf.display_msg(conf, 'Architecture flags', opts.arch)
498 autowaf.display_msg(conf, 'Aubio', bool(conf.env['HAVE_AUBIO']))
499 autowaf.display_msg(conf, 'AudioUnits', opts.audiounits)
500 autowaf.display_msg(conf, 'CoreAudio', bool(conf.env['HAVE_COREAUDIO']))
501 if bool(conf.env['HAVE_COREAUDIO']):
502 conf.define ('COREAUDIO', 1)
503 if opts.audiounits:
504 conf.define('AUDIOUNITS',1)
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, 'GtkOSX', opts.gtkosx)
513 if opts.gtkosx:
514 conf.define ('GTKOSX', 1)
515 autowaf.display_msg(conf, 'LV2 Support', bool(conf.env['HAVE_SLV2']))
516 autowaf.display_msg(conf, 'Rubberband', bool(conf.env['HAVE_RUBBERBAND']))
517 autowaf.display_msg(conf, 'Samplerate', bool(conf.env['HAVE_SAMPLERATE']))
518 autowaf.display_msg(conf, 'Soundtouch', bool(conf.env['HAVE_SOUNDTOUCH']))
519 autowaf.display_msg(conf, 'Translation', opts.nls)
520 if opts.nls:
521 conf.define ('ENABLE_NLS', 1)
522 autowaf.display_msg(conf, 'Tranzport', opts.tranzport)
523 if opts.build_tests:
524 conf.env['BUILD_TESTS'] = opts.build_tests
525 autowaf.display_msg(conf, 'Unit Tests', bool(conf.env['BUILD_TESTS']) and bool (conf.env['HAVE_CPPUNIT']))
526 if opts.tranzport:
527 conf.define('TRANZPORT', 1)
528 autowaf.display_msg(conf, 'Universal Binary', opts.universal)
529 autowaf.display_msg(conf, 'VST Support', opts.vst)
530 if opts.vst:
531 conf.define('VST_SUPPORT', 1)
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 if opts.windows_key:
538 conf.define('WINDOWS_KEY', opts.windows_key)
539 autowaf.display_msg(conf, 'Windows Key', opts.windows_key)
540 conf.env['PROGRAM_NAME'] = opts.program_name
541 autowaf.display_msg(conf, 'Program Name', opts.program_name)
543 set_compiler_flags (conf, Options.options)
545 autowaf.display_msg(conf, 'C Compiler flags', conf.env['CCFLAGS'])
546 autowaf.display_msg(conf, 'C++ Compiler flags', conf.env['CXXFLAGS'])
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['BUILD_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 ('AudioUnits '); config_text.write (str (opts.audiounits)); config_text.write ("\\n\\\n")
560 config_text.write ('CoreAudio '); config_text.write (str (bool(conf.env['HAVE_COREAUDIO']))); config_text.write ("\\n\\\n")
561 config_text.write ('FPU Optimization '); config_text.write (str (opts.fpu_optimization)); config_text.write ("\\n\\\n")
562 config_text.write ('Freedesktop Files '); config_text.write (str (opts.freedesktop)); config_text.write ("\\n\\\n")
563 config_text.write ('Freesound '); config_text.write (str (opts.freesound)); config_text.write ("\\n\\\n")
564 config_text.write ('GtkOSX '); config_text.write (str (opts.gtkosx)); config_text.write ("\\n\\\n")
565 config_text.write ('LV2 Support '); config_text.write (str (bool(conf.env['HAVE_SLV2']))); config_text.write ("\\n\\\n")
566 config_text.write ('Rubberband '); config_text.write (str (bool(conf.env['HAVE_RUBBERBAND']))); config_text.write ("\\n\\\n")
567 config_text.write ('Samplerate '); config_text.write (str (bool(conf.env['HAVE_SAMPLERATE']))); config_text.write ("\\n\\\n")
568 config_text.write ('Soundtouch '); config_text.write (str (bool(conf.env['HAVE_SOUNDTOUCH']))); config_text.write ("\\n\\\n")
569 config_text.write ('Translation '); config_text.write (str (opts.nls)); config_text.write ("\\n\\\n")
570 config_text.write ('Tranzport '); config_text.write (str (opts.tranzport)); config_text.write ("\\n\\\n")
571 config_text.write ('Universal Binary '); config_text.write (str (opts.universal)); config_text.write ("\\n\\\n")
572 config_text.write ('VST Support '); config_text.write (str (opts.vst)); config_text.write ("\\n\\\n")
573 config_text.write ('Wiimote Support '); config_text.write (str (opts.wiimote)); config_text.write ("\\n\\\n")
574 config_text.write ('Windows Key '); config_text.write (str (opts.windows_key)); config_text.write ("\\n\\\n")
575 config_text.write ('C Compiler flags '); config_text.write (str (conf.env['CCFLAGS'])); config_text.write ("\\n\\\n")
576 config_text.write ('C++ Compiler flags '); config_text.write (str (conf.env['CXXFLAGS'])); config_text.write ("\\n\\\n")
577 config_text.write ('";}\n')
578 config_text.close ()
580 def build(bld):
581 autowaf.set_recursive()
582 if sys.platform == 'darwin':
583 bld.add_subdirs('libs/appleutility')
584 for i in children:
585 bld.add_subdirs(i)
587 # ideally, we'd like to use the OS-provided MIDI API
588 # for default ports. that doesn't work on at least
589 # Fedora (Nov 9th, 2009) so use JACK MIDI on linux.
591 if sys.platform == 'darwin':
592 rc_subst_dict = {
593 'MIDITAG' : 'control',
594 'MIDITYPE' : 'coremidi',
595 'JACK_INPUT' : 'auditioner'
597 else:
598 rc_subst_dict = {
599 'MIDITAG' : 'control',
600 'MIDITYPE' : 'jack',
601 'JACK_INPUT' : 'auditioner'
604 obj = bld.new_task_gen('subst')
605 obj.source = 'ardour.rc.in'
606 obj.target = 'ardour_system.rc'
607 obj.dict = rc_subst_dict
608 obj.install_path = '${CONFIGDIR}/ardour3'
610 def i18n(bld):
611 bld.recurse (i18n_children)