3 from __future__ import print_function
11 from waflib import Logs, Options, Task, Utils
12 from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext
16 JACK_API_VERSION = '0.1.0'
18 # these variables are mandatory ('/' are converted automatically)
22 # lib32 variant name used when building in mixed mode
25 def display_feature(conf, msg, build):
27 conf.msg(msg, 'yes', color='GREEN')
29 conf.msg(msg, 'no', color='YELLOW')
31 def check_for_celt(conf):
33 for version in ['11', '8', '7', '5']:
34 define = 'HAVE_CELT_API_0_' + version
38 package='celt >= 0.%s.0' % version,
39 args='--cflags --libs')
41 conf.define(define, 1)
43 except conf.errors.ConfigurationError:
45 conf.define(define, 0)
48 raise conf.errors.ConfigurationError
51 # options provided by the modules
52 opt.load('compiler_cxx')
53 opt.load('compiler_c')
54 opt.load('autooptions');
61 opt.add_option('--htmldir', type='string', default=None, help='HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/')
62 opt.add_option('--libdir', type='string', help='Library directory [Default: <prefix>/lib]')
63 opt.add_option('--libdir32', type='string', help='32bit Library directory [Default: <prefix>/lib32]')
64 opt.add_option('--mandir', type='string', help='Manpage directory [Default: <prefix>/share/man/man1]')
66 # options affecting binaries
67 opt.add_option('--platform', type='string', default=sys.platform, help='Target platform for cross-compiling, e.g. cygwin or win32')
68 opt.add_option('--mixed', action='store_true', default=False, help='Build with 32/64 bits mixed mode')
69 opt.add_option('--debug', action='store_true', default=False, dest='debug', help='Build debuggable binaries')
71 # options affecting general jack functionality
72 opt.add_option('--classic', action='store_true', default=False, help='Force enable standard JACK (jackd) even if D-Bus JACK (jackdbus) is enabled too')
73 opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)')
74 opt.add_option('--autostart', type='string', default='default', help='Autostart method. Possible values: "default", "classic", "dbus", "none"')
75 opt.add_option('--profile', action='store_true', default=False, help='Build with engine profiling')
76 opt.add_option('--clients', default=64, type='int', dest='clients', help='Maximum number of JACK clients')
77 opt.add_option('--ports-per-application', default=768, type='int', dest='application_ports', help='Maximum number of ports per application')
78 opt.add_option('--systemd-unit', action='store_true', default=False, help='Install systemd units.')
80 opt.set_auto_options_define('HAVE_%s')
81 opt.set_auto_options_style('yesno_and_hack')
83 # options with third party dependencies
84 doxygen = opt.add_auto_option(
86 help='Build doxygen documentation',
87 conf_dest='BUILD_DOXYGEN_DOCS',
89 doxygen.find_program('doxygen')
90 alsa = opt.add_auto_option(
92 help='Enable ALSA driver',
93 conf_dest='BUILD_DRIVER_ALSA')
95 package='alsa >= 1.0.18',
96 args='--cflags --libs')
97 firewire = opt.add_auto_option(
99 help='Enable FireWire driver (FFADO)',
100 conf_dest='BUILD_DRIVER_FFADO')
102 package='libffado >= 1.999.17',
103 args='--cflags --libs')
104 iio = opt.add_auto_option(
106 help='Enable IIO driver',
107 conf_dest='BUILD_DRIVER_IIO')
109 package='gtkIOStream >= 1.4.0',
110 args='--cflags --libs')
112 package='eigen3 >= 3.1.2',
113 args='--cflags --libs')
114 portaudio = opt.add_auto_option(
116 help='Enable Portaudio driver',
117 conf_dest='BUILD_DRIVER_PORTAUDIO')
118 portaudio.check(header_name='windows.h') # only build portaudio on windows
120 package='portaudio-2.0 >= 19',
121 uselib_store='PORTAUDIO',
122 args='--cflags --libs')
123 winmme = opt.add_auto_option(
125 help='Enable WinMME driver',
126 conf_dest='BUILD_DRIVER_WINMME')
128 header_name=['windows.h', 'mmsystem.h'],
129 msg='Checking for header mmsystem.h')
131 celt = opt.add_auto_option(
133 help='Build with CELT')
134 celt.add_function(check_for_celt)
136 # Suffix _PKG to not collide with HAVE_OPUS defined by the option.
137 opus = opt.add_auto_option(
139 help='Build Opus netjack2')
140 opus.check(header_name='opus/opus_custom.h')
142 package='opus >= 0.9.0',
143 args='--cflags --libs',
144 define_name='HAVE_OPUS_PKG')
146 samplerate = opt.add_auto_option(
148 help='Build with libsamplerate')
149 samplerate.check_cfg(
150 package='samplerate',
151 args='--cflags --libs')
152 sndfile = opt.add_auto_option(
154 help='Build with libsndfile')
157 args='--cflags --libs')
158 readline = opt.add_auto_option(
160 help='Build with readline')
161 readline.check(lib='readline')
163 header_name=['stdio.h', 'readline/readline.h'],
164 msg='Checking for header readline/readline.h')
165 sd = opt.add_auto_option(
167 help='Use systemd notify')
168 sd.check(header_name='systemd/sd-daemon.h')
169 sd.check(lib='systemd')
170 db = opt.add_auto_option(
172 help='Use Berkeley DB (metadata)')
173 db.check(header_name='db.h')
179 # this must be called before the configure phase
180 opt.apply_auto_options_hack()
182 def detect_platform(conf):
183 # GNU/kFreeBSD and GNU/Hurd are treated as Linux
185 # ('KEY, 'Human readable name', ['strings', 'to', 'check', 'for'])
186 ('IS_LINUX', 'Linux', ['gnu0', 'gnukfreebsd', 'linux', 'posix']),
187 ('IS_MACOSX', 'MacOS X', ['darwin']),
188 ('IS_SUN', 'SunOS', ['sunos']),
189 ('IS_WINDOWS', 'Windows', ['cygwin', 'msys', 'win32'])
192 for key,name,strings in platforms:
193 conf.env[key] = False
195 conf.start_msg('Checking platform')
196 platform = Options.options.platform
197 for key,name,strings in platforms:
199 if platform.startswith(s):
201 conf.end_msg(name, color='CYAN')
206 conf.load('compiler_cxx')
207 conf.load('compiler_c')
209 detect_platform(conf)
211 if conf.env['IS_WINDOWS']:
212 conf.env.append_unique('CCDEFINES', '_POSIX')
213 conf.env.append_unique('CXXDEFINES', '_POSIX')
215 conf.env.append_unique('CFLAGS', '-Wall')
216 conf.env.append_unique('CXXFLAGS', '-Wall')
217 conf.env.append_unique('CXXFLAGS', '-std=gnu++11')
219 if not conf.env['IS_MACOSX']:
220 conf.env.append_unique('LDFLAGS', '-Wl,--no-undefined')
222 conf.check(lib='aften', uselib='AFTEN', define_name='AFTEN')
225 + '#include <aften/aften.h>\n'
229 + 'AftenContext fAftenContext;\n'
230 + 'aften_set_defaults(&fAftenContext);\n'
231 + 'unsigned char *fb;\n'
232 + 'float *buf=new float[10];\n'
233 + 'int res = aften_encode_frame(&fAftenContext, fb, buf, 1);\n'
236 msg='Checking for aften_encode_frame()',
237 define_name='HAVE_AFTEN_NEW_API',
240 conf.load('autooptions')
242 conf.recurse('compat')
244 # Check for functions.
247 + '#define _GNU_SOURCE\n'
248 + '#include <poll.h>\n'
249 + '#include <signal.h>\n'
250 + '#include <stddef.h>\n'
254 + ' ppoll(NULL, 0, NULL, NULL);\n'
256 msg='Checking for ppoll',
257 define_name='HAVE_PPOLL',
260 # Check for backtrace support
262 header_name='execinfo.h',
263 define_name='HAVE_EXECINFO_H',
266 conf.recurse('common')
267 if Options.options.dbus:
269 if conf.env['BUILD_JACKDBUS'] != True:
270 conf.fatal('jackdbus was explicitly requested but cannot be built')
271 if conf.env['IS_LINUX']:
272 if Options.options.systemd_unit:
273 conf.recurse('systemd')
275 conf.env['SYSTEMD_USER_UNIT_DIR'] = None
278 conf.recurse('example-clients')
280 # test for the availability of ucontext, and how it should be used
281 for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
282 fragment = '#include <ucontext.h>\n'
283 fragment += 'int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }' % t
284 confvar = 'HAVE_UCONTEXT_%s' % t.upper()
285 conf.check_cc(fragment=fragment, define_name=confvar, mandatory=False,
286 msg='Checking for ucontext->uc_mcontext.%s' % t)
287 if conf.is_defined(confvar):
288 conf.define('HAVE_UCONTEXT', 1)
290 fragment = '#include <ucontext.h>\n'
291 fragment += 'int main() { return NGREG; }'
292 conf.check_cc(fragment=fragment, define_name='HAVE_NGREG', mandatory=False,
293 msg='Checking for NGREG')
295 conf.env['LIB_PTHREAD'] = ['pthread']
296 conf.env['LIB_DL'] = ['dl']
297 conf.env['LIB_RT'] = ['rt']
298 conf.env['LIB_M'] = ['m']
299 conf.env['LIB_STDC++'] = ['stdc++']
300 conf.env['JACK_API_VERSION'] = JACK_API_VERSION
301 conf.env['JACK_VERSION'] = VERSION
303 conf.env['BUILD_WITH_PROFILE'] = Options.options.profile
304 conf.env['BUILD_WITH_32_64'] = Options.options.mixed
305 conf.env['BUILD_CLASSIC'] = Options.options.classic
306 conf.env['BUILD_DEBUG'] = Options.options.debug
308 if conf.env['BUILD_JACKDBUS']:
309 conf.env['BUILD_JACKD'] = conf.env['BUILD_CLASSIC']
311 conf.env['BUILD_JACKD'] = True
313 conf.env['BINDIR'] = conf.env['PREFIX'] + '/bin'
315 if Options.options.htmldir:
316 conf.env['HTMLDIR'] = Options.options.htmldir
318 # set to None here so that the doxygen code can find out the highest
319 # directory to remove upon install
320 conf.env['HTMLDIR'] = None
322 if Options.options.libdir:
323 conf.env['LIBDIR'] = Options.options.libdir
325 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib'
327 if Options.options.mandir:
328 conf.env['MANDIR'] = Options.options.mandir
330 conf.env['MANDIR'] = conf.env['PREFIX'] + '/share/man/man1'
332 if conf.env['BUILD_DEBUG']:
333 conf.env.append_unique('CXXFLAGS', '-g')
334 conf.env.append_unique('CFLAGS', '-g')
335 conf.env.append_unique('LINKFLAGS', '-g')
337 if not Options.options.autostart in ['default', 'classic', 'dbus', 'none']:
338 conf.fatal('Invalid autostart value "' + Options.options.autostart + '"')
340 if Options.options.autostart == 'default':
341 if conf.env['BUILD_JACKD']:
342 conf.env['AUTOSTART_METHOD'] = 'classic'
344 conf.env['AUTOSTART_METHOD'] = 'dbus'
346 conf.env['AUTOSTART_METHOD'] = Options.options.autostart
348 if conf.env['AUTOSTART_METHOD'] == 'dbus' and not conf.env['BUILD_JACKDBUS']:
349 conf.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
350 if conf.env['AUTOSTART_METHOD'] == 'classic' and not conf.env['BUILD_JACKD']:
351 conf.fatal('Classic autostart mode was specified but jackd will not be built')
353 if conf.env['AUTOSTART_METHOD'] == 'dbus':
354 conf.define('USE_LIBDBUS_AUTOLAUNCH', 1)
355 elif conf.env['AUTOSTART_METHOD'] == 'classic':
356 conf.define('USE_CLASSIC_AUTOLAUNCH', 1)
358 conf.define('CLIENT_NUM', Options.options.clients)
359 conf.define('PORT_NUM_FOR_CLIENT', Options.options.application_ports)
361 if conf.env['IS_WINDOWS']:
362 # we define this in the environment to maintain compatibility with
363 # existing install paths that use ADDON_DIR rather than have to
364 # have special cases for windows each time.
365 conf.env['ADDON_DIR'] = conf.env['BINDIR'] + '/jack'
366 # don't define ADDON_DIR in config.h, use the default 'jack' defined in
367 # windows/JackPlatformPlug_os.h
369 conf.env['ADDON_DIR'] = os.path.normpath(os.path.join(conf.env['LIBDIR'], 'jack'))
370 conf.define('ADDON_DIR', conf.env['ADDON_DIR'])
371 conf.define('JACK_LOCATION', os.path.normpath(os.path.join(conf.env['PREFIX'], 'bin')))
373 if not conf.env['IS_WINDOWS']:
374 conf.define('USE_POSIX_SHM', 1)
375 conf.define('JACKMP', 1)
376 if conf.env['BUILD_JACKDBUS']:
377 conf.define('JACK_DBUS', 1)
378 if conf.env['BUILD_WITH_PROFILE']:
379 conf.define('JACK_MONITOR', 1)
380 conf.write_config_header('config.h', remove=False)
384 f = open('svnversion.h')
386 m = re.match(r'^#define SVN_VERSION "([^"]*)"$', data)
393 if Options.options.mixed:
394 conf.setenv(lib32, env=conf.env.derive())
395 conf.env.append_unique('CXXFLAGS', '-m32')
396 conf.env.append_unique('CFLAGS', '-m32')
397 conf.env.append_unique('LINKFLAGS', '-m32')
398 if Options.options.libdir32:
399 conf.env['LIBDIR'] = Options.options.libdir32
401 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32'
402 # libdb does not work in mixed mode
403 conf.all_envs[lib32]['HAVE_DB'] = 0
404 conf.all_envs[lib32]['HAVE_DB_H'] = 0
405 conf.all_envs[lib32]['LIB_DB'] = []
406 # no need for opus in 32bit mixed mode clients
407 conf.all_envs[lib32]['LIB_OPUS'] = []
408 # someone tell me where this file gets written please..
409 conf.write_config_header('config.h')
412 print('==================')
413 version_msg = 'JACK ' + VERSION
415 version_msg += ' exported from r' + svnrev
417 version_msg += ' svn revision will checked and eventually updated during build'
420 conf.msg('Maximum JACK clients', Options.options.clients, color='NORMAL')
421 conf.msg('Maximum ports per application', Options.options.application_ports, color='NORMAL')
423 conf.msg('Install prefix', conf.env['PREFIX'], color='CYAN')
424 conf.msg('Library directory', conf.all_envs['']['LIBDIR'], color='CYAN')
425 if conf.env['BUILD_WITH_32_64']:
426 conf.msg('32-bit library directory', conf.all_envs[lib32]['LIBDIR'], color='CYAN')
427 conf.msg('Drivers directory', conf.env['ADDON_DIR'], color='CYAN')
428 display_feature(conf, 'Build debuggable binaries', conf.env['BUILD_DEBUG'])
431 ('C compiler flags', ['CFLAGS', 'CPPFLAGS']),
432 ('C++ compiler flags', ['CXXFLAGS', 'CPPFLAGS']),
433 ('Linker flags', ['LINKFLAGS', 'LDFLAGS'])
435 for name,vars in tool_flags:
438 flags += conf.all_envs[''][var]
439 conf.msg(name, repr(flags), color='NORMAL')
441 if conf.env['BUILD_WITH_32_64']:
442 conf.msg('32-bit C compiler flags', repr(conf.all_envs[lib32]['CFLAGS']))
443 conf.msg('32-bit C++ compiler flags', repr(conf.all_envs[lib32]['CXXFLAGS']))
444 conf.msg('32-bit linker flags', repr(conf.all_envs[lib32]['LINKFLAGS']))
445 display_feature(conf, 'Build with engine profiling', conf.env['BUILD_WITH_PROFILE'])
446 display_feature(conf, 'Build with 32/64 bits mixed mode', conf.env['BUILD_WITH_32_64'])
448 display_feature(conf, 'Build standard JACK (jackd)', conf.env['BUILD_JACKD'])
449 display_feature(conf, 'Build D-Bus JACK (jackdbus)', conf.env['BUILD_JACKDBUS'])
450 conf.msg('Autostart method', conf.env['AUTOSTART_METHOD'])
452 if conf.env['BUILD_JACKDBUS'] and conf.env['BUILD_JACKD']:
453 print(Logs.colors.RED + 'WARNING !! mixing both jackd and jackdbus may cause issues:' + Logs.colors.NORMAL)
454 print(Logs.colors.RED + 'WARNING !! jackdbus does not use .jackdrc nor qjackctl settings' + Logs.colors.NORMAL)
456 conf.summarize_auto_options()
458 if conf.env['BUILD_JACKDBUS']:
459 conf.msg('D-Bus service install directory', conf.env['DBUS_SERVICES_DIR'], color='CYAN')
461 if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
463 print(Logs.colors.RED + 'WARNING: D-Bus session services directory as reported by pkg-config is')
464 print(Logs.colors.RED + 'WARNING:', end=' ')
465 print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR_REAL'])
466 print(Logs.colors.RED + 'WARNING: but service file will be installed in')
467 print(Logs.colors.RED + 'WARNING:', end=' ')
468 print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR'])
469 print(Logs.colors.RED + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus')
470 print('WARNING: You can override dbus service install directory')
471 print('WARNING: with --enable-pkg-config-dbus-service-dir option to this script')
472 print(Logs.colors.NORMAL, end=' ')
476 for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
477 name = y.__name__.replace('Context','').lower()
479 cmd = name + '_' + lib32
482 def obj_add_includes(bld, obj):
483 if bld.env['BUILD_JACKDBUS']:
484 obj.includes += ['dbus']
486 if bld.env['IS_LINUX']:
487 obj.includes += ['linux', 'posix']
489 if bld.env['IS_MACOSX']:
490 obj.includes += ['macosx', 'posix']
492 if bld.env['IS_SUN']:
493 obj.includes += ['posix', 'solaris']
495 if bld.env['IS_WINDOWS']:
496 obj.includes += ['windows']
498 # FIXME: Is SERVER_SIDE needed?
499 def build_jackd(bld):
501 features = ['cxx', 'cxxprogram'],
502 defines = ['HAVE_CONFIG_H','SERVER_SIDE'],
503 includes = ['.', 'common', 'common/jack'],
505 source = ['common/Jackdmp.cpp'],
506 use = ['serverlib', 'SYSTEMD']
509 if bld.env['BUILD_JACKDBUS']:
510 jackd.source += ['dbus/audio_reserve.c', 'dbus/reserve.c']
511 jackd.use += ['DBUS-1']
513 if bld.env['IS_LINUX']:
514 jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
516 if bld.env['IS_MACOSX']:
517 jackd.use += ['DL', 'PTHREAD']
518 jackd.framework = ['CoreFoundation']
520 if bld.env['IS_SUN']:
521 jackd.use += ['DL', 'PTHREAD']
523 obj_add_includes(bld, jackd)
527 # FIXME: Is SERVER_SIDE needed?
528 def create_driver_obj(bld, **kw):
530 kw['use'] += ['serverlib']
532 kw['use'] = ['serverlib']
535 features = ['c', 'cxx', 'cshlib', 'cxxshlib'],
536 defines = ['HAVE_CONFIG_H', 'SERVER_SIDE'],
537 includes = ['.', 'common', 'common/jack'],
538 install_path = '${ADDON_DIR}/',
541 if bld.env['IS_WINDOWS']:
542 driver.env['cxxshlib_PATTERN'] = 'jack_%s.dll'
544 driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
546 obj_add_includes(bld, driver)
550 def build_drivers(bld):
551 # Non-hardware driver sources. Lexically sorted.
553 'common/JackDummyDriver.cpp'
557 'common/JackLoopbackDriver.cpp'
561 'common/JackNetDriver.cpp'
565 'common/JackNetOneDriver.cpp',
567 'common/netjack_packet.c'
571 'common/JackProxyDriver.cpp'
574 # Hardware driver sources. Lexically sorted.
577 'linux/alsa/JackAlsaDriver.cpp',
578 'linux/alsa/alsa_rawmidi.c',
579 'linux/alsa/alsa_seqmidi.c',
580 'linux/alsa/alsa_midi_jackmp.cpp',
581 'linux/alsa/generic_hw.c',
583 'linux/alsa/alsa_driver.c',
584 'linux/alsa/hammerfall.c',
585 'linux/alsa/ice1712.c'
589 'linux/alsarawmidi/JackALSARawMidiDriver.cpp',
590 'linux/alsarawmidi/JackALSARawMidiInputPort.cpp',
591 'linux/alsarawmidi/JackALSARawMidiOutputPort.cpp',
592 'linux/alsarawmidi/JackALSARawMidiPort.cpp',
593 'linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
594 'linux/alsarawmidi/JackALSARawMidiSendQueue.cpp',
595 'linux/alsarawmidi/JackALSARawMidiUtil.cpp'
600 'solaris/oss/JackBoomerDriver.cpp'
604 'macosx/coreaudio/JackCoreAudioDriver.mm',
605 'common/JackAC3Encoder.cpp'
609 'macosx/coremidi/JackCoreMidiInputPort.mm',
610 'macosx/coremidi/JackCoreMidiOutputPort.mm',
611 'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
612 'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
613 'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
614 'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
615 'macosx/coremidi/JackCoreMidiPort.mm',
616 'macosx/coremidi/JackCoreMidiUtil.mm',
617 'macosx/coremidi/JackCoreMidiDriver.mm'
621 'linux/firewire/JackFFADODriver.cpp',
622 'linux/firewire/JackFFADOMidiInputPort.cpp',
623 'linux/firewire/JackFFADOMidiOutputPort.cpp',
624 'linux/firewire/JackFFADOMidiReceiveQueue.cpp',
625 'linux/firewire/JackFFADOMidiSendQueue.cpp'
629 'linux/iio/JackIIODriver.cpp'
634 'solaris/oss/JackOSSDriver.cpp'
638 'windows/portaudio/JackPortAudioDevices.cpp',
639 'windows/portaudio/JackPortAudioDriver.cpp',
643 'windows/winmme/JackWinMMEDriver.cpp',
644 'windows/winmme/JackWinMMEInputPort.cpp',
645 'windows/winmme/JackWinMMEOutputPort.cpp',
646 'windows/winmme/JackWinMMEPort.cpp',
649 # Create non-hardware driver objects. Lexically sorted.
658 source = loopback_src)
669 use = ['SAMPLERATE', 'CELT'])
676 # Create hardware driver objects. Lexically sorted after the conditional,
677 # e.g. BUILD_DRIVER_ALSA.
678 if bld.env['BUILD_DRIVER_ALSA']:
686 target = 'alsarawmidi',
687 source = alsarawmidi_src,
690 if bld.env['BUILD_DRIVER_FFADO']:
697 if bld.env['BUILD_DRIVER_IIO']:
702 use = ['GTKIOSTREAM', 'EIGEN3'])
704 if bld.env['BUILD_DRIVER_PORTAUDIO']:
707 target = 'portaudio',
708 source = portaudio_src,
711 if bld.env['BUILD_DRIVER_WINMME']:
718 if bld.env['IS_MACOSX']:
721 target = 'coreaudio',
722 source = coreaudio_src,
724 framework = ['AudioUnit', 'CoreAudio', 'CoreServices'])
729 source = coremidi_src,
730 use = ['serverlib'], # FIXME: Is this needed?
731 framework = ['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
733 if bld.env['IS_SUN']:
744 if not bld.variant and bld.env['BUILD_WITH_32_64']:
745 Options.commands.append(bld.cmd + '_' + lib32)
747 # process subfolders from here
748 bld.recurse('common')
751 # only the wscript in common/ knows how to handle variants
754 bld.recurse('compat')
756 if not os.access('svnversion.h', os.R_OK):
758 sg = Utils.h_file(self.outputs[0].abspath(self.env))
759 #print sg.encode('hex')
760 Build.bld.node_sigs[self.env.variant()][self.outputs[0].id] = sg
762 script = bld.path.find_resource('svnversion_regenerate.sh')
763 script = script.abspath()
766 rule = '%s ${TGT}' % script,
768 runnable_status = Task.RUN_ME,
772 source = ['svnversion_regenerate.sh'],
773 target = [bld.path.find_or_declare('svnversion.h')]
776 if bld.env['BUILD_JACKD']:
781 bld.recurse('example-clients')
782 if bld.env['IS_LINUX']:
784 bld.recurse('systemd')
785 if not bld.env['IS_WINDOWS']:
787 if bld.env['BUILD_JACKDBUS']:
790 if bld.env['BUILD_DOXYGEN_DOCS']:
791 html_build_dir = bld.path.find_or_declare('html').abspath()
795 source = 'doxyfile.in',
797 HTML_BUILD_DIR = html_build_dir,
798 SRCDIR = bld.srcnode.abspath(),
802 # There are two reasons for logging to doxygen.log and using it as
803 # target in the build rule (rather than html_build_dir):
804 # (1) reduce the noise when running the build
805 # (2) waf has a regular file to check for a timestamp. If the directory
806 # is used instead waf will rebuild the doxygen target (even upon
809 doxyfile = task.inputs[0].abspath()
810 logfile = task.outputs[0].abspath()
811 cmd = '%s %s &> %s' % (task.env['DOXYGEN'][0], doxyfile, logfile)
812 return task.exec_command(cmd)
817 target = 'doxygen.log'
820 # Determine where to install HTML documentation. Since share_dir is the
821 # highest directory the uninstall routine should remove, there is no
822 # better candidate for share_dir, but the requested HTML directory if
823 # --htmldir is given.
824 if bld.env['HTMLDIR']:
825 html_install_dir = bld.options.destdir + bld.env['HTMLDIR']
826 share_dir = html_install_dir
828 share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
829 html_install_dir = share_dir + '/reference/html/'
831 if bld.cmd == 'install':
832 if os.path.isdir(html_install_dir):
833 Logs.pprint('CYAN', 'Removing old doxygen documentation installation...')
834 shutil.rmtree(html_install_dir)
835 Logs.pprint('CYAN', 'Removing old doxygen documentation installation done.')
836 Logs.pprint('CYAN', 'Installing doxygen documentation...')
837 shutil.copytree(html_build_dir, html_install_dir)
838 Logs.pprint('CYAN', 'Installing doxygen documentation done.')
839 elif bld.cmd =='uninstall':
840 Logs.pprint('CYAN', 'Uninstalling doxygen documentation...')
841 if os.path.isdir(share_dir):
842 shutil.rmtree(share_dir)
843 Logs.pprint('CYAN', 'Uninstalling doxygen documentation done.')
844 elif bld.cmd =='clean':
845 if os.access(html_build_dir, os.R_OK):
846 Logs.pprint('CYAN', 'Removing doxygen generated documentation...')
847 shutil.rmtree(html_build_dir)
848 Logs.pprint('CYAN', 'Removing doxygen generated documentation done.')
851 # This code blindly assumes it is working in the toplevel source directory.
852 if not os.path.exists('svnversion.h'):
853 os.system('./svnversion_regenerate.sh svnversion.h')
855 from waflib import TaskGen
856 @TaskGen.extension('.mm')
857 def mm_hook(self, node):
858 """Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
859 return self.create_compiled_task('cxx', node)