VST=1 support working in build scripts
[ardour.git] / SConstruct
index d657e822cace09ad93219da3da44462f777e5a2e..9ab5434314bb1dfedd0eb96ba92663f38518e9de 100644 (file)
@@ -15,7 +15,7 @@ import SCons.Node.FS
 SConsignFile()
 EnsureSConsVersion(0, 96)
 
 SConsignFile()
 EnsureSConsVersion(0, 96)
 
-version = '2.0beta2'
+version = '2.0beta5'
 
 subst_dict = { }
 
 
 subst_dict = { }
 
@@ -25,7 +25,7 @@ subst_dict = { }
 
 opts = Options('scache.conf')
 opts.AddOptions(
 
 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),
     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),
@@ -365,8 +365,8 @@ if env['VST']:
     answer = sys.stdin.readline ()
     answer = answer.rstrip().strip()
     if answer != "yes" and answer != "y":
     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"
 
     else:
         print "OK, VST support will be enabled"
 
@@ -468,17 +468,6 @@ if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == 0:
     
 libraries['boost'] = conf.Finish ()
 
     
 libraries['boost'] = conf.Finish ()
 
-conf = env.Configure ()
-
-# jack_port_ensure_monitor available
-
-if conf.CheckFunc('jack_port_ensure_monitor'):
-    env.Append(CCFLAGS='-DWITH_JACK_PORT_ENSURE_MONITOR')
-else:
-    print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
-
-env = conf.Finish()
-
 #
 # Check for liblo
 
 #
 # Check for liblo
 
@@ -576,15 +565,18 @@ if env['SYSLIBS']:
         'libs/libsndfile',
         'libs/pbd',
         'libs/midi++2',
         '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']
-
-    if env['COREAUDIO']:
-        subdirs = subdirs + ['libs/appleutility']
-    
     gtk_subdirs = [
 #        'libs/flowcanvas',
         'libs/gtkmm2ext',
     gtk_subdirs = [
 #        'libs/flowcanvas',
         'libs/gtkmm2ext',
@@ -637,15 +629,18 @@ else:
         'libs/libsndfile',
         'libs/pbd',
         'libs/midi++2',
         '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']
-
-    if env['COREAUDIO']:
-        subdirs = subdirs + ['libs/appleutility']
-    
     gtk_subdirs = [
        'libs/glibmm2',
        'libs/gtkmm2/pango',
     gtk_subdirs = [
        'libs/glibmm2',
        'libs/gtkmm2/pango',
@@ -691,9 +686,15 @@ if os.environ.has_key('DISTCC_HOSTS'):
     env['ENV']['HOME'] = os.environ['HOME']
 
 final_prefix = '$PREFIX'
     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'
 
 if env['PREFIX'] == '/usr':
     final_config_prefix = '/etc'
@@ -702,7 +703,6 @@ else:
 
 config_prefix = '$DESTDIR' + final_config_prefix
 
 
 config_prefix = '$DESTDIR' + final_config_prefix
 
-
 # SCons should really do this for us
 
 conf = Configure (env)
 # SCons should really do this for us
 
 conf = Configure (env)
@@ -954,7 +954,17 @@ env.Distribute (env['DISTTREE'],
                   'COPYING', 'PACKAGER_README', 'README',
                   'ardour.rc.in',
                   'ardour_system.rc',
                   '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*') +
                   ] +
                 glob.glob ('DOCUMENTATION/AUTHORS*') +
                 glob.glob ('DOCUMENTATION/CONTRIBUTORS*') +
@@ -966,6 +976,7 @@ env.Distribute (env['DISTTREE'],
 
 srcdist = env.Tarball(env['TARBALL'], env['DISTTREE'])
 env.Alias ('srctar', srcdist)
 
 srcdist = env.Tarball(env['TARBALL'], env['DISTTREE'])
 env.Alias ('srctar', srcdist)
+
 #
 # don't leave the distree around
 #
 #
 # don't leave the distree around
 #