Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r59be50d rc3b3b84  
    1515APPNAME = 'aubio'
    1616
    17 from this_version import *
    18 
    19 VERSION = get_aubio_version()
    20 LIB_VERSION = get_libaubio_version()
     17# source VERSION
     18for l in open('VERSION').readlines(): exec (l.strip())
     19
     20VERSION = '.'.join ([str(x) for x in [
     21    AUBIO_MAJOR_VERSION,
     22    AUBIO_MINOR_VERSION,
     23    AUBIO_PATCH_VERSION
     24    ]]) + AUBIO_VERSION_STATUS
     25
     26LIB_VERSION = '.'.join ([str(x) for x in [
     27    LIBAUBIO_LT_CUR,
     28    LIBAUBIO_LT_REV,
     29    LIBAUBIO_LT_AGE]])
    2130
    2231top = '.'
     
    123132    ctx.env['DEST_OS'] = target_platform
    124133
    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    
    132134    if ctx.options.build_type == "debug":
    133135        ctx.define('DEBUG', 1)
     
    323325                args = '--cflags --libs', uselib_store = 'AVUTIL',
    324326                mandatory = ctx.options.enable_avcodec)
    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'] ):
     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)
    330351            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')
    334352
    335353    if (ctx.options.enable_wavread != False):
     
    410428        if 'MANDIR' not in bld.env:
    411429            bld.env['MANDIR'] = bld.env['DATAROOTDIR'] + '/man'
    412         bld.env.VERSION = str(VERSION)
     430        bld.env.VERSION = VERSION
    413431        rule_str = '${TXT2MAN} -t `basename ${TGT} | cut -f 1 -d . | tr a-z A-Z`'
    414432        rule_str += ' -r ${PACKAGE}\\ ${VERSION} -P ${PACKAGE}'
     
    441459    # note: build in ../doc/_build/html, otherwise waf wont install unsigned files
    442460    if bld.env['SPHINX']:
    443         bld.env.VERSION = str(VERSION)
     461        bld.env.VERSION = VERSION
    444462        bld( name = 'sphinx',
    445463                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.