Browse Source

waf: Nitpick styling for consistency. Fixes #172.

tags/v1.9.12
Karl Linden 6 years ago
parent
commit
c21c774855
No known key found for this signature in database GPG Key ID: 1961C090EF542D56
5 changed files with 79 additions and 81 deletions
  1. +25
    -27
      common/wscript
  2. +6
    -6
      example-clients/wscript
  3. +1
    -1
      man/wscript
  4. +3
    -3
      tests/wscript
  5. +44
    -44
      wscript

+ 25
- 27
common/wscript View File

@@ -10,12 +10,12 @@ def configure(conf):

if conf.env['IS_WINDOWS']:
try:
conf.check(function_name='regcomp', header_name='regex.h', lib='regex', uselib_store="REGEX", define_name='HAVE_REGEX_H')
conf.check(function_name='regcomp', header_name='regex.h', lib='regex', uselib_store='REGEX', define_name='HAVE_REGEX_H')
except:
conf.check(function_name='regcomp', header_name='regex.h', lib='tre', uselib_store="REGEX", define_name='HAVE_REGEX_H')
conf.check(function_name='htons', header_name='winsock2.h', lib='ws2_32', uselib_store="WS2_32", define_name='HAVE_WINSOCK2_H')
conf.check(function_name='timeGetDevCaps', header_name=['windows.h', 'mmsystem.h'], lib='winmm', uselib_store="WINMM", define_name='HAVE_MMSYSTEM_H')
conf.check(function_name='EnumProcesses', header_name=['windows.h', 'psapi.h'], lib='psapi', uselib_store="PSAPI", define_name='HAVE_PSAPI_H')
conf.check(function_name='regcomp', header_name='regex.h', lib='tre', uselib_store='REGEX', define_name='HAVE_REGEX_H')
conf.check(function_name='htons', header_name='winsock2.h', lib='ws2_32', uselib_store='WS2_32', define_name='HAVE_WINSOCK2_H')
conf.check(function_name='timeGetDevCaps', header_name=['windows.h', 'mmsystem.h'], lib='winmm', uselib_store='WINMM', define_name='HAVE_MMSYSTEM_H')
conf.check(function_name='EnumProcesses', header_name=['windows.h', 'psapi.h'], lib='psapi', uselib_store='PSAPI', define_name='HAVE_PSAPI_H')

