From 795fcd9f0c9481f47efd4382fb07e80cfed35c97 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 12 Aug 2015 19:01:34 +0200 Subject: [PATCH] wscript: make foo mandatory only when --enable-foo is passed --- wscript | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/wscript b/wscript index f7f74b02..ac1f81da 100644 --- a/wscript +++ b/wscript @@ -178,17 +178,22 @@ def configure(ctx): # one of fftwf or fftw3f if (ctx.options.enable_fftw3f != False): ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', + mandatory = ctx.options.enable_fftw3f) if (ctx.options.enable_double == True): - ctx.msg('Warning', 'fftw3f enabled, but compiling in double precision!') + ctx.msg('Warning', + 'fftw3f enabled, but compiling in double precision!') else: - # fftw3f not enabled, take most sensible one according to enable_double + # fftw3f disabled, take most sensible one according to + # enable_double if (ctx.options.enable_double == True): ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', mandatory = + ctx.options.enable_fftw3) else: ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', + mandatory = ctx.options.enable_fftw3) ctx.define('HAVE_FFTW3', 1) # fftw not enabled, use vDSP or ooura @@ -204,28 +209,35 @@ def configure(ctx): # check for libsndfile if (ctx.options.enable_sndfile != False): ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', + mandatory = ctx.options.enable_sndfile) # check for libsamplerate if (ctx.options.enable_samplerate != False): ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', + mandatory = ctx.options.enable_samplerate) # check for jack if (ctx.options.enable_jack != False): ctx.check_cfg(package = 'jack', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', + mandatory = ctx.options.enable_jack) # check for libav if (ctx.options.enable_avcodec != False): ctx.check_cfg(package = 'libavcodec', atleast_version = '54.35.0', - args = '--cflags --libs', uselib_store = 'AVCODEC', mandatory = False) + args = '--cflags --libs', uselib_store = 'AVCODEC', + mandatory = ctx.options.enable_avcodec) ctx.check_cfg(package = 'libavformat', atleast_version = '52.3.0', - args = '--cflags --libs', uselib_store = 'AVFORMAT', mandatory = False) + args = '--cflags --libs', uselib_store = 'AVFORMAT', + mandatory = ctx.options.enable_avcodec) ctx.check_cfg(package = 'libavutil', atleast_version = '52.3.0', - args = '--cflags --libs', uselib_store = 'AVUTIL', mandatory = False) + args = '--cflags --libs', uselib_store = 'AVUTIL', + mandatory = ctx.options.enable_avcodec) ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1', - args = '--cflags --libs', uselib_store = 'AVRESAMPLE', mandatory = False) + args = '--cflags --libs', uselib_store = 'AVRESAMPLE', + mandatory = ctx.options.enable_avcodec) if all ( 'HAVE_' + i in ctx.env.define_key for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ): ctx.define('HAVE_LIBAV', 1) -- 2.11.0