Commit 5e565e68 authored by Stephane Letz's avatar Stephane Letz
Browse files

Merge remote-tracking branch 'upstream/master'

parents 02f74a65 790243f3
...@@ -2,6 +2,7 @@ build/ ...@@ -2,6 +2,7 @@ build/
man/*.1 man/*.1
.lock* .lock*
__pycache__ __pycache__
*.pyc
android/.server/ android/.server/
android/.client/ android/.client/
codeBlocks codeBlocks
...@@ -134,4 +134,5 @@ WAFLIB_STRIP_EXTRAS=" ...@@ -134,4 +134,5 @@ WAFLIB_STRIP_EXTRAS="
why why
win32_opts win32_opts
xcode xcode
xcode6
" "
/* config.h.in. */
#ifndef CONFIG_H
#define CONFIG_H
/* Name of package */
#define PACKAGE $PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "<jack-devel@jackaudio.org>"
#define ADDON_DIR "$ADDON_DIR"
#define JACK_LOCATION "$JACK_LOCATION"
#define JACK_SVNREVISION "$JACK_SVNREVISION"
#endif // CONFIG_H
#! /usr/bin/env python
# encoding: utf-8
from waflib import Context
def configure(conf):
conf.define('HAVE_PPOLL', 1 )
def create_jack_driver_obj(bld, target, sources, uselib = None):
driver = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
#driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE', 'HAVE_PPOLL']
driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE', 'HAVE_PPOLL', 'HAVE_TIMERFD']
driver.includes = ['.', '../linux', '../posix', '../common', '../common/jack', '../dbus', '../']
driver.target = target
driver.source = sources
driver.install_path = '${ADDON_DIR}/'
driver.use = []
if uselib:
driver.use += uselib
return driver
def build(bld):
if bld.env['BUILD_JACKD'] == True:
jackd = bld(features = ['cxx', 'cxxprogram'])
jackd.includes = ['../linux', '../posix', '../common/jack', '../common', '../dbus', '../']
jackd.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
jackd.source = ['../common/Jackdmp.cpp']
jackd.use = ['serverlib']
if bld.env['IS_LINUX'] and bld.env['BUILD_JACKDBUS']:
jackd.source += ['../dbus/reserve.c', '../dbus/audio_reserve.c']
jackd.use += ['PTHREAD', 'DL', 'RT', 'M', 'STDC++', 'DBUS-1']
else:
jackd.use += ['PTHREAD', 'DL', 'RT', 'M', 'STDC++']
jackd.target = 'jackd'
create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
alsa_driver_src = [
'alsa/JackAlsaDriver.cpp',
'alsa/alsa_rawmidi.c',
'alsa/alsa_seqmidi.c',
'alsa/alsa_midi_jackmp.cpp',
'../common/memops.c',
'alsa/generic_hw.c',
'alsa/hdsp.c',
'alsa/alsa_driver.c',
'alsa/hammerfall.c',
'alsa/ice1712.c'
]
alsarawmidi_driver_src = ['alsarawmidi/JackALSARawMidiDriver.cpp',
'alsarawmidi/JackALSARawMidiInputPort.cpp',
'alsarawmidi/JackALSARawMidiOutputPort.cpp',
'alsarawmidi/JackALSARawMidiPort.cpp',
'alsarawmidi/JackALSARawMidiReceiveQueue.cpp',
'alsarawmidi/JackALSARawMidiSendQueue.cpp',
'alsarawmidi/JackALSARawMidiUtil.cpp'
]
ffado_driver_src = ['firewire/JackFFADODriver.cpp',
'firewire/JackFFADOMidiInputPort.cpp',
'firewire/JackFFADOMidiOutputPort.cpp',
'firewire/JackFFADOMidiReceiveQueue.cpp',
'firewire/JackFFADOMidiSendQueue.cpp'
]
iio_driver_src = ['iio/JackIIODriver.cpp']
if bld.env['BUILD_DRIVER_ALSA'] == True:
create_jack_driver_obj(bld, 'alsa', alsa_driver_src, ["ALSA"])
create_jack_driver_obj(bld, 'alsarawmidi', alsarawmidi_driver_src,
["ALSA"])
if bld.env['BUILD_DRIVER_FREEBOB'] == True:
create_jack_driver_obj(bld, 'freebob', 'freebob/JackFreebobDriver.cpp', ["LIBFREEBOB"])
if bld.env['BUILD_DRIVER_FFADO'] == True:
create_jack_driver_obj(bld, 'firewire', ffado_driver_src, ["LIBFFADO"])
if bld.env['BUILD_DRIVER_IIO'] == True:
create_jack_driver_obj(bld, 'iio', iio_driver_src, ["GTKIOSTREAM", "EIGEN3"])
create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp')
create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')
create_jack_driver_obj(bld, 'netone', [ '../common/JackNetOneDriver.cpp',
'../common/netjack.c',
'../common/netjack_packet.c' ], ["SAMPLERATE", "CELT"])
create_jack_driver_obj(bld, 'proxy', '../common/JackProxyDriver.cpp')
#! /usr/bin/env python
# encoding: utf-8
def create_jack_driver_obj(bld, target, sources, uselib = None):
driver = bld.new_task_gen('cxx', 'shlib')
driver.features.append('cc')
driver.env['shlib_PATTERN'] = 'jack_%s.so'
driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack']
driver.target = target
driver.source = sources
driver.install_path = '${ADDON_DIR}/'
driver.uselib_local = 'serverlib'
if uselib:
driver.uselib = uselib
return driver
def create_jack_audio_driver_obj(bld, target, sources, uselib = None):
driver = bld.new_task_gen('cxx', 'shlib')
driver.features.append('cc')
driver.env['shlib_PATTERN'] = 'jack_%s.so'
driver.defines = 'HAVE_CONFIG_H'
driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack']
driver.target = target
driver.source = sources
driver.install_path = '${ADDON_DIR}/'
driver.uselib_local = 'serverlib'
driver.env.append_value("LINKFLAGS", "-framework CoreAudio -framework CoreServices -framework AudioUnit")
if uselib:
driver.uselib = uselib
return driver
def create_jack_midi_driver_obj(bld, target, sources, uselib = None):
driver = bld.new_task_gen('cxx', 'shlib')
driver.features.append('cc')
driver.env['shlib_PATTERN'] = 'jack_%s.so'
driver.defines = 'HAVE_CONFIG_H'
driver.includes = ['.', '../macosx', '../posix', '../common', '../common/jack']
driver.target = target
driver.source = sources
driver.install_path = '${ADDON_DIR}/'
driver.uselib_local = 'serverlib'
driver.env.append_value("LINKFLAGS", "-framework CoreMIDI -framework CoreServices -framework AudioUnit")
if uselib:
driver.uselib = uselib
return driver
def build(bld):
if bld.env['BUILD_JACKD'] == True:
jackd = bld.new_task_gen('cxx', 'program')
jackd.includes = ['.', '../macosx', '../posix', '../common', '../common/jack']
jackd.defines = 'HAVE_CONFIG_H'
jackd.source = ['../common/Jackdmp.cpp']
jackd.uselib = 'PTHREAD DL'
jackd.uselib_local = 'serverlib'
jackd.env.append_value("LINKFLAGS", "-framework CoreFoundation")
jackd.target = 'jackd'
create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')
create_jack_audio_driver_obj(bld, 'coreaudio', 'coreaudio/JackCoreAudioDriver.cpp')
create_jack_midi_driver_obj(
bld,
'coremidi',
['coremidi/JackCoreMidiInputPort.cpp',
'coremidi/JackCoreMidiOutputPort.cpp',
'coremidi/JackCoreMidiPhysicalInputPort.cpp',
'coremidi/JackCoreMidiPhysicalOutputPort.cpp',
'coremidi/JackCoreMidiVirtualInputPort.cpp',
'coremidi/JackCoreMidiVirtualOutputPort.cpp',
'coremidi/JackCoreMidiPort.cpp',
'coremidi/JackCoreMidiUtil.cpp',
'coremidi/JackCoreMidiDriver.cpp'])
portaudio_src = [
'../windows/JackPortAudioDriver.cpp',
'../windows/JackPortAudioDevices.cpp',
]
#create_jack_audio_driver_obj(bld, 'portaudio', portaudio_src)
create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp')
create_jack_driver_obj(bld, 'netone', [ '../common/JackNetOneDriver.cpp',
'../common/netjack.c',
'../common/netjack_packet.c' ], "SAMPLERATE CELT" )
create_jack_driver_obj(bld, 'proxy', '../common/JackProxyDriver.cpp')
#! /usr/bin/env python
# encoding: utf-8
def create_jack_driver_obj(bld, target, sources, uselib = None):
driver = bld.new_task_gen('cxx', 'shlib')
driver.features.append('cc')
driver.env['shlib_PATTERN'] = 'jack_%s.so'
#driver.env.append_unique('CXXFLAGS', '-march=i686 -msse3 -ffast-math')
#driver.env.append_unique('CFLAGS', '-march=i686 -msse3 -ffast-math')
driver.defines = 'HAVE_CONFIG_H'
driver.includes = ['.', '..','../posix', '../common', '../common/jack']
driver.target = target
driver.source = sources
driver.install_path = '${ADDON_DIR}/'
driver.uselib_local = 'serverlib'
if uselib:
driver.uselib = uselib
return driver
def build(bld):
jackd = bld.new_task_gen('cxx', 'program')
jackd.includes = ['.','..', '../posix', '../common/jack', '../common']
jackd.defines = 'HAVE_CONFIG_H'
jackd.source = ['../common/Jackdmp.cpp']
jackd.uselib = 'PTHREAD DL'
jackd.uselib_local = 'serverlib'
jackd.target = 'jackd'
create_jack_driver_obj(bld, 'oss', ['oss/JackOSSDriver.cpp', '../common/memops.c'])
create_jack_driver_obj(bld, 'boomer', ['oss/JackBoomerDriver.cpp', '../common/memops.c'])
create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp')
create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')
create_jack_driver_obj(bld, 'proxy', '../common/JackProxyDriver.cpp')
...@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
import os, sys, inspect import os, sys, inspect
VERSION="1.8.14" VERSION="1.8.17"
REVISION="x" REVISION="x"
GIT="x" GIT="x"
INSTALL="x" INSTALL="x"
......
...@@ -44,6 +44,10 @@ POST_LAZY = 1 ...@@ -44,6 +44,10 @@ POST_LAZY = 1
POST_BOTH = 2 POST_BOTH = 2
"""Post mode: post the task generators at once, then re-check them for each group""" """Post mode: post the task generators at once, then re-check them for each group"""
PROTOCOL = -1
if sys.platform == 'cli':
PROTOCOL = 0
class BuildContext(Context.Context): class BuildContext(Context.Context):
'''executes the build''' '''executes the build'''
...@@ -322,7 +326,7 @@ class BuildContext(Context.Context): ...@@ -322,7 +326,7 @@ class BuildContext(Context.Context):
try: try:
waflib.Node.pickle_lock.acquire() waflib.Node.pickle_lock.acquire()
waflib.Node.Nod3 = self.node_class waflib.Node.Nod3 = self.node_class
x = cPickle.dumps(data, -1) x = cPickle.dumps(data, PROTOCOL)
finally: finally:
waflib.Node.pickle_lock.release() waflib.Node.pickle_lock.release()
...@@ -821,17 +825,10 @@ class inst(Task.Task): ...@@ -821,17 +825,10 @@ class inst(Task.Task):
else: else:
y = self.path.find_resource(x) y = self.path.find_resource(x)
if not y: if not y:
if Logs.verbose: if os.path.isabs(x):
Logs.warn('Could not find %s immediately (may cause broken builds)' % x) y = self.bld.root.make_node(x)
idx = self.generator.bld.get_group_idx(self)
for tg in self.generator.bld.groups[idx]:
if not isinstance(tg, inst) and id(tg) != id(self):
tg.post()
y = self.path.find_resource(x)
if y:
break
else: else:
raise Errors.WafError('Could not find %r in %r' % (x, self.path)) y = self.path.make_node(x)
buf.append(y) buf.append(y)
self.inputs = buf self.inputs = buf
...@@ -1039,6 +1036,7 @@ class InstallContext(BuildContext): ...@@ -1039,6 +1036,7 @@ class InstallContext(BuildContext):
:param postpone: execute the task immediately to perform the installation :param postpone: execute the task immediately to perform the installation
:type postpone: bool :type postpone: bool
""" """
assert(dest)
tsk = inst(env=env or self.env) tsk = inst(env=env or self.env)
tsk.bld = self tsk.bld = self
tsk.path = cwd or self.path tsk.path = cwd or self.path
...@@ -1075,6 +1073,7 @@ class InstallContext(BuildContext): ...@@ -1075,6 +1073,7 @@ class InstallContext(BuildContext):
:param postpone: execute the task immediately to perform the installation :param postpone: execute the task immediately to perform the installation
:type postpone: bool :type postpone: bool
""" """
assert(dest)
tsk = inst(env=env or self.env) tsk = inst(env=env or self.env)
tsk.bld = self tsk.bld = self
tsk.path = cwd or self.path tsk.path = cwd or self.path
...@@ -1107,11 +1106,11 @@ class InstallContext(BuildContext): ...@@ -1107,11 +1106,11 @@ class InstallContext(BuildContext):
:param relative_trick: make the symlink relative (default: ``False``) :param relative_trick: make the symlink relative (default: ``False``)
:type relative_trick: bool :type relative_trick: bool
""" """
if Utils.is_win32: if Utils.is_win32:
# symlinks *cannot* work on that platform # symlinks *cannot* work on that platform
# TODO waf 1.9 - replace by install_as
return return
assert(dest)
tsk = inst(env=env or self.env) tsk = inst(env=env or self.env)
tsk.bld = self tsk.bld = self
tsk.dest = dest tsk.dest = dest
......
...@@ -151,14 +151,8 @@ class ConfigurationContext(Context.Context): ...@@ -151,14 +151,8 @@ class ConfigurationContext(Context.Context):
if ver: if ver:
app = "%s (%s)" % (app, ver) app = "%s (%s)" % (app, ver)
now = time.ctime() params = {'now': time.ctime(), 'pyver': sys.hexversion, 'systype': sys.platform, 'args': " ".join(sys.argv), 'wafver': Context.WAFVERSION, 'abi': Context.ABI, 'app': app}
pyver = sys.hexversion self.to_log(conf_template % params)
systype = sys.platform
args = " ".join(sys.argv)
wafver = Context.WAFVERSION
abi = Context.ABI
self.to_log(conf_template % vars())
self.msg('Setting top to', self.srcnode.abspath()) self.msg('Setting top to', self.srcnode.abspath())
self.msg('Setting out to', self.bldnode.abspath()) self.msg('Setting out to', self.bldnode.abspath())
...@@ -208,17 +202,17 @@ class ConfigurationContext(Context.Context): ...@@ -208,17 +202,17 @@ class ConfigurationContext(Context.Context):
""" """
if not env.PREFIX: if not env.PREFIX:
if Options.options.prefix or Utils.is_win32: if Options.options.prefix or Utils.is_win32:
env.PREFIX = os.path.abspath(os.path.expanduser(Options.options.prefix)) env.PREFIX = Utils.sane_path(Options.options.prefix)
else: else:
env.PREFIX = '' env.PREFIX = ''
if not env.BINDIR: if not env.BINDIR:
if Options.options.bindir: if Options.options.bindir:
env.BINDIR = os.path.abspath(os.path.expanduser(Options.options.bindir)) env.BINDIR = Utils.sane_path(Options.options.bindir)
else: else:
env.BINDIR = Utils.subst_vars('${PREFIX}/bin', env) env.BINDIR = Utils.subst_vars('${PREFIX}/bin', env)
if not env.LIBDIR: if not env.LIBDIR:
if Options.options.libdir: if Options.options.libdir:
env.LIBDIR = os.path.abspath(os.path.expanduser(Options.options.libdir)) env.LIBDIR = Utils.sane_path(Options.options.libdir)
else: else:
env.LIBDIR = Utils.subst_vars('${PREFIX}/lib%s' % Utils.lib64(), env) env.LIBDIR = Utils.subst_vars('${PREFIX}/lib%s' % Utils.lib64(), env)
...@@ -347,6 +341,7 @@ def conf(f): ...@@ -347,6 +341,7 @@ def conf(f):
if mandatory: if mandatory:
raise raise
fun.__name__ = f.__name__
setattr(ConfigurationContext, f.__name__, fun) setattr(ConfigurationContext, f.__name__, fun)
setattr(Build.BuildContext, f.__name__, fun) setattr(Build.BuildContext, f.__name__, fun)
return f return f
...@@ -422,7 +417,7 @@ def find_file(self, filename, path_list=[]): ...@@ -422,7 +417,7 @@ def find_file(self, filename, path_list=[]):
""" """
for n in Utils.to_list(filename): for n in Utils.to_list(filename):
for d in Utils.to_list(path_list): for d in Utils.to_list(path_list):
p = os.path.join(d, n) p = os.path.expanduser(os.path.join(d, n))
if os.path.exists(p): if os.path.exists(p):
return p return p
self.fatal('Could not find %r' % filename) self.fatal('Could not find %r' % filename)
...@@ -529,7 +524,6 @@ def find_binary(self, filenames, exts, paths): ...@@ -529,7 +524,6 @@ def find_binary(self, filenames, exts, paths):
return x return x
return None return None
@conf @conf
def run_build(self, *k, **kw): def run_build(self, *k, **kw):
""" """
......
...@@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs ...@@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs
import waflib.Node import waflib.Node
# the following 3 constants are updated on each new release (do not touch) # the following 3 constants are updated on each new release (do not touch)
HEXVERSION=0x1080e00 HEXVERSION=0x1081100
"""Constant updated on new releases""" """Constant updated on new releases"""
WAFVERSION="1.8.14" WAFVERSION="1.8.17"
"""Constant updated on new releases""" """Constant updated on new releases"""
WAFREVISION="ce8234c396bb246a20ea9f51594ee051d5b378e7" WAFREVISION="cd7579a727d1b390bf9cbf111c1b20e811370bc0"
"""Git revision when the waf version is updated""" """Git revision when the waf version is updated"""
ABI = 98 ABI = 98
...@@ -307,6 +307,10 @@ class Context(ctx): ...@@ -307,6 +307,10 @@ class Context(ctx):
elif not node: elif not node:
if not mandatory: if not mandatory:
continue continue
try:
os.listdir(d)
except OSError:
raise Errors.WafError('Cannot read the folder %r' % d)
raise Errors.WafError('No wscript file in directory %s' % d) raise Errors.WafError('No wscript file in directory %s' % d)
def exec_command(self, cmd, **kw): def exec_command(self, cmd, **kw):
...@@ -610,7 +614,7 @@ class Context(ctx): ...@@ -610,7 +614,7 @@ class Context(ctx):
doban = False doban = False
for b in ban: for b in ban:
r = b.replace("*", ".*") r = b.replace("*", ".*")
if re.match(b, f): if re.match(r, f):
doban = True doban = True
if not doban: if not doban:
f = f.replace('.py', '') f = f.replace('.py', '')
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
logging, colors, terminal width and pretty-print logging, colors, terminal width and pretty-print
""" """
import os, re, traceback, sys, types import os, re, traceback, sys
from waflib import Utils, ansiterm from waflib import Utils, ansiterm
if not os.environ.get('NOSYNC', False): if not os.environ.get('NOSYNC', False):
...@@ -43,6 +43,11 @@ colors_lst = { ...@@ -43,6 +43,11 @@ colors_lst = {
indicator = '\r\x1b[K%s%s%s' indicator = '\r\x1b[K%s%s%s'
try:
unicode
except NameError:
unicode = None
def enable_colors(use): def enable_colors(use):
if use == 1: if use == 1:
if not (sys.stderr.isatty() or sys.stdout.isatty()): if not (sys.stderr.isatty() or sys.stdout.isatty()):
...@@ -150,7 +155,7 @@ class log_handler(logging.StreamHandler): ...@@ -150,7 +155,7 @@ class log_handler(logging.StreamHandler):
def emit_override(self, record, **kw): def emit_override(self, record, **kw):
self.terminator = getattr(record, 'terminator', '\n') self.terminator = getattr(record, 'terminator', '\n')
stream = self.stream stream = self.stream
if hasattr(types, "UnicodeType"): if unicode:
# python2 # python2
msg = self.formatter.format(record) msg = self.formatter.format(record)
fs = '%s' + self.terminator fs = '%s' + self.terminator
...@@ -316,7 +321,7 @@ def free_logger(logger): ...@@ -316,7 +321,7 @@ def free_logger(logger):
for x in logger.handlers: for x in logger.handlers:
x.close() x.close()
logger.removeHandler(x) logger.removeHandler(x)
except Exception as e: except Exception:
pass pass
def pprint(col, msg, label='', sep='\n'): def pprint(col, msg, label='', sep='\n'):
......
...@@ -59,14 +59,11 @@ Ant patterns for files and folders to exclude while doing the ...@@ -59,14 +59,11 @@ Ant patterns for files and folders to exclude while doing the
recursive traversal in :py:meth:`waflib.Node.Node.ant_glob` recursive traversal in :py:meth:`waflib.Node.Node.ant_glob`
""" """
# TODO waf 1.9 # TODO remove in waf 1.9
split_path = Utils.split_path_unix split_path = Utils.split_path
split_path_unix = Utils.split_path_unix
split_path_cygwin = Utils.split_path_cygwin split_path_cygwin = Utils.split_path_cygwin
split_path_win32 = Utils.split_path_win32 split_path_win32 = Utils.split_path_win32
if sys.platform == 'cygwin':
split_path = split_path_cygwin
elif Utils.is_win32:
split_path = split_path_win32
class Node(object): class Node(object):
""" """
...@@ -152,6 +149,69 @@ class Node(object): ...@@ -152,6 +149,69 @@ class Node(object):
""" """
Utils.writef(self.abspath(), data, flags, encoding) Utils.writef(self.abspath(), data, flags, encoding)
def read_json(self, convert=True, encoding='utf-8'):