def create_jack_process_obj(bld, target, sources, uselib = None, framework = None):
process = bld(features = ['cxx', 'cxxshlib'])
@@ -36,10 +36,8 @@ def create_jack_process_obj(bld, target, sources, uselib = None, framework = Non
process.name = target
process.target = target
process.source = sources
if bld.env['IS_LINUX']:
process.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_MACOSX']:
process.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']:
process.env.append_value('CPPFLAGS', '-fvisibility=hidden')
process.install_path = '${ADDON_DIR}/'
process.use = [uselib.name]
return process
@@ -76,7 +74,7 @@ def build(bld):
includes.append('..')
else:
includes.append('../..')
uselib = ["PTHREAD", "CELT", "OPUS"]
uselib = ['PTHREAD', 'CELT', 'OPUS']

if bld.env['IS_LINUX']:
common_libsources += [
@@ -145,7 +143,7 @@ def build(bld):
clientlib.install_path = '${BINDIR}'
else:
clientlib.install_path = '${LIBDIR}'
if bld.env['AUTOSTART_METHOD'] == "dbus":
if bld.env['AUTOSTART_METHOD'] == 'dbus':
clientlib.use.append('DBUS-1')
clientlib.includes = includes
clientlib.name = 'clientlib'
@@ -185,14 +183,14 @@ def build(bld):
clientlib.vnum = bld.env['JACK_API_VERSION']

if bld.env['IS_LINUX']:
clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')

if bld.env['IS_MACOSX']:
clientlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
clientlib.env.append_value("LINKFLAGS", "-single_module")
clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
clientlib.env.append_value('LINKFLAGS', '-single_module')

if bld.env['IS_SUN']:
clientlib.env.append_value("LINKFLAGS", "-lnsl -lsocket")
clientlib.env.append_value('LINKFLAGS', '-lnsl -lsocket')

if bld.variant:
# if there is variant defined, we expect it to be the 32bit client lib one
@@ -284,14 +282,14 @@ def build(bld):
serverlib.vnum = bld.env['JACK_API_VERSION']

if bld.env['IS_LINUX']:
serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
serverlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')

if bld.env['IS_MACOSX']:
serverlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
serverlib.env.append_value("LINKFLAGS", "-single_module")
serverlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
serverlib.env.append_value('LINKFLAGS', '-single_module')

if bld.env['IS_SUN']:
serverlib.env.append_value("LINKFLAGS", "-lnsl -lsocket")
serverlib.env.append_value('LINKFLAGS', '-lnsl -lsocket')

if bld.env['BUILD_NETLIB']:
netlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
@@ -323,16 +321,16 @@ def build(bld):

if bld.env['IS_LINUX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../linux/JackLinuxTime.c']
netlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
netlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')

if bld.env['IS_SUN']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../solaris/JackSolarisTime.c']
netlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
netlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')

if bld.env['IS_MACOSX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../macosx/JackMachThread.mm', '../macosx/JackMachTime.c']
netlib.env.append_value("LINKFLAGS", "-single_module")
netlib.env.append_value('LINKFLAGS', '-single_module')

if bld.env['IS_WINDOWS']:
netlib.source += ['../windows/JackNetWinSocket.cpp','../windows/JackWinThread.cpp', '../windows/JackMMCSS.cpp', '../windows/JackWinTime.c']
@@ -370,10 +368,10 @@ def build(bld):
audio_adapter_sources,
serverlib,
framework = [
"CoreAudio",
"AudioUnit",
"AudioToolbox",
"CoreServices"
'CoreAudio',
'AudioUnit',
'AudioToolbox',
'CoreServices'
]
)
process.use += ['SAMPLERATE']


+ 6
- 6
example-clients/wscript View File

@@ -67,7 +67,7 @@ def build(bld):
use = ['clientlib']

if bld.env['IS_MACOSX']:
prog = bld(features='c cprogram', framework = ["Foundation"])
prog = bld(features='c cprogram', framework = ['Foundation'])
else:
prog = bld(features='c cprogram')
prog.includes = os_incdir + ['../common/jack', '../common']
@@ -79,7 +79,7 @@ def build(bld):
prog.use += ['M']

prog.target = example_program
if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT']:
prog = bld(features = 'c cprogram')
prog.includes = os_incdir + ['../common/jack', '../common']
@@ -112,7 +112,7 @@ def build(bld):
prog = bld(features = 'c cprogram')
prog.includes = os_incdir + ['.', '..', '../common/jack', '../common']
prog.source = ['netsource.c', '../common/netjack_packet.c']
prog.env.append_value("CFLAGS", "-DNO_JACK_ERROR")
prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR')
prog.use = ['CELT', 'SAMPLERATE', 'OPUS', 'M', 'clientlib']
prog.target = 'jack_netsource'
prog.defines = ['HAVE_CONFIG_H']
@@ -121,14 +121,14 @@ def build(bld):
prog = bld(features = 'c cprogram')
prog.includes = os_incdir + ['../common/jack', '../common']
prog.source = ['alsa_in.c', '../common/memops.c']
prog.env.append_value("CFLAGS", "-DNO_JACK_ERROR")
prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR')
prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M']
prog.target = 'alsa_in'

prog = bld(features = 'c cprogram')
prog.includes = os_incdir + ['../common/jack', '../common']
prog.source = ['alsa_out.c', '../common/memops.c']
prog.env.append_value("CFLAGS", "-DNO_JACK_ERROR")
prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR')
prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M']
prog.target = 'alsa_out'

@@ -140,7 +140,7 @@ def build(bld):
lib.target = example_lib
lib.source = example_lib_source
if bld.env['IS_SUN']:
lib.env.append_value("LINKFLAGS", "-lm")
lib.env.append_value('LINKFLAGS', '-lm')
lib.use = 'serverlib'
lib.install_path = '${ADDON_DIR}/'



+ 1
- 1
man/wscript View File

@@ -6,6 +6,6 @@ import os


def build(bld):
bld.exec_command("cd man ; sh fill_template %s" % bld.env['JACK_VERSION'])
bld.exec_command('cd man ; sh fill_template %s' % bld.env['JACK_VERSION'])
bld.install_files(bld.env['MANDIR'], bld.path.ant_glob('*.1'))


+ 3
- 3
tests/wscript View File

@@ -17,11 +17,11 @@ def build(bld):
for test_program, test_program_sources in list(test_programs.items()):
prog = bld(features = 'cxx cxxprogram')
if bld.env['IS_MACOSX']:
prog.includes = ['..','../macosx', '../posix', '../common/jack', '../common']
prog.includes = ['..','../macosx', '../posix', '../common/jack', '../common']
if bld.env['IS_LINUX']:
prog.includes = ['..','../linux', '../posix', '../common/jack', '../common']
prog.includes = ['..','../linux', '../posix', '../common/jack', '../common']
if bld.env['IS_SUN']:
prog.includes = ['..','../solaris', '../posix', '../common/jack', '../common']
prog.includes = ['..','../solaris', '../posix', '../common/jack', '../common']
prog.source = test_program_sources
if bld.env['IS_LINUX']:
prog.uselib = 'RT'


+ 44
- 44
wscript View File

@@ -391,10 +391,10 @@ def options(opt):
opt.load('xcode6')

# install directories
opt.add_option('--htmldir', type='string', default=None, help="HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/")
opt.add_option('--libdir', type='string', help="Library directory [Default: <prefix>/lib]")
opt.add_option('--libdir32', type='string', help="32bit Library directory [Default: <prefix>/lib32]")
opt.add_option('--mandir', type='string', help="Manpage directory [Default: <prefix>/share/man/man1]")
opt.add_option('--htmldir', type='string', default=None, help='HTML documentation directory [Default: <prefix>/share/jack-audio-connection-kit/reference/html/')
opt.add_option('--libdir', type='string', help='Library directory [Default: <prefix>/lib]')
opt.add_option('--libdir32', type='string', help='32bit Library directory [Default: <prefix>/lib32]')
opt.add_option('--mandir', type='string', help='Manpage directory [Default: <prefix>/share/man/man1]')

# options affecting binaries
opt.add_option('--platform', type='string', default=sys.platform, help='Target platform for cross-compiling, e.g. cygwin or win32')
@@ -404,10 +404,10 @@ def options(opt):
# options affecting general jack functionality
opt.add_option('--classic', action='store_true', default=False, help='Force enable standard JACK (jackd) even if D-Bus JACK (jackdbus) is enabled too')
opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)')
opt.add_option('--autostart', type='string', default="default", help='Autostart method. Possible values: "default", "classic", "dbus", "none"')
opt.add_option('--autostart', type='string', default='default', help='Autostart method. Possible values: "default", "classic", "dbus", "none"')
opt.add_option('--profile', action='store_true', default=False, help='Build with engine profiling')
opt.add_option('--clients', default=64, type="int", dest="clients", help='Maximum number of JACK clients')
opt.add_option('--ports-per-application', default=768, type="int", dest="application_ports", help='Maximum number of ports per application')
opt.add_option('--clients', default=64, type='int', dest='clients', help='Maximum number of JACK clients')
opt.add_option('--ports-per-application', default=768, type='int', dest='application_ports', help='Maximum number of ports per application')

