r80@gandalf: fugalh | 2006-06-22 16:37:01 -0600
[ardour.git] / SConstruct
index 15d7ac743698f1712dcee8656d402368664217fa..b0c0bb07ccc15731884a8f640f51401ac5fa05aa 100644 (file)
@@ -14,7 +14,7 @@ import SCons.Node.FS
 SConsignFile()
 EnsureSConsVersion(0, 96)
 
-version = '2.0alpha2'
+version = '2.0beta1'
 
 subst_dict = { }
 
@@ -36,8 +36,10 @@ opts.AddOptions(
     BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1),
     BoolOption('FFT_ANALYSIS', 'Include FFT analysis window', 0),
     BoolOption('SURFACES', 'Build support for control surfaces', 0),
-    BoolOption('DMALLOC', 'Compile and link using the dmalloc library', 0)
-  )
+    BoolOption('DMALLOC', 'Compile and link using the dmalloc library', 0),
+    BoolOption('LIBLO', 'Compile with support for liblo library', 1),
+    BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library -- UNSTABLE', 0)
+)
 
 #----------------------------------------------------------------------
 # a handy helper that provides a way to merge compile/link information
@@ -351,8 +353,8 @@ libraries = { }
 
 libraries['core'] = LibraryInfo (CCFLAGS = '-Ilibs')
 
-libraries['sndfile'] = LibraryInfo()
-libraries['sndfile'].ParseConfig('pkg-config --cflags --libs sndfile')
+#libraries['sndfile'] = LibraryInfo(CCFLAGS = '-Ilibs/libsndfile/src')
+#libraries['sndfile'].ParseConfig('pkg-config --cflags --libs sndfile')
 
 libraries['lrdf'] = LibraryInfo()
 libraries['lrdf'].ParseConfig('pkg-config --cflags --libs lrdf')
@@ -380,6 +382,7 @@ libraries['glib2'] = LibraryInfo()
 libraries['glib2'].ParseConfig ('pkg-config --cflags --libs glib-2.0')
 libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gobject-2.0')
 libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gmodule-2.0')
+libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gthread-2.0')
 
 libraries['gtk2'] = LibraryInfo()
 libraries['gtk2'].ParseConfig ('pkg-config --cflags --libs gtk+-2.0')
@@ -425,14 +428,15 @@ libraries['usb'] = conf.Finish ()
 #
 # Check for liblo
 
-libraries['lo'] = LibraryInfo ()
+if env['LIBLO']:
+    libraries['lo'] = LibraryInfo ()
 
-conf = Configure (libraries['lo'])
-if conf.CheckLib ('lo', 'lo_server_new') == False:
-    print "liblo does not appear to be installed."
-    exit (0)
+    conf = Configure (libraries['lo'])
+    if conf.CheckLib ('lo', 'lo_server_new') == False:
+        print "liblo does not appear to be installed."
+        sys.exit (1)
     
-libraries['lo'] = conf.Finish ()
+    libraries['lo'] = conf.Finish ()
 
 #
 # Check for dmalloc
@@ -470,7 +474,10 @@ elif conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/Co
     env['SYSMIDI'] = 'CoreMIDI'
     subst_dict['%MIDITAG%'] = "ardour"
     subst_dict['%MIDITYPE%'] = "coremidi"
-
+else:
+    print "It appears you don't have the required MIDI libraries installed."
+    sys.exit (1)
+        
 env = conf.Finish()
 
 if env['SYSLIBS']:
@@ -539,6 +546,9 @@ else:
     libraries['soundtouch'] = LibraryInfo(LIBS='soundtouch',
                                           LIBPATH='#libs/soundtouch',
                                           CPPPATH=['#libs', '#libs/soundtouch'])
+    libraries['sndfile'] = LibraryInfo(LIBS='libsndfile',
+                                    LIBPATH='#libs/libsndfile',
+                                    CPPPATH='#libs/libsndfile')
 #    libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
 #                                          LIBPATH='#libs/libglademm',
 #                                          CPPPATH='#libs/libglademm')
@@ -551,6 +561,7 @@ else:
     subdirs = [
 #          'libs/cassowary',
         'libs/sigc++2',
+        'libs/libsndfile',
         'libs/pbd3',
         'libs/midi++2',
         'libs/ardour'
@@ -568,10 +579,14 @@ else:
     'gtk2_ardour'
         ]
 
-surface_subdirs = []
+#
+# always build the LGPL control protocol lib, since we link against it ourselves
+# ditto for generic MIDI
+#
+
+surface_subdirs = [ 'libs/surfaces/control_protocol', 'libs/surfaces/generic_midi' ]
 
 if env['SURFACES']:
-    surface_subdirs += [ 'libs/surfaces/control_protocol', 'libs/surfaces/generic_midi' ]
     if have_libusb:
         surface_subdirs += [ 'libs/surfaces/tranzport' ]
     if os.access ('libs/surfaces/sony9pin', os.F_OK):
@@ -725,6 +740,12 @@ if env['FPU_OPTIMIZATION']:
             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)"
 # end optimization section
 
+#
+# save off guessed arch element in an env
+#
+env.Append(CONFIG_ARCH=config[config_arch])
+
+
 #
 # ARCH="..." overrides all 
 #
@@ -753,6 +774,9 @@ env.Append(CCFLAGS="-Wall")
 if env['VST']:
     env.Append(CCFLAGS="-DVST_SUPPORT")
 
+if env['LIBLO']:
+    env.Append(CCFLAGS="-DHAVE_LIBLO")
+
 #
 # everybody needs this
 #
@@ -852,7 +876,7 @@ env.AddPostAction (srcdist, Action ('rm -rf ' + str (File (env['DISTTREE']))))
 for subdir in coredirs:
     SConscript (subdir + '/SConscript')
 
-for sublistdir in [subdirs, gtk_subdirs, surface_subdirs]:
+for sublistdir in [ subdirs, gtk_subdirs, surface_subdirs ]:
     for subdir in sublistdir:
         SConscript (subdir + '/SConscript')