Changeset 0318cc1 for wscript


Ignore:
Timestamp:
Mar 30, 2013, 6:35:11 AM (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:
002563f
Parents:
c833f56
Message:

wscript: always use installed external dependancies, simplify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    rc833f56 r0318cc1  
    3434  ctx.add_option('--enable-double', action='store_true', default=False,
    3535      help='compile aubio in double precision mode')
    36   ctx.add_option('--enable-fftw', action='store_true', default=False,
     36  ctx.add_option('--enable-fftw', action='store_true', default=None,
    3737      help='compile with ooura instead of fftw')
    38   ctx.add_option('--enable-fftw3f', action='store_true', default=False,
     38  ctx.add_option('--enable-fftw3f', action='store_true', default=None,
    3939      help='compile with fftw3 instead of fftw3f')
    4040  ctx.add_option('--enable-complex', action='store_true', default=False,
    4141      help='compile with C99 complex')
    42   ctx.add_option('--enable-jack', action='store_true', default=False,
     42  ctx.add_option('--enable-jack', action='store_true', default=None,
    4343      help='compile with jack support')
    44   ctx.add_option('--enable-lash', action='store_true', default=False,
     44  ctx.add_option('--enable-lash', action='store_true', default=None,
    4545      help='compile with lash support')
    46   ctx.add_option('--enable-sndfile', action='store_true', default=False,
     46  ctx.add_option('--enable-sndfile', action='store_true', default=None,
    4747      help='compile with libsndfile support')
    48   ctx.add_option('--enable-samplerate', action='store_true', default=False,
     48  ctx.add_option('--enable-samplerate', action='store_true', default=None,
    4949      help='compile with libsamplerate support')
    50   ctx.add_option('--enable-swig', action='store_true', default=False,
    51       help='compile with swig support (obsolete)')
    5250  ctx.add_option('--with-target-platform', type='string',
    5351      help='set target platform for cross-compilation', dest='target_platform')
     
    9492  ctx.check(header_name='limits.h')
    9593
    96   # optionally use complex.h
    97   if (Options.options.enable_complex == True):
    98     ctx.check(header_name='complex.h')
    99 
    100   # check dependencies
    101   if (Options.options.enable_sndfile == True):
    102     ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
    103       args = '--cflags --libs')
    104   if (Options.options.enable_samplerate == True):
    105       ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
    106         args = '--cflags --libs')
    107 
    108   # double precision mode
    109   if (Options.options.enable_double == True):
    110     ctx.define('HAVE_AUBIO_DOUBLE', 1)
    111   else:
    112     ctx.define('HAVE_AUBIO_DOUBLE', 0)
    113 
    114   # check if pkg-config is installed, optional
    115   try:
    116     ctx.find_program('pkg-config', var='PKGCONFIG')
    117   except ctx.errors.ConfigurationError:
    118     ctx.msg('Could not find pkg-config', 'disabling fftw, jack, and lash')
    119     ctx.msg('Could not find fftw', 'using ooura')
    120 
    121   # optional dependancies using pkg-config
    122   if ctx.env['PKGCONFIG']:
    123 
    124     if (Options.options.enable_fftw == True or Options.options.enable_fftw3f == True):
    125       # one of fftwf or fftw3f
    126       if (Options.options.enable_fftw3f == True):
    127         ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    128             args = '--cflags --libs')
    129         if (Options.options.enable_double == True):
    130           ctx.msg('Warning', 'fftw3f enabled, but aubio compiled in double precision!')
    131       else:
    132         # fftw3f not enabled, take most sensible one according to enable_double
    133         if (Options.options.enable_double == True):
    134           ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
    135               args = '--cflags --libs')
    136         else:
    137           ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    138               args = '--cflags --libs')
    139       ctx.define('HAVE_FFTW3', 1)
    140     else:
    141       # fftw disabled, use ooura
    142       ctx.msg('Checking for FFT implementation', 'ooura')
    143       pass
    144 
    145     if (Options.options.enable_jack == True):
    146       ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
    147       args = '--cflags --libs')
    148 
    149     if (Options.options.enable_lash == True):
    150       ctx.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
    151       args = '--cflags --libs', uselib_store = 'LASH')
    152 
    153   # swig
    154   if (Options.options.enable_swig == True):
    155     try:
    156       ctx.find_program('swig', var='SWIG')
    157     except ctx.errors.ConfigurationError:
    158       ctx.to_log('swig was not found, not looking for (ignoring)')
    159 
    160     if ctx.env['SWIG']:
    161       ctx.check_tool('swig')
    162       ctx.check_swig_version()
    163 
    164       # python
    165       if ctx.find_program('python'):
    166         ctx.check_tool('python')
    167         ctx.check_python_version((2,4,2))
    168         ctx.check_python_headers()
    169 
    17094  # check support for C99 __VA_ARGS__ macros
    17195  check_c99_varargs = '''
     
    177101      msg = 'Checking for C99 __VA_ARGS__ macro'):
    178102    ctx.define('HAVE_C99_VARARGS_MACROS', 1)
     103
     104  # optionally use complex.h
     105  if (Options.options.enable_complex == True):
     106    ctx.check(header_name='complex.h')
     107
     108  # check dependencies
     109  if (Options.options.enable_sndfile != False):
     110      ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
     111        args = '--cflags --libs', mandatory = False)
     112  if (Options.options.enable_samplerate != False):
     113      ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
     114        args = '--cflags --libs', mandatory = False)
     115
     116  # double precision mode
     117  if (Options.options.enable_double == True):
     118    ctx.define('HAVE_AUBIO_DOUBLE', 1)
     119  else:
     120    ctx.define('HAVE_AUBIO_DOUBLE', 0)
     121
     122  # optional dependancies using pkg-config
     123  if (Options.options.enable_fftw != False or Options.options.enable_fftw3f != False):
     124    # one of fftwf or fftw3f
     125    if (Options.options.enable_fftw3f != False):
     126      ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
     127          args = '--cflags --libs', mandatory = False)
     128      if (Options.options.enable_double == True):
     129        ctx.msg('Warning', 'fftw3f enabled, but aubio compiled in double precision!')
     130    else:
     131      # fftw3f not enabled, take most sensible one according to enable_double
     132      if (Options.options.enable_double == True):
     133        ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
     134            args = '--cflags --libs', mandatory = False)
     135      else:
     136        ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
     137            args = '--cflags --libs', mandatory = False)
     138    ctx.define('HAVE_FFTW3', 1)
     139  else:
     140    # fftw disabled, use ooura
     141    ctx.msg('Checking for FFT implementation', 'ooura')
     142    pass
     143
     144  if (Options.options.enable_jack != False):
     145    ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
     146    args = '--cflags --libs', mandatory = False)
     147
     148  if (Options.options.enable_lash != False):
     149    ctx.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
     150    args = '--cflags --libs', uselib_store = 'LASH', mandatory = False)
    179151
    180152  # write configuration header
Note: See TracChangeset for help on using the changeset viewer.