fix (?) crash caused near program exit when using MCP. sort of a bandaid, but its...
[ardour.git] / SConstruct
index 2b2577d57f06acc6791834ee653ed2b13ebc3055..c60aece0be1b225c6797ef7370ff19babc081259 100644 (file)
@@ -21,7 +21,7 @@ import SCons.Node.FS
 SConsignFile()
 EnsureSConsVersion(0, 96)
 
-ardour_version = '2.8.1'
+ardour_version = '2.8.3'
 
 subst_dict = { }
 
@@ -51,6 +51,7 @@ opts.AddOptions(
     PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
     BoolOption('SURFACES', 'Build support for control surfaces', 1),
     BoolOption('WIIMOTE', 'Build the wiimote control surface', 0),
+    ('DIST_LIBDIR', 'Explicitly set library dir. If not set, Fedora-style defaults are used (typically lib or lib64)', ''),
     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),
     BoolOption('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0),
@@ -432,7 +433,8 @@ deps = \
        'raptor'               : '1.4.2',
        'lrdf'                 : '0.4.0',
        'jack'                 : '0.109.0',
-       'libgnomecanvas-2.0'   : '2.0'
+       'libgnomecanvas-2.0'   : '2.0',
+       'sndfile'              : '1.0.18'
 }
 
 def DependenciesRequiredMessage():
@@ -564,6 +566,9 @@ libraries['lrdf'].ParseConfig('pkg-config --cflags --libs lrdf')
 libraries['raptor'] = LibraryInfo()
 libraries['raptor'].ParseConfig('pkg-config --cflags --libs raptor')
 
+libraries['sndfile'] = LibraryInfo()
+libraries['sndfile'].ParseConfig ('pkg-config --cflags --libs sndfile')
+
 libraries['samplerate'] = LibraryInfo()
 libraries['samplerate'].ParseConfig('pkg-config --cflags --libs samplerate')
 
@@ -659,6 +664,12 @@ if env['DIST_TARGET'] == 'auto':
     print "detected DIST_TARGET = " + env['DIST_TARGET']
     print "*******************************\n"
 
+if env['DIST_TARGET'] != 'tiger' and env['DIST_TARGET'] != 'leopard':
+       # make sure this is all disabled for non-OS X builds
+       env['GTKOSX'] = 0
+       env['COREAUDIO'] = 0
+       env['AUDIOUNITS'] = 0
+       env['AUSTATE'] = 0
 
 if config[config_cpu] == 'powerpc' and env['DIST_TARGET'] != 'none':
     #
@@ -736,15 +747,18 @@ if env['FPU_OPTIMIZATION']:
             opt_flags.append ("-DUSE_X86_64_ASM")
             debug_flags.append ("-DUSE_X86_64_ASM")
         if build_host_supports_sse != 1:
-            print "\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)"
+            print "\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be anerror, especially if you are a package maintainer)"
 # end optimization section
 
 # handle x86/x86_64 libdir properly
 
-if env['DIST_TARGET'] == 'x86_64':
-    env['LIBDIR']='lib64'
+if env['DIST_LIBDIR'] == '':
+    if env['DIST_TARGET'] == 'x86_64':
+        env['LIBDIR']='lib64'
+    else:
+        env['LIBDIR']='lib'
 else:
-    env['LIBDIR']='lib'
+    env['LIBDIR'] = env['DIST_LIBDIR']
 
 #
 # no VST on x86_64
@@ -918,29 +932,9 @@ if env['WIIMOTE']:
 
 
 #
-# 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')
+# need a way to see if the installed version of libsndfile supports
+# FLAC ....
+# 
 
 # boost (we don't link against boost, just use some header files)
 
@@ -1077,14 +1071,6 @@ if env['SYSLIBS']:
     libraries['libgnomecanvasmm'] = LibraryInfo()
     libraries['libgnomecanvasmm'].ParseConfig ('pkg-config --cflags --libs libgnomecanvasmm-2.6')
 
-#
-# cannot use system one for the time being
-#
-    
-    libraries['sndfile-ardour'] = LibraryInfo(LIBS='libsndfile-ardour',
-                                    LIBPATH='#libs/libsndfile',
-                                    CPPPATH=['#libs/libsndfile/src'])
-
 #    libraries['libglademm'] = LibraryInfo()
 #    libraries['libglademm'].ParseConfig ('pkg-config --cflags --libs libglademm-2.4')
 
@@ -1104,7 +1090,6 @@ if env['SYSLIBS']:
     ]
     
     subdirs = [
-        'libs/libsndfile',
         'libs/pbd',
         'libs/midi++2',
         'libs/ardour',
@@ -1157,9 +1142,6 @@ else:
     libraries['soundtouch'] = LibraryInfo(LIBS='soundtouch',
                                           LIBPATH='#libs/soundtouch',
                                           CPPPATH=['#libs', '#libs/soundtouch'])
-    libraries['sndfile-ardour'] = LibraryInfo(LIBS='libsndfile-ardour',
-                                    LIBPATH='#libs/libsndfile',
-                                    CPPPATH=['#libs/libsndfile', '#libs/libsndfile/src'])
 #    libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
 #                                          LIBPATH='#libs/libglademm',
 #                                          CPPPATH='#libs/libglademm')
@@ -1174,7 +1156,6 @@ else:
     
     subdirs = [
         'libs/sigc++2',
-        'libs/libsndfile',
         'libs/pbd',
         'libs/midi++2',
         'libs/ardour',
@@ -1308,7 +1289,7 @@ env = conf.Finish()
 if env['NLS'] == 1:
     env.Append(CCFLAGS="-DENABLE_NLS")
 
-Export('env install_prefix final_prefix config_prefix final_config_prefix libraries i18n ardour_version subst_dict use_flac')
+Export('env install_prefix final_prefix config_prefix final_config_prefix libraries i18n ardour_version subst_dict')
 
 #
 # the configuration file may be system dependent