2009-02-25 13:59:45 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import autowaf
|
2009-02-26 12:16:22 -05:00
|
|
|
import Options
|
2009-02-25 21:24:16 -05:00
|
|
|
import os
|
|
|
|
import commands
|
2009-02-25 13:59:45 -05:00
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
VERSION = '3.0pre0'
|
|
|
|
APPNAME = 'ardour'
|
|
|
|
|
|
|
|
# Mandatory variables
|
|
|
|
srcdir = '.'
|
|
|
|
blddir = 'build'
|
|
|
|
|
2009-02-25 14:36:16 -05:00
|
|
|
children = [
|
|
|
|
'libs/pbd',
|
|
|
|
'libs/midi++2',
|
|
|
|
'libs/evoral',
|
|
|
|
'libs/vamp-sdk',
|
2009-02-25 20:34:03 -05:00
|
|
|
'libs/vamp-plugins',
|
2009-02-25 14:36:16 -05:00
|
|
|
'libs/taglib',
|
2009-02-25 20:22:20 -05:00
|
|
|
'libs/rubberband',
|
2009-02-25 16:48:32 -05:00
|
|
|
'libs/surfaces',
|
2009-02-25 18:21:49 -05:00
|
|
|
'libs/ardour',
|
|
|
|
'libs/gtkmm2ext',
|
|
|
|
'gtk2_ardour'
|
2009-02-25 14:36:16 -05:00
|
|
|
]
|
2009-02-25 13:59:45 -05:00
|
|
|
|
2009-02-25 21:24:16 -05:00
|
|
|
|
|
|
|
# Version stuff
|
|
|
|
|
|
|
|
def fetch_svn_revision (path):
|
|
|
|
cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'"
|
|
|
|
return commands.getoutput(cmd)
|
|
|
|
|
|
|
|
def fetch_git_revision (path):
|
|
|
|
cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
|
|
|
|
output = commands.getoutput(cmd).splitlines()
|
|
|
|
rev = output[0].replace ("commit", "git")[0:10]
|
|
|
|
for line in output:
|
|
|
|
try:
|
|
|
|
if "git-svn-id" in line:
|
|
|
|
line = line.split('@')[1].split(' ')
|
|
|
|
rev = line[0]
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
return rev
|
|
|
|
|
|
|
|
def create_stored_revision():
|
|
|
|
rev = ""
|
|
|
|
if os.path.exists('.svn'):
|
|
|
|
rev = fetch_svn_revision('.');
|
|
|
|
elif os.path.exists('.git'):
|
|
|
|
rev = fetch_git_revision('.');
|
|
|
|
elif os.path.exists('libs/ardour/svn_revision.cc'):
|
|
|
|
print "Using packaged svn revision"
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
print "Missing libs/ardour/svn_revision.cc. Blame the packager."
|
|
|
|
sys.exit(-1)
|
|
|
|
|
|
|
|
try:
|
|
|
|
text = '#include <ardour/svn_revision.h>\n'
|
|
|
|
text += 'namespace ARDOUR { extern const char* svn_revision = \"' + rev + '\"; }\n'
|
2009-02-26 12:44:47 -05:00
|
|
|
print 'Writing svn revision info to libs/ardour/svn_revision.cc'
|
2009-02-25 21:24:16 -05:00
|
|
|
o = file('libs/ardour/svn_revision.cc', 'w')
|
|
|
|
o.write(text)
|
|
|
|
o.close()
|
|
|
|
except IOError:
|
|
|
|
print 'Could not open libs/ardour/svn_revision.cc for writing\n'
|
|
|
|
sys.exit(-1)
|
|
|
|
|
|
|
|
|
|
|
|
# Waf stages
|
|
|
|
|
2009-02-25 13:59:45 -05:00
|
|
|
def set_options(opt):
|
|
|
|
autowaf.set_options(opt)
|
2009-02-26 12:16:22 -05:00
|
|
|
opt.add_option('--arch', type='string', dest='arch',
|
|
|
|
help='Architecture-specific compiler flags')
|
|
|
|
opt.add_option('--aubio', action='store_true', default=True, dest='aubio',
|
|
|
|
help="Use Paul Brossier's aubio library for feature detection (if available)")
|
|
|
|
opt.add_option('--audiounits', action='store_true', default=False, dest='audiounits',
|
2009-02-26 19:49:24 -05:00
|
|
|
help='Compile with Apple\'s AudioUnit library (experimental)')
|
2009-02-26 12:16:22 -05:00
|
|
|
opt.add_option('--coreaudio', action='store_true', default=False, dest='coreaudio',
|
|
|
|
help='Compile with Apple\'s CoreAudio library')
|
|
|
|
opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
|
|
|
|
help='Build runtime checked assembler code')
|
|
|
|
opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
|
|
|
|
help='Install MIME type, icons and .desktop file as per freedesktop.org standards')
|
|
|
|
opt.add_option('--freesound', action='store_true', default=False, dest='freesound',
|
|
|
|
help='Include Freesound database lookup')
|
|
|
|
opt.add_option('--gtkosx', action='store_true', default=False, dest='gtkosx',
|
|
|
|
help='Compile for use with GTK-OSX, not GTK-X11')
|
|
|
|
opt.add_option('--lv2', action='store_true', default=False, dest='lv2',
|
|
|
|
help='Compile with support for LV2 (if slv2 is available)')
|
|
|
|
opt.add_option('--nls', action='store_true', default=True, dest='nls',
|
2009-02-26 19:49:24 -05:00
|
|
|
help='Enable i18n (native language support)')
|
2009-02-26 12:16:22 -05:00
|
|
|
opt.add_option('--surfaces', action='store_true', default=True, dest='surfaces',
|
|
|
|
help='Build support for control surfaces')
|
2009-02-26 12:42:54 -05:00
|
|
|
opt.add_option('--syslibs', action='store_true', default=True, dest='syslibs',
|
2009-02-26 12:16:22 -05:00
|
|
|
help='Use existing system versions of various libraries instead of internal ones')
|
|
|
|
opt.add_option('--tranzport', action='store_true', default=True, dest='tranzport',
|
2009-02-26 19:49:24 -05:00
|
|
|
help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
|
2009-02-26 12:16:22 -05:00
|
|
|
opt.add_option('--universal', action='store_true', default=False, dest='universal',
|
2009-02-26 19:49:24 -05:00
|
|
|
help='Compile as universal binary (requires that external libraries are universal)')
|
2009-02-26 12:16:22 -05:00
|
|
|
opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
|
|
|
|
help='Add revision information to executable name inside the build directory')
|
|
|
|
opt.add_option('--vst', action='store_true', default=False, dest='vst',
|
|
|
|
help='Compile with support for VST')
|
|
|
|
opt.add_option('--wiimote', action='store_true', default=False, dest='wiimote',
|
|
|
|
help='Build the wiimote control surface')
|
|
|
|
opt.add_option('--windows-key', type='string', dest='windows_key',
|
2009-04-20 17:02:46 -04:00
|
|
|
help='Set X Modifier (Mod1,Mod2,Mod3,Mod4,Mod5) for "Windows" key [Default: Mod4]', default='Mod4><Super')
|
2009-02-25 13:59:45 -05:00
|
|
|
for i in children:
|
|
|
|
opt.sub_options(i)
|
2009-05-04 18:10:15 -04:00
|
|
|
|
2009-02-25 13:59:45 -05:00
|
|
|
def sub_config_and_use(conf, name, has_objects = True):
|
|
|
|
conf.sub_config(name)
|
|
|
|
autowaf.set_local_lib(conf, name, has_objects)
|
|
|
|
|
|
|
|
def configure(conf):
|
2009-02-25 21:24:16 -05:00
|
|
|
create_stored_revision()
|
2009-02-25 13:59:45 -05:00
|
|
|
autowaf.set_recursive()
|
|
|
|
autowaf.configure(conf)
|
2009-02-25 19:05:51 -05:00
|
|
|
autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
|
|
|
|
autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
|
2009-02-25 13:59:45 -05:00
|
|
|
for i in children:
|
|
|
|
sub_config_and_use(conf, i)
|
2009-05-04 18:10:15 -04:00
|
|
|
|
2009-02-26 13:59:15 -05:00
|
|
|
# Fix utterly braindead FLAC include path to not smash assert.h
|
|
|
|
conf.env['CPPPATH_FLAC'] = []
|
2009-02-26 13:37:41 -05:00
|
|
|
|
2009-02-26 12:16:22 -05:00
|
|
|
autowaf.print_summary(conf)
|
|
|
|
opts = Options.options
|
|
|
|
autowaf.display_header('Ardour Configuration')
|
|
|
|
autowaf.display_msg(conf, 'Architecture flags', opts.arch)
|
|
|
|
autowaf.display_msg(conf, 'Aubio', bool(conf.env['HAVE_AUBIO']))
|
|
|
|
autowaf.display_msg(conf, 'AudioUnits', opts.audiounits)
|
|
|
|
autowaf.display_msg(conf, 'CoreAudio', opts.coreaudio)
|
|
|
|
autowaf.display_msg(conf, 'FPU Optimization', opts.fpu_optimization)
|
|
|
|
autowaf.display_msg(conf, 'Freedesktop Files', opts.freedesktop)
|
|
|
|
autowaf.display_msg(conf, 'Freesound', opts.freesound)
|
|
|
|
autowaf.display_msg(conf, 'GtkOSX', opts.gtkosx)
|
|
|
|
autowaf.display_msg(conf, 'LV2 Support', bool(conf.env['HAVE_SLV2']))
|
2009-02-26 21:32:53 -05:00
|
|
|
autowaf.display_msg(conf, 'Rubberband', bool(conf.env['HAVE_RUBBERBAND']))
|
|
|
|
autowaf.display_msg(conf, 'Samplerate', bool(conf.env['HAVE_SAMPLERATE']))
|
|
|
|
autowaf.display_msg(conf, 'Soundtouch', bool(conf.env['HAVE_SOUNDTOUCH']))
|
2009-02-26 12:16:22 -05:00
|
|
|
autowaf.display_msg(conf, 'Translation', opts.nls)
|
|
|
|
autowaf.display_msg(conf, 'Surfaces', opts.surfaces)
|
|
|
|
autowaf.display_msg(conf, 'System Libraries', opts.syslibs)
|
|
|
|
autowaf.display_msg(conf, 'Tranzport', opts.tranzport)
|
|
|
|
autowaf.display_msg(conf, 'Universal Binary', opts.universal)
|
|
|
|
autowaf.display_msg(conf, 'Versioned Binary', opts.versioned)
|
|
|
|
autowaf.display_msg(conf, 'VST Support', opts.vst)
|
|
|
|
autowaf.display_msg(conf, 'Wiimote Support', opts.wiimote)
|
|
|
|
autowaf.display_msg(conf, 'Windows Key', opts.windows_key)
|
2009-02-25 13:59:45 -05:00
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
autowaf.set_recursive()
|
|
|
|
for i in children:
|
|
|
|
bld.add_subdirs(i)
|
|
|
|
|
|
|
|
def shutdown():
|
|
|
|
autowaf.shutdown()
|
|
|
|
|