configure time detection of a patch/feature of libsndfile not yet in release
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 8 Sep 2015 21:36:02 +0000 (17:36 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 8 Sep 2015 21:40:28 +0000 (17:40 -0400)
wscript

diff --git a/wscript b/wscript
index 3e39d76b3c4eef2c48ba18d982fbad779d2d2eea..4e97d480a331759c962ee9c890e1bb25926a4f5f 100644 (file)
--- a/wscript
+++ b/wscript
@@ -906,6 +906,22 @@ def configure(conf):
     autowaf.check_pkg(conf, 'vamp-hostsdk', uselib_store='VAMPHOSTSDK', atleast_version='2.1', mandatory=True)
     autowaf.check_pkg(conf, 'rubberband', uselib_store='RUBBERBAND', mandatory=True)
 
+    have_rf64_riff_support = conf.check_cc(fragment = '''
+#include <sndfile.h>
+int main () { int x = SFC_AUTO_DOWNGRADE_RF64; return 0; }
+''',
+                                           features  = 'c',
+                                           mandatory = False,
+                                           execute   = False,
+                                           use = 'SNDFILE',
+                                           msg       = 'Checking for  sndfile RF64=>RIFF support',
+                                           okmsg = 'Found',
+                                           errmsg = 'Not found, no RF64-to-WAV support')
+
+    if have_rf64_riff_support:
+            conf.env.append_value('CXXFLAGS', "-DHAVE_RF64_RIFF")
+            conf.env.append_value('CFLAGS', "-DHAVE_RF64_RIFF")
+    
     if Options.options.dist_target == 'mingw':
         Options.options.fpu_optimization = True
         conf.env.append_value('CFLAGS', '-DPLATFORM_WINDOWS')