3 from __future__
import print_function
12 from waflib
import Logs
, Options
, Task
, Utils
13 from waflib
.Build
import BuildContext
, CleanContext
, InstallContext
, UninstallContext
17 JACK_API_VERSION
= '0.1.0'
19 # these variables are mandatory ('/' are converted automatically)
23 # lib32 variant name used when building in mixed mode
28 def display_msg(msg
, status
= None, color
= None):
31 g_maxlen
= max(g_maxlen
, len(msg
))
33 Logs
.pprint('NORMAL', "%s :" % msg
.ljust(g_maxlen
), sep
=' ')
34 Logs
.pprint(color
, status
)
36 print("%s" % msg
.ljust(g_maxlen
))
38 def display_feature(msg
, build
):
40 display_msg(msg
, "yes", 'GREEN')
42 display_msg(msg
, "no", 'YELLOW')
44 # This function prints an error without stopping waf. The reason waf should not
45 # be stopped is to be able to list all missing dependencies in one chunk.
47 print(Logs
.colors
.RED
+ msg
+ Logs
.colors
.NORMAL
)
51 This class is the foundation for the auto options. It adds an option
52 --foo=no|yes to the list of options and deals with all logic and checks for
55 Each option can have different dependencies that will be checked. If all
56 dependencies are available and the user has not done any request the option
57 will be enabled. If the user has requested to enable the option the class
58 ensures that all dependencies are available and prints an error message
59 otherwise. If the user disables the option, i.e. --foo=no, no checks are
62 For each option it is possible to add packages that are required for the
63 option using the add_package function. For dependency programs add_program
64 should be used. For libraries (without pkg-config support) the add_library
65 function should be used. For headers the add_header function exists. If
66 there is another type of requirement or dependency the check hook (an
67 external function called when configuring) can be used.
69 When all checks have been made and the class has made a decision the result
70 is saved in conf.env['NAME'] where 'NAME' by default is the uppercase of the
71 name argument to __init__, but it can be changed with the conf_dest argument
74 The class will define a preprocessor symbol with the result. The default
75 name is HAVE_NAME, but it can be changed using the define argument to
79 def __init__(self
, opt
, name
, help, conf_dest
=None, define
=None):
80 # check hook to call upon configuration
81 self
.check_hook
= None
82 self
.check_hook_error
= None
83 self
.check_hook_found
= True
86 self
.libs
= [] # elements on the form [lib,uselib_store]
87 self
.libs_not_found
= [] # elements on the form lib
91 self
.headers_not_found
= []
93 # required packages (checked with pkg-config)
94 self
.packages
= [] # elements on the form [package,uselib_store,atleast_version]
95 self
.packages_not_found
= [] # elements on the form [package,atleast_version]
98 self
.programs
= [] # elements on the form [program,var]
99 self
.programs_not_found
= [] # elements on the form program
101 # the result of the configuration (should the option be enabled or not?)
105 self
.option
= '--' + name
106 self
.dest
= 'auto_option_' + name
108 self
.conf_dest
= conf_dest
110 self
.conf_dest
= name
.upper()
112 self
.define
= 'HAVE_' + name
.upper()
115 opt
.add_option(self
.option
, type='string', default
='auto', dest
=self
.dest
, help=self
.help+' (enabled by default if possible)', metavar
='no|yes')
117 def add_library(self
, library
, uselib_store
=None):
119 Add a required library that should be checked during configuration. The
120 library will be checked using the conf.check_cc function. If the
121 uselib_store arugment is not given it defaults to LIBRARY (the uppercase
122 of the library argument). The uselib_store argument will be passed to
123 check_cc which means LIB_LIBRARY, CFLAGS_LIBRARY and DEFINES_LIBRARY,
124 etc. will be defined if the option is enabled.
127 uselib_store
= library
.upper().replace('-', '_')
128 self
.libs
.append([library
, uselib_store
])
130 def add_header(self
, header
):
132 Add a required header that should be checked during configuration. The
133 header will be checked using the conf.check_cc function which means
134 HAVE_HEADER_H will be defined if found.
136 self
.headers
.append(header
)
138 def add_package(self
, package
, uselib_store
=None, atleast_version
=None):
140 Add a required package that should be checked using pkg-config during
141 configuration. The package will be checked using the conf.check_cfg
142 function and the uselib_store and atleast_version will be passed to
143 check_cfg. If uselib_store is None it defaults to PACKAGE (uppercase of
144 the package argument) with hyphens and dots replaced with underscores.
145 If atleast_version is None it defaults to '0'.
148 uselib_store
= package
.upper().replace('-', '_').replace('.', '_')
149 if not atleast_version
:
150 atleast_version
= '0'
151 self
.packages
.append([package
, uselib_store
, atleast_version
])
153 def add_program(self
, program
, var
=None):
155 Add a required program that should be checked during configuration. If
156 var is not given it defaults to PROGRAM (the uppercase of the program
157 argument). If the option is enabled the program is saved as a list (?!)
158 in conf.env['PROGRAM'].
161 var
= program
.upper().replace('-', '_')
162 self
.programs
.append([program
, var
])
164 def set_check_hook(self
, check_hook
, check_hook_error
):
166 Set the check hook and the corresponding error printing function to the
167 configure step. The check_hook argument is a function that should return
168 True if the extra prerequisites were found and False if not. The
169 check_hook_error argument is an error printing function that should
170 print an error message telling the user that --foo was explicitly
171 requested but cannot be built since the extra prerequisites were not
172 found. Both function should take a single argument that is the waf
173 configuration context.
175 self
.check_hook
= check_hook
176 self
.check_hook_error
= check_hook_error
178 def _check(self
, conf
):
180 This is an internal function that runs all necessary configure checks.
181 It checks all dependencies (even if some dependency was not found) so
182 that the user can install all missing dependencies in one go, instead
183 of playing the infamous hit-configure-hit-configure game.
185 This function returns True if all dependencies were found and False if
190 # check for libraries
191 for lib
,uselib_store
in self
.libs
:
193 conf
.check_cc(lib
=lib
, uselib_store
=uselib_store
)
194 except conf
.errors
.ConfigurationError
:
196 self
.libs_not_found
.append(lib
)
199 for header
in self
.headers
:
201 conf
.check_cc(header_name
=header
)
202 except conf
.errors
.ConfigurationError
:
204 self
.headers_not_found
.append(header
)
207 for package
,uselib_store
,atleast_version
in self
.packages
:
209 conf
.check_cfg(package
=package
, uselib_store
=uselib_store
, atleast_version
=atleast_version
, args
='--cflags --libs')
210 except conf
.errors
.ConfigurationError
:
212 self
.packages_not_found
.append([package
,atleast_version
])
215 for program
,var
in self
.programs
:
217 conf
.find_program(program
, var
=var
)
218 except conf
.errors
.ConfigurationError
:
220 self
.programs_not_found
.append(program
)
222 # call hook (if specified)
224 self
.check_hook_found
= self
.check_hook(conf
)
225 if not self
.check_hook_found
:
230 def _configure_error(self
, conf
):
232 This is an internal function that prints errors for each missing
233 dependency. The error messages tell the user that this option required
234 some dependency, but it cannot be found.
237 for lib
in self
.libs_not_found
:
238 print_error('%s requires the %s library, but it cannot be found.' % (self
.option
, lib
))
240 for header
in self
.headers_not_found
:
241 print_error('%s requires the %s header, but it cannot be found.' % (self
.option
, header
))
243 for package
,atleast_version
in self
.packages_not_found
:
246 string
+= ' >= ' + atleast_version
247 print_error('%s requires the package %s, but it cannot be found.' % (self
.option
, string
))
249 for program
in self
.programs_not_found
:
250 print_error('%s requires the %s program, but it cannot be found.' % (self
.option
, program
))
252 if not self
.check_hook_found
:
253 self
.check_hook_error(conf
)
255 def configure(self
, conf
):
257 This function configures the option examining the argument given too
258 --foo (where foo is this option). This function sets self.result to the
259 result of the configuration; True if the option should be enabled or
260 False if not. If not all dependencies were found self.result will shall
261 be False. conf.env['NAME'] will be set to the same value aswell as a
262 preprocessor symbol will be defined according to the result.
264 If --foo[=yes] was given, but some dependency was not found an error
265 message is printed (foreach missing dependency).
267 This function returns True on success and False on error.
269 argument
= getattr(Options
.options
, self
.dest
)
273 elif argument
== 'yes':
274 if self
._check
(conf
):
280 self
._configure
_error
(conf
)
281 elif argument
== 'auto':
282 self
.result
= self
._check
(conf
)
285 print_error('Invalid argument "' + argument
+ '" to ' + self
.option
)
289 conf
.env
[self
.conf_dest
] = self
.result
291 conf
.define(self
.define
, 1)
293 conf
.define(self
.define
, 0)
296 def display_message(self
):
298 This function displays a result message with the help text and the
299 result of the configuration.
301 display_feature(self
.help, self
.result
)
303 # This function adds an option to the list of auto options and returns the newly
305 def add_auto_option(opt
, name
, help, conf_dest
=None, define
=None):
306 option
= AutoOption(opt
, name
, help, conf_dest
=conf_dest
, define
=define
)
307 auto_options
.append(option
)
310 # This function applies a hack that for each auto option --foo=no|yes replaces
311 # any occurence --foo in argv with --foo=yes, in effect interpreting --foo as
312 # --foo=yes. The function has to be called before waf issues the option parser,
313 # i.e. before the configure phase.
314 def auto_options_argv_hack():
315 for option
in auto_options
:
316 for x
in range(1, len(sys
.argv
)):
317 if sys
.argv
[x
] == option
.option
:
318 sys
.argv
[x
] += '=yes'
320 # This function configures all auto options. It stops waf and prints an error
321 # message if there were unsatisfied requirements.
322 def configure_auto_options(conf
):
324 for option
in auto_options
:
325 if not option
.configure(conf
):
328 conf
.fatal('There were unsatisfied requirements.')
330 # This function displays all options and the configuration results.
331 def display_auto_options_messages():
332 for option
in auto_options
:
333 option
.display_message()
335 def check_for_celt(conf
):
337 for version
in ['11', '8', '7', '5']:
338 define
= 'HAVE_CELT_API_0_' + version
341 conf
.check_cfg(package
='celt', atleast_version
='0.' + version
+ '.0', args
='--cflags --libs')
343 conf
.define(define
, 1)
345 except conf
.errors
.ConfigurationError
:
347 conf
.define(define
, 0)
350 def check_for_celt_error(conf
):
351 print_error('--celt requires the package celt, but it could not be found.')
353 # The readline/readline.h header does not work if stdio.h is not included
354 # before. Thus a fragment with both stdio.h and readline/readline.h need to be
355 # test-compiled to find out whether readline is available.
356 def check_for_readline(conf
):
358 conf
.check_cc(fragment
='''
360 #include <readline/readline.h>
361 int main(void) { return 0; }''',
363 msg
='Checking for header readline/readline.h')
365 except conf
.errors
.ConfigurationError
:
368 def check_for_readline_error(conf
):
369 print_error('--readline requires the readline/readline.h header, but it cannot be found.')
371 def check_for_mmsystem(conf
):
373 conf
.check_cc(fragment
='''
375 #include <mmsystem.h>
376 int main(void) { return 0; }''',
378 msg
='Checking for header mmsystem.h')
380 except conf
.errors
.ConfigurationError
:
383 def check_for_mmsystem_error(conf
):
384 print_error('--winmme requires the mmsystem.h header, but it cannot be found.')
387 # options provided by the modules
388 opt
.load('compiler_cxx')
389 opt
.load('compiler_c')
391 # install directories
392 opt
.add_option('--htmldir', type='string', default
=None, help="HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/")
393 opt
.add_option('--libdir', type='string', help="Library directory [Default: <prefix>/lib]")
394 opt
.add_option('--libdir32', type='string', help="32bit Library directory [Default: <prefix>/lib32]")
395 opt
.add_option('--mandir', type='string', help="Manpage directory [Default: <prefix>/share/man/man1]")
397 # options affecting binaries
398 opt
.add_option('--dist-target', type='string', default
='auto', help='Specify the target for cross-compiling [auto,mingw]')
399 opt
.add_option('--mixed', action
='store_true', default
=False, help='Build with 32/64 bits mixed mode')
400 opt
.add_option('--debug', action
='store_true', default
=False, dest
='debug', help='Build debuggable binaries')
402 # options affecting general jack functionality
403 opt
.add_option('--classic', action
='store_true', default
=False, help='Force enable standard JACK (jackd) even if D-Bus JACK (jackdbus) is enabled too')
404 opt
.add_option('--dbus', action
='store_true', default
=False, help='Enable D-Bus JACK (jackdbus)')
405 opt
.add_option('--autostart', type='string', default
="default", help='Autostart method. Possible values: "default", "classic", "dbus", "none"')
406 opt
.add_option('--profile', action
='store_true', default
=False, help='Build with engine profiling')
407 opt
.add_option('--clients', default
=64, type="int", dest
="clients", help='Maximum number of JACK clients')
408 opt
.add_option('--ports-per-application', default
=768, type="int", dest
="application_ports", help='Maximum number of ports per application')
410 # options with third party dependencies
411 doxygen
= add_auto_option(opt
, 'doxygen', help='Build doxygen documentation', conf_dest
='BUILD_DOXYGEN_DOCS')
412 doxygen
.add_program('doxygen')
413 alsa
= add_auto_option(opt
, 'alsa', help='Enable ALSA driver', conf_dest
='BUILD_DRIVER_ALSA')
414 alsa
.add_package('alsa', atleast_version
='1.0.18')
415 firewire
= add_auto_option(opt
, 'firewire', help='Enable FireWire driver (FFADO)', conf_dest
='BUILD_DRIVER_FFADO')
416 firewire
.add_package('libffado', atleast_version
='1.999.17')
417 freebob
= add_auto_option(opt
, 'freebob', help='Enable FreeBob driver')
418 freebob
.add_package('libfreebob', atleast_version
='1.0.0')
419 iio
= add_auto_option(opt
, 'iio', help='Enable IIO driver', conf_dest
='BUILD_DRIVER_IIO')
420 iio
.add_package('gtkIOStream', atleast_version
='1.4.0')
421 iio
.add_package('eigen3', atleast_version
='3.1.2')
422 portaudio
= add_auto_option(opt
, 'portaudio', help='Enable Portaudio driver', conf_dest
='BUILD_DRIVER_PORTAUDIO')
423 portaudio
.add_header('windows.h') # only build portaudio on windows
424 portaudio
.add_package('portaudio-2.0', uselib_store
='PORTAUDIO', atleast_version
='19')
425 winmme
= add_auto_option(opt
, 'winmme', help='Enable WinMME driver', conf_dest
='BUILD_DRIVER_WINMME')
426 winmme
.set_check_hook(check_for_mmsystem
, check_for_mmsystem_error
)
428 celt
= add_auto_option(opt
, 'celt', help='Build with CELT')
429 celt
.set_check_hook(check_for_celt
, check_for_celt_error
)
430 opus
= add_auto_option(opt
, 'opus', help='Build Opus netjack2')
431 opus
.add_header('opus/opus_custom.h')
432 opus
.add_package('opus', atleast_version
='0.9.0')
433 samplerate
= add_auto_option(opt
, 'samplerate', help='Build with libsamplerate')
434 samplerate
.add_package('samplerate')
435 sndfile
= add_auto_option(opt
, 'sndfile', help='Build with libsndfile')
436 sndfile
.add_package('sndfile')
437 readline
= add_auto_option(opt
, 'readline', help='Build with readline')
438 readline
.add_library('readline')
439 readline
.set_check_hook(check_for_readline
, check_for_readline_error
)
444 # this must be called before the configure phase
445 auto_options_argv_hack()
448 conf
.load('compiler_cxx')
449 conf
.load('compiler_c')
450 if Options
.options
.dist_target
== 'auto':
451 platform
= sys
.platform
452 conf
.env
['IS_MACOSX'] = platform
== 'darwin'
453 conf
.env
['IS_LINUX'] = platform
== 'linux' or platform
== 'linux2' or platform
== 'linux3' or platform
== 'posix'
454 conf
.env
['IS_SUN'] = platform
== 'sunos'
455 # GNU/kFreeBSD and GNU/Hurd are treated as Linux
456 if platform
.startswith('gnu0') or platform
.startswith('gnukfreebsd'):
457 conf
.env
['IS_LINUX'] = True
458 elif Options
.options
.dist_target
== 'mingw':
459 conf
.env
['IS_WINDOWS'] = True
461 if conf
.env
['IS_LINUX']:
462 Logs
.pprint('CYAN', "Linux detected")
464 if conf
.env
['IS_MACOSX']:
465 Logs
.pprint('CYAN', "MacOS X detected")
467 if conf
.env
['IS_SUN']:
468 Logs
.pprint('CYAN', "SunOS detected")
470 if conf
.env
['IS_WINDOWS']:
471 Logs
.pprint('CYAN', "Windows detected")
473 if conf
.env
['IS_WINDOWS']:
474 conf
.env
.append_unique('CCDEFINES', '_POSIX')
475 conf
.env
.append_unique('CXXDEFINES', '_POSIX')
477 conf
.env
.append_unique('CXXFLAGS', '-Wall')
478 conf
.env
.append_unique('CFLAGS', '-Wall')
480 # configure all auto options
481 configure_auto_options(conf
)
483 conf
.recurse('common')
484 if conf
.env
['IS_LINUX']:
485 conf
.recurse('linux')
486 if Options
.options
.dbus
:
488 if conf
.env
['BUILD_JACKDBUS'] != True:
489 conf
.fatal('jackdbus was explicitly requested but cannot be built')
491 conf
.recurse('example-clients')
493 conf
.env
['LIB_PTHREAD'] = ['pthread']
494 conf
.env
['LIB_DL'] = ['dl']
495 conf
.env
['LIB_RT'] = ['rt']
496 conf
.env
['LIB_M'] = ['m']
497 conf
.env
['LIB_STDC++'] = ['stdc++']
498 conf
.env
['JACK_API_VERSION'] = JACK_API_VERSION
499 conf
.env
['JACK_VERSION'] = VERSION
501 conf
.env
['BUILD_WITH_PROFILE'] = Options
.options
.profile
502 conf
.env
['BUILD_WITH_32_64'] = Options
.options
.mixed
503 conf
.env
['BUILD_CLASSIC'] = Options
.options
.classic
504 conf
.env
['BUILD_DEBUG'] = Options
.options
.debug
506 if conf
.env
['BUILD_JACKDBUS']:
507 conf
.env
['BUILD_JACKD'] = conf
.env
['BUILD_CLASSIC']
509 conf
.env
['BUILD_JACKD'] = True
511 conf
.env
['BINDIR'] = conf
.env
['PREFIX'] + '/bin'
513 if Options
.options
.htmldir
:
514 conf
.env
['HTMLDIR'] = Options
.options
.htmldir
516 # set to None here so that the doxygen code can find out the highest
517 # directory to remove upon install
518 conf
.env
['HTMLDIR'] = None
520 if Options
.options
.libdir
:
521 conf
.env
['LIBDIR'] = Options
.options
.libdir
523 conf
.env
['LIBDIR'] = conf
.env
['PREFIX'] + '/lib'
525 if Options
.options
.mandir
:
526 conf
.env
['MANDIR'] = Options
.options
.mandir
528 conf
.env
['MANDIR'] = conf
.env
['PREFIX'] + '/share/man/man1'
530 if conf
.env
['BUILD_DEBUG']:
531 conf
.env
.append_unique('CXXFLAGS', '-g')
532 conf
.env
.append_unique('CFLAGS', '-g')
533 conf
.env
.append_unique('LINKFLAGS', '-g')
535 if not Options
.options
.autostart
in ["default", "classic", "dbus", "none"]:
536 conf
.fatal("Invalid autostart value \"" + Options
.options
.autostart
+ "\"")
538 if Options
.options
.autostart
== "default":
539 if conf
.env
['BUILD_JACKDBUS'] == True and conf
.env
['BUILD_JACKD'] == False:
540 conf
.env
['AUTOSTART_METHOD'] = "dbus"
542 conf
.env
['AUTOSTART_METHOD'] = "classic"
544 conf
.env
['AUTOSTART_METHOD'] = Options
.options
.autostart
546 if conf
.env
['AUTOSTART_METHOD'] == "dbus" and not conf
.env
['BUILD_JACKDBUS']:
547 conf
.fatal("D-Bus autostart mode was specified but jackdbus will not be built")
548 if conf
.env
['AUTOSTART_METHOD'] == "classic" and not conf
.env
['BUILD_JACKD']:
549 conf
.fatal("Classic autostart mode was specified but jackd will not be built")
551 if conf
.env
['AUTOSTART_METHOD'] == "dbus":
552 conf
.define('USE_LIBDBUS_AUTOLAUNCH', 1)
553 elif conf
.env
['AUTOSTART_METHOD'] == "classic":
554 conf
.define('USE_CLASSIC_AUTOLAUNCH', 1)
556 conf
.define('CLIENT_NUM', Options
.options
.clients
)
557 conf
.define('PORT_NUM_FOR_CLIENT', Options
.options
.application_ports
)
559 if conf
.env
['IS_WINDOWS']:
560 # we define this in the environment to maintain compatability with
561 # existing install paths that use ADDON_DIR rather than have to
562 # have special cases for windows each time.
563 conf
.env
['ADDON_DIR'] = conf
.env
['BINDIR'] + '/jack'
564 # don't define ADDON_DIR in config.h, use the default 'jack' defined in
565 # windows/JackPlatformPlug_os.h
567 conf
.env
['ADDON_DIR'] = os
.path
.normpath(os
.path
.join(conf
.env
['LIBDIR'], 'jack'))
568 conf
.define('ADDON_DIR', conf
.env
['ADDON_DIR'])
569 conf
.define('JACK_LOCATION', os
.path
.normpath(os
.path
.join(conf
.env
['PREFIX'], 'bin')))
571 if not conf
.env
['IS_WINDOWS']:
572 conf
.define('USE_POSIX_SHM', 1)
573 conf
.define('JACKMP', 1)
574 if conf
.env
['BUILD_JACKDBUS'] == True:
575 conf
.define('JACK_DBUS', 1)
576 if conf
.env
['BUILD_WITH_PROFILE'] == True:
577 conf
.define('JACK_MONITOR', 1)
578 conf
.write_config_header('config.h', remove
=False)
582 f
= open('svnversion.h')
584 m
= re
.match(r
'^#define SVN_VERSION "([^"]*)"$', data
)
591 if Options
.options
.mixed
== True:
592 conf
.setenv(lib32
, env
=conf
.env
.derive())
593 conf
.env
.append_unique('CXXFLAGS', '-m32')
594 conf
.env
.append_unique('CFLAGS', '-m32')
595 conf
.env
.append_unique('LINKFLAGS', '-m32')
596 if Options
.options
.libdir32
:
597 conf
.env
['LIBDIR'] = Options
.options
.libdir32
599 conf
.env
['LIBDIR'] = conf
.env
['PREFIX'] + '/lib32'
600 conf
.write_config_header('config.h')
603 display_msg("==================")
604 version_msg
= "JACK " + VERSION
606 version_msg
+= " exported from r" + svnrev
608 version_msg
+= " svn revision will checked and eventually updated during build"
611 print("Build with a maximum of %d JACK clients" % Options
.options
.clients
)
612 print("Build with a maximum of %d ports per application" % Options
.options
.application_ports
)
614 display_msg("Install prefix", conf
.env
['PREFIX'], 'CYAN')
615 display_msg("Library directory", conf
.all_envs
[""]['LIBDIR'], 'CYAN')
616 if conf
.env
['BUILD_WITH_32_64'] == True:
617 display_msg("32-bit library directory", conf
.all_envs
[lib32
]['LIBDIR'], 'CYAN')
618 display_msg("Drivers directory", conf
.env
['ADDON_DIR'], 'CYAN')
619 display_feature('Build debuggable binaries', conf
.env
['BUILD_DEBUG'])
620 display_msg('C compiler flags', repr(conf
.all_envs
[""]['CFLAGS']))
621 display_msg('C++ compiler flags', repr(conf
.all_envs
[""]['CXXFLAGS']))
622 display_msg('Linker flags', repr(conf
.all_envs
[""]['LINKFLAGS']))
623 if conf
.env
['BUILD_WITH_32_64'] == True:
624 display_msg('32-bit C compiler flags', repr(conf
.all_envs
[lib32
]['CFLAGS']))
625 display_msg('32-bit C++ compiler flags', repr(conf
.all_envs
[lib32
]['CXXFLAGS']))
626 display_msg('32-bit linker flags', repr(conf
.all_envs
[lib32
]['LINKFLAGS']))
627 display_feature('Build with engine profiling', conf
.env
['BUILD_WITH_PROFILE'])
628 display_feature('Build with 32/64 bits mixed mode', conf
.env
['BUILD_WITH_32_64'])
630 display_feature('Build standard JACK (jackd)', conf
.env
['BUILD_JACKD'])
631 display_feature('Build D-Bus JACK (jackdbus)', conf
.env
['BUILD_JACKDBUS'])
632 display_msg('Autostart method', conf
.env
['AUTOSTART_METHOD'])
634 if conf
.env
['BUILD_JACKDBUS'] and conf
.env
['BUILD_JACKD']:
635 print(Logs
.colors
.RED
+ 'WARNING !! mixing both jackd and jackdbus may cause issues:' + Logs
.colors
.NORMAL
)
636 print(Logs
.colors
.RED
+ 'WARNING !! jackdbus does not use .jackdrc nor qjackctl settings' + Logs
.colors
.NORMAL
)
638 # display configuration result messages for auto options
639 display_auto_options_messages()
641 if conf
.env
['BUILD_JACKDBUS'] == True:
642 display_msg('D-Bus service install directory', conf
.env
['DBUS_SERVICES_DIR'], 'CYAN')
643 #display_msg('Settings persistence', xxx)
645 if conf
.env
['DBUS_SERVICES_DIR'] != conf
.env
['DBUS_SERVICES_DIR_REAL']:
647 print(Logs
.colors
.RED
+ "WARNING: D-Bus session services directory as reported by pkg-config is")
648 print(Logs
.colors
.RED
+ "WARNING:", end
=' ')
649 print(Logs
.colors
.CYAN
+ conf
.env
['DBUS_SERVICES_DIR_REAL'])
650 print(Logs
.colors
.RED
+ 'WARNING: but service file will be installed in')
651 print(Logs
.colors
.RED
+ "WARNING:", end
=' ')
652 print(Logs
.colors
.CYAN
+ conf
.env
['DBUS_SERVICES_DIR'])
653 print(Logs
.colors
.RED
+ 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus')
654 print('WARNING: You can override dbus service install directory')
655 print('WARNING: with --enable-pkg-config-dbus-service-dir option to this script')
656 print(Logs
.colors
.NORMAL
, end
=' ')
660 for y
in (BuildContext
, CleanContext
, InstallContext
, UninstallContext
):
661 name
= y
.__name
__.replace('Context','').lower()
663 cmd
= name
+ '_' + lib32
670 out2
= out
+ "/" + bld
.variant
671 print("make[1]: Entering directory `" + os
.getcwd() + "/" + out2
+ "'")
674 if bld
.env
['BUILD_WITH_32_64'] == True:
675 Options
.commands
.append(bld
.cmd
+ '_' + lib32
)
677 # process subfolders from here
678 bld
.recurse('common')
681 # only the wscript in common/ knows how to handle variants
684 if not os
.access('svnversion.h', os
.R_OK
):
686 sg
= Utils
.h_file(self
.outputs
[0].abspath(self
.env
))
687 #print sg.encode('hex')
688 Build
.bld
.node_sigs
[self
.env
.variant()][self
.outputs
[0].id] = sg
690 script
= bld
.path
.find_resource('svnversion_regenerate.sh')
691 script
= script
.abspath()
694 rule
= '%s ${TGT}' % script
,
696 runnable_status
= Task
.RUN_ME
,
700 source
= ['svnversion_regenerate.sh'],
701 target
= [bld
.path
.find_or_declare('svnversion.h')]
704 if bld
.env
['IS_LINUX']:
706 bld
.recurse('example-clients')
709 if bld
.env
['BUILD_JACKDBUS'] == True:
712 if bld
.env
['IS_MACOSX']:
713 bld
.recurse('macosx')
714 bld
.recurse('example-clients')
716 if bld
.env
['BUILD_JACKDBUS'] == True:
719 if bld
.env
['IS_SUN']:
720 bld
.recurse('solaris')
721 bld
.recurse('example-clients')
723 if bld
.env
['BUILD_JACKDBUS'] == True:
726 if bld
.env
['IS_WINDOWS']:
727 bld
.recurse('windows')
728 bld
.recurse('example-clients')
729 #bld.recurse('tests')
731 if bld
.env
['BUILD_DOXYGEN_DOCS'] == True:
732 html_build_dir
= bld
.path
.find_or_declare('html').abspath()
736 source
= 'doxyfile.in',
738 HTML_BUILD_DIR
= html_build_dir
,
739 SRCDIR
= bld
.srcnode
.abspath(),
743 # There are two reasons for logging to doxygen.log and using it as
744 # target in the build rule (rather than html_build_dir):
745 # (1) reduce the noise when running the build
746 # (2) waf has a regular file to check for a timestamp. If the directory
747 # is used instead waf will rebuild the doxygen target (even upon
750 doxyfile
= task
.inputs
[0].abspath()
751 logfile
= task
.outputs
[0].abspath()
752 cmd
= '%s %s &> %s' % (task
.env
['DOXYGEN'][0], doxyfile
, logfile
)
753 return task
.exec_command(cmd
)
758 target
= 'doxygen.log'
761 # Determine where to install HTML documentation. Since share_dir is the
762 # highest directory the uninstall routine should remove, there is no
763 # better candidate for share_dir, but the requested HTML directory if
764 # --htmldir is given.
765 if bld
.env
['HTMLDIR']:
766 html_install_dir
= bld
.options
.destdir
+ bld
.env
['HTMLDIR']
767 share_dir
= html_install_dir
769 share_dir
= bld
.options
.destdir
+ bld
.env
['PREFIX'] + '/share/jack-audio-connection-kit'
770 html_install_dir
= share_dir
+ '/reference/html/'
772 if bld
.cmd
== 'install':
773 if os
.path
.isdir(html_install_dir
):
774 Logs
.pprint('CYAN', "Removing old doxygen documentation installation...")
775 shutil
.rmtree(html_install_dir
)
776 Logs
.pprint('CYAN', "Removing old doxygen documentation installation done.")
777 Logs
.pprint('CYAN', "Installing doxygen documentation...")
778 shutil
.copytree(html_build_dir
, html_install_dir
)
779 Logs
.pprint('CYAN', "Installing doxygen documentation done.")
780 elif bld
.cmd
=='uninstall':
781 Logs
.pprint('CYAN', "Uninstalling doxygen documentation...")
782 if os
.path
.isdir(share_dir
):
783 shutil
.rmtree(share_dir
)
784 Logs
.pprint('CYAN', "Uninstalling doxygen documentation done.")
785 elif bld
.cmd
=='clean':
786 if os
.access(html_build_dir
, os
.R_OK
):
787 Logs
.pprint('CYAN', "Removing doxygen generated documentation...")
788 shutil
.rmtree(html_build_dir
)
789 Logs
.pprint('CYAN', "Removing doxygen generated documentation done.")
792 # This code blindly assumes it is working in the toplevel source directory.
793 if not os
.path
.exists('svnversion.h'):
794 os
.system('./svnversion_regenerate.sh svnversion.h')