add control port to ardour.rc.in and fix crash bug caused by bad shared_ptr<Region...
[ardour.git] / SConstruct
index 3fff60f04b6b529fa8f18c41430de2ce81ecbceb..71a533e7092864b88ff85e0364dfc9e161792fe7 100644 (file)
@@ -15,7 +15,7 @@ import SCons.Node.FS
 SConsignFile()
 EnsureSConsVersion(0, 96)
 
-version = '2.0beta2'
+version = '2.0beta5.1'
 
 subst_dict = { }
 
@@ -25,12 +25,14 @@ subst_dict = { }
 
 opts = Options('scache.conf')
 opts.AddOptions(
-  ('ARCH', 'Set architecture-specific compilation flags by hand (all flags as 1 argument)',''),
+    ('ARCH', 'Set architecture-specific compilation flags by hand (all flags as 1 argument)',''),
+    BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0),
     BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0),
     BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
     PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
     EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'none' ), ignorecase=2),
     BoolOption('DMALLOC', 'Compile and link using the dmalloc library', 0),
+    BoolOption('EXTRA_WARN', 'Compile with -Wextra, -ansi, and -pedantic.  Might break compilation.  For pedants', 0),
     BoolOption('FFT_ANALYSIS', 'Include FFT analysis window', 0),
     BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1),
     BoolOption('LIBLO', 'Compile with support for liblo library', 1),
@@ -363,8 +365,8 @@ if env['VST']:
     answer = sys.stdin.readline ()
     answer = answer.rstrip().strip()
     if answer != "yes" and answer != "y":
-        print 'You cannot build Ardour with VST support for distribution to others.\nIt is a violation of several different licenses. VST support disabled.'
-        env['VST'] = 0;
+        print 'You cannot build Ardour with VST support for distribution to others.\nIt is a violation of several different licenses. Build with VST=false.'
+        sys.exit (-1);
     else:
         print "OK, VST support will be enabled"
 
@@ -450,9 +452,22 @@ libraries['usb'] = conf.Finish ()
 libraries['flac'] = LibraryInfo ()
 
 conf = Configure (libraries['flac'])
-conf.CheckLib ('FLAC', 'FLAC__stream_decoder_new')
+conf.CheckLib ('FLAC', 'FLAC__stream_decoder_new', language='CXX')
 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 ()
+conf = Configure (libraries['boost'])
+if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == 0:
+        print "Boost header files do not appear to be installed."
+        sys.exit (1)
+    
+libraries['boost'] = conf.Finish ()
+
 #
 # Check for liblo
 
@@ -483,8 +498,6 @@ else:
 
 libraries['dmalloc'] = conf.Finish ()
 
-#
-
 #
 # Audio/MIDI library (needed for MIDI, since audio is all handled via JACK)
 #
@@ -539,6 +552,10 @@ if env['SYSLIBS']:
 #    libraries['flowcanvas'] = LibraryInfo(LIBS='flowcanvas', LIBPATH='#/libs/flowcanvas', CPPPATH='#libs/flowcanvas')
     libraries['soundtouch'] = LibraryInfo()
     libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs soundtouch-1.0')
+
+    libraries['appleutility'] = LibraryInfo(LIBS='libappleutility',
+                                            LIBPATH='#libs/appleutility',
+                                            CPPPATH='#libs/appleutility')
     
     coredirs = [
         'templates'
@@ -548,12 +565,18 @@ if env['SYSLIBS']:
         'libs/libsndfile',
         'libs/pbd',
         'libs/midi++2',
-        'libs/ardour'
+        'libs/ardour',
+    # these are unconditionally included but have
+    # tests internally to avoid compilation etc
+    # if VST is not set
+        'libs/fst',
+        'vst',
+    # this is unconditionally included but has
+    # tests internally to avoid compilation etc
+    # if COREAUDIO is not set
+        'libs/appleutility'
         ]
     
