[waf] add vorbisenc detection
authorPaul Brossier <piem@piem.org>
Wed, 12 Dec 2018 13:15:51 +0000 (14:15 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 12 Dec 2018 13:15:51 +0000 (14:15 +0100)
src/wscript_build
wscript

index 895c191..17790b6 100644 (file)
@@ -11,6 +11,7 @@ uselib += ['AVFORMAT']
 uselib += ['SWRESAMPLE']
 uselib += ['AVRESAMPLE']
 uselib += ['AVUTIL']
+uselib += ['VORBISENC']
 uselib += ['BLAS']
 
 source = ctx.path.ant_glob('*.c **/*.c')
diff --git a/wscript b/wscript
index 86208cd..52bfe3b 100644 (file)
--- a/wscript
+++ b/wscript
@@ -66,6 +66,9 @@ def options(ctx):
     add_option_enable_disable(ctx, 'avcodec', default = None,
             help_str = 'compile with libavcodec (auto)',
             help_disable_str = 'disable libavcodec')
+    add_option_enable_disable(ctx, 'vorbis', default = None,
+            help_str = 'compile with libvorbis (auto)',
+            help_disable_str = 'disable libvorbis')
     add_option_enable_disable(ctx, 'samplerate', default = None,
             help_str = 'compile with samplerate (auto)',
             help_disable_str = 'disable samplerate')
@@ -429,6 +432,13 @@ def configure(ctx):
                 ctx.define('HAVE_AVRESAMPLE', 1)
             ctx.define('HAVE_LIBAV', 1)
 
+    # check for vorbisenc
+    if (ctx.options.enable_vorbis != False):
+        ctx.check_cfg(package = 'vorbisenc',
+                args = '--cflags --libs',
+                uselib_store = 'VORBISENC',
+                mandatory = ctx.options.enable_vorbis)
+
     if (ctx.options.enable_wavread != False):
         ctx.define('HAVE_WAVREAD', 1)
     ctx.msg('Checking if using source_wavread',