import glob
import errno
import time
+from sets import Set
import SCons.Node.FS
SConsignFile()
BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
BoolOption('DEVBUILD', 'Use shared libardour (developers only)', 0),
- BoolOption('SIGCCVSBUILD', 'Use if building sigc++ with a new configure.ac (developers only)', 0),
BoolOption('NLS', 'Set to turn on i18n support', 1),
BoolOption('NOARCH', 'Do not use architecture-specific compilation flags', 0),
PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
BoolOption('VST', 'Compile with support for VST', 0),
BoolOption('VERSIONED', 'Add version information to ardour/gtk executable name inside the build directory', 0),
BoolOption('USE_SSE_EVERYWHERE', 'Ask the compiler to use x86/SSE instructions and also our hand-written x86/SSE optimizations when possible (off by default)', 0),
- BoolOption('BUILD_SSE_OPTIMIZATIONS', 'Use our hand-written x86/SSE optimizations when possible (off by default)', 0)
+ BoolOption('BUILD_SSE_OPTIMIZATIONS', 'Use our hand-written x86/SSE optimizations when possible (off by default)', 0),
+ BoolOption('BUILD_VECLIB_OPTIMIZATIONS', 'Build with Apple Accelerate/vecLib optimizations when possible (off by default)', 0)
)
-
#----------------------------------------------------------------------
# a handy helper that provides a way to merge compile/link information
# from multiple different "environments"
self.Append (LIBPATH = other.get ('LIBPATH', []))
self.Append (CPPPATH = other.get('CPPPATH', []))
self.Append (LINKFLAGS = other.get('LINKFLAGS', []))
+ self.Replace(LIBPATH = list(Set(self.get('LIBPATH', []))))
+ self.Replace(CPPPATH = list(Set(self.get('CPPPATH',[]))))
+ #doing LINKFLAGS breaks -framework
+ #doing LIBS break link order dependency
env = LibraryInfo (options = opts,
libraries['libgnomecanvas2'] = LibraryInfo()
libraries['libgnomecanvas2'].ParseConfig ('pkg-config --cflags --libs libgnomecanvas-2.0')
+libraries['glade2'] = LibraryInfo()
+libraries['glade2'].ParseConfig ('pkg-config --cflags --libs libglade-2.0')
+
+libraries['flowcanvas'] = LibraryInfo(LIBS='flowcanvas', LIBPATH='#/libs/flowcanvas', CPPPATH='#libs/flowcanvas')
+
libraries['ardour'] = LibraryInfo (LIBS='ardour', LIBPATH='#libs/ardour', CPPPATH='#libs/ardour')
libraries['midi++2'] = LibraryInfo (LIBS='midi++', LIBPATH='#libs/midi++2', CPPPATH='#libs/midi++2')
libraries['pbd3'] = LibraryInfo (LIBS='pbd', LIBPATH='#libs/pbd3', CPPPATH='#libs/pbd3')
libraries['gtkmm2'] = LibraryInfo()
libraries['gtkmm2'].ParseConfig ('pkg-config --cflags --libs gtkmm-2.0')
-
+
+ libraries['libglademm'] = LibraryInfo()
+ libraries['libglademm'].ParseConfig ('pkg-config --cflags --libs libglademm-2.4')
+
libraries['soundtouch'] = LibraryInfo(LIBS='SoundTouch')
coredirs = [
libraries['soundtouch'] = LibraryInfo(LIBS='soundtouch',
LIBPATH='#libs/soundtouch',
CPPPATH=['#libs', '#libs/soundtouch'])
+ libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
+ LIBPATH='#libs/libglademm',
+ CPPPATH='#libs/libglademm')
coredirs = [
'libs/soundtouch',
'libs/gtkmm2/atk',
'libs/gtkmm2/gdk',
'libs/gtkmm2/gtk',
+ 'libs/libglademm',
'libs/libgnomecanvasmm',
+ 'libs/flowcanvas',
'libs/gtkmm2ext',
- 'gtk2_ardour',
+ 'gtk2_ardour'
]
opts.Save('scache.conf', env)
config_prefix = '$DESTDIR' + final_config_prefix
+
+# SCons should really do this for us
+
+conf = Configure (env)
+
+have_cxx = conf.TryAction (Action (env['CXX'] + ' --version'));
+if have_cxx[0] != 1:
+ print "This system has no functional C++ compiler. You cannot build Ardour from source without one."
+ exit (1);
+else:
+ print "Congratulations, you have a functioning C++ compiler."
+
+env = conf.Finish()
+
#
# Compiler flags and other system-dependent stuff
#
libraries['core'].Append (LIBPATH = [ '/opt/local/lib' ])
if os.path.isdir('/opt/local/include'):
libraries['core'].Append (CPPPATH = [ '/opt/local/include' ])
+
+ if env['BUILD_VECLIB_OPTIMIZATIONS'] == 1:
+ opt_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
+ debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
+ libraries['core'].Append(LINKFLAGS= '-framework Accelerate')
+
if config[config_cpu] == 'powerpc':
#
# Apple/PowerPC optimization options
env.Append(CCFLAGS="-DVST_SUPPORT")
+# check endianness
+if sys.byteorder == "big":
+ print "Host is big endian"
+ env.Append(CCFLAGS="-DWORDS_BIGENDIAN")
+else:
+ print "Host is little endian"
+
+
#
# everybody needs this
#