From: W. Trevor King Date: Thu, 18 Apr 2013 14:27:28 +0000 (-0400) Subject: wscript: With --enable-$x, the existence of $x should be mandatory X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;ds=sidebyside;p=aubio.git wscript: With --enable-$x, the existence of $x should be mandatory If the user says they want to compile aubio with $x enabled, it should be a critical failure if aubio can't do that. If the user only wants to compile aubio with $x enabled if it's possible, then they shouldn't be setting `--enable-$x`. With this change, aubio defaults to "include $x if we find it", which the user can override with either --enable-$x or --disable-$x. --- diff --git a/wscript b/wscript index 4667fb90..f9c53d7d 100644 --- a/wscript +++ b/wscript @@ -36,12 +36,12 @@ def options(ctx): ctx.add_option('--disable-double', dest='enable_double', action='store_false', help='compile aubio in single precision mode') - ctx.add_option('--enable-fftw3', action='store_true', default=False, + ctx.add_option('--enable-fftw3', action='store_true', default=None, help='compile with fftw3 instead of ooura (recommended)') ctx.add_option('--disable-fftw3', dest='enable_fftw3', action='store_false', help='compile with ooura instead of fftw3') - ctx.add_option('--enable-complex', action='store_true', default=False, + ctx.add_option('--enable-complex', action='store_true', default=None, help='compile with C99 complex') ctx.add_option('--disable-complex', dest='enable_complex', action='store_false', @@ -127,10 +127,11 @@ def configure(ctx): # check dependencies if (Options.options.enable_sndfile != False): ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', mandatory = Options.options.enable_sndfile) if (Options.options.enable_samplerate != False): ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', + mandatory = Options.options.enable_samplerate) # double precision mode if (Options.options.enable_double == True): @@ -145,7 +146,7 @@ def configure(ctx): if not Options.options.enable_double: package = 'fftw3f' ctx.check_cfg(package = package, atleast_version = '3.0.0', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', mandatory = Options.options.enable_fftw3) ctx.define('HAVE_FFTW3', 1) else: # fftw disabled, use ooura @@ -157,11 +158,12 @@ def configure(ctx): if (Options.options.enable_jack != False): ctx.check_cfg(package = 'jack', atleast_version = '0.15.0', - args = '--cflags --libs', mandatory = False) + args = '--cflags --libs', mandatory = Options.options.enable_jack) if (Options.options.enable_lash != False): ctx.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0', - args = '--cflags --libs', uselib_store = 'LASH', mandatory = False) + args = '--cflags --libs', uselib_store = 'LASH', + mandatory = Options.options.enable_lash) # write configuration header ctx.write_config_header('src/config.h')