-    if env['VST']:
-        subdirs = ['libs/fst'] + subdirs + ['vst']
-    
     gtk_subdirs = [
 #        'libs/flowcanvas',
         'libs/gtkmm2ext',
@@ -592,7 +615,10 @@ else:
 #    libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
 #                                          LIBPATH='#libs/libglademm',
 #                                          CPPPATH='#libs/libglademm')
-    
+    libraries['appleutility'] = LibraryInfo(LIBS='libappleutility',
+                                            LIBPATH='#libs/appleutility',
+                                            CPPPATH='#libs/appleutility')
+
     coredirs = [
         'libs/soundtouch',
         'templates'
@@ -603,12 +629,18 @@ else:
         'libs/libsndfile',
         'libs/pbd',
         'libs/midi++2',
-        'libs/ardour'
+        'libs/ardour',
+    # these are unconditionally included but have
+    # tests internally to avoid compilation etc
+    # if VST is not set
+        'libs/fst',
+        'vst',
+    # this is unconditionally included but has
+    # tests internally to avoid compilation etc
+    # if COREAUDIO is not set
+        'libs/appleutility'
         ]
     
-    if env['VST']:
-        subdirs = ['libs/fst'] + subdirs + ['vst']
-    
     gtk_subdirs = [
        'libs/glibmm2',
        'libs/gtkmm2/pango',
@@ -654,9 +686,15 @@ if os.environ.has_key('DISTCC_HOSTS'):
     env['ENV']['HOME'] = os.environ['HOME']
 
 final_prefix = '$PREFIX'
-install_prefix = '$DESTDIR/$PREFIX'
 
-subst_dict['INSTALL_PREFIX'] = install_prefix;
+if env['DESTDIR'] :
+    install_prefix = '$DESTDIR/$PREFIX'
+else:
+    install_prefix = env['PREFIX']
+
+subst_dict['%INSTALL_PREFIX%'] = install_prefix;
+subst_dict['%FINAL_PREFIX%'] = final_prefix;
+subst_dict['%PREFIX%'] = final_prefix;
 
 if env['PREFIX'] == '/usr':
     final_config_prefix = '/etc'
@@ -665,7 +703,6 @@ else:
 
 config_prefix = '$DESTDIR' + final_config_prefix
 
-
 # SCons should really do this for us
 
 conf = Configure (env)
@@ -818,6 +855,10 @@ else:
 env.Append(CCFLAGS="-Wall")
 env.Append(CXXFLAGS="-Woverloaded-virtual")
 
+if env['EXTRA_WARN']:
+    env.Append(CCFLAGS="-Wextra -pedantic")
+    env.Append(CXXFLAGS="-ansi")
+
 if env['LIBLO']:
     env.Append(CCFLAGS="-DHAVE_LIBLO")
 
@@ -913,7 +954,17 @@ env.Distribute (env['DISTTREE'],
                   'COPYING', 'PACKAGER_README', 'README',
                   'ardour.rc.in',
                   'ardour_system.rc',
-                  'tools/config.guess'
+                  'tools/config.guess',
+                  'icons/icon/ardour_icon_mac_mask.png',
+                  'icons/icon/ardour_icon_mac.png',
+                  'icons/icon/ardour_icon_tango_16px_blue.png',
+                  'icons/icon/ardour_icon_tango_16px_red.png',
+                  'icons/icon/ardour_icon_tango_22px_blue.png',
+                  'icons/icon/ardour_icon_tango_22px_red.png',
+                  'icons/icon/ardour_icon_tango_32px_blue.png',
+                  'icons/icon/ardour_icon_tango_32px_red.png',
+                  'icons/icon/ardour_icon_tango_48px_blue.png',
+                  'icons/icon/ardour_icon_tango_48px_red.png'
                   ] +
                 glob.glob ('DOCUMENTATION/AUTHORS*') +
                 glob.glob ('DOCUMENTATION/CONTRIBUTORS*') +
@@ -925,6 +976,7 @@ env.Distribute (env['DISTTREE'],
 
 srcdist = env.Tarball(env['TARBALL'], env['DISTTREE'])
 env.Alias ('srctar', srcdist)
+
 #
 # don't leave the distree around
 #