[waf] add flac detection
authorPaul Brossier <piem@piem.org>
Wed, 12 Dec 2018 22:26:35 +0000 (23:26 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 12 Dec 2018 22:26:35 +0000 (23:26 +0100)
src/wscript_build
wscript

index 17790b6..57d26e7 100644 (file)
@@ -12,6 +12,7 @@ uselib += ['SWRESAMPLE']
 uselib += ['AVRESAMPLE']
 uselib += ['AVUTIL']
 uselib += ['VORBISENC']
+uselib += ['FLAC']
 uselib += ['BLAS']
 
 source = ctx.path.ant_glob('*.c **/*.c')
diff --git a/wscript b/wscript
index 52bfe3b..091a4dc 100644 (file)
--- a/wscript
+++ b/wscript
@@ -69,6 +69,9 @@ def options(ctx):
     add_option_enable_disable(ctx, 'vorbis', default = None,
             help_str = 'compile with libvorbis (auto)',
             help_disable_str = 'disable libvorbis')
+    add_option_enable_disable(ctx, 'flac', default = None,
+            help_str = 'compile with libFLAC (auto)',
+            help_disable_str = 'disable libflac')
     add_option_enable_disable(ctx, 'samplerate', default = None,
             help_str = 'compile with samplerate (auto)',
             help_disable_str = 'disable samplerate')
@@ -439,6 +442,13 @@ def configure(ctx):
                 uselib_store = 'VORBISENC',
                 mandatory = ctx.options.enable_vorbis)
 
+    # check for flac
+    if (ctx.options.enable_flac != False):
+        ctx.check_cfg(package = 'flac',
+                args = '--cflags --libs',
+                uselib_store = 'FLAC',
+                mandatory = ctx.options.enable_flac)
+
     if (ctx.options.enable_wavread != False):
         ctx.define('HAVE_WAVREAD', 1)
     ctx.msg('Checking if using source_wavread',