Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r5e1c04f rff75d60  
    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,
    37       help='compile with ooura instead of fftw')
    3836  ctx.add_option('--enable-fftw3f', action='store_true', default=False,
    39       help='compile with fftw3 instead of fftw3f')
     37      help='compile with fftw3f instead of ooura (recommended)')
     38  ctx.add_option('--enable-fftw3', action='store_true', default=False,
     39      help='compile with fftw3 instead of ooura (recommended in double precision)')
    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')
     
    7270    ctx.env.CC = 'llvm-gcc-4.2'
    7371    ctx.env.LINK_CC = 'llvm-gcc-4.2'
    74     ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox']
     72    ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate']
     73    ctx.define('HAVE_ACCELERATE', 1)
    7574
    7675  if Options.platform == 'ios':
     
    7877    ctx.env.LD = 'clang'
    7978    ctx.env.LINK_CC = 'clang'
    80     ctx.define('TARGET_OS_IPHONE', 1)
    81     SDKVER="6.1"
     79    SDKVER="7.0"
    8280    DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
    8381    SDKROOT="%(DEVROOT)s/SDKs/iPhoneOS%(SDKVER)s.sdk" % locals()
    84     ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox']
    85     ctx.env.CFLAGS += [ '-miphoneos-version-min=6.1', '-arch', 'armv7', '-arch', 'armv7s',
     82    ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate']
     83    ctx.define('HAVE_ACCELERATE', 1)
     84    ctx.env.CFLAGS += [ '-miphoneos-version-min=6.1', '-arch', 'armv7',
    8685            '--sysroot=%s' % SDKROOT]
    87     ctx.env.LINKFLAGS += ['-std=c99', '-arch', 'armv7', '-arch', 'armv7s', '--sysroot=%s' %
     86    ctx.env.LINKFLAGS += ['-std=c99', '-arch', 'armv7', '--sysroot=%s' %
    8887            SDKROOT]
    8988
     
    9493  ctx.check(header_name='string.h')
    9594  ctx.check(header_name='limits.h')
    96 
    97   # optionally use complex.h
    98   if (Options.options.enable_complex == True):
    99     ctx.check(header_name='complex.h')
    100 
    101   # check dependencies
    102   if (Options.options.enable_sndfile == True):
    103     ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
    104       args = '--cflags --libs')
    105   if (Options.options.enable_samplerate == True):
    106       ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
    107         args = '--cflags --libs')
    108 
    109   # double precision mode
    110   if (Options.options.enable_double == True):
    111     ctx.define('HAVE_AUBIO_DOUBLE', 1)
    112   else:
    113     ctx.define('HAVE_AUBIO_DOUBLE', 0)
    114 
    115   # check if pkg-config is installed, optional
    116   try:
    117     ctx.find_program('pkg-config', var='PKGCONFIG')
    118   except ctx.errors.ConfigurationError:
    119     ctx.msg('Could not find pkg-config', 'disabling fftw, jack, and lash')
    120     ctx.msg('Could not find fftw', 'using ooura')
    121 
    122   # optional dependancies using pkg-config
    123   if ctx.env['PKGCONFIG']:
    124 
    125     if (Options.options.enable_fftw == True or Options.options.enable_fftw3f == True):
    126       # one of fftwf or fftw3f
    127       if (Options.options.enable_fftw3f == True):
    128         ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    129             args = '--cflags --libs')
    130         if (Options.options.enable_double == True):
    131           ctx.msg('Warning', 'fftw3f enabled, but aubio compiled in double precision!')
    132       else:
    133         # fftw3f not enabled, take most sensible one according to enable_double
    134         if (Options.options.enable_double == True):
    135           ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
    136               args = '--cflags --libs')
    137         else:
    138           ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    139               args = '--cflags --libs')
    140       ctx.define('HAVE_FFTW3', 1)
    141     else:
    142       # fftw disabled, use ooura
    143       ctx.msg('Checking for FFT implementation', 'ooura')
    144       pass
    145 
    146     if (Options.options.enable_jack == True):
    147       ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
    148       args = '--cflags --libs')
    149 
    150     if (Options.options.enable_lash == True):
    151       ctx.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
    152       args = '--cflags --libs', uselib_store = 'LASH')
    153 
    154   # swig
    155   if (Options.options.enable_swig == True):
    156     try:
    157       ctx.find_program('swig', var='SWIG')
    158     except ctx.errors.ConfigurationError:
    159       ctx.to_log('swig was not found, not looking for (ignoring)')
    160 
    161     if ctx.env['SWIG']:
    162       ctx.check_tool('swig')
    163       ctx.check_swig_version()
    164 
    165       # python
    166       if ctx.find_program('python'):
    167         ctx.check_tool('python')
    168         ctx.check_python_version((2,4,2))
    169         ctx.check_python_headers()
    17095
    17196  # check support for C99 __VA_ARGS__ macros
     
    179104    ctx.define('HAVE_C99_VARARGS_MACROS', 1)
    180105
     106  # optionally use complex.h
     107  if (Options.options.enable_complex == True):
     108    ctx.check(header_name='complex.h')
     109
     110  # check dependencies
     111  if (Options.options.enable_sndfile != False):
     112      ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
     113        args = '--cflags --libs', mandatory = False)
     114  if (Options.options.enable_samplerate != False):
     115      ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
     116        args = '--cflags --libs', mandatory = False)
     117
     118  # double precision mode
     119  if (Options.options.enable_double == True):
     120    ctx.define('HAVE_AUBIO_DOUBLE', 1)
     121  else:
     122    ctx.define('HAVE_AUBIO_DOUBLE', 0)
     123
     124  # optional dependancies using pkg-config
     125  if (Options.options.enable_fftw3 != False or Options.options.enable_fftw3f != False):
     126    # one of fftwf or fftw3f
     127    if (Options.options.enable_fftw3f != False):
     128      ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
     129          args = '--cflags --libs', mandatory = False)
     130      if (Options.options.enable_double == True):
     131        ctx.msg('Warning', 'fftw3f enabled, but aubio compiled in double precision!')
     132    else:
     133      # fftw3f not enabled, take most sensible one according to enable_double
     134      if (Options.options.enable_double == True):
     135        ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
     136            args = '--cflags --libs', mandatory = False)
     137      else:
     138        ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
     139            args = '--cflags --libs', mandatory = False)
     140    ctx.define('HAVE_FFTW3', 1)
     141
     142  # fftw disabled, use ooura
     143  if 'HAVE_FFTW3F' in ctx.env.define_key:
     144    ctx.msg('Checking for FFT implementation', 'fftw3f')
     145  elif 'HAVE_FFTW3' in ctx.env.define_key:
     146    ctx.msg('Checking for FFT implementation', 'fftw3')
     147  elif 'HAVE_ACCELERATE' in ctx.env.define_key:
     148    ctx.msg('Checking for FFT implementation', 'vDSP')
     149  else:
     150    ctx.msg('Checking for FFT implementation', 'ooura')
     151
     152  if (Options.options.enable_jack != False):
     153    ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
     154    args = '--cflags --libs', mandatory = False)
     155
     156  if (Options.options.enable_lash != False):
     157    ctx.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
     158    args = '--cflags --libs', uselib_store = 'LASH', mandatory = False)
     159
    181160  # write configuration header
    182161  ctx.write_config_header('src/config.h')
     
    204183
    205184  """
    206   # create the aubio.pc file for pkg-config
    207   if ctx.env['TARGET_PLATFORM'] == 'linux':
    208     aubiopc = ctx.new_task_gen('subst')
    209     aubiopc.source = 'aubio.pc.in'
    210     aubiopc.target = 'aubio.pc'
    211     aubiopc.install_path = '${PREFIX}/lib/pkgconfig'
    212 
    213   # build manpages from sgml files
    214   if ctx.env['DOCBOOKTOMAN']:
    215     import TaskGen
    216     TaskGen.declare_chain(
    217         name    = 'docbooktoman',
    218         rule    = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
    219         ext_in  = '.sgml',
    220         ext_out = '.1',
    221         reentrant = 0,
    222     )
    223     manpages = ctx.new_task_gen(name = 'docbooktoman',
    224         source=ctx.path.ant_glob('doc/*.sgml'))
    225     ctx.install_files('${MANDIR}/man1', ctx.path.ant_glob('doc/*.1'))
    226 
    227185  # install woodblock sound
    228186  bld.install_files('${PREFIX}/share/sounds/aubio/',
    229187      'sounds/woodblock.aiff')
    230188  """
     189
     190  bld( source = 'aubio.pc.in' )
     191
     192  # build manpages from sgml files
     193  if bld.env['DOCBOOKTOMAN']:
     194    from waflib import TaskGen
     195    if 'MANDIR' not in bld.env:
     196      bld.env['MANDIR'] = bld.env['PREFIX'] + '/share/man'
     197    TaskGen.declare_chain(
     198        name      = 'docbooktoman',
     199        rule      = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
     200        ext_in    = '.sgml',
     201        ext_out   = '.1',
     202        reentrant = False,
     203        install_path =  '${MANDIR}/man1',
     204    )
     205    bld( source = bld.path.ant_glob('doc/*.sgml') )
     206
     207  """
     208  bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html')
     209  """
     210
    231211
    232212def shutdown(bld):
Note: See TracChangeset for help on using the changeset viewer.