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)
196 conf_dest='BUILD_TESTS',
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 sd = opt.add_auto_option(
218 help='Use systemd notify')
219 sd.check(header_name='systemd/sd-daemon.h')
220 sd.check(lib='systemd')
221 db = opt.add_auto_option(
223 help='Use Berkeley DB (metadata)')
224 db.check(header_name='db.h')
227 # this must be called before the configure phase
228 opt.apply_auto_options_hack()
231 def detect_platform(conf):
232 # GNU/kFreeBSD and GNU/Hurd are treated as Linux
234 # ('KEY, 'Human readable name', ['strings', 'to', 'check', 'for'])
235 ('IS_LINUX', 'Linux', ['gnu0', 'gnukfreebsd', 'linux', 'posix']),
236 ('IS_FREEBSD', 'FreeBSD', ['freebsd']),
237 ('IS_MACOSX', 'MacOS X', ['darwin']),
238 ('IS_SUN', 'SunOS', ['sunos']),
239 ('IS_WINDOWS', 'Windows', ['cygwin', 'msys', 'win32'])
242 for key, name, strings in platforms:
243 conf.env[key] = False
245 conf.start_msg('Checking platform')
246 platform = Options.options.platform
247 for key, name, strings in platforms:
249 if platform.startswith(s):
251 conf.end_msg(name, color='CYAN')
256 conf.load('compiler_cxx')
257 conf.load('compiler_c')
259 detect_platform(conf)
261 if conf.env['IS_WINDOWS']:
262 conf.env.append_unique('CCDEFINES', '_POSIX')
263 conf.env.append_unique('CXXDEFINES', '_POSIX')
264 if Options.options.platform in ('msys', 'win32'):
265 conf.env.append_value('INCLUDES', ['/mingw64/include'])
267 header_name='pa_asio.h',
268 msg='Checking for PortAudio ASIO support',
269 define_name='HAVE_ASIO',
272 conf.env.append_unique('CFLAGS', '-Wall')
273 conf.env.append_unique('CXXFLAGS', ['-Wall', '-Wno-invalid-offsetof'])
274 conf.env.append_unique('CXXFLAGS', '-std=gnu++11')
276 if conf.env['IS_FREEBSD']:
277 conf.check(lib='execinfo', uselib='EXECINFO', define_name='EXECINFO')
278 conf.check_cfg(package='libsysinfo', args='--cflags --libs')
280 if not conf.env['IS_MACOSX']:
281 conf.env.append_unique('LDFLAGS', '-Wl,--no-undefined')
283 conf.check(lib='aften', uselib='AFTEN', define_name='AFTEN')
286 + '#include <aften/aften.h>\n'
290 + 'AftenContext fAftenContext;\n'
291 + 'aften_set_defaults(&fAftenContext);\n'
292 + 'unsigned char *fb;\n'
293 + 'float *buf=new float[10];\n'
294 + 'int res = aften_encode_frame(&fAftenContext, fb, buf, 1);\n'
297 msg='Checking for aften_encode_frame()',
298 define_name='HAVE_AFTEN_NEW_API',
302 conf.env.append_unique('CXXFLAGS', '-Wno-deprecated-register')
304 conf.load('autooptions')
306 conf.recurse('compat')
308 # Check for functions.
311 + '#define _GNU_SOURCE\n'
312 + '#include <poll.h>\n'
313 + '#include <signal.h>\n'
314 + '#include <stddef.h>\n'
318 + ' ppoll(NULL, 0, NULL, NULL);\n'
320 msg='Checking for ppoll',
321 define_name='HAVE_PPOLL',
324 # Check for backtrace support
326 header_name='execinfo.h',
327 define_name='HAVE_EXECINFO_H',
330 conf.recurse('common')
331 if conf.env['IS_LINUX']:
332 if Options.options.systemd_unit:
333 conf.recurse('systemd')
335 conf.env['SYSTEMD_USER_UNIT_DIR'] = None
337 # test for the availability of ucontext, and how it should be used
338 for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
339 fragment = '#include <ucontext.h>\n'
340 fragment += 'int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }' % t
341 confvar = 'HAVE_UCONTEXT_%s' % t.upper()
342 conf.check_cc(fragment=fragment, define_name=confvar, mandatory=False,
343 msg='Checking for ucontext->uc_mcontext.%s' % t)
344 if conf.is_defined(confvar):
345 conf.define('HAVE_UCONTEXT', 1)
347 fragment = '#include <ucontext.h>\n'
348 fragment += 'int main() { return NGREG; }'
349 conf.check_cc(fragment=fragment, define_name='HAVE_NGREG', mandatory=False,
350 msg='Checking for NGREG')
352 conf.env['LIB_PTHREAD'] = ['pthread']
353 conf.env['LIB_DL'] = ['dl']
354 conf.env['LIB_RT'] = ['rt']
355 conf.env['LIB_M'] = ['m']
356 conf.env['LIB_STDC++'] = ['stdc++']
357 conf.env['JACK_API_VERSION'] = JACK_API_VERSION
358 conf.env['JACK_VERSION'] = VERSION
360 conf.env['BUILD_WITH_PROFILE'] = Options.options.profile
361 conf.env['BUILD_WITH_32_64'] = Options.options.mixed
362 conf.env['BUILD_CLASSIC'] = Options.options.classic
363 conf.env['BUILD_DEBUG'] = Options.options.debug
364 conf.env['BUILD_STATIC'] = Options.options.static
366 conf.env['BUILD_JACKD'] = conf.env['BUILD_CLASSIC']
368 if conf.env['BUILD_JACKD'] and conf.env['BUILD_DBUS_RESERVATION']:
369 if not conf.check_cfg(package='dbus-1 >= 1.0.0', args='--cflags --libs', mandatory=False):
370 print(Logs.colors.RED + 'ERROR !! jackd cannot be built with D-Bus device reservation feature because libdbus-dev is missing' + Logs.colors.NORMAL)
373 conf.env['BINDIR'] = conf.env['PREFIX'] + '/bin'
375 if Options.options.htmldir:
376 conf.env['HTMLDIR'] = Options.options.htmldir
378 # set to None here so that the doxygen code can find out the highest
379 # directory to remove upon install
380 conf.env['HTMLDIR'] = None
382 if Options.options.libdir:
383 conf.env['LIBDIR'] = Options.options.libdir
385 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib'
387 if Options.options.pkgconfigdir:
388 conf.env['PKGCONFDIR'] = Options.options.pkgconfigdir
390 conf.env['PKGCONFDIR'] = conf.env['LIBDIR'] + '/pkgconfig'
392 if Options.options.mandir:
393 conf.env['MANDIR'] = Options.options.mandir
395 conf.env['MANDIR'] = conf.env['PREFIX'] + '/share/man/man1'
397 if conf.env['BUILD_DEBUG']:
398 conf.env.append_unique('CXXFLAGS', '-g')
399 conf.env.append_unique('CFLAGS', '-g')
400 conf.env.append_unique('LINKFLAGS', '-g')
402 if Options.options.autostart not in ['default', 'classic', 'dbus', 'none']:
403 conf.fatal('Invalid autostart value "' + Options.options.autostart + '"')
405 if Options.options.autostart == 'default':
406 conf.env['AUTOSTART_METHOD'] = 'none'
408 conf.env['AUTOSTART_METHOD'] = Options.options.autostart
410 if conf.env['AUTOSTART_METHOD'] == 'dbus' and not conf.env['BUILD_JACKDBUS']:
411 conf.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
412 if conf.env['AUTOSTART_METHOD'] == 'classic' and not conf.env['BUILD_JACKD']:
413 conf.fatal('Classic autostart mode was specified but jackd will not be built')
415 if conf.env['AUTOSTART_METHOD'] == 'dbus':
416 conf.define('USE_LIBDBUS_AUTOLAUNCH', 1)
417 elif conf.env['AUTOSTART_METHOD'] == 'classic':
418 conf.define('USE_CLASSIC_AUTOLAUNCH', 1)
420 conf.define('CLIENT_NUM', Options.options.clients)
421 conf.define('PORT_NUM_FOR_CLIENT', Options.options.application_ports)
423 if conf.env['IS_WINDOWS']:
424 # we define this in the environment to maintain compatibility with
425 # existing install paths that use ADDON_DIR rather than have to
426 # have special cases for windows each time.
427 conf.env['ADDON_DIR'] = conf.env['LIBDIR'] + '/jack'
428 if Options.options.platform in ('msys', 'win32'):
429 conf.define('ADDON_DIR', 'jack')
430 conf.define('__STDC_FORMAT_MACROS', 1) # for PRIu64
432 # don't define ADDON_DIR in config.h, use the default 'jack'
433 # defined in windows/JackPlatformPlug_os.h
436 conf.env['ADDON_DIR'] = os.path.normpath(os.path.join(conf.env['LIBDIR'], 'jack'))
437 conf.define('ADDON_DIR', conf.env['ADDON_DIR'])
438 conf.define('JACK_LOCATION', os.path.normpath(os.path.join(conf.env['PREFIX'], 'bin')))
440 if not conf.env['IS_WINDOWS']:
441 conf.define('USE_POSIX_SHM', 1)
442 conf.define('JACKMP', 1)
443 if conf.env['BUILD_WITH_PROFILE']:
444 conf.define('JACK_MONITOR', 1)
445 conf.write_config_header('config.h', remove=False)
447 if Options.options.mixed:
448 conf.setenv(lib32, env=conf.env.derive())
449 conf.env.append_unique('CFLAGS', '-m32')
450 conf.env.append_unique('CXXFLAGS', '-m32')
451 conf.env.append_unique('CXXFLAGS', '-DBUILD_WITH_32_64')
452 conf.env.append_unique('LINKFLAGS', '-m32')
453 if Options.options.libdir32:
454 conf.env['LIBDIR'] = Options.options.libdir32
456 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32'
458 if conf.env['IS_WINDOWS'] and conf.env['BUILD_STATIC']:
459 def replaceFor32bit(env):
461 yield e.replace('x86_64', 'i686', 1)
462 for env in ('AR', 'CC', 'CXX', 'LINK_CC', 'LINK_CXX'):
463 conf.all_envs[lib32][env] = list(replaceFor32bit(conf.all_envs[lib32][env]))
464 conf.all_envs[lib32]['LIB_REGEX'] = ['tre32']
466 # libdb does not work in mixed mode
467 conf.all_envs[lib32]['HAVE_DB'] = 0
468 conf.all_envs[lib32]['HAVE_DB_H'] = 0
469 conf.all_envs[lib32]['LIB_DB'] = []
470 # no need for opus in 32bit mixed mode clients
471 conf.all_envs[lib32]['LIB_OPUS'] = []
472 # someone tell me where this file gets written please..
473 conf.write_config_header('config.h')
476 print('LADI JACK ' + VERSION)
478 conf.msg('Maximum JACK clients', Options.options.clients, color='NORMAL')
479 conf.msg('Maximum ports per application', Options.options.application_ports, color='NORMAL')
481 conf.msg('Install prefix', conf.env['PREFIX'], color='CYAN')
482 conf.msg('Library directory', conf.all_envs['']['LIBDIR'], color='CYAN')
483 if conf.env['BUILD_WITH_32_64']:
484 conf.msg('32-bit library directory', conf.all_envs[lib32]['LIBDIR'], color='CYAN')
485 conf.msg('Drivers directory', conf.env['ADDON_DIR'], color='CYAN')
486 display_feature(conf, 'Build debuggable binaries', conf.env['BUILD_DEBUG'])
489 ('C compiler flags', ['CFLAGS', 'CPPFLAGS']),
490 ('C++ compiler flags', ['CXXFLAGS', 'CPPFLAGS']),
491 ('Linker flags', ['LINKFLAGS', 'LDFLAGS'])
493 for name, vars in tool_flags:
496 flags += conf.all_envs[''][var]
497 conf.msg(name, repr(flags), color='NORMAL')
499 if conf.env['BUILD_WITH_32_64']:
500 conf.msg('32-bit C compiler flags', repr(conf.all_envs[lib32]['CFLAGS']))
501 conf.msg('32-bit C++ compiler flags', repr(conf.all_envs[lib32]['CXXFLAGS']))
502 conf.msg('32-bit linker flags', repr(conf.all_envs[lib32]['LINKFLAGS']))
503 display_feature(conf, 'Build with engine profiling', conf.env['BUILD_WITH_PROFILE'])
504 display_feature(conf, 'Build with 32/64 bits mixed mode', conf.env['BUILD_WITH_32_64'])
506 display_feature(conf, 'Build standard JACK (jackd)', conf.env['BUILD_JACKD'])
507 if conf.env['BUILD_JACKD']:
508 display_feature(conf, 'D-Bus device reservation for jackd', conf.env['BUILD_DBUS_RESERVATION'])
509 conf.msg('Autostart method', conf.env['AUTOSTART_METHOD'])
511 conf.summarize_auto_options()
517 for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
518 name = y.__name__.replace('Context', '').lower()
521 cmd = name + '_' + lib32
525 def obj_add_includes(bld, obj):
526 if bld.env['IS_LINUX']:
527 obj.includes += ['linux', 'posix']
529 if bld.env['IS_FREEBSD']:
530 obj.includes += ['freebsd', 'posix']
532 if bld.env['IS_MACOSX']:
533 obj.includes += ['macosx', 'posix']
535 if bld.env['IS_SUN']:
536 obj.includes += ['posix', 'solaris']
538 if bld.env['IS_WINDOWS']:
539 obj.includes += ['windows']
542 # FIXME: Is SERVER_SIDE needed?
543 def build_jackd(bld):
545 features=['cxx', 'cxxprogram'],
546 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
547 includes=['.', 'common', 'common/jack'],
549 source=['common/Jackdmp.cpp'],
550 use=['serverlib', 'SYSTEMD']
553 if bld.env['BUILD_DBUS_RESERVATION']:
554 jackd.source += ['dbus/audio_reserve.c', 'dbus/reserve.c']
555 jackd.use += ['DBUS-1']
557 if bld.env['IS_LINUX']:
558 jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
560 if bld.env['IS_FREEBSD']:
561 jackd.use += ['M', 'PTHREAD']
563 if bld.env['IS_MACOSX']:
564 jackd.use += ['DL', 'PTHREAD']
565 jackd.framework = ['CoreFoundation']
567 if bld.env['IS_SUN']:
568 jackd.use += ['DL', 'PTHREAD']
570 obj_add_includes(bld, jackd)
575 # FIXME: Is SERVER_SIDE needed?
576 def create_driver_obj(bld, **kw):
578 kw['use'] += ['serverlib']
580 kw['use'] = ['serverlib']
583 features=['c', 'cxx', 'cshlib', 'cxxshlib'],
584 defines=['HAVE_CONFIG_H', 'SERVER_SIDE'],
585 includes=['.', 'common', 'common/jack'],
586 install_path='${ADDON_DIR}/',
589 if bld.env['IS_WINDOWS']:
590 driver.env['cxxshlib_PATTERN'] = 'jack_%s.dll'
592 driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
594 obj_add_includes(bld, driver)
599 def build_drivers(bld):
600 # Non-hardware driver sources. Lexically sorted.
602 'common/JackDummyDriver.cpp'
606 'common/JackLoopbackDriver.cpp'
610 'common/JackNetDriver.cpp'
614 'common/JackNetOneDriver.cpp',
616 'common/netjack_packet.c'
620 'common/JackProxyDriver.cpp'
623 # Hardware driver sources. Lexically sorted.
626 'linux/alsa/JackAlsaDriver.cpp',
627 'linux/alsa/alsa_rawmidi.c',
628 'linux/alsa/alsa_seqmidi.c',
629 'linux/alsa/alsa_midi_jackmp.cpp',
630 'linux/alsa/generic_hw.c',
632 'linux/alsa/alsa_driver.c',
633 'linux/alsa/hammerfall.c',
634 'linux/alsa/ice1712.c'
638 'linux/alsarawmidi/JackALSARawMidiDriver.cpp',
639 'linux/alsarawmidi/JackALSARawMidiInputPort.cpp',
640 'linux/alsarawmidi/JackALSARawMidiOutputPort.cpp',
641 'linux/alsarawmidi/JackALSARawMidiPort.cpp',
642 'linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
643 'linux/alsarawmidi/JackALSARawMidiSendQueue.cpp',
644 'linux/alsarawmidi/JackALSARawMidiUtil.cpp'
649 'solaris/oss/JackBoomerDriver.cpp'
653 'macosx/coreaudio/JackCoreAudioDriver.mm',
654 'common/JackAC3Encoder.cpp'
658 'macosx/coremidi/JackCoreMidiInputPort.mm',
659 'macosx/coremidi/JackCoreMidiOutputPort.mm',
660 'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
661 'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
662 'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
663 'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
664 'macosx/coremidi/JackCoreMidiPort.mm',
665 'macosx/coremidi/JackCoreMidiUtil.mm',
666 'macosx/coremidi/JackCoreMidiDriver.mm'
670 'linux/firewire/JackFFADODriver.cpp',
671 'linux/firewire/JackFFADOMidiInputPort.cpp',
672 'linux/firewire/JackFFADOMidiOutputPort.cpp',
673 'linux/firewire/JackFFADOMidiReceiveQueue.cpp',
674 'linux/firewire/JackFFADOMidiSendQueue.cpp'
679 'freebsd/oss/JackOSSDriver.cpp'
683 'linux/iio/JackIIODriver.cpp'
688 'solaris/oss/JackOSSDriver.cpp'
692 'windows/portaudio/JackPortAudioDevices.cpp',
693 'windows/portaudio/JackPortAudioDriver.cpp',
697 'windows/winmme/JackWinMMEDriver.cpp',
698 'windows/winmme/JackWinMMEInputPort.cpp',
699 'windows/winmme/JackWinMMEOutputPort.cpp',
700 'windows/winmme/JackWinMMEPort.cpp',
703 # Create non-hardware driver objects. Lexically sorted.
724 use=['SAMPLERATE', 'CELT'])
731 # Create hardware driver objects. Lexically sorted after the conditional,
732 # e.g. BUILD_DRIVER_ALSA.
733 if bld.env['BUILD_DRIVER_ALSA']:
741 target='alsarawmidi',
742 source=alsarawmidi_src,
745 if bld.env['BUILD_DRIVER_FFADO']:
752 if bld.env['BUILD_DRIVER_IIO']:
756 source=iio_driver_src,
757 use=['GTKIOSTREAM', 'EIGEN3'])
759 if bld.env['BUILD_DRIVER_PORTAUDIO']:
763 source=portaudio_src,
766 if bld.env['BUILD_DRIVER_WINMME']:
773 if bld.env['IS_MACOSX']:
777 source=coreaudio_src,
779 framework=['AudioUnit', 'CoreAudio', 'CoreServices'])
785 use=['serverlib'], # FIXME: Is this needed?
786 framework=['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
788 if bld.env['IS_FREEBSD']:
792 source=freebsd_oss_src)
794 if bld.env['IS_SUN']:
806 if not bld.variant and bld.env['BUILD_WITH_32_64']:
807 Options.commands.append(bld.cmd + '_' + lib32)
809 # process subfolders from here
810 bld.recurse('common')
813 # only the wscript in common/ knows how to handle variants
816 bld.recurse('compat')
818 if bld.env['BUILD_JACKD']:
823 if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
825 bld.recurse('systemd')
826 if not bld.env['IS_WINDOWS'] and bld.env['BUILD_TESTS']:
829 if bld.env['BUILD_DOXYGEN_DOCS']:
830 html_build_dir = bld.path.find_or_declare('html').abspath()
834 source='doxyfile.in',
836 HTML_BUILD_DIR=html_build_dir,
837 SRCDIR=bld.srcnode.abspath(),
841 # There are two reasons for logging to doxygen.log and using it as
842 # target in the build rule (rather than html_build_dir):
843 # (1) reduce the noise when running the build
844 # (2) waf has a regular file to check for a timestamp. If the directory
845 # is used instead waf will rebuild the doxygen target (even upon
848 doxyfile = task.inputs[0].abspath()
849 logfile = task.outputs[0].abspath()
850 cmd = '%s %s &> %s' % (task.env['DOXYGEN'][0], doxyfile, logfile)
851 return task.exec_command(cmd)
859 # Determine where to install HTML documentation. Since share_dir is the
860 # highest directory the uninstall routine should remove, there is no
861 # better candidate for share_dir, but the requested HTML directory if
862 # --htmldir is given.
863 if bld.env['HTMLDIR']:
864 html_install_dir = bld.options.destdir + bld.env['HTMLDIR']
865 share_dir = html_install_dir
867 share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
868 html_install_dir = share_dir + '/reference/html/'
870 if bld.cmd == 'install':
871 if os.path.isdir(html_install_dir):
872 Logs.pprint('CYAN', 'Removing old doxygen documentation installation...')
873 shutil.rmtree(html_install_dir)
874 Logs.pprint('CYAN', 'Removing old doxygen documentation installation done.')
875 Logs.pprint('CYAN', 'Installing doxygen documentation...')
876 shutil.copytree(html_build_dir, html_install_dir)
877 Logs.pprint('CYAN', 'Installing doxygen documentation done.')
878 elif bld.cmd == 'uninstall':
879 Logs.pprint('CYAN', 'Uninstalling doxygen documentation...')
880 if os.path.isdir(share_dir):
881 shutil.rmtree(share_dir)
882 Logs.pprint('CYAN', 'Uninstalling doxygen documentation done.')
883 elif bld.cmd == 'clean':
884 if os.access(html_build_dir, os.R_OK):
885 Logs.pprint('CYAN', 'Removing doxygen generated documentation...')
886 shutil.rmtree(html_build_dir)
887 Logs.pprint('CYAN', 'Removing doxygen generated documentation done.')
890 @TaskGen.extension('.mm')
891 def mm_hook(self, node):
892 """Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
893 return self.create_compiled_task('cxx', node)