# options with third party dependencies
doxygen = add_auto_option(opt, 'doxygen', help='Build doxygen documentation', conf_dest='BUILD_DOXYGEN_DOCS')
@@ -509,19 +509,19 @@ def configure(conf):
conf.recurse('example-clients')

# test for the availability of ucontext, and how it should be used
for t in ("gp_regs", "uc_regs", "mc_gregs", "gregs"):
fragment = "#include <ucontext.h>\n"
fragment += "int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }" % t
confvar = "HAVE_UCONTEXT_%s" % t.upper()
for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
fragment = '#include <ucontext.h>\n'
fragment += 'int main() { ucontext_t *ucontext; return (int) ucontext->uc_mcontext.%s[0]; }' % t
confvar = 'HAVE_UCONTEXT_%s' % t.upper()
conf.check_cc(fragment=fragment, define_name=confvar, mandatory=False,
msg="Checking for ucontext->uc_mcontext.%s" % t)
msg='Checking for ucontext->uc_mcontext.%s' % t)
if conf.is_defined(confvar):
conf.define('HAVE_UCONTEXT', 1)

fragment = "#include <ucontext.h>\n"
fragment += "int main() { return NGREG; }"
conf.check_cc(fragment=fragment, define_name="HAVE_NGREG", mandatory=False,
msg="Checking for NGREG")
fragment = '#include <ucontext.h>\n'
fragment += 'int main() { return NGREG; }'
conf.check_cc(fragment=fragment, define_name='HAVE_NGREG', mandatory=False,
msg='Checking for NGREG')

