import time
import platform
import string
+import commands
from sets import Set
import SCons.Node.FS
SConsignFile()
EnsureSConsVersion(0, 96)
-version = '2.0beta2'
+version = '2.0beta6.1'
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"', '/'),
# note: requires that DOMAIN, MAJOR, MINOR, MICRO are set in the construction environment
# note: assumes one source files, the header that declares the version variables
#
+
def version_builder (target, source, env):
- text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
- text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
- text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
-
- try:
- o = file (target[0].get_path(), 'w')
- o.write (text)
- o.close ()
- except IOError:
- print "Could not open", target[0].get_path(), " for writing\n"
- sys.exit (-1)
-
- text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
- text += "#define __" + env['DOMAIN'] + "_version_h__\n"
- text += "extern int " + env['DOMAIN'] + "_major_version;\n"
- text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
- text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
- text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
-
- try:
- o = file (target[1].get_path(), 'w')
- o.write (text)
- o.close ();
- except IOError:
- print "Could not open", target[1].get_path(), " for writing\n"
- sys.exit (-1)
-
- return None
+ cmd = "svn info "
+ cmd += source[0].get_path()
+ cmd += " | awk '/^Revision:/ { print $2}'"
+
+ rev = commands.getoutput (cmd)
+
+ text = "const char* " + env['DOMAIN'] + "_revision = \"" + rev + "\";\n"
+ text += "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
+ text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
+ text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
+
+ try:
+ o = file (target[0].get_path(), 'w')
+ o.write (text)
+ o.close ()
+ except IOError:
+ print "Could not open", target[0].get_path(), " for writing\n"
+ sys.exit (-1)
+
+ text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
+ text += "#define __" + env['DOMAIN'] + "_version_h__\n"
+ text += "extern const char* " + env['DOMAIN'] + "_revision;\n"
+ text += "extern int " + env['DOMAIN'] + "_major_version;\n"
+ text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
+ text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
+ text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
+
+ try:
+ o = file (target[1].get_path(), 'w')
+ o.write (text)
+ o.close ();
+ except IOError:
+ print "Could not open", target[1].get_path(), " for writing\n"
+ sys.exit (-1)
+
+ return None
version_bld = Builder (action = version_builder)
env.Append (BUILDERS = {'VersionBuild' : version_bld})
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"
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
libraries['dmalloc'] = conf.Finish ()
-#
-
#
# Audio/MIDI library (needed for MIDI, since audio is all handled via JACK)
#
# 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'
'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',
# 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'
'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',
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'
config_prefix = '$DESTDIR' + final_config_prefix
-
# SCons should really do this for us
conf = Configure (env)
'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*') +
srcdist = env.Tarball(env['TARBALL'], env['DISTTREE'])
env.Alias ('srctar', srcdist)
+
#
# don't leave the distree around
#