4 # Copyright (C) 2015-2018 Karl Linden <karl.j.linden@gmail.com>
5 # Copyleft (C) 2008-2022 Nedko Arnaudov
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 from __future__ import print_function
27 from waflib import Logs, Options, TaskGen
28 from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext
30 # see also common/JackConstants.h
33 JACK_API_VERSION = '0.1.0'
35 # these variables are mandatory ('/' are converted automatically)
39 # lib32 variant name used when building in mixed mode
43 def display_feature(conf, msg, build):
45 conf.msg(msg, 'yes', color='GREEN')
47 conf.msg(msg, 'no', color='YELLOW')
50 def check_for_celt(conf):
52 for version in ['11', '8', '7', '5']:
53 define = 'HAVE_CELT_API_0_' + version
57 package='celt >= 0.%s.0' % version,
58 args='--cflags --libs')
60 conf.define(define, 1)
62 except conf.errors.ConfigurationError:
64 conf.define(define, 0)
67 raise conf.errors.ConfigurationError
71 # options provided by the modules
72 opt.load('compiler_cxx')
73 opt.load('compiler_c')
74 opt.load('autooptions')
85 help='HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/',
87 opt.add_option('--libdir', type='string', help='Library directory [Default: <prefix>/lib]')
88 opt.add_option('--libdir32', type='string', help='32bit Library directory [Default: <prefix>/lib32]')
89 opt.add_option('--pkgconfigdir', type='string', help='pkg-config file directory [Default: <libdir>/pkgconfig]')
90 opt.add_option('--mandir', type='string', help='Manpage directory [Default: <prefix>/share/man/man1]')
92 # options affecting binaries
97 help='Target platform for cross-compiling, e.g. cygwin or win32',
99 opt.add_option('--mixed', action='store_true', default=False, help='Build with 32/64 bits mixed mode')
100 opt.add_option('--debug', action='store_true', default=False, dest='debug', help='Build debuggable binaries')
106 help='Build static binaries (Windows only)',
109 # options affecting general jack functionality
114 help='Force enable standard JACK (jackd)',
118 help='Use device reservation over D-Bus for jackd',
120 conf_dest='BUILD_DBUS_RESERVATION')
125 help='Autostart method. Possible values: "none", "dbus", "classic", "default" (none)',
127 opt.add_option('--profile', action='store_true', default=False, help='Build with engine profiling')
128 opt.add_option('--clients', default=256, type='int', dest='clients', help='Maximum number of JACK clients')
130 '--ports-per-application',
133 dest='application_ports',
134 help='Maximum number of ports per application',
136 opt.add_option('--systemd-unit', action='store_true', default=False, help='Install systemd units.')
138 opt.set_auto_options_define('HAVE_%s')
139 opt.set_auto_options_style('yesno_and_hack')
141 # options with third party dependencies
142 doxygen = opt.add_auto_option(
144 help='Build doxygen documentation',
145 conf_dest='BUILD_DOXYGEN_DOCS',
147 doxygen.find_program('doxygen')
148 alsa = opt.add_auto_option(
150 help='Enable ALSA driver',
151 conf_dest='BUILD_DRIVER_ALSA')
153 package='alsa >= 1.0.18',
154 args='--cflags --libs')
155 firewire = opt.add_auto_option(
157 help='Enable FireWire driver (FFADO)',
158 conf_dest='BUILD_DRIVER_FFADO')
160 package='libffado >= 1.999.17',
161 args='--cflags --libs')
162 iio = opt.add_auto_option(
164 help='Enable IIO driver',
165 conf_dest='BUILD_DRIVER_IIO')
167 package='gtkIOStream >= 1.4.0',
168 args='--cflags --libs')
170 package='eigen3 >= 3.1.2',
171 args='--cflags --libs')
172 portaudio = opt.add_auto_option(
174 help='Enable Portaudio driver',
175 conf_dest='BUILD_DRIVER_PORTAUDIO')
176 portaudio.check(header_name='windows.h') # only build portaudio on windows
178 package='portaudio-2.0 >= 19',
179 uselib_store='PORTAUDIO',
180 args='--cflags --libs')
181 winmme = opt.add_auto_option(
183 help='Enable WinMME driver',
184 conf_dest='BUILD_DRIVER_WINMME')
186 header_name=['windows.h', 'mmsystem.h'],
187 msg='Checking for header mmsystem.h')
189 celt = opt.add_auto_option(
191 help='Build with CELT')
192 celt.add_function(check_for_celt)
195 help='Build with jack-example-tools',
196 conf_dest='BUILD_JACK_EXAMPLE_TOOLS',
200 # Suffix _PKG to not collide with HAVE_OPUS defined by the option.
201 opus = opt.add_auto_option(
203 help='Build Opus netjack2')
204 opus.check(header_name='opus/opus_custom.h')
206 package='opus >= 0.9.0',
207 args='--cflags --libs',
208 define_name='HAVE_OPUS_PKG')
210 samplerate = opt.add_auto_option(
212 help='Build with libsamplerate')
213 samplerate.check_cfg(
214 package='samplerate',
215 args='--cflags --libs')
216 sndfile = opt.add_auto_option(
218 help='Build with libsndfile')
221 args='--cflags --libs')
222 readline = opt.add_auto_option(
224 help='Build with readline')
225 readline.check(lib='readline')
227 header_name=['stdio.h', 'readline/readline.h'],
228 msg='Checking for header readline/readline.h')
229 sd = opt.add_auto_option(
231 help='Use systemd notify')
232 sd.check(header_name='systemd/sd-daemon.h')
233 sd.check(lib='systemd')
234 db = opt.add_auto_option(
236 help='Use Berkeley DB (metadata)')
237 db.check(header_name='db.h')
239 zalsa = opt.add_auto_option(
241 help='Build internal zita-a2j/j2a client')
242 zalsa.check(lib='zita-alsa-pcmi')
243 zalsa.check(lib='zita-resampler')
245 # this must be called before the configure phase
246 opt.apply_auto_options_hack()
249 def detect_platform(conf):
250 # GNU/kFreeBSD and GNU/Hurd are treated as Linux
252 # ('KEY, 'Human readable name', ['strings', 'to', 'check', 'for'])
253 ('IS_LINUX', 'Linux', ['gnu0', 'gnukfreebsd', 'linux', 'posix']),
254 ('IS_FREEBSD', 'FreeBSD', ['freebsd']),
255 ('IS_MACOSX', 'MacOS X', ['darwin']),
256 ('IS_SUN', 'SunOS', ['sunos']),
257 ('IS_WINDOWS', 'Windows', ['cygwin', 'msys', 'win32'])
260 for key, name, strings in platforms:
261 conf.env[key] = False
263 conf.start_msg('Checking platform')
264 platform = Options.options.platform
265 for key, name, strings in platforms:
267 if platform.startswith(s):
269 conf.end_msg(name, color='CYAN')
274 conf.load('compiler_cxx')
275 conf.load('compiler_c')
277 detect_platform(conf)
279 if conf.env['IS_WINDOWS']:
280 conf.env.append_unique('CCDEFINES', '_POSIX')
281 conf.env.append_unique('CXXDEFINES', '_POSIX')
282 if Options.options.platform in ('msys', 'win32'):
283 conf.env.append_value('INCLUDES', ['/mingw64/include'])
285 header_name='pa_asio.h',
286 msg='Checking for PortAudio ASIO support',
287 define_name='HAVE_ASIO',
290 conf.env.append_unique('CFLAGS', '-Wall')
291 conf.env.append_unique('CXXFLAGS', ['-Wall', '-Wno-invalid-offsetof'])
292 conf.env.append_unique('CXXFLAGS', '-std=gnu++11')
294 if conf.env['IS_FREEBSD']:
295 conf.check(lib='execinfo', uselib='EXECINFO', define_name='EXECINFO')
296 conf.check_cfg(package='libsysinfo', args='--cflags --libs')
298 if not conf.env['IS_MACOSX']:
299 conf.env.append_unique('LDFLAGS', '-Wl,--no-undefined')
301 conf.check(lib='aften', uselib='AFTEN', define_name='AFTEN')
304 + '#include <aften/aften.h>\n'
308 + 'AftenContext fAftenContext;\n'
309 + 'aften_set_defaults(&fAftenContext);\n'
310 + 'unsigned char *fb;\n'
311 + 'float *buf=new float[10];\n'
312 + 'int res = aften_encode_frame(&fAftenContext, fb, buf, 1);\n'
315 msg='Checking for aften_encode_frame()',
316 define_name='HAVE_AFTEN_NEW_API',
320 conf.env.append_unique('CXXFLAGS', '-Wno-deprecated-register')
322 conf.load('autooptions')
324 conf.recurse('compat')
326 # Check for functions.
329 + '#define _GNU_SOURCE\n'
330 + '#include <poll.h>\n'
331 + '#include <signal.h>\n'
332 + '#include <stddef.h>\n'
336 + ' ppoll(NULL, 0, NULL, NULL);\n'
338 msg='Checking for ppoll',
339 define_name='HAVE_PPOLL',
342 # Check for backtrace support
344 header_name='execinfo.h',
345 define_name='HAVE_EXECINFO_H',
348 conf.recurse('common')
349 if conf.env['IS_LINUX']:
350 if Options.options.systemd_unit:
351 conf.recurse('systemd')
353 conf.env['SYSTEMD_USER_UNIT_DIR'] = None
355 if conf.env['BUILD_JACK_EXAMPLE_TOOLS']:
356 conf.recurse('example-clients')
357 conf.recurse('tools')
359 # test for the availability of ucontext, and how it should be used
360 for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
361 fragment = '#include <ucontext.h>\n'
362 fragment += 'int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }' % t
363 confvar = 'HAVE_UCONTEXT_%s' % t.upper()
364 conf.check_cc(fragment=fragment, define_name=confvar, mandatory=False,
365 msg='Checking for ucontext->uc_mcontext.%s' % t)
366 if conf.is_defined(confvar):
367 conf.define('HAVE_UCONTEXT', 1)
369 fragment = '#include <ucontext.h>\n'
370 fragment += 'int main() { return NGREG; }'
371 conf.check_cc(fragment=fragment, define_name='HAVE_NGREG', mandatory=False,
372 msg='Checking for NGREG')
374 conf.env['LIB_PTHREAD'] = ['pthread']
375 conf.env['LIB_DL'] = ['dl']
376 conf.env['LIB_RT'] = ['rt']
377 conf.env['LIB_M'] = ['m']
378 conf.env['LIB_STDC++'] = ['stdc++']
379 conf.env['JACK_API_VERSION'] = JACK_API_VERSION
380 conf.env['JACK_VERSION'] = VERSION
382 conf.env['BUILD_WITH_PROFILE'] = Options.options.profile
383 conf.env['BUILD_WITH_32_64'] = Options.options.mixed
384 conf.env['BUILD_CLASSIC'] = Options.options.classic
385 conf.env['BUILD_DEBUG'] = Options.options.debug
386 conf.env['BUILD_STATIC'] = Options.options.static
388 conf.env['BUILD_JACKD'] = conf.env['BUILD_CLASSIC']
390 if conf.env['BUILD_JACKD'] and conf.env['BUILD_DBUS_RESERVATION']:
391 if not conf.check_cfg(package='dbus-1 >= 1.0.0', args='--cflags --libs', mandatory=False):
392 print(Logs.colors.RED + 'ERROR !! jackd cannot be built with D-Bus device reservation feature because libdbus-dev is missing' + Logs.colors.NORMAL)
395 conf.env['BINDIR'] = conf.env['PREFIX'] + '/bin'
397 if Options.options.htmldir:
398 conf.env['HTMLDIR'] = Options.options.htmldir
400 # set to None here so that the doxygen code can find out the highest
401 # directory to remove upon install
402 conf.env['HTMLDIR'] = None
404 if Options.options.libdir:
405 conf.env['LIBDIR'] = Options.options.libdir
407 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib'
409 if Options.options.pkgconfigdir:
410 conf.env['PKGCONFDIR'] = Options.options.pkgconfigdir
412 conf.env['PKGCONFDIR'] = conf.env['LIBDIR'] + '/pkgconfig'
414 if Options.options.mandir:
415 conf.env['MANDIR'] = Options.options.mandir
417 conf.env['MANDIR'] = conf.env['PREFIX'] + '/share/man/man1'
419 if conf.env['BUILD_DEBUG']:
420 conf.env.append_unique('CXXFLAGS', '-g')
421 conf.env.append_unique('CFLAGS', '-g')
422 conf.env.append_unique('LINKFLAGS', '-g')
424 if Options.options.autostart not in ['default', 'classic', 'dbus', 'none']:
425 conf.fatal('Invalid autostart value "' + Options.options.autostart + '"')
427 if Options.options.autostart == 'default':
428 conf.env['AUTOSTART_METHOD'] = 'none'
430 conf.env['AUTOSTART_METHOD'] = Options.options.autostart
432 if conf.env['AUTOSTART_METHOD'] == 'dbus' and not conf.env['BUILD_JACKDBUS']:
433 conf.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
434 if conf.env['AUTOSTART_METHOD'] == 'classic' and not conf.env['BUILD_JACKD']:
435 conf.fatal('Classic autostart mode was specified but jackd will not be built')
437 if conf.env['AUTOSTART_METHOD'] == 'dbus':
438 conf.define('USE_LIBDBUS_AUTOLAUNCH', 1)
439 elif conf.env['AUTOSTART_METHOD'] == 'classic':
440 conf.define('USE_CLASSIC_AUTOLAUNCH', 1)
442 conf.define('CLIENT_NUM', Options.options.clients)
443 conf.define('PORT_NUM_FOR_CLIENT', Options.options.application_ports)
445 if conf.env['IS_WINDOWS']:
446 # we define this in the environment to maintain compatibility with
447 # existing install paths that use ADDON_DIR rather than have to
448 # have special cases for windows each time.
449 conf.env['ADDON_DIR'] = conf.env['LIBDIR'] + '/jack'
450 if Options.options.platform in ('msys', 'win32'):
451 conf.define('ADDON_DIR', 'jack')
452 conf.define('__STDC_FORMAT_MACROS', 1) # for PRIu64
454 # don't define ADDON_DIR in config.h, use the default 'jack'
455 # defined in windows/JackPlatformPlug_os.h
458 conf.env['ADDON_DIR'] = os.path.normpath(os.path.join(conf.env['LIBDIR'], 'jack'))
459 conf.define('ADDON_DIR', conf.env['ADDON_DIR'])
460 conf.define('JACK_LOCATION', os.path.normpath(os.path.join(conf.env['PREFIX'], 'bin')))
462 if not conf.env['IS_WINDOWS']:
463 conf.define('USE_POSIX_SHM', 1)
464 conf.define('JACKMP', 1)
465 if conf.env['BUILD_WITH_PROFILE']:
466 conf.define('JACK_MONITOR', 1)
467 conf.write_config_header('config.h', remove=False)
469 if Options.options.mixed:
470 conf.setenv(lib32, env=conf.env.derive())
471 conf.env.append_unique('CFLAGS', '-m32')
472 conf.env.append_unique('CXXFLAGS', '-m32')
473 conf.env.append_unique('CXXFLAGS', '-DBUILD_WITH_32_64')
474 conf.env.append_unique('LINKFLAGS', '-m32')
475 if Options.options.libdir32:
476 conf.env['LIBDIR'] = Options.options.libdir32
478 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32'
480 if conf.env['IS_WINDOWS'] and conf.env['BUILD_STATIC']:
481 def replaceFor32bit(env):
483 yield e.replace('x86_64', 'i686', 1)
484 for env in ('AR', 'CC', 'CXX', 'LINK_CC', 'LINK_CXX'):
485 conf.all_envs[lib32][env] = list(replaceFor32bit(conf.all_envs[lib32][env]))
486 conf.all_envs[lib32]['LIB_REGEX'] = ['tre32']
488 # libdb does not work in mixed mode
489 conf.all_envs[lib32]['HAVE_DB'] = 0
490 conf.all_envs[lib32]['HAVE_DB_H'] = 0
491 conf.all_envs[lib32]['LIB_DB'] = []
492 # no need for opus in 32bit mixed mode clients
493 conf.all_envs[lib32]['LIB_OPUS'] = []
494 # someone tell me where this file gets written please..
495 conf.write_config_header('config.h')
498 print('LADI JACK ' + VERSION)
500 conf.msg('Maximum JACK clients', Options.options.clients, color='NORMAL')
501 conf.msg('Maximum ports per application', Options.options.application_ports, color='NORMAL')
503 conf.msg('Install prefix', conf.env['PREFIX'], color='CYAN')
504 conf.msg('Library directory', conf.all_envs['']['LIBDIR'], color='CYAN')
505 if conf.env['BUILD_WITH_32_64']:
506 conf.msg('32-bit library directory', conf.all_envs[lib32]['LIBDIR'], color='CYAN')
507 conf.msg('Drivers directory', conf.env['ADDON_DIR'], color='CYAN')
508 display_feature(conf, 'Build debuggable binaries', conf.env['BUILD_DEBUG'])
511 ('C compiler flags', ['CFLAGS', 'CPPFLAGS']),
512 ('C++ compiler flags', ['CXXFLAGS', 'CPPFLAGS']),
513 ('Linker flags', ['LINKFLAGS', 'LDFLAGS'])
515 for name, vars in tool_flags:
518 flags += conf.all_envs[''][var]
519 conf.msg(name, repr(flags), color='NORMAL')
521 if conf.env['BUILD_WITH_32_64']:
522 conf.msg('32-bit C compiler flags', repr(conf.all_envs[lib32]['CFLAGS']))
523 conf.msg('32-bit C++ compiler flags', repr(conf.all_envs[lib32]['CXXFLAGS']))
524 conf.msg('32-bit linker flags', repr(conf.all_envs[lib32]['LINKFLAGS']))
525 display_feature(conf, 'Build with engine profiling', conf.env['BUILD_WITH_PROFILE'])
526 display_feature(conf, 'Build with 32/64 bits mixed mode', conf.env['BUILD_WITH_32_64'])
528 display_feature(conf, 'Build standard JACK (jackd)', conf.env['BUILD_JACKD'])
529 if conf.env['BUILD_JACKD']:
530 display_feature(conf, 'D-Bus device reservation for jackd', conf.env['BUILD_DBUS_RESERVATION'])
531 conf.msg('Autostart method', conf.env['AUTOSTART_METHOD'])
533 conf.summarize_auto_options()
539 for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
540 name = y.__name__.replace('Context', '').lower()
543 cmd = name + '_' + lib32
547 def obj_add_includes(bld, obj):
548 if bld.env['IS_LINUX']:
549 obj.includes += ['linux', 'posix']
551 if bld.env['IS_FREEBSD']:
552 obj.includes += ['freebsd', 'posix']
554 if bld.env['IS_MACOSX']:
555 obj.includes += ['macosx', 'posix']
557 if bld.env['IS_SUN']:
558 obj.includes += ['posix', 'solaris']
560 if bld.env['IS_WINDOWS']:
561 obj.includes += ['windows']
564 # FIXME: Is SERVER_SIDE needed?
565 def build_jackd(bld):
567 features=['cxx', 'cxxprogram'],
568 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
569 includes=['.', 'common', 'common/jack'],
571 source=['common/Jackdmp.cpp'],
572 use=['serverlib', 'SYSTEMD']
575 if bld.env['BUILD_DBUS_RESERVATION']:
576 jackd.source += ['dbus/audio_reserve.c', 'dbus/reserve.c']
577 jackd.use += ['DBUS-1']
579 if bld.env['IS_LINUX']:
580 jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
582 if bld.env['IS_FREEBSD']:
583 jackd.use += ['M', 'PTHREAD']
585 if bld.env['IS_MACOSX']:
586 jackd.use += ['DL', 'PTHREAD']
587 jackd.framework = ['CoreFoundation']
589 if bld.env['IS_SUN']:
590 jackd.use += ['DL', 'PTHREAD']
592 obj_add_includes(bld, jackd)
597 # FIXME: Is SERVER_SIDE needed?
598 def create_driver_obj(bld, **kw):
600 kw['use'] += ['serverlib']
602 kw['use'] = ['serverlib']
605 features=['c', 'cxx', 'cshlib', 'cxxshlib'],
606 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
607 includes=['.', 'common', 'common/jack'],
608 install_path='${ADDON_DIR}/',
611 if bld.env['IS_WINDOWS']:
612 driver.env['cxxshlib_PATTERN'] = 'jack_%s.dll'
614 driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
616 obj_add_includes(bld, driver)
621 def build_drivers(bld):
622 # Non-hardware driver sources. Lexically sorted.
624 'common/JackDummyDriver.cpp'
628 'common/JackLoopbackDriver.cpp'
632 'common/JackNetDriver.cpp'
636 'common/JackNetOneDriver.cpp',
638 'common/netjack_packet.c'
642 'common/JackProxyDriver.cpp'
645 # Hardware driver sources. Lexically sorted.
648 'linux/alsa/JackAlsaDriver.cpp',
649 'linux/alsa/alsa_rawmidi.c',
650 'linux/alsa/alsa_seqmidi.c',
651 'linux/alsa/alsa_midi_jackmp.cpp',
652 'linux/alsa/generic_hw.c',
654 'linux/alsa/alsa_driver.c',
655 'linux/alsa/hammerfall.c',
656 'linux/alsa/ice1712.c'
660 'linux/alsarawmidi/JackALSARawMidiDriver.cpp',
661 'linux/alsarawmidi/JackALSARawMidiInputPort.cpp',
662 'linux/alsarawmidi/JackALSARawMidiOutputPort.cpp',
663 'linux/alsarawmidi/JackALSARawMidiPort.cpp',
664 'linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
665 'linux/alsarawmidi/JackALSARawMidiSendQueue.cpp',
666 'linux/alsarawmidi/JackALSARawMidiUtil.cpp'
671 'solaris/oss/JackBoomerDriver.cpp'
675 'macosx/coreaudio/JackCoreAudioDriver.mm',
676 'common/JackAC3Encoder.cpp'
680 'macosx/coremidi/JackCoreMidiInputPort.mm',
681 'macosx/coremidi/JackCoreMidiOutputPort.mm',
682 'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
683 'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
684 'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
685 'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
686 'macosx/coremidi/JackCoreMidiPort.mm',
687 'macosx/coremidi/JackCoreMidiUtil.mm',
688 'macosx/coremidi/JackCoreMidiDriver.mm'
692 'linux/firewire/JackFFADODriver.cpp',
693 'linux/firewire/JackFFADOMidiInputPort.cpp',
694 'linux/firewire/JackFFADOMidiOutputPort.cpp',
695 'linux/firewire/JackFFADOMidiReceiveQueue.cpp',
696 'linux/firewire/JackFFADOMidiSendQueue.cpp'
701 'freebsd/oss/JackOSSDriver.cpp'
705 'linux/iio/JackIIODriver.cpp'
710 'solaris/oss/JackOSSDriver.cpp'
714 'windows/portaudio/JackPortAudioDevices.cpp',
715 'windows/portaudio/JackPortAudioDriver.cpp',
719 'windows/winmme/JackWinMMEDriver.cpp',
720 'windows/winmme/JackWinMMEInputPort.cpp',
721 'windows/winmme/JackWinMMEOutputPort.cpp',
722 'windows/winmme/JackWinMMEPort.cpp',
725 # Create non-hardware driver objects. Lexically sorted.
746 use=['SAMPLERATE', 'CELT'])
753 # Create hardware driver objects. Lexically sorted after the conditional,
754 # e.g. BUILD_DRIVER_ALSA.
755 if bld.env['BUILD_DRIVER_ALSA']:
763 target='alsarawmidi',
764 source=alsarawmidi_src,
767 if bld.env['BUILD_DRIVER_FFADO']:
774 if bld.env['BUILD_DRIVER_IIO']:
778 source=iio_driver_src,
779 use=['GTKIOSTREAM', 'EIGEN3'])
781 if bld.env['BUILD_DRIVER_PORTAUDIO']:
785 source=portaudio_src,
788 if bld.env['BUILD_DRIVER_WINMME']:
795 if bld.env['IS_MACOSX']:
799 source=coreaudio_src,
801 framework=['AudioUnit', 'CoreAudio', 'CoreServices'])
807 use=['serverlib'], # FIXME: Is this needed?
808 framework=['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
810 if bld.env['IS_FREEBSD']:
814 source=freebsd_oss_src)
816 if bld.env['IS_SUN']:
828 if not bld.variant and bld.env['BUILD_WITH_32_64']:
829 Options.commands.append(bld.cmd + '_' + lib32)
831 # process subfolders from here
832 bld.recurse('common')
835 # only the wscript in common/ knows how to handle variants
838 bld.recurse('compat')
840 if bld.env['BUILD_JACKD']:
845 if bld.env['BUILD_JACK_EXAMPLE_TOOLS']:
846 bld.recurse('example-clients')
849 if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
851 bld.recurse('systemd')
852 if not bld.env['IS_WINDOWS'] and bld.env['BUILD_JACK_EXAMPLE_TOOLS']:
855 if bld.env['BUILD_DOXYGEN_DOCS']:
856 html_build_dir = bld.path.find_or_declare('html').abspath()
860 source='doxyfile.in',
862 HTML_BUILD_DIR=html_build_dir,
863 SRCDIR=bld.srcnode.abspath(),
867 # There are two reasons for logging to doxygen.log and using it as
868 # target in the build rule (rather than html_build_dir):
869 # (1) reduce the noise when running the build
870 # (2) waf has a regular file to check for a timestamp. If the directory
871 # is used instead waf will rebuild the doxygen target (even upon
874 doxyfile = task.inputs[0].abspath()
875 logfile = task.outputs[0].abspath()
876 cmd = '%s %s &> %s' % (task.env['DOXYGEN'][0], doxyfile, logfile)
877 return task.exec_command(cmd)
885 # Determine where to install HTML documentation. Since share_dir is the
886 # highest directory the uninstall routine should remove, there is no
887 # better candidate for share_dir, but the requested HTML directory if
888 # --htmldir is given.
889 if bld.env['HTMLDIR']:
890 html_install_dir = bld.options.destdir + bld.env['HTMLDIR']
891 share_dir = html_install_dir
893 share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
894 html_install_dir = share_dir + '/reference/html/'
896 if bld.cmd == 'install':
897 if os.path.isdir(html_install_dir):
898 Logs.pprint('CYAN', 'Removing old doxygen documentation installation...')
899 shutil.rmtree(html_install_dir)
900 Logs.pprint('CYAN', 'Removing old doxygen documentation installation done.')
901 Logs.pprint('CYAN', 'Installing doxygen documentation...')
902 shutil.copytree(html_build_dir, html_install_dir)
903 Logs.pprint('CYAN', 'Installing doxygen documentation done.')
904 elif bld.cmd == 'uninstall':
905 Logs.pprint('CYAN', 'Uninstalling doxygen documentation...')
906 if os.path.isdir(share_dir):
907 shutil.rmtree(share_dir)
908 Logs.pprint('CYAN', 'Uninstalling doxygen documentation done.')
909 elif bld.cmd == 'clean':
910 if os.access(html_build_dir, os.R_OK):
911 Logs.pprint('CYAN', 'Removing doxygen generated documentation...')
912 shutil.rmtree(html_build_dir)
913 Logs.pprint('CYAN', 'Removing doxygen generated documentation done.')
916 @TaskGen.extension('.mm')
917 def mm_hook(self, node):
918 """Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
919 return self.create_compiled_task('cxx', node)