From 841568bfa71cf1f593f62d393ae5a60da3317f8e Mon Sep 17 00:00:00 2001
From: Tim Mayberry <mojofunk@gmail.com>
Date: Fri, 25 Apr 2008 22:17:27 +1000
Subject: [PATCH] Add RUBBERBAND SCons option and enable it by default as fftw is a required dependency

---
 SConstruct |   27 ++++++---------------------
 1 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/SConstruct b/SConstruct
index 42d1c32..782a0b6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -49,6 +49,7 @@ opts.AddOptions(
     BoolOption('LIBLO', 'Compile with support for liblo library', 1),
     BoolOption('NLS', 'Set to turn on i18n support', 1),
     PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
+    BoolOption('RUBBERBAND', 'Use Rubberband library for time stretching functionality', 1),
     BoolOption('SURFACES', 'Build support for control surfaces', 1),
     BoolOption('SYSLIBS', 'USE AT YOUR OWN RISK: CANCELS ALL SUPPORT FROM ARDOUR AUTHORS: Use existing system versions of various libraries instead of internal ones', 0),
     BoolOption('UNIVERSAL', 'Compile as universal binary.  Requires that external libraries are already universal.', 0),
@@ -818,27 +819,11 @@ libraries['vamphost'] = LibraryInfo (LIBS='vamphostsdk',
                                  LIBPATH='#libs/vamp-sdk',
                                  CPPPATH='#libs/vamp-sdk')
 
-env['RUBBERBAND'] = False
-
-conf = Configure (env)
-
-if conf.CheckHeader ('fftw3.h'):
-    env['RUBBERBAND'] = True
-    libraries['rubberband'] = LibraryInfo (LIBS='rubberband',
-                                           LIBPATH='#libs/rubberband',
-                                           CPPPATH='#libs/rubberband',
-                                           CCFLAGS='-DUSE_RUBBERBAND')
-else:
-    print ""
-    print "-------------------------------------------------------------------------"
-    print "You do not have the FFTW single-precision development package installed."
-    print "This prevents Ardour from using the Rubberband library for timestretching"
-    print "and pitchshifting. It will fall back on SoundTouch for timestretch, and "
-    print "pitchshifting will not be available."
-    print "-------------------------------------------------------------------------"
-    print ""
-
-conf.Finish()
+if env['RUBBERBAND']:
+	libraries['rubberband'] = LibraryInfo (LIBS='rubberband',
+			LIBPATH='#libs/rubberband',
+			CPPPATH='#libs/rubberband',
+			CCFLAGS='-DUSE_RUBBERBAND')
 
 #
 # Check for libusb
-- 
1.5.4.1

