3 from __future__
import print_function
11 from waflib
import Logs
, Options
, Task
, Utils
12 from waflib
.Build
import BuildContext
, CleanContext
, InstallContext
, UninstallContext
16 JACK_API_VERSION
= '0.1.0'
18 # these variables are mandatory ('/' are converted automatically)
22 # lib32 variant name used when building in mixed mode
25 def display_feature(conf
, msg
, build
):
27 conf
.msg(msg
, 'yes', color
='GREEN')
29 conf
.msg(msg
, 'no', color
='YELLOW')
31 def check_for_celt(conf
):
33 for version
in ['11', '8', '7', '5']:
34 define
= 'HAVE_CELT_API_0_' + version
38 package
='celt >= 0.%s.0' % version
,
39 args
='--cflags --libs')
41 conf
.define(define
, 1)
43 except conf
.errors
.ConfigurationError
:
45 conf
.define(define
, 0)
48 raise conf
.errors
.ConfigurationError
51 # options provided by the modules
52 opt
.load('compiler_cxx')
53 opt
.load('compiler_c')
54 opt
.load('autooptions');
61 opt
.add_option('--htmldir', type='string', default
=None, help='HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/')
62 opt
.add_option('--libdir', type='string', help='Library directory [Default: <prefix>/lib]')
63 opt
.add_option('--libdir32', type='string', help='32bit Library directory [Default: <prefix>/lib32]')
64 opt
.add_option('--mandir', type='string', help='Manpage directory [Default: <prefix>/share/man/man1]')
66 # options affecting binaries
67 opt
.add_option('--platform', type='string', default
=sys
.platform
, help='Target platform for cross-compiling, e.g. cygwin or win32')
68 opt
.add_option('--mixed', action
='store_true', default
=False, help='Build with 32/64 bits mixed mode')
69 opt
.add_option('--debug', action
='store_true', default
=False, dest
='debug', help='Build debuggable binaries')
71 # options affecting general jack functionality
72 opt
.add_option('--classic', action
='store_true', default
=False, help='Force enable standard JACK (jackd) even if D-Bus JACK (jackdbus) is enabled too')
73 opt
.add_option('--dbus', action
='store_true', default
=False, help='Enable D-Bus JACK (jackdbus)')
74 opt
.add_option('--autostart', type='string', default
='default', help='Autostart method. Possible values: "default", "classic", "dbus", "none"')
75 opt
.add_option('--profile', action
='store_true', default
=False, help='Build with engine profiling')
76 opt
.add_option('--clients', default
=64, type='int', dest
='clients', help='Maximum number of JACK clients')
77 opt
.add_option('--ports-per-application', default
=768, type='int', dest
='application_ports', help='Maximum number of ports per application')
79 opt
.set_auto_options_define('HAVE_%s')
80 opt
.set_auto_options_style('yesno_and_hack')
82 # options with third party dependencies
83 doxygen
= opt
.add_auto_option(
85 help='Build doxygen documentation',
86 conf_dest
='BUILD_DOXYGEN_DOCS',
88 doxygen
.find_program('doxygen')
89 alsa
= opt
.add_auto_option(
91 help='Enable ALSA driver',
92 conf_dest
='BUILD_DRIVER_ALSA')
94 package
='alsa >= 1.0.18',
95 args
='--cflags --libs')
96 firewire
= opt
.add_auto_option(
98 help='Enable FireWire driver (FFADO)',
99 conf_dest
='BUILD_DRIVER_FFADO')
101 package
='libffado >= 1.999.17',
102 args
='--cflags --libs')
103 iio
= opt
.add_auto_option(
105 help='Enable IIO driver',
106 conf_dest
='BUILD_DRIVER_IIO')
108 package
='gtkIOStream >= 1.4.0',
109 args
='--cflags --libs')
111 package
='eigen3 >= 3.1.2',
112 args
='--cflags --libs')
113 portaudio
= opt
.add_auto_option(
115 help='Enable Portaudio driver',
116 conf_dest
='BUILD_DRIVER_PORTAUDIO')
117 portaudio
.check(header_name
='windows.h') # only build portaudio on windows
119 package
='portaudio-2.0 >= 19',
120 uselib_store
='PORTAUDIO',
121 args
='--cflags --libs')
122 winmme
= opt
.add_auto_option(
124 help='Enable WinMME driver',
125 conf_dest
='BUILD_DRIVER_WINMME')
127 header_name
=['windows.h', 'mmsystem.h'],
128 msg
='Checking for header mmsystem.h')
130 celt
= opt
.add_auto_option(
132 help='Build with CELT')
133 celt
.add_function(check_for_celt
)
135 # Suffix _PKG to not collide with HAVE_OPUS defined by the option.
136 opus
= opt
.add_auto_option(
138 help='Build Opus netjack2')
139 opus
.check(header_name
='opus/opus_custom.h')
141 package
='opus >= 0.9.0',
142 args
='--cflags --libs',
143 define_name
='HAVE_OPUS_PKG')
145 samplerate
= opt
.add_auto_option(
147 help='Build with libsamplerate')
148 samplerate
.check_cfg(
149 package
='samplerate',
150 args
='--cflags --libs')
151 sndfile
= opt
.add_auto_option(
153 help='Build with libsndfile')
156 args
='--cflags --libs')
157 readline
= opt
.add_auto_option(
159 help='Build with readline')
160 readline
.check(lib
='readline')
162 header_name
=['stdio.h', 'readline/readline.h'],
163 msg
='Checking for header readline/readline.h')
164 sd
= opt
.add_auto_option(
166 help='Use systemd notify')
167 sd
.check(header_name
='systemd/sd-daemon.h')
168 sd
.check(lib
='systemd')
169 db
= opt
.add_auto_option(
171 help='Use Berkeley DB (metadata)')
172 db
.check(header_name
='db.h')
178 # this must be called before the configure phase
179 opt
.apply_auto_options_hack()
181 def detect_platform(conf
):
182 # GNU/kFreeBSD and GNU/Hurd are treated as Linux
184 # ('KEY, 'Human readable name', ['strings', 'to', 'check', 'for'])
185 ('IS_LINUX', 'Linux', ['gnu0', 'gnukfreebsd', 'linux', 'posix']),
186 ('IS_MACOSX', 'MacOS X', ['darwin']),
187 ('IS_SUN', 'SunOS', ['sunos']),
188 ('IS_WINDOWS', 'Windows', ['cygwin', 'msys', 'win32'])
191 for key
,name
,strings
in platforms
:
192 conf
.env
[key
] = False
194 conf
.start_msg('Checking platform')
195 platform
= Options
.options
.platform
196 for key
,name
,strings
in platforms
:
198 if platform
.startswith(s
):
200 conf
.end_msg(name
, color
='CYAN')
204 conf
.load('compiler_cxx')
205 conf
.load('compiler_c')
207 detect_platform(conf
)
209 if conf
.env
['IS_WINDOWS']:
210 conf
.env
.append_unique('CCDEFINES', '_POSIX')
211 conf
.env
.append_unique('CXXDEFINES', '_POSIX')
213 conf
.env
.append_unique('CXXFLAGS', '-Wall')
214 conf
.env
.append_unique('CXXFLAGS', '-std=gnu++11')
215 conf
.env
.append_unique('CFLAGS', '-Wall')
217 if conf
.env
['IS_MACOSX']:
218 conf
.check(lib
='aften', uselib
='AFTEN', define_name
='AFTEN')
220 conf
.load('autooptions')
222 conf
.recurse('compat')
224 # Check for functions.
227 + '#define _GNU_SOURCE\n'
228 + '#include <poll.h>\n'
229 + '#include <signal.h>\n'
230 + '#include <stddef.h>\n'
234 + ' ppoll(NULL, 0, NULL, NULL);\n'
236 msg
='Checking for ppoll',
237 define_name
='HAVE_PPOLL',
240 # Check for backtrace support
242 header_name
='execinfo.h',
243 define_name
='HAVE_EXECINFO_H',
246 conf
.recurse('common')
247 if Options
.options
.dbus
:
249 if conf
.env
['BUILD_JACKDBUS'] != True:
250 conf
.fatal('jackdbus was explicitly requested but cannot be built')
252 conf
.recurse('example-clients')
254 # test for the availability of ucontext, and how it should be used
255 for t
in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
256 fragment
= '#include <ucontext.h>\n'
257 fragment
+= 'int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }' % t
258 confvar
= 'HAVE_UCONTEXT_%s' % t
.upper()
259 conf
.check_cc(fragment
=fragment
, define_name
=confvar
, mandatory
=False,
260 msg
='Checking for ucontext->uc_mcontext.%s' % t
)
261 if conf
.is_defined(confvar
):
262 conf
.define('HAVE_UCONTEXT', 1)
264 fragment
= '#include <ucontext.h>\n'
265 fragment
+= 'int main() { return NGREG; }'
266 conf
.check_cc(fragment
=fragment
, define_name
='HAVE_NGREG', mandatory
=False,
267 msg
='Checking for NGREG')
269 conf
.env
['LIB_PTHREAD'] = ['pthread']
270 conf
.env
['LIB_DL'] = ['dl']
271 conf
.env
['LIB_RT'] = ['rt']
272 conf
.env
['LIB_M'] = ['m']
273 conf
.env
['LIB_STDC++'] = ['stdc++']
274 conf
.env
['JACK_API_VERSION'] = JACK_API_VERSION
275 conf
.env
['JACK_VERSION'] = VERSION
277 conf
.env
['BUILD_WITH_PROFILE'] = Options
.options
.profile
278 conf
.env
['BUILD_WITH_32_64'] = Options
.options
.mixed
279 conf
.env
['BUILD_CLASSIC'] = Options
.options
.classic
280 conf
.env
['BUILD_DEBUG'] = Options
.options
.debug
282 if conf
.env
['BUILD_JACKDBUS']:
283 conf
.env
['BUILD_JACKD'] = conf
.env
['BUILD_CLASSIC']
285 conf
.env
['BUILD_JACKD'] = True
287 conf
.env
['BINDIR'] = conf
.env
['PREFIX'] + '/bin'
289 if Options
.options
.htmldir
:
290 conf
.env
['HTMLDIR'] = Options
.options
.htmldir
292 # set to None here so that the doxygen code can find out the highest
293 # directory to remove upon install
294 conf
.env
['HTMLDIR'] = None
296 if Options
.options
.libdir
:
297 conf
.env
['LIBDIR'] = Options
.options
.libdir
299 conf
.env
['LIBDIR'] = conf
.env
['PREFIX'] + '/lib'
301 if Options
.options
.mandir
:
302 conf
.env
['MANDIR'] = Options
.options
.mandir
304 conf
.env
['MANDIR'] = conf
.env
['PREFIX'] + '/share/man/man1'
306 if conf
.env
['BUILD_DEBUG']:
307 conf
.env
.append_unique('CXXFLAGS', '-g')
308 conf
.env
.append_unique('CFLAGS', '-g')
309 conf
.env
.append_unique('LINKFLAGS', '-g')
311 if not Options
.options
.autostart
in ['default', 'classic', 'dbus', 'none']:
312 conf
.fatal('Invalid autostart value "' + Options
.options
.autostart
+ '"')
314 if Options
.options
.autostart
== 'default':
315 if conf
.env
['BUILD_JACKD']:
316 conf
.env
['AUTOSTART_METHOD'] = 'classic'
318 conf
.env
['AUTOSTART_METHOD'] = 'dbus'
320 conf
.env
['AUTOSTART_METHOD'] = Options
.options
.autostart
322 if conf
.env
['AUTOSTART_METHOD'] == 'dbus' and not conf
.env
['BUILD_JACKDBUS']:
323 conf
.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
324 if conf
.env
['AUTOSTART_METHOD'] == 'classic' and not conf
.env
['BUILD_JACKD']:
325 conf
.fatal('Classic autostart mode was specified but jackd will not be built')
327 if conf
.env
['AUTOSTART_METHOD'] == 'dbus':
328 conf
.define('USE_LIBDBUS_AUTOLAUNCH', 1)
329 elif conf
.env
['AUTOSTART_METHOD'] == 'classic':
330 conf
.define('USE_CLASSIC_AUTOLAUNCH', 1)
332 conf
.define('CLIENT_NUM', Options
.options
.clients
)
333 conf
.define('PORT_NUM_FOR_CLIENT', Options
.options
.application_ports
)
335 if conf
.env
['IS_WINDOWS']:
336 # we define this in the environment to maintain compatability with
337 # existing install paths that use ADDON_DIR rather than have to
338 # have special cases for windows each time.
339 conf
.env
['ADDON_DIR'] = conf
.env
['BINDIR'] + '/jack'
340 # don't define ADDON_DIR in config.h, use the default 'jack' defined in
341 # windows/JackPlatformPlug_os.h
343 conf
.env
['ADDON_DIR'] = os
.path
.normpath(os
.path
.join(conf
.env
['LIBDIR'], 'jack'))
344 conf
.define('ADDON_DIR', conf
.env
['ADDON_DIR'])
345 conf
.define('JACK_LOCATION', os
.path
.normpath(os
.path
.join(conf
.env
['PREFIX'], 'bin')))
347 if not conf
.env
['IS_WINDOWS']:
348 conf
.define('USE_POSIX_SHM', 1)
349 conf
.define('JACKMP', 1)
350 if conf
.env
['BUILD_JACKDBUS']:
351 conf
.define('JACK_DBUS', 1)
352 if conf
.env
['BUILD_WITH_PROFILE']:
353 conf
.define('JACK_MONITOR', 1)
354 conf
.write_config_header('config.h', remove
=False)
358 f
= open('svnversion.h')
360 m
= re
.match(r
'^#define SVN_VERSION "([^"]*)"$', data
)
367 if Options
.options
.mixed
:
368 conf
.setenv(lib32
, env
=conf
.env
.derive())
369 conf
.env
.append_unique('CXXFLAGS', '-m32')
370 conf
.env
.append_unique('CFLAGS', '-m32')
371 conf
.env
.append_unique('LINKFLAGS', '-m32')
372 if Options
.options
.libdir32
:
373 conf
.env
['LIBDIR'] = Options
.options
.libdir32
375 conf
.env
['LIBDIR'] = conf
.env
['PREFIX'] + '/lib32'
376 conf
.write_config_header('config.h')
379 print('==================')
380 version_msg
= 'JACK ' + VERSION
382 version_msg
+= ' exported from r' + svnrev
384 version_msg
+= ' svn revision will checked and eventually updated during build'
387 conf
.msg('Maximum JACK clients', Options
.options
.clients
, color
='NORMAL')
388 conf
.msg('Maximum ports per application', Options
.options
.application_ports
, color
='NORMAL')
390 conf
.msg('Install prefix', conf
.env
['PREFIX'], color
='CYAN')
391 conf
.msg('Library directory', conf
.all_envs
['']['LIBDIR'], color
='CYAN')
392 if conf
.env
['BUILD_WITH_32_64']:
393 conf
.msg('32-bit library directory', conf
.all_envs
[lib32
]['LIBDIR'], color
='CYAN')
394 conf
.msg('Drivers directory', conf
.env
['ADDON_DIR'], color
='CYAN')
395 display_feature(conf
, 'Build debuggable binaries', conf
.env
['BUILD_DEBUG'])
398 ('C compiler flags', ['CFLAGS', 'CPPFLAGS']),
399 ('C++ compiler flags', ['CXXFLAGS', 'CPPFLAGS']),
400 ('Linker flags', ['LINKFLAGS', 'LDFLAGS'])
402 for name
,vars in tool_flags
:
405 flags
+= conf
.all_envs
[''][var
]
406 conf
.msg(name
, repr(flags
), color
='NORMAL')
408 if conf
.env
['BUILD_WITH_32_64']:
409 conf
.msg('32-bit C compiler flags', repr(conf
.all_envs
[lib32
]['CFLAGS']))
410 conf
.msg('32-bit C++ compiler flags', repr(conf
.all_envs
[lib32
]['CXXFLAGS']))
411 conf
.msg('32-bit linker flags', repr(conf
.all_envs
[lib32
]['LINKFLAGS']))
412 display_feature(conf
, 'Build with engine profiling', conf
.env
['BUILD_WITH_PROFILE'])
413 display_feature(conf
, 'Build with 32/64 bits mixed mode', conf
.env
['BUILD_WITH_32_64'])
415 display_feature(conf
, 'Build standard JACK (jackd)', conf
.env
['BUILD_JACKD'])
416 display_feature(conf
, 'Build D-Bus JACK (jackdbus)', conf
.env
['BUILD_JACKDBUS'])
417 conf
.msg('Autostart method', conf
.env
['AUTOSTART_METHOD'])
419 if conf
.env
['BUILD_JACKDBUS'] and conf
.env
['BUILD_JACKD']:
420 print(Logs
.colors
.RED
+ 'WARNING !! mixing both jackd and jackdbus may cause issues:' + Logs
.colors
.NORMAL
)
421 print(Logs
.colors
.RED
+ 'WARNING !! jackdbus does not use .jackdrc nor qjackctl settings' + Logs
.colors
.NORMAL
)
423 conf
.summarize_auto_options()
425 if conf
.env
['BUILD_JACKDBUS']:
426 conf
.msg('D-Bus service install directory', conf
.env
['DBUS_SERVICES_DIR'], color
='CYAN')
428 if conf
.env
['DBUS_SERVICES_DIR'] != conf
.env
['DBUS_SERVICES_DIR_REAL']:
430 print(Logs
.colors
.RED
+ 'WARNING: D-Bus session services directory as reported by pkg-config is')
431 print(Logs
.colors
.RED
+ 'WARNING:', end
=' ')
432 print(Logs
.colors
.CYAN
+ conf
.env
['DBUS_SERVICES_DIR_REAL'])
433 print(Logs
.colors
.RED
+ 'WARNING: but service file will be installed in')
434 print(Logs
.colors
.RED
+ 'WARNING:', end
=' ')
435 print(Logs
.colors
.CYAN
+ conf
.env
['DBUS_SERVICES_DIR'])
436 print(Logs
.colors
.RED
+ 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus')
437 print('WARNING: You can override dbus service install directory')
438 print('WARNING: with --enable-pkg-config-dbus-service-dir option to this script')
439 print(Logs
.colors
.NORMAL
, end
=' ')
443 for y
in (BuildContext
, CleanContext
, InstallContext
, UninstallContext
):
444 name
= y
.__name
__.replace('Context','').lower()
446 cmd
= name
+ '_' + lib32
449 def obj_add_includes(bld
, obj
):
450 if bld
.env
['BUILD_JACKDBUS']:
451 obj
.includes
+= ['dbus']
453 if bld
.env
['IS_LINUX']:
454 obj
.includes
+= ['linux', 'posix']
456 if bld
.env
['IS_MACOSX']:
457 obj
.includes
+= ['macosx', 'posix']
459 if bld
.env
['IS_SUN']:
460 obj
.includes
+= ['posix', 'solaris']
462 if bld
.env
['IS_WINDOWS']:
463 obj
.includes
+= ['windows']
465 # FIXME: Is SERVER_SIDE needed?
466 def build_jackd(bld
):
468 features
= ['cxx', 'cxxprogram'],
469 defines
= ['HAVE_CONFIG_H','SERVER_SIDE'],
470 includes
= ['.', 'common', 'common/jack'],
472 source
= ['common/Jackdmp.cpp'],
473 use
= ['serverlib', 'SYSTEMD']
476 if bld
.env
['BUILD_JACKDBUS']:
477 jackd
.source
+= ['dbus/audio_reserve.c', 'dbus/reserve.c']
478 jackd
.use
+= ['DBUS-1']
480 if bld
.env
['IS_LINUX']:
481 jackd
.use
+= ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
483 if bld
.env
['IS_MACOSX']:
484 jackd
.use
+= ['DL', 'PTHREAD']
485 jackd
.framework
= ['CoreFoundation']
487 if bld
.env
['IS_SUN']:
488 jackd
.use
+= ['DL', 'PTHREAD']
490 obj_add_includes(bld
, jackd
)
494 # FIXME: Is SERVER_SIDE needed?
495 def create_driver_obj(bld
, **kw
):
496 if bld
.env
['IS_MACOSX'] or bld
.env
['IS_WINDOWS']:
497 # On MacOSX this is necessary.
498 # I do not know if this is necessary on Windows.
499 # Note added on 2015-12-13 by karllinden.
501 kw
['use'] += ['serverlib']
503 kw
['use'] = ['serverlib']
506 features
= ['c', 'cxx', 'cshlib', 'cxxshlib'],
507 defines
= ['HAVE_CONFIG_H', 'SERVER_SIDE'],
508 includes
= ['.', 'common', 'common/jack'],
509 install_path
= '${ADDON_DIR}/',
512 if bld
.env
['IS_WINDOWS']:
513 driver
.env
['cxxshlib_PATTERN'] = 'jack_%s.dll'
515 driver
.env
['cxxshlib_PATTERN'] = 'jack_%s.so'
517 obj_add_includes(bld
, driver
)
521 def build_drivers(bld
):
522 # Non-hardware driver sources. Lexically sorted.
524 'common/JackDummyDriver.cpp'
528 'common/JackLoopbackDriver.cpp'
532 'common/JackNetDriver.cpp'
536 'common/JackNetOneDriver.cpp',
538 'common/netjack_packet.c'
542 'common/JackProxyDriver.cpp'
545 # Hardware driver sources. Lexically sorted.
548 'linux/alsa/JackAlsaDriver.cpp',
549 'linux/alsa/alsa_rawmidi.c',
550 'linux/alsa/alsa_seqmidi.c',
551 'linux/alsa/alsa_midi_jackmp.cpp',
552 'linux/alsa/generic_hw.c',
554 'linux/alsa/alsa_driver.c',
555 'linux/alsa/hammerfall.c',
556 'linux/alsa/ice1712.c'
560 'linux/alsarawmidi/JackALSARawMidiDriver.cpp',
561 'linux/alsarawmidi/JackALSARawMidiInputPort.cpp',
562 'linux/alsarawmidi/JackALSARawMidiOutputPort.cpp',
563 'linux/alsarawmidi/JackALSARawMidiPort.cpp',
564 'linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
565 'linux/alsarawmidi/JackALSARawMidiSendQueue.cpp',
566 'linux/alsarawmidi/JackALSARawMidiUtil.cpp'
571 'solaris/oss/JackBoomerDriver.cpp'
575 'macosx/coreaudio/JackCoreAudioDriver.mm',
576 'common/JackAC3Encoder.cpp'
580 'macosx/coremidi/JackCoreMidiInputPort.mm',
581 'macosx/coremidi/JackCoreMidiOutputPort.mm',
582 'macosx/coremidi/JackCoreMidiPhysicalInputPort.mm',
583 'macosx/coremidi/JackCoreMidiPhysicalOutputPort.mm',
584 'macosx/coremidi/JackCoreMidiVirtualInputPort.mm',
585 'macosx/coremidi/JackCoreMidiVirtualOutputPort.mm',
586 'macosx/coremidi/JackCoreMidiPort.mm',
587 'macosx/coremidi/JackCoreMidiUtil.mm',
588 'macosx/coremidi/JackCoreMidiDriver.mm'
592 'linux/firewire/JackFFADODriver.cpp',
593 'linux/firewire/JackFFADOMidiInputPort.cpp',
594 'linux/firewire/JackFFADOMidiOutputPort.cpp',
595 'linux/firewire/JackFFADOMidiReceiveQueue.cpp',
596 'linux/firewire/JackFFADOMidiSendQueue.cpp'
600 'linux/iio/JackIIODriver.cpp'
605 'solaris/oss/JackOSSDriver.cpp'
609 'windows/portaudio/JackPortAudioDevices.cpp',
610 'windows/portaudio/JackPortAudioDriver.cpp',
614 'windows/winmme/JackWinMMEDriver.cpp',
615 'windows/winmme/JackWinMMEInputPort.cpp',
616 'windows/winmme/JackWinMMEOutputPort.cpp',
617 'windows/winmme/JackWinMMEPort.cpp',
620 # Create non-hardware driver objects. Lexically sorted.
629 source
= loopback_src
)
640 use
= ['SAMPLERATE', 'CELT'])
647 # Create hardware driver objects. Lexically sorted after the conditional,
648 # e.g. BUILD_DRIVER_ALSA.
649 if bld
.env
['BUILD_DRIVER_ALSA']:
657 target
= 'alsarawmidi',
658 source
= alsarawmidi_src
,
661 if bld
.env
['BUILD_DRIVER_FFADO']:
668 if bld
.env
['BUILD_DRIVER_IIO']:
673 use
= ['GTKIOSTREAM', 'EIGEN3'])
675 if bld
.env
['BUILD_DRIVER_PORTAUDIO']:
678 target
= 'portaudio',
679 source
= portaudio_src
,
682 if bld
.env
['BUILD_DRIVER_WINMME']:
689 if bld
.env
['IS_MACOSX']:
692 target
= 'coreaudio',
693 source
= coreaudio_src
,
695 framework
= ['AudioUnit', 'CoreAudio', 'CoreServices'])
700 source
= coremidi_src
,
701 use
= ['serverlib'], # FIXME: Is this needed?
702 framework
= ['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
704 if bld
.env
['IS_SUN']:
715 if not bld
.variant
and bld
.env
['BUILD_WITH_32_64']:
716 Options
.commands
.append(bld
.cmd
+ '_' + lib32
)
718 # process subfolders from here
719 bld
.recurse('common')
722 # only the wscript in common/ knows how to handle variants
725 bld
.recurse('compat')
727 if not os
.access('svnversion.h', os
.R_OK
):
729 sg
= Utils
.h_file(self
.outputs
[0].abspath(self
.env
))
730 #print sg.encode('hex')
731 Build
.bld
.node_sigs
[self
.env
.variant()][self
.outputs
[0].id] = sg
733 script
= bld
.path
.find_resource('svnversion_regenerate.sh')
734 script
= script
.abspath()
737 rule
= '%s ${TGT}' % script
,
739 runnable_status
= Task
.RUN_ME
,
743 source
= ['svnversion_regenerate.sh'],
744 target
= [bld
.path
.find_or_declare('svnversion.h')]
747 if bld
.env
['BUILD_JACKD']:
752 bld
.recurse('example-clients')
753 if bld
.env
['IS_LINUX']:
755 if not bld
.env
['IS_WINDOWS']:
757 if bld
.env
['BUILD_JACKDBUS']:
760 if bld
.env
['BUILD_DOXYGEN_DOCS']:
761 html_build_dir
= bld
.path
.find_or_declare('html').abspath()
765 source
= 'doxyfile.in',
767 HTML_BUILD_DIR
= html_build_dir
,
768 SRCDIR
= bld
.srcnode
.abspath(),
772 # There are two reasons for logging to doxygen.log and using it as
773 # target in the build rule (rather than html_build_dir):
774 # (1) reduce the noise when running the build
775 # (2) waf has a regular file to check for a timestamp. If the directory
776 # is used instead waf will rebuild the doxygen target (even upon
779 doxyfile
= task
.inputs
[0].abspath()
780 logfile
= task
.outputs
[0].abspath()
781 cmd
= '%s %s &> %s' % (task
.env
['DOXYGEN'][0], doxyfile
, logfile
)
782 return task
.exec_command(cmd
)
787 target
= 'doxygen.log'
790 # Determine where to install HTML documentation. Since share_dir is the
791 # highest directory the uninstall routine should remove, there is no
792 # better candidate for share_dir, but the requested HTML directory if
793 # --htmldir is given.
794 if bld
.env
['HTMLDIR']:
795 html_install_dir
= bld
.options
.destdir
+ bld
.env
['HTMLDIR']
796 share_dir
= html_install_dir
798 share_dir
= bld
.options
.destdir
+ bld
.env
['PREFIX'] + '/share/jack-audio-connection-kit'
799 html_install_dir
= share_dir
+ '/reference/html/'
801 if bld
.cmd
== 'install':
802 if os
.path
.isdir(html_install_dir
):
803 Logs
.pprint('CYAN', 'Removing old doxygen documentation installation...')
804 shutil
.rmtree(html_install_dir
)
805 Logs
.pprint('CYAN', 'Removing old doxygen documentation installation done.')
806 Logs
.pprint('CYAN', 'Installing doxygen documentation...')
807 shutil
.copytree(html_build_dir
, html_install_dir
)
808 Logs
.pprint('CYAN', 'Installing doxygen documentation done.')
809 elif bld
.cmd
=='uninstall':
810 Logs
.pprint('CYAN', 'Uninstalling doxygen documentation...')
811 if os
.path
.isdir(share_dir
):
812 shutil
.rmtree(share_dir
)
813 Logs
.pprint('CYAN', 'Uninstalling doxygen documentation done.')
814 elif bld
.cmd
=='clean':
815 if os
.access(html_build_dir
, os
.R_OK
):
816 Logs
.pprint('CYAN', 'Removing doxygen generated documentation...')
817 shutil
.rmtree(html_build_dir
)
818 Logs
.pprint('CYAN', 'Removing doxygen generated documentation done.')
821 # This code blindly assumes it is working in the toplevel source directory.
822 if not os
.path
.exists('svnversion.h'):
823 os
.system('./svnversion_regenerate.sh svnversion.h')
825 from waflib
import TaskGen
826 @TaskGen.extension('.mm')
827 def mm_hook(self
, node
):
828 """Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
829 return self
.create_compiled_task('cxx', node
)