Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r22dd9dc r54dd945  
    3131out = 'build'
    3232
    33 def add_option_enable_disable(ctx, name, default = None, help_str = None, help_disable_str = None):
    34   if help_str == None:
    35       help_str = 'enable ' + name + ' support'
    36   if help_disable_str == None:
    37       help_disable_str = 'do not ' + help_str
    38   ctx.add_option('--enable-' + name, action = 'store_true', default = default,
    39           dest = 'enable_' + name,
    40           help = help_str)
    41   ctx.add_option('--disable-' + name, action = 'store_false',
    42           #default = default,
    43           dest = 'enable_' + name,
    44           help = help_disable_str )
    45 
    4633def options(ctx):
    47   add_option_enable_disable(ctx, 'double', default = False,
    48           help_str = 'compile aubio in double precision mode')
    49   add_option_enable_disable(ctx, 'fftw3f', default = False,
    50           help_str = 'compile with fftw3f instead of ooura (recommended)', help_disable_str = 'do not compile with fftw3f')
    51   add_option_enable_disable(ctx, 'fftw3', default = False,
    52           help_str = 'compile with fftw3 instead of ooura', help_disable_str = 'do not compile with fftw3')
    53   add_option_enable_disable(ctx, 'complex', default = False,
    54           help_str ='compile with C99 complex', help_disable_str = 'do not use C99 complex (default)' )
    55   add_option_enable_disable(ctx, 'jack', default = None,
    56           help_str = 'compile with jack (auto)', help_disable_str = 'disable jack support')
    57   add_option_enable_disable(ctx, 'lash', default = None,
    58           help_str = 'compile with LASH (auto)', help_disable_str = 'disable LASH' )
    59   add_option_enable_disable(ctx, 'sndfile', default = None,
    60           help_str = 'compile with sndfile (auto)', help_disable_str = 'disable sndfile')
    61   add_option_enable_disable(ctx, 'samplerate', default = None,
    62           help_str = 'compile with samplerate (auto)', help_disable_str = 'disable samplerate')
    63 
     34  ctx.add_option('--enable-double', action='store_true', default=False,
     35      help='compile aubio in double precision mode')
     36  ctx.add_option('--enable-fftw3f', action='store_true', default=False,
     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)')
     40  ctx.add_option('--enable-complex', action='store_true', default=False,
     41      help='compile with C99 complex')
     42  ctx.add_option('--enable-jack', action='store_true', default=None,
     43      help='compile with jack support')
     44  ctx.add_option('--enable-lash', action='store_true', default=None,
     45      help='compile with lash support')
     46  ctx.add_option('--enable-sndfile', action='store_true', default=None,
     47      help='compile with libsndfile support')
     48  ctx.add_option('--enable-samplerate', action='store_true', default=None,
     49      help='compile with libsamplerate support')
    6450  ctx.add_option('--with-target-platform', type='string',
    6551      help='set target platform for cross-compilation', dest='target_platform')
    6652  ctx.load('compiler_c')
    6753  ctx.load('waf_unit_test')
    68   ctx.load('gnu_dirs')
    6954
    7055def configure(ctx):
     
    7257  ctx.load('compiler_c')
    7358  ctx.load('waf_unit_test')
    74   ctx.load('gnu_dirs')
    7559  ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
    7660
     
    8973    ctx.define('HAVE_ACCELERATE', 1)
    9074
    91   if Options.platform in [ 'ios', 'iosimulator' ]:
     75  if Options.platform == 'ios':
    9276    ctx.env.CC = 'clang'
    9377    ctx.env.LD = 'clang'
    9478    ctx.env.LINK_CC = 'clang'
     79    SDKVER="6.1"
     80    DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
     81    SDKROOT="%(DEVROOT)s/SDKs/iPhoneOS%(SDKVER)s.sdk" % locals()
     82    ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate']
    9583    ctx.define('HAVE_ACCELERATE', 1)
    96     ctx.define('TARGET_OS_IPHONE', 1)
    97     ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate']
    98     SDKVER="7.0"
    99     MINSDKVER="6.1"
    100     if Options.platform == 'ios':
    101         DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
    102         SDKROOT="%(DEVROOT)s/SDKs/iPhoneOS%(SDKVER)s.sdk" % locals()
    103         ctx.env.CFLAGS += [ '-arch', 'armv7' ]
    104         ctx.env.CFLAGS += [ '-arch', 'armv7s' ]
    105         ctx.env.LINKFLAGS += ['-arch', 'armv7']
    106         ctx.env.LINKFLAGS += ['-arch', 'armv7s']
    107     else:
    108         DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer"
    109         SDKROOT="%(DEVROOT)s/SDKs/iPhoneSimulator%(SDKVER)s.sdk" % locals()
    110         ctx.env.CFLAGS += [ '-arch', 'i386' ]
    111         ctx.env.LINKFLAGS += ['-arch', 'i386']
    112     ctx.env.CFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ]
    113     ctx.env.CFLAGS += [ '--sysroot=%s' % SDKROOT]
    114     ctx.env.CFLAGS += ['-std=c99']
    115     ctx.env.LINKFLAGS += ['-std=c99']
    116     ctx.env.LINKFLAGS += ['--sysroot=%s' % SDKROOT]
     84    ctx.env.CFLAGS += [ '-miphoneos-version-min=6.1', '-arch', 'armv7',
     85            '--sysroot=%s' % SDKROOT]
     86    ctx.env.LINKFLAGS += ['-std=c99', '-arch', 'armv7', '--sysroot=%s' %
     87            SDKROOT]
    11788
    11889  # check for required headers
     
    168139            args = '--cflags --libs', mandatory = False)
    169140    ctx.define('HAVE_FFTW3', 1)
    170 
    171   # fftw disabled, use ooura
    172   if 'HAVE_FFTW3F' in ctx.env.define_key:
    173     ctx.msg('Checking for FFT implementation', 'fftw3f')
    174   elif 'HAVE_FFTW3' in ctx.env.define_key:
    175     ctx.msg('Checking for FFT implementation', 'fftw3')
    176   elif 'HAVE_ACCELERATE' in ctx.env.define_key:
    177     ctx.msg('Checking for FFT implementation', 'vDSP')
    178141  else:
    179     ctx.msg('Checking for FFT implementation', 'ooura')
     142    # fftw disabled, use ooura
     143    if 'HAVE_ACCELERATE' in ctx.env.define_key:
     144        ctx.msg('Checking for FFT implementation', 'vDSP')
     145    else:
     146        ctx.msg('Checking for FFT implementation', 'ooura')
     147    pass
    180148
    181149  if (Options.options.enable_jack != False):
     
    207175  bld.recurse('src')
    208176  from waflib import Options
    209   if Options.platform not in ['ios', 'iosimulator']:
     177  if Options.platform != 'ios':
    210178      bld.recurse('examples')
    211179      bld.recurse('tests')
    212180
    213181  """
     182  # create the aubio.pc file for pkg-config
     183  if ctx.env['TARGET_PLATFORM'] == 'linux':
     184    aubiopc = ctx.new_task_gen('subst')
     185    aubiopc.source = 'aubio.pc.in'
     186    aubiopc.target = 'aubio.pc'
     187    aubiopc.install_path = '${PREFIX}/lib/pkgconfig'
     188
     189  # build manpages from sgml files
     190  if ctx.env['DOCBOOKTOMAN']:
     191    import TaskGen
     192    TaskGen.declare_chain(
     193        name    = 'docbooktoman',
     194        rule    = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
     195        ext_in  = '.sgml',
     196        ext_out = '.1',
     197        reentrant = 0,
     198    )
     199    manpages = ctx.new_task_gen(name = 'docbooktoman',
     200        source=ctx.path.ant_glob('doc/*.sgml'))
     201    ctx.install_files('${MANDIR}/man1', ctx.path.ant_glob('doc/*.1'))
     202
    214203  # install woodblock sound
    215204  bld.install_files('${PREFIX}/share/sounds/aubio/',
     
    217206  """
    218207
    219   bld( source = 'aubio.pc.in' )
    220 
    221   # build manpages from sgml files
    222   if bld.env['DOCBOOKTOMAN']:
    223     from waflib import TaskGen
    224     if 'MANDIR' not in bld.env:
    225       bld.env['MANDIR'] = bld.env['PREFIX'] + '/share/man'
    226     TaskGen.declare_chain(
    227         name      = 'docbooktoman',
    228         rule      = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
    229         ext_in    = '.sgml',
    230         ext_out   = '.1',
    231         reentrant = False,
    232         install_path =  '${MANDIR}/man1',
    233     )
    234     bld( source = bld.path.ant_glob('doc/*.sgml') )
    235 
    236   """
    237   bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html')
    238   """
    239 
    240 
    241208def shutdown(bld):
    242209    from waflib import Options, Logs
    243     if Options.platform in ['ios', 'iosimulator']:
     210    if Options.platform == 'ios':
    244211          msg ='aubio built for ios, contact the author for a commercial license'
    245212          Logs.pprint('RED', msg)
    246213          msg ='   Paul Brossier <piem@aubio.org>'
    247214          Logs.pprint('RED', msg)
    248 
    249 
    250 def dist(ctx):
    251     ctx.excl  = ' **/.waf-1* **/*~ **/*.pyc **/*.swp **/.lock-w* **/.git*'
    252     ctx.excl += ' **/build/*'
    253     ctx.excl += ' **/python/gen **/python/build **/python/dist'
    254     ctx.excl += ' **/**.zip **/**.tar.bz2'
    255     ctx.excl += ' **/doc/full/*'
    256     ctx.excl += ' **/python/*.db'
    257     ctx.excl += ' **/python.old/*'
Note: See TracChangeset for help on using the changeset viewer.