+if env['UNIVERSAL'] == 1:
+ env.Append(CCFLAGS="-arch i386 -arch ppc")
+ env.Append(LINKFLAGS="-arch i386 -arch ppc")
+
+
+#
+# warnings flags
+#
+
+env.Append(CCFLAGS="-Wall")
+env.Append(CXXFLAGS="-Woverloaded-virtual")
+
+if env['EXTRA_WARN']:
+ env.Append(CCFLAGS="-Wextra -pedantic -ansi")
+ env.Append(CXXFLAGS="-ansi")
+# env.Append(CFLAGS="-iso")
+
+#
+# fix scons nitpickiness on APPLE
+#
+
+
+def prep_libcheck(topenv, libinfo):
+ if topenv['IS_OSX']:
+ #
+ # rationale: GTK-Quartz uses jhbuild and installs to ~/gtk/inst by default.
+ # All libraries needed should be built against this location
+
+ if topenv['GTKOSX']:
+ GTKROOT = os.path.expanduser ('~/gtk/inst')
+ libinfo.Append(CPPPATH= GTKROOT + "/include", LIBPATH= GTKROOT + "/lib")
+ libinfo.Append(CXXFLAGS="-I" + GTKROOT + "/include", LINKFLAGS="-L" + GTKROOT + "/lib")
+
+
+
+prep_libcheck(env, env)
+
+#
+# these are part of the Ardour source tree because they are C++
+#
+
+libraries['vamp'] = LibraryInfo (LIBS='vampsdk',
+ LIBPATH='#libs/vamp-sdk',
+ CPPPATH='#libs/vamp-sdk')
+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()
+
+#
+# Check for libusb
+
+libraries['usb'] = LibraryInfo ()
+prep_libcheck(env, libraries['usb'])
+
+conf = Configure (libraries['usb'])
+if conf.CheckLib ('usb', 'usb_interrupt_write'):
+ have_libusb = True
+else:
+ have_libusb = False
+
+# check for linux/input.h while we're at it for powermate
+if conf.CheckHeader('linux/input.h'):
+ have_linux_input = True
+else:
+ have_linux_input = False
+
+libraries['usb'] = conf.Finish ()
+
+#
+# Check for wiimote dependencies
+
+if env['WIIMOTE']:
+ wiimoteConf = env.Configure ( )
+ if not wiimoteConf.CheckHeader('cwiid.h'):
+ print 'WIIMOTE configured but you are missing libcwiid!'
+ sys.exit(1)
+ if not wiimoteConf.CheckHeader('bluetooth/bluetooth.h'):
+ print 'WIIMOTE configured but you are missing the libbluetooth headers which you need to compile wiimote support!'
+ sys.exit(1)
+ wiimoteConf.Finish()
+
+
+#
+# Check for FLAC
+
+libraries['flac'] = LibraryInfo ()
+prep_libcheck(env, libraries['flac'])
+libraries['flac'].Append(CPPPATH="/usr/local/include", LIBPATH="/usr/local/lib")
+
+#
+# june 1st 2007: look for a function that is in FLAC 1.1.2 and not in later versions
+# since the version of libsndfile we have internally does not support
+# the new API that libFLAC has adopted
+#
+
+conf = Configure (libraries['flac'])
+if conf.CheckLib ('FLAC', 'FLAC__seekable_stream_decoder_init', language='CXX'):
+ conf.env.Append(CCFLAGS='-DHAVE_FLAC')
+ use_flac = True
+else:
+ use_flac = False
+
+libraries['flac'] = conf.Finish ()
+
+# or if that fails...
+#libraries['flac'] = LibraryInfo (LIBS='FLAC')
+
+# boost (we don't link against boost, just use some header files)
+
+libraries['boost'] = LibraryInfo ()
+prep_libcheck(env, libraries['boost'])
+libraries['boost'].Append(CPPPATH="/usr/local/include", LIBPATH="/usr/local/lib")
+conf = Configure (libraries['boost'])
+if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == False:
+ print "Boost header files do not appear to be installed. You also might be running a buggy version of scons. Try scons 0.97 if you can."
+ sys.exit (1)
+
+libraries['boost'] = conf.Finish ()
+
+#
+# Check for liblo
+
+libraries['lo'] = LibraryInfo ()
+prep_libcheck(env, libraries['lo'])
+
+conf = Configure (libraries['lo'])
+if conf.CheckLib ('lo', 'lo_server_new') == False:
+ print "liblo does not appear to be installed."
+ env['HAVE_LIBLO'] = False
+else:
+ env['HAVE_LIBLO'] = True
+
+libraries['lo'] = conf.Finish ()
+
+#
+# Check for dmalloc
+
+libraries['dmalloc'] = LibraryInfo ()
+prep_libcheck(env, libraries['dmalloc'])
+
+#
+# look for the threaded version
+#
+
+conf = Configure (libraries['dmalloc'])
+if conf.CheckLib ('dmallocth', 'dmalloc_shutdown'):
+ have_libdmalloc = True
+else:
+ have_libdmalloc = False
+
+libraries['dmalloc'] = conf.Finish ()
+
+#
+# ensure FREEDESKTOP target is doable..
+#
+
+conf = env.Configure ()
+if env['FREEDESKTOP']:
+ have_update_mime_database = conf.TryAction (Action ('update-mime-database -v'))
+ if have_update_mime_database[0] != 1:
+ print "Warning. You have no update-mime-database command in your PATH. FREEDESKTOP is now disabled."
+ env['FREEDESKTOP'] = 0
+ have_gtk_update_icon_cache = conf.TryAction (Action ('gtk-update-icon-cache -?'))
+ if have_gtk_update_icon_cache[0] != 1:
+ print "Warning. You have no gtk-update-icon-cache command in your PATH. FREEDESKTOP is now disabled."
+ env['FREEDESKTOP'] = 0
+ have_update_desktop_database = conf.TryAction (Action ('update-desktop-database -?'))
+ if have_update_desktop_database[0] != 1:
+ print "Warning. You have no update-desktop-database command in your PATH. FREEDESKTOP is now disabled."
+ env['FREEDESKTOP'] = 0
+env = conf.Finish()
+
+#
+# Audio/MIDI library (needed for MIDI, since audio is all handled via JACK)
+#
+
+conf = Configure(env)
+
+# ALSA, for engine dialog
+libraries['asound'] = LibraryInfo ()
+
+if conf.CheckCHeader('alsa/asoundlib.h'):
+ libraries['asound'].ParseConfig('pkg-config --cflags --libs alsa')
+
+if conf.CheckCHeader('jack/midiport.h'):
+ libraries['sysmidi'] = LibraryInfo (LIBS='jack')
+ env['SYSMIDI'] = 'JACK MIDI'
+ subst_dict['%MIDITAG%'] = "control"
+ subst_dict['%MIDITYPE%'] = "jack"
+ env.Append(CCFLAGS=" -DWITH_JACK_MIDI")
+ print "Using JACK MIDI"
+elif conf.CheckCHeader('alsa/asoundlib.h'):
+ libraries['sysmidi'] = LibraryInfo ()
+ libraries['sysmidi'].ParseConfig('pkg-config --cflags --libs alsa')
+ env['SYSMIDI'] = 'ALSA Sequencer'
+ subst_dict['%MIDITAG%'] = "control"
+ subst_dict['%MIDITYPE%'] = "alsa/sequencer"
+ print "Using ALSA MIDI"
+elif conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
+ # this line is needed because scons can't handle -framework in ParseConfig() yet.
+ if env['GTKOSX']:
+ # We need Carbon as well as the rest
+ libraries['sysmidi'] = LibraryInfo (
+ LINKFLAGS = ' -framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox -framework Carbon -bind_at_load' )
+ else:
+ libraries['sysmidi'] = LibraryInfo (
+ LINKFLAGS = ' -framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox -bind_at_load' )
+ env['SYSMIDI'] = 'CoreMIDI'
+ subst_dict['%MIDITAG%'] = "ardour"
+ subst_dict['%MIDITYPE%'] = "coremidi"
+else:
+ print "It appears you don't have the required MIDI libraries installed. For Linux this means you are missing the development package for ALSA libraries."
+ sys.exit (1)
+
+env = conf.Finish()
+
+if env['GTKOSX']:
+ clearlooks_version = 'libs/clearlooks-newer'
+else:
+ clearlooks_version = 'libs/clearlooks-older'
+
+if env['SYSLIBS']:
+
+ syslibdeps = \
+ {
+ 'sigc++-2.0' : '2.0',
+ 'gtkmm-2.4' : '2.8',
+ 'libgnomecanvasmm-2.6' : '2.12.0'
+ }
+
+ conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
+ 'CheckPKGVersion' : CheckPKGVersion })
+
+ for pkg, version in syslibdeps.iteritems():
+ if not conf.CheckPKGVersion( pkg, version ):
+ print '%s >= %s not found.' %(pkg, version)
+ DependenciesRequiredMessage()
+ Exit(1)
+
+ env = conf.Finish()
+