conf.env['LIB_PTHREAD'] = ['pthread']
conf.env['LIB_DL'] = ['dl']
@@ -565,10 +565,10 @@ def configure(conf):
conf.env.append_unique('CFLAGS', '-g')
conf.env.append_unique('LINKFLAGS', '-g')

if not Options.options.autostart in ["default", "classic", "dbus", "none"]:
conf.fatal("Invalid autostart value \"" + Options.options.autostart + "\"")
if not Options.options.autostart in ['default', 'classic', 'dbus' 'none']:
conf.fatal('Invalid autostart value "' + Options.options.autostart + '"')

if Options.options.autostart == "default":
if Options.options.autostart == 'default':
if conf.env['BUILD_JACKD']:
conf.env['AUTOSTART_METHOD'] = 'classic'
else:
@@ -576,14 +576,14 @@ def configure(conf):
else:
conf.env['AUTOSTART_METHOD'] = Options.options.autostart

if conf.env['AUTOSTART_METHOD'] == "dbus" and not conf.env['BUILD_JACKDBUS']:
conf.fatal("D-Bus autostart mode was specified but jackdbus will not be built")
if conf.env['AUTOSTART_METHOD'] == "classic" and not conf.env['BUILD_JACKD']:
conf.fatal("Classic autostart mode was specified but jackd will not be built")
if conf.env['AUTOSTART_METHOD'] == 'dbus' and not conf.env['BUILD_JACKDBUS']:
conf.fatal('D-Bus autostart mode was specified but jackdbus will not be built')
if conf.env['AUTOSTART_METHOD'] == 'classic' and not conf.env['BUILD_JACKD']:
conf.fatal('Classic autostart mode was specified but jackd will not be built')

if conf.env['AUTOSTART_METHOD'] == "dbus":
if conf.env['AUTOSTART_METHOD'] == 'dbus':
conf.define('USE_LIBDBUS_AUTOLAUNCH', 1)
elif conf.env['AUTOSTART_METHOD'] == "classic":
elif conf.env['AUTOSTART_METHOD'] == 'classic':
conf.define('USE_CLASSIC_AUTOLAUNCH', 1)

conf.define('CLIENT_NUM', Options.options.clients)
@@ -634,18 +634,18 @@ def configure(conf):

print()
print('==================')
version_msg = "JACK " + VERSION
version_msg = 'JACK ' + VERSION
if svnrev:
version_msg += " exported from r" + svnrev
version_msg += ' exported from r' + svnrev
else:
version_msg += " svn revision will checked and eventually updated during build"
version_msg += ' svn revision will checked and eventually updated during build'
print(version_msg)

conf.msg('Maximum JACK clients', Options.options.clients, color='NORMAL')
conf.msg('Maximum ports per application', Options.options.application_ports, color='NORMAL')

