From: Paul Brossier Date: Sun, 10 Feb 2013 00:03:21 +0000 (-0500) Subject: waf: update to 1.7.9 X-Git-Tag: 0.4.0-beta1~335^2~27 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=6ed0f4ee598ff53b9223e916c5a6e1ba4ec17f31;p=aubio.git waf: update to 1.7.9 --- diff --git a/examples/wscript_build b/examples/wscript_build index 6cb25ee0..3a4f0cd0 100644 --- a/examples/wscript_build +++ b/examples/wscript_build @@ -1,19 +1,19 @@ # vim:set syntax=python: # build examples -utilsio = ctx.new_task_gen(name = 'utilsio', features = 'c', - includes = '../src', - source = ['utils.c', 'jackio.c'], - uselib = ['LASH', 'JACK'], - target = 'utilsio') +utilsio = bld( + name = 'utilsio', + features = 'c', + includes = '../src', + source = ['utils.c', 'jackio.c'], + uselib = ['LASH', 'JACK'], + target = 'utilsio') # loop over all *.c filenames in examples to build them all -for target_name in ctx.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c']): - ctx.new_task_gen(features = 'c cprogram', - add_objects = 'utilsio', +for source_file in ctx.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c']): + bld.program(features = 'c cprogram', includes = '../src', - uselib = ['LASH', 'JACK', 'SNDFILE'], - use = 'aubio', - source = target_name, - # program name is filename.c without the .c - target = str(target_name).split('.')[0]) + use = ['aubio', 'LASH', 'JACK', 'SNDFILE', 'utilsio'], + source = str(source_file), + target = str(source_file).split('.')[0] + ) diff --git a/src/wscript_build b/src/wscript_build index 5333b8a0..1fa905d7 100644 --- a/src/wscript_build +++ b/src/wscript_build @@ -24,6 +24,6 @@ ctx.shlib( # install headers, except _priv.h ones ctx.install_files('${PREFIX}/include/aubio/', - ctx.path.ant_glob('**/*.h', - exclude = ['_priv.h', 'config.h']), - relative_trick=True) + + ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']), + relative_trick=True) diff --git a/tests/wscript_build b/tests/wscript_build new file mode 100644 index 00000000..145a3e92 --- /dev/null +++ b/tests/wscript_build @@ -0,0 +1,21 @@ +# vim:set syntax=python: + +for target_name in ctx.path.ant_glob('src/**/*.c'): + uselib = [] + includes = ['../src'] + extra_source = [] + if str(target_name).endswith('-jack.c') and ctx.env['JACK']: + uselib += ['JACK'] + includes += ['../examples'] + extra_source += ['../examples/jackio.c'] + + bld(features = 'c cprogram test', + uselib = uselib, + source = [target_name] + extra_source, + target = str(target_name).split('.')[0], + includes = includes, + install_path = None, + defines = 'AUBIO_UNSTABLE_API=1', + cflags = ['-g'], + use = 'aubio') + diff --git a/waf b/waf index ed987cb0..c55d478f 100755 Binary files a/waf and b/waf differ diff --git a/wscript b/wscript index 1ff6ebd2..fa60eb36 100644 --- a/wscript +++ b/wscript @@ -52,13 +52,11 @@ def options(ctx): ctx.add_option('--with-target-platform', type='string', help='set target platform for cross-compilation', dest='target_platform') ctx.load('compiler_c') - ctx.load('gnu_dirs') ctx.load('waf_unit_test') def configure(ctx): - import Options - ctx.check_tool('compiler_c') - ctx.check_tool('gnu_dirs') # helpful for autotools transition and .pc generation + from waflib import Options + ctx.load('compiler_c') ctx.load('waf_unit_test') ctx.env.CFLAGS = ['-g', '-Wall', '-Wextra'] @@ -179,16 +177,14 @@ def configure(ctx): except ctx.errors.ConfigurationError: ctx.to_log('docbook-to-man was not found (ignoring)') -def build(ctx): - ctx.env['VERSION'] = VERSION - ctx.env['LIB_VERSION'] = LIB_VERSION +def build(bld): + bld.env['VERSION'] = VERSION + bld.env['LIB_VERSION'] = LIB_VERSION # add sub directories - ctx.add_subdirs(['src','examples']) - if ctx.env['SWIG']: - if ctx.env['PYTHON']: - ctx.add_subdirs('python') + bld.recurse('src examples tests') + """ # create the aubio.pc file for pkg-config if ctx.env['TARGET_PLATFORM'] == 'linux': aubiopc = ctx.new_task_gen('subst') @@ -211,33 +207,6 @@ def build(ctx): ctx.install_files('${MANDIR}/man1', ctx.path.ant_glob('doc/*.1')) # install woodblock sound - ctx.install_files('${PREFIX}/share/sounds/aubio/', + bld.install_files('${PREFIX}/share/sounds/aubio/', 'sounds/woodblock.aiff') - - # build and run the unit tests - build_tests(ctx) - -def shutdown(ctx): - pass - -# loop over all *.c filenames in tests/src to build them all -# target name is filename.c without the .c -def build_tests(ctx): - for target_name in ctx.path.ant_glob('tests/src/**/*.c'): - uselib = [] - includes = ['src'] - extra_source = [] - if str(target_name).endswith('-jack.c') and ctx.env['JACK']: - uselib += ['JACK'] - includes += ['examples'] - extra_source += ['examples/jackio.c'] - - this_target = ctx.new_task_gen( - features = 'c cprogram test', - uselib = uselib, - source = [target_name] + extra_source, - target = str(target_name).split('.')[0], - includes = includes, - defines = 'AUBIO_UNSTABLE_API=1', - cflags = ['-g'], - use = 'aubio') + """