Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    rc3b3b84 r59be50d  
    1515APPNAME = 'aubio'
    1616
    17 # source VERSION
    18 for l in open('VERSION').readlines(): exec (l.strip())
    19 
    20 VERSION = '.'.join ([str(x) for x in [
    21     AUBIO_MAJOR_VERSION,
    22     AUBIO_MINOR_VERSION,
    23     AUBIO_PATCH_VERSION
    24     ]]) + AUBIO_VERSION_STATUS
    25 
    26 LIB_VERSION = '.'.join ([str(x) for x in [
    27     LIBAUBIO_LT_CUR,
    28     LIBAUBIO_LT_REV,
    29     LIBAUBIO_LT_AGE]])
     17from this_version import *
     18
     19VERSION = get_aubio_version()
     20LIB_VERSION = get_libaubio_version()
    3021
    3122top = '.'
     
    132123    ctx.env['DEST_OS'] = target_platform
    133124
     125    version_dict = get_version_info();
     126    ctx.define('AUBIO_VERSION',VERSION)
     127    ctx.define('AUBIO_MAJOR_VERSION', version_dict['AUBIO_MAJOR_VERSION'])
     128    ctx.define('AUBIO_MINOR_VERSION', version_dict['AUBIO_MINOR_VERSION'])
     129    ctx.define('AUBIO_PATCH_VERSION', version_dict['AUBIO_PATCH_VERSION'])
     130    ctx.define('AUBIO_VERSION_STATUS', version_dict['AUBIO_VERSION_STATUS'])
     131   
    134132    if ctx.options.build_type == "debug":
    135133        ctx.define('DEBUG', 1)
     
    325323                args = '--cflags --libs', uselib_store = 'AVUTIL',
    326324                mandatory = ctx.options.enable_avcodec)
    327         ctx.check_cfg(package = 'libswresample', atleast_version = '2.3.0',
    328                 args = '--cflags --libs', uselib_store = 'SWRESAMPLE',
    329                 mandatory = False)
    330         if 'HAVE_SWRESAMPLE' not in ctx.env:
    331             ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
    332                     args = '--cflags --libs', uselib_store = 'AVRESAMPLE',
    333                     mandatory = False)
    334 
    335         msg_check = 'Checking for all libav libraries'
    336         if 'HAVE_AVCODEC' not in ctx.env:
    337             ctx.msg(msg_check, 'not found (missing avcodec)', color = 'YELLOW')
    338         elif 'HAVE_AVFORMAT' not in ctx.env:
    339             ctx.msg(msg_check, 'not found (missing avformat)', color = 'YELLOW')
    340         elif 'HAVE_AVUTIL' not in ctx.env:
    341             ctx.msg(msg_check, 'not found (missing avutil)', color = 'YELLOW')
    342         elif 'HAVE_SWRESAMPLE' not in ctx.env and 'HAVE_AVRESAMPLE' not in ctx.env:
    343             resample_missing = 'not found (avresample or swresample required)'
    344             ctx.msg(msg_check, resample_missing, color = 'YELLOW')
    345         else:
    346             ctx.msg(msg_check, 'yes')
    347             if 'HAVE_SWRESAMPLE' in ctx.env:
    348                 ctx.define('HAVE_SWRESAMPLE', 1)
    349             elif 'HAVE_AVRESAMPLE' in ctx.env:
    350                 ctx.define('HAVE_AVRESAMPLE', 1)
     325        ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
     326                args = '--cflags --libs', uselib_store = 'AVRESAMPLE',
     327                mandatory = ctx.options.enable_avcodec)
     328        if all ( 'HAVE_' + i in ctx.env
     329                for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
    351330            ctx.define('HAVE_LIBAV', 1)
     331            ctx.msg('Checking for all libav libraries', 'yes')
     332        else:
     333            ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW')
    352334
    353335    if (ctx.options.enable_wavread != False):
     
    428410        if 'MANDIR' not in bld.env:
    429411            bld.env['MANDIR'] = bld.env['DATAROOTDIR'] + '/man'
    430         bld.env.VERSION = VERSION
     412        bld.env.VERSION = str(VERSION)
    431413        rule_str = '${TXT2MAN} -t `basename ${TGT} | cut -f 1 -d . | tr a-z A-Z`'
    432414        rule_str += ' -r ${PACKAGE}\\ ${VERSION} -P ${PACKAGE}'
     
    459441    # note: build in ../doc/_build/html, otherwise waf wont install unsigned files
    460442    if bld.env['SPHINX']:
    461         bld.env.VERSION = VERSION
     443        bld.env.VERSION = str(VERSION)
    462444        bld( name = 'sphinx',
    463445                rule = '${SPHINX} -b html -D release=${VERSION} -D version=${VERSION} -a -q `dirname ${SRC}` `dirname ${TGT}`',
Note: See TracChangeset for help on using the changeset viewer.