conf.msg('Install prefix', conf.env['PREFIX'], color='CYAN')
conf.msg('Library directory', conf.all_envs[""]['LIBDIR'], color='CYAN')
conf.msg('Library directory', conf.all_envs['']['LIBDIR'], color='CYAN')
if conf.env['BUILD_WITH_32_64']:
conf.msg('32-bit library directory', conf.all_envs[lib32]['LIBDIR'], color='CYAN')
conf.msg('Drivers directory', conf.env['ADDON_DIR'], color='CYAN')
@@ -659,7 +659,7 @@ def configure(conf):
for name,vars in tool_flags:
flags = []
for var in vars:
flags += conf.all_envs[""][var]
flags += conf.all_envs[''][var]
conf.msg(name, repr(flags), color='NORMAL')

if conf.env['BUILD_WITH_32_64']:
@@ -685,11 +685,11 @@ def configure(conf):

if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
print()
print(Logs.colors.RED + "WARNING: D-Bus session services directory as reported by pkg-config is")
print(Logs.colors.RED + "WARNING:", end=' ')
print(Logs.colors.RED + 'WARNING: D-Bus session services directory as reported by pkg-config is')
print(Logs.colors.RED + 'WARNING:', end=' ')
print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR_REAL'])
print(Logs.colors.RED + 'WARNING: but service file will be installed in')
print(Logs.colors.RED + "WARNING:", end=' ')
print(Logs.colors.RED + 'WARNING:', end=' ')
print(Logs.colors.CYAN + conf.env['DBUS_SERVICES_DIR'])
print(Logs.colors.RED + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus')
print('WARNING: You can override dbus service install directory')
@@ -761,7 +761,7 @@ def create_driver_obj(bld, **kw):
kw['use'] = ['serverlib']

driver = bld(
features = ['c', 'cshlib', 'cxx', 'cxxshlib'],
features = ['c', 'cxx', 'cshlib', 'cxxshlib'],
defines = ['HAVE_CONFIG_H', 'SERVER_SIDE'],
includes = ['.', 'common', 'common/jack'],
install_path = '${ADDON_DIR}/',
@@ -1067,22 +1067,22 @@ def build(bld):

if bld.cmd == 'install':
if os.path.isdir(html_install_dir):
Logs.pprint('CYAN', "Removing old doxygen documentation installation...")
Logs.pprint('CYAN', 'Removing old doxygen documentation installation...')
shutil.rmtree(html_install_dir)
Logs.pprint('CYAN', "Removing old doxygen documentation installation done.")
Logs.pprint('CYAN', "Installing doxygen documentation...")
Logs.pprint('CYAN', 'Removing old doxygen documentation installation done.')
Logs.pprint('CYAN', 'Installing doxygen documentation...')
shutil.copytree(html_build_dir, html_install_dir)
Logs.pprint('CYAN', "Installing doxygen documentation done.")
Logs.pprint('CYAN', 'Installing doxygen documentation done.')
elif bld.cmd =='uninstall':
Logs.pprint('CYAN', "Uninstalling doxygen documentation...")
Logs.pprint('CYAN', 'Uninstalling doxygen documentation...')
if os.path.isdir(share_dir):
shutil.rmtree(share_dir)
Logs.pprint('CYAN', "Uninstalling doxygen documentation done.")
Logs.pprint('CYAN', 'Uninstalling doxygen documentation done.')
elif bld.cmd =='clean':
if os.access(html_build_dir, os.R_OK):
Logs.pprint('CYAN', "Removing doxygen generated documentation...")
Logs.pprint('CYAN', 'Removing doxygen generated documentation...')
shutil.rmtree(html_build_dir)
Logs.pprint('CYAN', "Removing doxygen generated documentation done.")
Logs.pprint('CYAN', 'Removing doxygen generated documentation done.')

def dist(ctx):
# This code blindly assumes it is working in the toplevel source directory.
@@ -1092,5 +1092,5 @@ def dist(ctx):
from waflib import TaskGen
@TaskGen.extension('.mm')
def mm_hook(self, node):
"""Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
return self.create_compiled_task('cxx', node)
"""Alias .mm files to be compiled the same as .cpp files, gcc will do the right thing."""
return self.create_compiled_task('cxx', node)

Loading…
Cancel
Save