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=True, help='Enable D-Bus JACK (jackdbus)')
103 help='Autostart method. Possible values: "none", "dbus", "classic", "default" (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 conf.env['AUTOSTART_METHOD'] = 'none'
413 conf.env['AUTOSTART_METHOD'] = Options.options.autostart
415 if conf.env['AUTOSTART_METHOD'] == 'dbus' and not conf.env['BUILD_JACKDBUS']:
416 conf.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
417 if conf.env['AUTOSTART_METHOD'] == 'classic' and not conf.env['BUILD_JACKD']:
418 conf.fatal('Classic autostart mode was specified but jackd will not be built')
420 if conf.env['AUTOSTART_METHOD'] == 'dbus':
421 conf.define('USE_LIBDBUS_AUTOLAUNCH', 1)
422 elif conf.env['AUTOSTART_METHOD'] == 'classic':
423 conf.define('USE_CLASSIC_AUTOLAUNCH', 1)
425 conf.define('CLIENT_NUM', Options.options.clients)
426 conf.define('PORT_NUM_FOR_CLIENT', Options.options.application_ports)
428 if conf.env['IS_WINDOWS']:
429 # we define this in the environment to maintain compatibility with
430 # existing install paths that use ADDON_DIR rather than have to
431 # have special cases for windows each time.
432 conf.env['ADDON_DIR'] = conf.env['LIBDIR'] + '/jack'
433 if Options.options.platform in ('msys', 'win32'):
434 conf.define('ADDON_DIR', 'jack')
435 conf.define('__STDC_FORMAT_MACROS', 1) # for PRIu64
437 # don't define ADDON_DIR in config.h, use the default 'jack'
438 # defined in windows/JackPlatformPlug_os.h
441 conf.env['ADDON_DIR'] = os.path.normpath(os.path.join(conf.env['LIBDIR'], 'jack'))
442 conf.define('ADDON_DIR', conf.env['ADDON_DIR'])
443 conf.define('JACK_LOCATION', os.path.normpath(os.path.join(conf.env['PREFIX'], 'bin')))
445 if not conf.env['IS_WINDOWS']:
446 conf.define('USE_POSIX_SHM', 1)
447 conf.define('JACKMP', 1)
448 if conf.env['BUILD_JACKDBUS']:
449 conf.define('JACK_DBUS', 1)
450 if conf.env['BUILD_WITH_PROFILE']:
451 conf.define('JACK_MONITOR', 1)
452 conf.write_config_header('config.h', remove=False)
454 if Options.options.mixed:
455 conf.setenv(lib32, env=conf.env.derive())
456 conf.env.append_unique('CFLAGS', '-m32')
457 conf.env.append_unique('CXXFLAGS', '-m32')
458 conf.env.append_unique('CXXFLAGS', '-DBUILD_WITH_32_64')
459 conf.env.append_unique('LINKFLAGS', '-m32')
460 if Options.options.libdir32:
461 conf.env['LIBDIR'] = Options.options.libdir32
463 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32'
465 if conf.env['IS_WINDOWS'] and conf.env['BUILD_STATIC']:
466 def replaceFor32bit(env):
468 yield e.replace('x86_64', 'i686', 1)
469 for env in ('AR', 'CC', 'CXX', 'LINK_CC', 'LINK_CXX'):
470 conf.all_envs[lib32][env] = list(replaceFor32bit(conf.all_envs[lib32][env]))
471 conf.all_envs[lib32]['LIB_REGEX'] = ['tre32']
473 # libdb does not work in mixed mode
474 conf.all_envs[lib32]['HAVE_DB'] = 0
475 conf.all_envs[lib32]['HAVE_DB_H'] = 0
476 conf.all_envs[lib32]['LIB_DB'] = []
477 # no need for opus in 32bit mixed mode clients
478 conf.all_envs[lib32]['LIB_OPUS'] = []
479 # someone tell me where this file gets written please..
480 conf.write_config_header('config.h')
483 print('LADI JACK ' + VERSION)
485 conf.msg('Maximum JACK clients', Options.options.clients, color='NORMAL')
486 conf.msg('Maximum ports per application', Options.options.application_ports, color='NORMAL')
488 conf.msg('Install prefix', conf.env['PREFIX'], color='CYAN')
489 conf.msg('Library directory', conf.all_envs['']['LIBDIR'], color='CYAN')
490 if conf.env['BUILD_WITH_32_64']:
491 conf.msg('32-bit library directory', conf.all_envs[lib32]['LIBDIR'], color='CYAN')
492 conf.msg('Drivers directory', conf.env['ADDON_DIR'], color='CYAN')
493 display_feature(conf, 'Build debuggable binaries', conf.env['BUILD_DEBUG'])
496 ('C compiler flags', ['CFLAGS', 'CPPFLAGS']),
497 ('C++ compiler flags', ['CXXFLAGS', 'CPPFLAGS']),
498 ('Linker flags', ['LINKFLAGS', 'LDFLAGS'])
500 for name, vars in tool_flags:
503 flags += conf.all_envs[''][var]
504 conf.msg(name, repr(flags), color='NORMAL')
506 if conf.env['BUILD_WITH_32_64']:
507 conf.msg('32-bit C compiler flags', repr(conf.all_envs[lib32]['CFLAGS']))
508 conf.msg('32-bit C++ compiler flags', repr(conf.all_envs[lib32]['CXXFLAGS']))
509 conf.msg('32-bit linker flags', repr(conf.all_envs[lib32]['LINKFLAGS']))
510 display_feature(conf, 'Build with engine profiling', conf.env['BUILD_WITH_PROFILE'])
511 display_feature(conf, 'Build with 32/64 bits mixed mode', conf.env['BUILD_WITH_32_64'])
513 display_feature(conf, 'Build standard JACK (jackd)', conf.env['BUILD_JACKD'])
514 display_feature(conf, 'Build D-Bus JACK (jackdbus)', conf.env['BUILD_JACKDBUS'])
515 conf.msg('Autostart method', conf.env['AUTOSTART_METHOD'])
517 if conf.env['BUILD_JACKDBUS'] and conf.env['BUILD_JACKD']:
518 print(Logs.colors.RED + 'WARNING !! mixing both jackd and jackdbus may cause issues:' + Logs.colors.NORMAL)
519 print(Logs.colors.RED + 'WARNING !! jackdbus does not use .jackdrc nor qjackctl settings' + Logs.colors.NORMAL)
521 conf.summarize_auto_options()
523 if conf.env['BUILD_JACKDBUS']:
524 conf.msg('D-Bus service install directory', conf.env['DBUS_SERVICES_DIR'], color='CYAN')
526 if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
528 print(Logs.colors.RED + 'WARNING: D-Bus session services directory as reported by pkg-config is')
529 print(Logs.colors.RED + 'WARNING:', end=' ')
530 print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR_REAL'])
531 print(Logs.colors.RED + 'WARNING: but service file will be installed in')
532 print(Logs.colors.RED + 'WARNING:', end=' ')
533 print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR'])
535 Logs.colors.RED + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus'
537 print('WARNING: You can override dbus service install directory')
538 print('WARNING: with --enable-pkg-config-dbus-service-dir option to this script')
539 print(Logs.colors.NORMAL, end=' ')
544 for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
545 name = y.__name__.replace('Context', '').lower()
548 cmd = name + '_' + lib32
552 def obj_add_includes(bld, obj):
553 if bld.env['BUILD_JACKDBUS']:
554 obj.includes += ['dbus']
556 if bld.env['IS_LINUX']:
557 obj.includes += ['linux', 'posix']
559 if bld.env['IS_FREEBSD']:
560 obj.includes += ['freebsd', 'posix']
562 if bld.env['IS_MACOSX']:
563 obj.includes += ['macosx', 'posix']
565 if bld.env['IS_SUN']:
566 obj.includes += ['posix', 'solaris']
568 if bld.env['IS_WINDOWS']:
569 obj.includes += ['windows']
572 # FIXME: Is SERVER_SIDE needed?
573 def build_jackd(bld):
575 features=['cxx', 'cxxprogram'],
576 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
577 includes=['.', 'common', 'common/jack'],
579 source=['common/Jackdmp.cpp'],
580 use=['serverlib', 'SYSTEMD']
583 if bld.env['BUILD_JACKDBUS']:
584 jackd.source += ['dbus/audio_reserve.c', 'dbus/reserve.c']
585 jackd.use += ['DBUS-1']
587 if bld.env['IS_LINUX']:
588 jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
590 if bld.env['IS_FREEBSD']:
591 jackd.use += ['M', 'PTHREAD']
593 if bld.env['IS_MACOSX']:
594 jackd.use += ['DL', 'PTHREAD']
595 jackd.framework = ['CoreFoundation']
597 if bld.env['IS_SUN']:
598 jackd.use += ['DL', 'PTHREAD']
600 obj_add_includes(bld, jackd)
605 # FIXME: Is SERVER_SIDE needed?
606 def create_driver_obj(bld, **kw):
608 kw['use'] += ['serverlib']
610 kw['use'] = ['serverlib']
613 features=['c', 'cxx', 'cshlib', 'cxxshlib'],
614 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
615 includes=['.', 'common', 'common/jack'],
616 install_path='${ADDON_DIR}/',
619 if bld.env['IS_WINDOWS']:
620 driver.env['cxxshlib_PATTERN'] = 'jack_%s.dll'
622 driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
624 obj_add_includes(bld, driver)
629 def build_drivers(bld):
630 # Non-hardware driver sources. Lexically sorted.
632 'common/JackDummyDriver.cpp'
636 'common/JackLoopbackDriver.cpp'
640 'common/JackNetDriver.cpp'
644 'common/JackNetOneDriver.cpp',
646 'common/netjack_packet.c'
650 'common/JackProxyDriver.cpp'
653 # Hardware driver sources. Lexically sorted.
656 'linux/alsa/JackAlsaDriver.cpp',
657 'linux/alsa/alsa_rawmidi.c',
658 'linux/alsa/alsa_seqmidi.c',
659 'linux/alsa/alsa_midi_jackmp.cpp',
660 'linux/alsa/generic_hw.c',
662 'linux/alsa/alsa_driver.c',
663 'linux/alsa/hammerfall.c',
664 'linux/alsa/ice1712.c'
668 'linux/alsarawmidi/JackALSARawMidiDriver.cpp',
669 'linux/alsarawmidi/JackALSARawMidiInputPort.cpp',
670 'linux/alsarawmidi/JackALSARawMidiOutputPort.cpp',
671 'linux/alsarawmidi/JackALSARawMidiPort.cpp',
672 'linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
673 'linux/alsarawmidi/JackALSARawMidiSendQueue.cpp',
674 'linux/alsarawmidi/JackALSARawMidiUtil.cpp'
679 'solaris/oss/JackBoomerDriver.cpp'
683 'macosx/coreaudio/JackCoreAudioDriver.mm',
684 'common/JackAC3Encoder.cpp'
688 'macosx/coremidi/JackCoreMidiInputPort.mm',
689 'macosx/coremidi/JackCoreMidiOutputPort.mm',
690 'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
691 'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
692 'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
693 'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
694 'macosx/coremidi/JackCoreMidiPort.mm',
695 'macosx/coremidi/JackCoreMidiUtil.mm',
696 'macosx/coremidi/JackCoreMidiDriver.mm'
700 'linux/firewire/JackFFADODriver.cpp',
701 'linux/firewire/JackFFADOMidiInputPort.cpp',
702 'linux/firewire/JackFFADOMidiOutputPort.cpp',
703 'linux/firewire/JackFFADOMidiReceiveQueue.cpp',
704 'linux/firewire/JackFFADOMidiSendQueue.cpp'
709 'freebsd/oss/JackOSSDriver.cpp'
713 'linux/iio/JackIIODriver.cpp'
718 'solaris/oss/JackOSSDriver.cpp'
722 'windows/portaudio/JackPortAudioDevices.cpp',
723 'windows/portaudio/JackPortAudioDriver.cpp',
727 'windows/winmme/JackWinMMEDriver.cpp',
728 'windows/winmme/JackWinMMEInputPort.cpp',
729 'windows/winmme/JackWinMMEOutputPort.cpp',
730 'windows/winmme/JackWinMMEPort.cpp',
733 # Create non-hardware driver objects. Lexically sorted.
754 use=['SAMPLERATE', 'CELT'])
761 # Create hardware driver objects. Lexically sorted after the conditional,
762 # e.g. BUILD_DRIVER_ALSA.
763 if bld.env['BUILD_DRIVER_ALSA']:
771 target='alsarawmidi',
772 source=alsarawmidi_src,
775 if bld.env['BUILD_DRIVER_FFADO']:
782 if bld.env['BUILD_DRIVER_IIO']:
786 source=iio_driver_src,
787 use=['GTKIOSTREAM', 'EIGEN3'])
789 if bld.env['BUILD_DRIVER_PORTAUDIO']:
793 source=portaudio_src,
796 if bld.env['BUILD_DRIVER_WINMME']:
803 if bld.env['IS_MACOSX']:
807 source=coreaudio_src,
809 framework=['AudioUnit', 'CoreAudio', 'CoreServices'])
815 use=['serverlib'], # FIXME: Is this needed?
816 framework=['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
818 if bld.env['IS_FREEBSD']:
822 source=freebsd_oss_src)
824 if bld.env['IS_SUN']:
836 if not bld.variant and bld.env['BUILD_WITH_32_64']:
837 Options.commands.append(bld.cmd + '_' + lib32)
839 # process subfolders from here
840 bld.recurse('common')
843 # only the wscript in common/ knows how to handle variants
846 bld.recurse('compat')
848 if bld.env['BUILD_JACKD']:
853 if bld.env['BUILD_JACK_EXAMPLE_TOOLS']:
854 bld.recurse('example-clients')
857 if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
859 bld.recurse('systemd')
860 if not bld.env['IS_WINDOWS'] and bld.env['BUILD_JACK_EXAMPLE_TOOLS']:
862 if bld.env['BUILD_JACKDBUS']:
865 if bld.env['BUILD_DOXYGEN_DOCS']:
866 html_build_dir = bld.path.find_or_declare('html').abspath()
870 source='doxyfile.in',
872 HTML_BUILD_DIR=html_build_dir,
873 SRCDIR=bld.srcnode.abspath(),
877 # There are two reasons for logging to doxygen.log and using it as
878 # target in the build rule (rather than html_build_dir):
879 # (1) reduce the noise when running the build
880 # (2) waf has a regular file to check for a timestamp. If the directory
881 # is used instead waf will rebuild the doxygen target (even upon
884 doxyfile = task.inputs[0].abspath()
885 logfile = task.outputs[0].abspath()
886 cmd = '%s %s &> %s' % (task.env['DOXYGEN'][0], doxyfile, logfile)
887 return task.exec_command(cmd)
895 # Determine where to install HTML documentation. Since share_dir is the
896 # highest directory the uninstall routine should remove, there is no
897 # better candidate for share_dir, but the requested HTML directory if
898 # --htmldir is given.
899 if bld.env['HTMLDIR']:
900 html_install_dir = bld.options.destdir + bld.env['HTMLDIR']
901 share_dir = html_install_dir
903 share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
904 html_install_dir = share_dir + '/reference/html/'
906 if bld.cmd == 'install':
907 if os.path.isdir(html_install_dir):
908 Logs.pprint('CYAN', 'Removing old doxygen documentation installation...')
909 shutil.rmtree(html_install_dir)
910 Logs.pprint('CYAN', 'Removing old doxygen documentation installation done.')
911 Logs.pprint('CYAN', 'Installing doxygen documentation...')
912 shutil.copytree(html_build_dir, html_install_dir)
913 Logs.pprint('CYAN', 'Installing doxygen documentation done.')
914 elif bld.cmd == 'uninstall':
915 Logs.pprint('CYAN', 'Uninstalling doxygen documentation...')
916 if os.path.isdir(share_dir):
917 shutil.rmtree(share_dir)
918 Logs.pprint('CYAN', 'Uninstalling doxygen documentation done.')
919 elif bld.cmd == 'clean':
920 if os.access(html_build_dir, os.R_OK):
921 Logs.pprint('CYAN', 'Removing doxygen generated documentation...')
922 shutil.rmtree(html_build_dir)
923 Logs.pprint('CYAN', 'Removing doxygen generated documentation done.')
926 @TaskGen.extension('.mm')
927 def mm_hook(self, node):
928 """Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
929 return self.create_compiled_task('cxx', node)