Changeset 110ac90


Ignore:
Timestamp:
Jan 6, 2012, 11:59:03 PM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
b517cb3
Parents:
a5bf9a5
Message:

examples/wscript_build, wscript: update

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • examples/wscript_build

    ra5bf9a5 r110ac90  
    1 # build examples
    2 sndfileio = bld.new_task_gen(features = 'c',
    3     includes = '../src',
    4     source = ['sndfileio.c'],
    5     target = 'sndfileio')
     1if bld.env['SNDFILE']:
     2  # build examples
     3  sndfileio = bld.new_task_gen(features = 'c',
     4      includes = '../src',
     5      source = ['sndfileio.c'],
     6      target = 'sndfileio')
    67
    7 utilsio = bld.new_task_gen(features = 'c',
    8       includes = '../src',
    9       add_objects = 'sndfileio',
    10       source = ['utils.c', 'jackio.c'],
    11       uselib = ['LASH', 'JACK', 'SNDFILE'],
    12       target = 'utilsio')
     8  utilsio = bld.new_task_gen(features = 'c',
     9        includes = '../src',
     10        add_objects = 'sndfileio',
     11        source = ['utils.c', 'jackio.c'],
     12        uselib = ['LASH', 'JACK', 'SNDFILE'],
     13        target = 'utilsio')
    1314
    14 # loop over all *.c filenames in examples to build them all
    15 for target_name in bld.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c', 'sndfileio.c']):
    16   bld.new_task_gen(features = 'c cprogram',
    17       add_objects = 'utilsio',
    18       includes = '../src',
    19       uselib = ['LASH', 'JACK', 'SNDFILE'],
    20       use = 'aubio',
    21       source = target_name,
    22       # program name is filename.c without the .c
    23       target = str(target_name).split('.')[0])
     15  # loop over all *.c filenames in examples to build them all
     16  for target_name in bld.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c', 'sndfileio.c']):
     17    bld.new_task_gen(features = 'c cprogram',
     18        add_objects = 'utilsio',
     19        includes = '../src',
     20        uselib = ['LASH', 'JACK', 'SNDFILE'],
     21        use = 'aubio',
     22        source = target_name,
     23        # program name is filename.c without the .c
     24        target = str(target_name).split('.')[0])
  • wscript

    ra5bf9a5 r110ac90  
    11#! /usr/bin/python
    2 # 
     2#
    33# waf build script, see http://code.google.com/p/waf/
    44# usage:
     
    1010# TODO
    1111#  - doc: add doxygen
    12 #  - tests: move to new unit test system 
     12#  - tests: move to new unit test system
    1313
    1414APPNAME = 'aubio'
     
    4747  opt.add_option('--enable-lash', action='store_true', default=False,
    4848      help='compile with lash support')
     49  opt.add_option('--enable-sndfile', action='store_true', default=False,
     50      help='compile with libsndfile support')
    4951  opt.add_option('--enable-samplerate', action='store_true', default=False,
    5052      help='compile with libsamplerate support')
     
    6163  conf.check_tool('compiler_cxx')
    6264  conf.check_tool('gnu_dirs') # helpful for autotools transition and .pc generation
    63   conf.check_tool('misc') # needed for subst
     65  #conf.check_tool('misc') # needed for subst
    6466  conf.load('waf_unit_test')
    6567
     
    8284
    8385  # check dependencies
    84   conf.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
    85     args = '--cflags --libs')
     86  if (Options.options.enable_sndfile == True):
     87    conf.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
     88      args = '--cflags --libs')
    8689  if (Options.options.enable_samplerate == True):
    8790      conf.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
     
    9497    conf.define('HAVE_AUBIO_DOUBLE', 0)
    9598
    96   if (Options.options.disable_fftw == False):
     99  # check if pkg-config is installed, optional
     100  try:
     101    conf.find_program('pkg-config', var='PKGCONFIG')
     102  except conf.errors.ConfigurationError:
     103    conf.to_log('pkg-config was not found, not looking for (ignoring)')
     104
     105  print conf.env
     106  print Options.options.directories
     107
     108  if (Options.options.disable_fftw == False) or not conf.env['PKGCONFIG']:
    97109    # one of fftwf or fftw3f
    98110    if (Options.options.disable_fftw3f == True):
     
    121133
    122134  # swig
    123   if 0: #conf.find_program('swig', var='SWIG', mandatory = False):
     135  try:
     136    conf.find_program('swig', var='SWIG')
     137  except conf.errors.ConfigurationError:
     138    conf.to_log('swig was not found, not looking for (ignoring)')
     139  if conf.env['SWIG']:
    124140    conf.check_tool('swig', tooldir='swig')
    125141    conf.check_swig_version('1.3.27')
    126142
    127143    # python
    128     if conf.find_program('python', mandatory = False):
     144    if conf.find_program('python'):
    129145      conf.check_tool('python')
    130146      conf.check_python_version((2,4,2))
     
    136152#define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
    137153'''
    138   if conf.check_cc(fragment = check_c99_varargs, 
     154  if conf.check_cc(fragment = check_c99_varargs,
    139155      type='cstlib',
    140156      msg = 'Checking for C99 __VA_ARGS__ macro'):
     
    144160  conf.write_config_header('src/config.h')
    145161
    146   # add some defines used in examples 
     162  # add some defines used in examples
    147163  conf.define('AUBIO_PREFIX', conf.env['PREFIX'])
    148164  conf.define('PACKAGE', APPNAME)
    149165
    150166  # check if docbook-to-man is installed, optional
    151   conf.find_program('docbook-to-man', var='DOCBOOKTOMAN', mandatory=False)
     167  try:
     168    conf.find_program('docbook-to-man', var='DOCBOOKTOMAN')
     169  except conf.errors.ConfigurationError:
     170    conf.to_log('docbook-to-man was not found (ignoring)')
    152171
    153172def build(bld):
    154   bld.env['VERSION'] = VERSION 
    155   bld.env['LIB_VERSION'] = LIB_VERSION 
     173  bld.env['VERSION'] = VERSION
     174  bld.env['LIB_VERSION'] = LIB_VERSION
    156175
    157176  # add sub directories
     
    162181
    163182  # create the aubio.pc file for pkg-config
    164   aubiopc = bld.new_task_gen('subst')
    165   aubiopc.source = 'aubio.pc.in'
    166   aubiopc.target = 'aubio.pc'
    167   aubiopc.install_path = '${PREFIX}/lib/pkgconfig'
     183  if bld.env['TARGET_PLATFORM'] == 'linux':
     184    aubiopc = bld.new_task_gen('subst')
     185    aubiopc.source = 'aubio.pc.in'
     186    aubiopc.target = 'aubio.pc'
     187    aubiopc.install_path = '${PREFIX}/lib/pkgconfig'
    168188
    169189  # build manpages from sgml files
     
    177197        reentrant = 0,
    178198    )
    179     manpages = bld.new_task_gen(name = 'docbooktoman', 
     199    manpages = bld.new_task_gen(name = 'docbooktoman',
    180200        source=bld.path.ant_glob('doc/*.sgml'))
    181201    bld.install_files('${MANDIR}/man1', bld.path.ant_glob('doc/*.1'))
    182202
    183203  # install woodblock sound
    184   bld.install_files('${PREFIX}/share/sounds/aubio/', 
     204  bld.install_files('${PREFIX}/share/sounds/aubio/',
    185205      'sounds/woodblock.aiff')
    186206
     
    195215def build_tests(bld):
    196216  for target_name in bld.path.ant_glob('tests/src/**/*.c'):
     217    includes = ['src']
     218    uselib = []
     219    if not str(target_name).endswith('-jack.c'):
     220      includes = []
     221      uselib = []
     222      extra_source = []
     223    else:
     224      # phasevoc-jack needs jack
     225      if bld.env['JACK']:
     226        includes = ['examples']
     227        uselib = ['JACK']
     228        extra_source = ['examples/jackio.c']
     229      else:
     230        continue
     231
    197232    this_target = bld.new_task_gen(
    198233        features = 'c cprogram test',
    199         source = target_name,
     234        uselib = uselib,
     235        source = [target_name] + extra_source,
    200236        target = str(target_name).split('.')[0],
    201         includes = 'src',
     237        includes = ['src'] + includes,
    202238        defines = 'AUBIO_UNSTABLE_API=1',
    203239        use = 'aubio')
    204     # phasevoc-jack also needs jack
    205     if str(target_name).endswith('test-phasevoc-jack.c'):
    206       this_target.includes = ['src', 'examples']
    207       this_target.uselib = ['JACK']
    208       this_target.target += ' examples/jackio.c'
Note: See TracChangeset for help on using the changeset viewer.