Changeset 985a5d1


Ignore:
Timestamp:
Nov 19, 2013, 11:46:35 PM (10 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:
cdfc394
Parents:
d75c900
Message:

wscript, src/wscpript: use ctx.options.target_platform, always build .a, indent and cleanup

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/wscript_build

    rd75c900 r985a5d1  
    99uselib += ['LASH']
    1010
     11ctx(features = 'c',
     12      source = source,
     13      includes = ['.'],
     14      uselib = uselib,
     15      lib = 'm',
     16      target = 'lib_objects')
    1117
    12 # build libaubio
     18# build libaubio.so (cshlib) and/or libaubio.a (cstlib)
    1319if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
    14     build_lib_func = ctx.stlib
    15 else:
    16     build_lib_func = ctx.shlib
     20    build_features = ['cstlib']
     21else: #linux, darwin, android, windows, ...
     22    build_features = ['cshlib', 'cstlib']
    1723
    18 build_lib_func(
    19     includes = ['.'],
    20     source = source,
    21     target = 'aubio',
    22     lib = 'm',
    23     uselib = uselib,
    24     install_path = '${PREFIX}/lib',
    25     vnum = ctx.env['LIB_VERSION'])
     24for feat in build_features:
     25    ctx(features = 'c ' + feat,
     26        use = ['lib_objects'], #source = source,
     27        target = 'aubio',
     28        install_path = '${PREFIX}/lib',
     29        vnum = ctx.env['LIB_VERSION'])
    2630
    2731# install headers, except _priv.h ones
  • wscript

    rd75c900 r985a5d1  
    7575  ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
    7676
    77   if Options.options.target_platform:
    78     Options.platform = Options.options.target_platform
    79     ctx.env['DEST_OS'] = Options.platform
    80 
    81   if Options.platform == 'win32':
     77  target_platform = Options.platform
     78  if ctx.options.target_platform:
     79    target_platform = ctx.options.target_platform
     80  ctx.env['DEST_OS'] = target_platform
     81
     82  if target_platform == 'win32':
    8283    ctx.env['shlib_PATTERN'] = 'lib%s.dll'
    8384
    84   if Options.platform == 'darwin':
     85  if target_platform == 'darwin':
    8586    ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
    8687    ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
     
    8889    ctx.define('HAVE_ACCELERATE', 1)
    8990
    90   if Options.platform in [ 'ios', 'iosimulator' ]:
     91  if target_platform in [ 'ios', 'iosimulator' ]:
    9192    ctx.define('HAVE_ACCELERATE', 1)
    9293    ctx.define('TARGET_OS_IPHONE', 1)
     
    9596    MINSDKVER="6.1"
    9697    ctx.env.CFLAGS += ['-std=c99']
    97     if Options.platform == 'ios':
     98    if target_platform == 'ios':
    9899        DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
    99100        SDKROOT="%(DEVROOT)s/SDKs/iPhoneOS%(SDKVER)s.sdk" % locals()
     
    136137
    137138  # optionally use complex.h
    138   if (Options.options.enable_complex == True):
     139  if (ctx.options.enable_complex == True):
    139140    ctx.check(header_name='complex.h')
    140141
    141142  # check dependencies
    142   if (Options.options.enable_sndfile != False):
     143  if (ctx.options.enable_sndfile != False):
    143144      ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
    144145        args = '--cflags --libs', mandatory = False)
    145   if (Options.options.enable_samplerate != False):
     146  if (ctx.options.enable_samplerate != False):
    146147      ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
    147148        args = '--cflags --libs', mandatory = False)
    148149
    149150  # double precision mode
    150   if (Options.options.enable_double == True):
     151  if (ctx.options.enable_double == True):
    151152    ctx.define('HAVE_AUBIO_DOUBLE', 1)
    152153  else:
     
    154155
    155156  # optional dependancies using pkg-config
    156   if (Options.options.enable_fftw3 != False or Options.options.enable_fftw3f != False):
     157  if (ctx.options.enable_fftw3 != False or ctx.options.enable_fftw3f != False):
    157158    # one of fftwf or fftw3f
    158     if (Options.options.enable_fftw3f != False):
     159    if (ctx.options.enable_fftw3f != False):
    159160      ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    160161          args = '--cflags --libs', mandatory = False)
    161       if (Options.options.enable_double == True):
     162      if (ctx.options.enable_double == True):
    162163        ctx.msg('Warning', 'fftw3f enabled, but aubio compiled in double precision!')
    163164    else:
    164165      # fftw3f not enabled, take most sensible one according to enable_double
    165       if (Options.options.enable_double == True):
     166      if (ctx.options.enable_double == True):
    166167        ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
    167168            args = '--cflags --libs', mandatory = False)
     
    181182    ctx.msg('Checking for FFT implementation', 'ooura')
    182183
    183   if (Options.options.enable_jack != False):
     184  if (ctx.options.enable_jack != False):
    184185    ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
    185186    args = '--cflags --libs', mandatory = False)
    186187
    187   if (Options.options.enable_lash != False):
     188  if (ctx.options.enable_lash != False):
    188189    ctx.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
    189190    args = '--cflags --libs', uselib_store = 'LASH', mandatory = False)
     
    203204
    204205def build(bld):
    205   bld.env['VERSION'] = VERSION
    206   bld.env['LIB_VERSION'] = LIB_VERSION
    207 
    208   # add sub directories
    209   bld.recurse('src')
    210   if bld.env['DEST_OS'] not in ['ios', 'iosimulator']:
    211       bld.recurse('examples')
    212       bld.recurse('tests')
    213 
    214   bld( source = 'aubio.pc.in' )
    215 
    216   # build manpages from sgml files
    217   if bld.env['DOCBOOKTOMAN']:
    218     from waflib import TaskGen
    219     if 'MANDIR' not in bld.env:
    220       bld.env['MANDIR'] = bld.env['PREFIX'] + '/share/man'
    221     TaskGen.declare_chain(
    222         name      = 'docbooktoman',
    223         rule      = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
    224         ext_in    = '.sgml',
    225         ext_out   = '.1',
    226         reentrant = False,
    227         install_path =  '${MANDIR}/man1',
    228     )
    229     bld( source = bld.path.ant_glob('doc/*.sgml') )
    230 
    231   """
    232   bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html')
    233   """
     206    bld.env['VERSION'] = VERSION
     207    bld.env['LIB_VERSION'] = LIB_VERSION
     208
     209    # add sub directories
     210    bld.recurse('src')
     211    if bld.env['DEST_OS'] not in ['ios', 'iosimulator']:
     212        pass
     213    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
     214        bld.recurse('examples')
     215        bld.recurse('tests')
     216
     217    bld( source = 'aubio.pc.in' )
     218
     219    # build manpages from sgml files
     220    if bld.env['DOCBOOKTOMAN']:
     221        from waflib import TaskGen
     222        if 'MANDIR' not in bld.env:
     223            bld.env['MANDIR'] = bld.env['PREFIX'] + '/share/man'
     224        TaskGen.declare_chain(
     225                name      = 'docbooktoman',
     226                rule      = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
     227                ext_in    = '.sgml',
     228                ext_out   = '.1',
     229                reentrant = False,
     230                install_path =  '${MANDIR}/man1',
     231                )
     232        bld( source = bld.path.ant_glob('doc/*.sgml') )
     233
     234    """
     235    bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html')
     236    """
    234237
    235238
    236239def shutdown(bld):
    237     from waflib import Options, Logs
    238     if Options.platform in ['ios', 'iosimulator']:
    239           msg ='aubio built for ios, contact the author for a commercial license'
    240           Logs.pprint('RED', msg)
    241           msg ='   Paul Brossier <piem@aubio.org>'
    242           Logs.pprint('RED', msg)
    243 
     240    from waflib import Logs
     241    if bld.options.target_platform in ['ios', 'iosimulator']:
     242        msg ='building for %s, contact the author for a commercial license' % bld.options.target_platform
     243        Logs.pprint('RED', msg)
     244        msg ='   Paul Brossier <piem@aubio.org>'
     245        Logs.pprint('RED', msg)
    244246
    245247def dist(ctx):
Note: See TracChangeset for help on using the changeset viewer.