waf: update to 1.7.9
authorPaul Brossier <piem@piem.org>
Sun, 10 Feb 2013 00:03:21 +0000 (19:03 -0500)
committerPaul Brossier <piem@piem.org>
Sun, 10 Feb 2013 00:03:21 +0000 (19:03 -0500)
examples/wscript_build
src/wscript_build
tests/wscript_build [new file with mode: 0644]
waf
wscript

index 6cb25ee0c6687fe35a4eccc0bea485cd327cbb56..3a4f0cd08cd6f475bacfb20198b81ad30ea9e280 100644 (file)
@@ -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]
+    )
index 5333b8a0126347cba257a7ef10395de1f546ff7b..1fa905d7244cc6a805a534d6cbd1c110acd79d23 100644 (file)
@@ -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 (file)
index 0000000..145a3e9
--- /dev/null
@@ -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 ed987cb0c84498361a4173720e0f00d03bc97a0a..c55d478ff86f598a12b45baa1c9cca742395d9f1 100755 (executable)
Binary files a/waf and b/waf differ
diff --git a/wscript b/wscript
index 1ff6ebd207d407fba967d626f9829483dd83ef32..fa60eb361a1306d44782acfe5d454b983ddfb036 100644 (file)
--- 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')
+  """