3 from __future__ import print_function
9 from waflib import Logs, Options, TaskGen
10 from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext
12 # see also common/JackConstants.h
15 JACK_API_VERSION = '0.1.0'
17 # these variables are mandatory ('/' are converted automatically)
21 # 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')
32 def check_for_celt(conf):
34 for version in ['11', '8', '7', '5']:
35 define = 'HAVE_CELT_API_0_' + version
39 package='celt >= 0.%s.0' % version,
40 args='--cflags --libs')
42 conf.define(define, 1)
44 except conf.errors.ConfigurationError:
46 conf.define(define, 0)
49 raise conf.errors.ConfigurationError
53 # options provided by the modules
54 opt.load('compiler_cxx')
55 opt.load('compiler_c')
56 opt.load('autooptions')
67 help='HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/',
69 opt.add_option('--libdir', type='string', help='Library directory [Default: <prefix>/lib]')
70 opt.add_option('--libdir32', type='string', help='32bit Library directory [Default: <prefix>/lib32]')
71 opt.add_option('--pkgconfigdir', type='string', help='pkg-config file directory [Default: <libdir>/pkgconfig]')
72 opt.add_option('--mandir', type='string', help='Manpage directory [Default: <prefix>/share/man/man1]')
74 # options affecting binaries
79 help='Target platform for cross-compiling, e.g. cygwin or win32',
81 opt.add_option('--mixed', action='store_true', default=False, help='Build with 32/64 bits mixed mode')
82 opt.add_option('--debug', action='store_true', default=False, dest='debug', help='Build debuggable binaries')
88 help='Build static binaries (Windows only)',
91 # options affecting general jack functionality
96 help='Force enable standard JACK (jackd) even if D-Bus JACK (jackdbus) is enabled too',
98 opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)')
103 help='Autostart method. Possible values: "default", "classic", "dbus", "none"',
105 opt.add_option('--profile', action='store_true', default=False, help='Build with engine profiling')
106 opt.add_option('--clients', default=256, type='int', dest='clients', help='Maximum number of JACK clients')
108 '--ports-per-application',
111 dest='application_ports',
112 help='Maximum number of ports per application',
114 opt.add_option('--systemd-unit', action='store_true', default=False, help='Install systemd units.')
116 opt.set_auto_options_define('HAVE_%s')
117 opt.set_auto_options_style('yesno_and_hack')
119 # options with third party dependencies
120 doxygen = opt.add_auto_option(
122 help='Build doxygen documentation',
123 conf_dest='BUILD_DOXYGEN_DOCS',
125 doxygen.find_program('doxygen')
126 alsa = opt.add_auto_option(
128 help='Enable ALSA driver',
129 conf_dest='BUILD_DRIVER_ALSA')
131 package='alsa >= 1.0.18',
132 args='--cflags --libs')
133 firewire = opt.add_auto_option(
135 help='Enable FireWire driver (FFADO)',
136 conf_dest='BUILD_DRIVER_FFADO')
138 package='libffado >= 1.999.17',
139 args='--cflags --libs')
140 iio = opt.add_auto_option(
142 help='Enable IIO driver',
143 conf_dest='BUILD_DRIVER_IIO')
145 package='gtkIOStream >= 1.4.0',
146 args='--cflags --libs')
148 package='eigen3 >= 3.1.2',
149 args='--cflags --libs')
150 portaudio = opt.add_auto_option(
152 help='Enable Portaudio driver',
153 conf_dest='BUILD_DRIVER_PORTAUDIO')
154 portaudio.check(header_name='windows.h') # only build portaudio on windows
156 package='portaudio-2.0 >= 19',
157 uselib_store='PORTAUDIO',
158 args='--cflags --libs')
159 winmme = opt.add_auto_option(
161 help='Enable WinMME driver',
162 conf_dest='BUILD_DRIVER_WINMME')
164 header_name=['windows.h', 'mmsystem.h'],
165 msg='Checking for header mmsystem.h')
167 celt = opt.add_auto_option(
169 help='Build with CELT')
170 celt.add_function(check_for_celt)
173 help='Build with jack-example-tools',
174 conf_dest='BUILD_JACK_EXAMPLE_TOOLS',
178 # Suffix _PKG to not collide with HAVE_OPUS defined by the option.
179 opus = opt.add_auto_option(
181 help='Build Opus netjack2')
182 opus.check(header_name='opus/opus_custom.h')
184 package='opus >= 0.9.0',
185 args='--cflags --libs',
186 define_name='HAVE_OPUS_PKG')
188 samplerate = opt.add_auto_option(
190 help='Build with libsamplerate')
191 samplerate.check_cfg(
192 package='samplerate',
193 args='--cflags --libs')
194 sndfile = opt.add_auto_option(
196 help='Build with libsndfile')
199 args='--cflags --libs')
200 readline = opt.add_auto_option(
202 help='Build with readline')
203 readline.check(lib='readline')
205 header_name=['stdio.h', 'readline/readline.h'],
206 msg='Checking for header readline/readline.h')
207 sd = opt.add_auto_option(
209 help='Use systemd notify')
210 sd.check(header_name='systemd/sd-daemon.h')
211 sd.check(lib='systemd')
212 db = opt.add_auto_option(
214 help='Use Berkeley DB (metadata)')
215 db.check(header_name='db.h')
217 zalsa = opt.add_auto_option(
219 help='Build internal zita-a2j/j2a client')
220 zalsa.check(lib='zita-alsa-pcmi')
221 zalsa.check(lib='zita-resampler')
226 # this must be called before the configure phase
227 opt.apply_auto_options_hack()
230 def detect_platform(conf):
231 # GNU/kFreeBSD and GNU/Hurd are treated as Linux
233 # ('KEY, 'Human readable name', ['strings', 'to', 'check', 'for'])
234 ('IS_LINUX', 'Linux', ['gnu0', 'gnukfreebsd', 'linux', 'posix']),
235 ('IS_FREEBSD', 'FreeBSD', ['freebsd']),
236 ('IS_MACOSX', 'MacOS X', ['darwin']),
237 ('IS_SUN', 'SunOS', ['sunos']),
238 ('IS_WINDOWS', 'Windows', ['cygwin', 'msys', 'win32'])
241 for key, name, strings in platforms:
242 conf.env[key] = False
244 conf.start_msg('Checking platform')
245 platform = Options.options.platform
246 for key, name, strings in platforms:
248 if platform.startswith(s):
250 conf.end_msg(name, color='CYAN')
255 conf.load('compiler_cxx')
256 conf.load('compiler_c')
258 detect_platform(conf)
260 if conf.env['IS_WINDOWS']:
261 conf.env.append_unique('CCDEFINES', '_POSIX')
262 conf.env.append_unique('CXXDEFINES', '_POSIX')
263 if Options.options.platform in ('msys', 'win32'):
264 conf.env.append_value('INCLUDES', ['/mingw64/include'])
266 header_name='pa_asio.h',
267 msg='Checking for PortAudio ASIO support',
268 define_name='HAVE_ASIO',
271 conf.env.append_unique('CFLAGS', '-Wall')
272 conf.env.append_unique('CXXFLAGS', ['-Wall', '-Wno-invalid-offsetof'])
273 conf.env.append_unique('CXXFLAGS', '-std=gnu++11')
275 if conf.env['IS_FREEBSD']:
276 conf.check(lib='execinfo', uselib='EXECINFO', define_name='EXECINFO')
277 conf.check_cfg(package='libsysinfo', args='--cflags --libs')
279 if not conf.env['IS_MACOSX']:
280 conf.env.append_unique('LDFLAGS', '-Wl,--no-undefined')
282 conf.check(lib='aften', uselib='AFTEN', define_name='AFTEN')
285 + '#include <aften/aften.h>\n'
289 + 'AftenContext fAftenContext;\n'
290 + 'aften_set_defaults(&fAftenContext);\n'
291 + 'unsigned char *fb;\n'
292 + 'float *buf=new float[10];\n'
293 + 'int res = aften_encode_frame(&fAftenContext, fb, buf, 1);\n'
296 msg='Checking for aften_encode_frame()',
297 define_name='HAVE_AFTEN_NEW_API',
301 conf.env.append_unique('CXXFLAGS', '-Wno-deprecated-register')
303 conf.load('autooptions')
305 conf.recurse('compat')
307 # Check for functions.
310 + '#define _GNU_SOURCE\n'
311 + '#include <poll.h>\n'
312 + '#include <signal.h>\n'
313 + '#include <stddef.h>\n'
317 + ' ppoll(NULL, 0, NULL, NULL);\n'
319 msg='Checking for ppoll',
320 define_name='HAVE_PPOLL',
323 # Check for backtrace support
325 header_name='execinfo.h',
326 define_name='HAVE_EXECINFO_H',
329 conf.recurse('common')
330 if Options.options.dbus:
332 if not conf.env['BUILD_JACKDBUS']:
333 conf.fatal('jackdbus was explicitly requested but cannot be built')
334 if conf.env['IS_LINUX']:
335 if Options.options.systemd_unit:
336 conf.recurse('systemd')
338 conf.env['SYSTEMD_USER_UNIT_DIR'] = None
340 if conf.env['BUILD_JACK_EXAMPLE_TOOLS']:
341 conf.recurse('example-clients')
342 conf.recurse('tools')
344 # test for the availability of ucontext, and how it should be used
345 for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
346 fragment = '#include <ucontext.h>\n'
347 fragment += 'int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }' % t
348 confvar = 'HAVE_UCONTEXT_%s' % t.upper()
349 conf.check_cc(fragment=fragment, define_name=confvar, mandatory=False,
350 msg='Checking for ucontext->uc_mcontext.%s' % t)
351 if conf.is_defined(confvar):
352 conf.define('HAVE_UCONTEXT', 1)
354 fragment = '#include <ucontext.h>\n'
355 fragment += 'int main() { return NGREG; }'
356 conf.check_cc(fragment=fragment, define_name='HAVE_NGREG', mandatory=False,
357 msg='Checking for NGREG')
359 conf.env['LIB_PTHREAD'] = ['pthread']
360 conf.env['LIB_DL'] = ['dl']
361 conf.env['LIB_RT'] = ['rt']
362 conf.env['LIB_M'] = ['m']
363 conf.env['LIB_STDC++'] = ['stdc++']
364 conf.env['JACK_API_VERSION'] = JACK_API_VERSION
365 conf.env['JACK_VERSION'] = VERSION
367 conf.env['BUILD_WITH_PROFILE'] = Options.options.profile
368 conf.env['BUILD_WITH_32_64'] = Options.options.mixed
369 conf.env['BUILD_CLASSIC'] = Options.options.classic
370 conf.env['BUILD_DEBUG'] = Options.options.debug
371 conf.env['BUILD_STATIC'] = Options.options.static
373 if conf.env['BUILD_JACKDBUS']:
374 conf.env['BUILD_JACKD'] = conf.env['BUILD_CLASSIC']
376 conf.env['BUILD_JACKD'] = True
378 conf.env['BINDIR'] = conf.env['PREFIX'] + '/bin'
380 if Options.options.htmldir:
381 conf.env['HTMLDIR'] = Options.options.htmldir
383 # set to None here so that the doxygen code can find out the highest
384 # directory to remove upon install
385 conf.env['HTMLDIR'] = None
387 if Options.options.libdir:
388 conf.env['LIBDIR'] = Options.options.libdir
390 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib'
392 if Options.options.pkgconfigdir:
393 conf.env['PKGCONFDIR'] = Options.options.pkgconfigdir
395 conf.env['PKGCONFDIR'] = conf.env['LIBDIR'] + '/pkgconfig'
397 if Options.options.mandir:
398 conf.env['MANDIR'] = Options.options.mandir
400 conf.env['MANDIR'] = conf.env['PREFIX'] + '/share/man/man1'
402 if conf.env['BUILD_DEBUG']:
403 conf.env.append_unique('CXXFLAGS', '-g')
404 conf.env.append_unique('CFLAGS', '-g')
405 conf.env.append_unique('LINKFLAGS', '-g')
407 if Options.options.autostart not in ['default', 'classic', 'dbus', 'none']:
408 conf.fatal('Invalid autostart value "' + Options.options.autostart + '"')
410 if Options.options.autostart == 'default':
411 if conf.env['BUILD_JACKD']:
412 conf.env['AUTOSTART_METHOD'] = 'classic'
414 conf.env['AUTOSTART_METHOD'] = 'dbus'
416 conf.env['AUTOSTART_METHOD'] = Options.options.autostart
418 if conf.env['AUTOSTART_METHOD'] == 'dbus' and not conf.env['BUILD_JACKDBUS']:
419 conf.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
420 if conf.env['AUTOSTART_METHOD'] == 'classic' and not conf.env['BUILD_JACKD']:
421 conf.fatal('Classic autostart mode was specified but jackd will not be built')
423 if conf.env['AUTOSTART_METHOD'] == 'dbus':
424 conf.define('USE_LIBDBUS_AUTOLAUNCH', 1)
425 elif conf.env['AUTOSTART_METHOD'] == 'classic':
426 conf.define('USE_CLASSIC_AUTOLAUNCH', 1)
428 conf.define('CLIENT_NUM', Options.options.clients)
429 conf.define('PORT_NUM_FOR_CLIENT', Options.options.application_ports)
431 if conf.env['IS_WINDOWS']:
432 # we define this in the environment to maintain compatibility with
433 # existing install paths that use ADDON_DIR rather than have to
434 # have special cases for windows each time.
435 conf.env['ADDON_DIR'] = conf.env['LIBDIR'] + '/jack'
436 if Options.options.platform in ('msys', 'win32'):
437 conf.define('ADDON_DIR', 'jack')
438 conf.define('__STDC_FORMAT_MACROS', 1) # for PRIu64
440 # don't define ADDON_DIR in config.h, use the default 'jack'
441 # defined in windows/JackPlatformPlug_os.h
444 conf.env['ADDON_DIR'] = os.path.normpath(os.path.join(conf.env['LIBDIR'], 'jack'))
445 conf.define('ADDON_DIR', conf.env['ADDON_DIR'])
446 conf.define('JACK_LOCATION', os.path.normpath(os.path.join(conf.env['PREFIX'], 'bin')))
448 if not conf.env['IS_WINDOWS']:
449 conf.define('USE_POSIX_SHM', 1)
450 conf.define('JACKMP', 1)
451 if conf.env['BUILD_JACKDBUS']:
452 conf.define('JACK_DBUS', 1)
453 if conf.env['BUILD_WITH_PROFILE']:
454 conf.define('JACK_MONITOR', 1)
455 conf.write_config_header('config.h', remove=False)
457 if Options.options.mixed:
458 conf.setenv(lib32, env=conf.env.derive())
459 conf.env.append_unique('CFLAGS', '-m32')
460 conf.env.append_unique('CXXFLAGS', '-m32')
461 conf.env.append_unique('CXXFLAGS', '-DBUILD_WITH_32_64')
462 conf.env.append_unique('LINKFLAGS', '-m32')
463 if Options.options.libdir32:
464 conf.env['LIBDIR'] = Options.options.libdir32
466 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32'
468 if conf.env['IS_WINDOWS'] and conf.env['BUILD_STATIC']:
469 def replaceFor32bit(env):
471 yield e.replace('x86_64', 'i686', 1)
472 for env in ('AR', 'CC', 'CXX', 'LINK_CC', 'LINK_CXX'):
473 conf.all_envs[lib32][env] = list(replaceFor32bit(conf.all_envs[lib32][env]))
474 conf.all_envs[lib32]['LIB_REGEX'] = ['tre32']
476 # libdb does not work in mixed mode
477 conf.all_envs[lib32]['HAVE_DB'] = 0
478 conf.all_envs[lib32]['HAVE_DB_H'] = 0
479 conf.all_envs[lib32]['LIB_DB'] = []
480 # no need for opus in 32bit mixed mode clients
481 conf.all_envs[lib32]['LIB_OPUS'] = []
482 # someone tell me where this file gets written please..
483 conf.write_config_header('config.h')
486 print('JACK ' + VERSION)
488 conf.msg('Maximum JACK clients', Options.options.clients, color='NORMAL')
489 conf.msg('Maximum ports per application', Options.options.application_ports, color='NORMAL')
491 conf.msg('Install prefix', conf.env['PREFIX'], color='CYAN')
492 conf.msg('Library directory', conf.all_envs['']['LIBDIR'], color='CYAN')
493 if conf.env['BUILD_WITH_32_64']:
494 conf.msg('32-bit library directory', conf.all_envs[lib32]['LIBDIR'], color='CYAN')
495 conf.msg('Drivers directory', conf.env['ADDON_DIR'], color='CYAN')
496 display_feature(conf, 'Build debuggable binaries', conf.env['BUILD_DEBUG'])
499 ('C compiler flags', ['CFLAGS', 'CPPFLAGS']),
500 ('C++ compiler flags', ['CXXFLAGS', 'CPPFLAGS']),
501 ('Linker flags', ['LINKFLAGS', 'LDFLAGS'])
503 for name, vars in tool_flags:
506 flags += conf.all_envs[''][var]
507 conf.msg(name, repr(flags), color='NORMAL')
509 if conf.env['BUILD_WITH_32_64']:
510 conf.msg('32-bit C compiler flags', repr(conf.all_envs[lib32]['CFLAGS']))
511 conf.msg('32-bit C++ compiler flags', repr(conf.all_envs[lib32]['CXXFLAGS']))
512 conf.msg('32-bit linker flags', repr(conf.all_envs[lib32]['LINKFLAGS']))
513 display_feature(conf, 'Build with engine profiling', conf.env['BUILD_WITH_PROFILE'])
514 display_feature(conf, 'Build with 32/64 bits mixed mode', conf.env['BUILD_WITH_32_64'])
516 display_feature(conf, 'Build standard JACK (jackd)', conf.env['BUILD_JACKD'])
517 display_feature(conf, 'Build D-Bus JACK (jackdbus)', conf.env['BUILD_JACKDBUS'])
518 conf.msg('Autostart method', conf.env['AUTOSTART_METHOD'])
520 if conf.env['BUILD_JACKDBUS'] and conf.env['BUILD_JACKD']:
521 print(Logs.colors.RED + 'WARNING !! mixing both jackd and jackdbus may cause issues:' + Logs.colors.NORMAL)
522 print(Logs.colors.RED + 'WARNING !! jackdbus does not use .jackdrc nor qjackctl settings' + Logs.colors.NORMAL)
524 conf.summarize_auto_options()
526 if conf.env['BUILD_JACKDBUS']:
527 conf.msg('D-Bus service install directory', conf.env['DBUS_SERVICES_DIR'], color='CYAN')
529 if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
531 print(Logs.colors.RED + 'WARNING: D-Bus session services directory as reported by pkg-config is')
532 print(Logs.colors.RED + 'WARNING:', end=' ')
533 print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR_REAL'])
534 print(Logs.colors.RED + 'WARNING: but service file will be installed in')
535 print(Logs.colors.RED + 'WARNING:', end=' ')
536 print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR'])
538 Logs.colors.RED + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus'
540 print('WARNING: You can override dbus service install directory')
541 print('WARNING: with --enable-pkg-config-dbus-service-dir option to this script')
542 print(Logs.colors.NORMAL, end=' ')
547 for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
548 name = y.__name__.replace('Context', '').lower()
551 cmd = name + '_' + lib32
555 def obj_add_includes(bld, obj):
556 if bld.env['BUILD_JACKDBUS']:
557 obj.includes += ['dbus']
559 if bld.env['IS_LINUX']:
560 obj.includes += ['linux', 'posix']
562 if bld.env['IS_FREEBSD']:
563 obj.includes += ['freebsd', 'posix']
565 if bld.env['IS_MACOSX']:
566 obj.includes += ['macosx', 'posix']
568 if bld.env['IS_SUN']:
569 obj.includes += ['posix', 'solaris']
571 if bld.env['IS_WINDOWS']:
572 obj.includes += ['windows']
575 # FIXME: Is SERVER_SIDE needed?
576 def build_jackd(bld):
578 features=['cxx', 'cxxprogram'],
579 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
580 includes=['.', 'common', 'common/jack'],
582 source=['common/Jackdmp.cpp'],
583 use=['serverlib', 'SYSTEMD']
586 if bld.env['BUILD_JACKDBUS']:
587 jackd.source += ['dbus/audio_reserve.c', 'dbus/reserve.c']
588 jackd.use += ['DBUS-1']
590 if bld.env['IS_LINUX']:
591 jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
593 if bld.env['IS_FREEBSD']:
594 jackd.use += ['M', 'PTHREAD']
596 if bld.env['IS_MACOSX']:
597 jackd.use += ['DL', 'PTHREAD']
598 jackd.framework = ['CoreFoundation']
600 if bld.env['IS_SUN']:
601 jackd.use += ['DL', 'PTHREAD']
603 obj_add_includes(bld, jackd)
608 # FIXME: Is SERVER_SIDE needed?
609 def create_driver_obj(bld, **kw):
611 kw['use'] += ['serverlib']
613 kw['use'] = ['serverlib']
616 features=['c', 'cxx', 'cshlib', 'cxxshlib'],
617 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
618 includes=['.', 'common', 'common/jack'],
619 install_path='${ADDON_DIR}/',
622 if bld.env['IS_WINDOWS']:
623 driver.env['cxxshlib_PATTERN'] = 'jack_%s.dll'
625 driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
627 obj_add_includes(bld, driver)
632 def build_drivers(bld):
633 # Non-hardware driver sources. Lexically sorted.
635 'common/JackDummyDriver.cpp'
639 'common/JackLoopbackDriver.cpp'
643 'common/JackNetDriver.cpp'
647 'common/JackNetOneDriver.cpp',
649 'common/netjack_packet.c'
653 'common/JackProxyDriver.cpp'
656 # Hardware driver sources. Lexically sorted.
659 'linux/alsa/JackAlsaDriver.cpp',
660 'linux/alsa/alsa_rawmidi.c',
661 'linux/alsa/alsa_seqmidi.c',
662 'linux/alsa/alsa_midi_jackmp.cpp',
663 'linux/alsa/generic_hw.c',
665 'linux/alsa/alsa_driver.c',
666 'linux/alsa/hammerfall.c',
667 'linux/alsa/ice1712.c'
671 'linux/alsarawmidi/JackALSARawMidiDriver.cpp',
672 'linux/alsarawmidi/JackALSARawMidiInputPort.cpp',
673 'linux/alsarawmidi/JackALSARawMidiOutputPort.cpp',
674 'linux/alsarawmidi/JackALSARawMidiPort.cpp',
675 'linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
676 'linux/alsarawmidi/JackALSARawMidiSendQueue.cpp',
677 'linux/alsarawmidi/JackALSARawMidiUtil.cpp'
682 'solaris/oss/JackBoomerDriver.cpp'
686 'macosx/coreaudio/JackCoreAudioDriver.mm',
687 'common/JackAC3Encoder.cpp'
691 'macosx/coremidi/JackCoreMidiInputPort.mm',
692 'macosx/coremidi/JackCoreMidiOutputPort.mm',
693 'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
694 'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
695 'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
696 'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
697 'macosx/coremidi/JackCoreMidiPort.mm',
698 'macosx/coremidi/JackCoreMidiUtil.mm',
699 'macosx/coremidi/JackCoreMidiDriver.mm'
703 'linux/firewire/JackFFADODriver.cpp',
704 'linux/firewire/JackFFADOMidiInputPort.cpp',
705 'linux/firewire/JackFFADOMidiOutputPort.cpp',
706 'linux/firewire/JackFFADOMidiReceiveQueue.cpp',
707 'linux/firewire/JackFFADOMidiSendQueue.cpp'
712 'freebsd/oss/JackOSSDriver.cpp'
716 'linux/iio/JackIIODriver.cpp'
721 'solaris/oss/JackOSSDriver.cpp'
725 'windows/portaudio/JackPortAudioDevices.cpp',
726 'windows/portaudio/JackPortAudioDriver.cpp',
730 'windows/winmme/JackWinMMEDriver.cpp',
731 'windows/winmme/JackWinMMEInputPort.cpp',
732 'windows/winmme/JackWinMMEOutputPort.cpp',
733 'windows/winmme/JackWinMMEPort.cpp',
736 # Create non-hardware driver objects. Lexically sorted.
757 use=['SAMPLERATE', 'CELT'])
764 # Create hardware driver objects. Lexically sorted after the conditional,
765 # e.g. BUILD_DRIVER_ALSA.
766 if bld.env['BUILD_DRIVER_ALSA']:
774 target='alsarawmidi',
775 source=alsarawmidi_src,
778 if bld.env['BUILD_DRIVER_FFADO']:
785 if bld.env['BUILD_DRIVER_IIO']:
789 source=iio_driver_src,
790 use=['GTKIOSTREAM', 'EIGEN3'])
792 if bld.env['BUILD_DRIVER_PORTAUDIO']:
796 source=portaudio_src,
799 if bld.env['BUILD_DRIVER_WINMME']:
806 if bld.env['IS_MACOSX']:
810 source=coreaudio_src,
812 framework=['AudioUnit', 'CoreAudio', 'CoreServices'])
818 use=['serverlib'], # FIXME: Is this needed?
819 framework=['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
821 if bld.env['IS_FREEBSD']:
825 source=freebsd_oss_src)
827 if bld.env['IS_SUN']:
839 if not bld.variant and bld.env['BUILD_WITH_32_64']:
840 Options.commands.append(bld.cmd + '_' + lib32)
842 # process subfolders from here
843 bld.recurse('common')
846 # only the wscript in common/ knows how to handle variants
849 bld.recurse('compat')
851 if bld.env['BUILD_JACKD']:
856 if bld.env['BUILD_JACK_EXAMPLE_TOOLS']:
857 bld.recurse('example-clients')
860 if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
862 bld.recurse('systemd')
863 if not bld.env['IS_WINDOWS'] and bld.env['BUILD_JACK_EXAMPLE_TOOLS']:
865 if bld.env['BUILD_JACKDBUS']:
868 if bld.env['BUILD_DOXYGEN_DOCS']:
869 html_build_dir = bld.path.find_or_declare('html').abspath()
873 source='doxyfile.in',
875 HTML_BUILD_DIR=html_build_dir,
876 SRCDIR=bld.srcnode.abspath(),
880 # There are two reasons for logging to doxygen.log and using it as
881 # target in the build rule (rather than html_build_dir):
882 # (1) reduce the noise when running the build
883 # (2) waf has a regular file to check for a timestamp. If the directory
884 # is used instead waf will rebuild the doxygen target (even upon
887 doxyfile = task.inputs[0].abspath()
888 logfile = task.outputs[0].abspath()
889 cmd = '%s %s &> %s' % (task.env['DOXYGEN'][0], doxyfile, logfile)
890 return task.exec_command(cmd)
898 # Determine where to install HTML documentation. Since share_dir is the
899 # highest directory the uninstall routine should remove, there is no
900 # better candidate for share_dir, but the requested HTML directory if
901 # --htmldir is given.
902 if bld.env['HTMLDIR']:
903 html_install_dir = bld.options.destdir + bld.env['HTMLDIR']
904 share_dir = html_install_dir
906 share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
907 html_install_dir = share_dir + '/reference/html/'
909 if bld.cmd == 'install':
910 if os.path.isdir(html_install_dir):
911 Logs.pprint('CYAN', 'Removing old doxygen documentation installation...')
912 shutil.rmtree(html_install_dir)
913 Logs.pprint('CYAN', 'Removing old doxygen documentation installation done.')
914 Logs.pprint('CYAN', 'Installing doxygen documentation...')
915 shutil.copytree(html_build_dir, html_install_dir)
916 Logs.pprint('CYAN', 'Installing doxygen documentation done.')
917 elif bld.cmd == 'uninstall':
918 Logs.pprint('CYAN', 'Uninstalling doxygen documentation...')
919 if os.path.isdir(share_dir):
920 shutil.rmtree(share_dir)
921 Logs.pprint('CYAN', 'Uninstalling doxygen documentation done.')
922 elif bld.cmd == 'clean':
923 if os.access(html_build_dir, os.R_OK):
924 Logs.pprint('CYAN', 'Removing doxygen generated documentation...')
925 shutil.rmtree(html_build_dir)
926 Logs.pprint('CYAN', 'Removing doxygen generated documentation done.')
929 @TaskGen.extension('.mm')
930 def mm_hook(self, node):
931 """Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
932 return self.create_compiled_task('cxx', node)