2014-02-24 13:49:58 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from waflib.extras import autowaf as autowaf
|
|
|
|
from waflib import Options, TaskGen
|
|
|
|
import waflib.Logs as Logs, waflib.Utils as Utils
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
import re
|
|
|
|
import time
|
|
|
|
from waflib.Task import Task
|
|
|
|
|
|
|
|
# Mandatory variables
|
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
|
|
|
|
|
|
|
hardour_sources = [
|
|
|
|
'load_session.cc',
|
|
|
|
'misc.cc',
|
|
|
|
]
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
autowaf.set_options(opt)
|
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
conf.load('misc')
|
|
|
|
conf.load('compiler_cxx')
|
|
|
|
autowaf.configure(conf)
|
|
|
|
|
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
|
|
|
|
VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
|
2014-02-24 17:32:35 -05:00
|
|
|
if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
|
|
|
|
return
|
2015-11-29 11:52:42 -05:00
|
|
|
|
2014-02-24 13:49:58 -05:00
|
|
|
# just the normal executable version of the GTK GUI
|
|
|
|
obj = bld (features = 'cxx c cxxprogram')
|
2014-03-01 16:17:58 -05:00
|
|
|
# this program does not do the whole hidden symbols thing
|
|
|
|
obj.cxxflags = [ '-fvisibility=default' ]
|
2014-02-24 13:49:58 -05:00
|
|
|
obj.source = hardour_sources
|
2014-07-13 08:36:11 -04:00
|
|
|
obj.target = 'hardour-' + str (bld.env['VERSION'])
|
2014-02-24 13:49:58 -05:00
|
|
|
obj.includes = ['.']
|
|
|
|
|
|
|
|
# at this point, "obj" refers to either the normal native executable
|
|
|
|
# OR the shared library built for use with wine on linux.
|
|
|
|
|
|
|
|
obj.use = [ 'libpbd',
|
|
|
|
'libardour',
|
|
|
|
'libardour_cp',
|
|
|
|
'libtimecode',
|
|
|
|
'libmidipp',
|
|
|
|
]
|
|
|
|
|
|
|
|
obj.defines = [
|
2014-07-13 08:36:11 -04:00
|
|
|
'VERSIONSTRING="' + str(bld.env['VERSION']) + '"',
|
2014-02-24 13:49:58 -05:00
|
|
|
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
|
|
|
|
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
|
|
|
|
'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
|
|
|
|
]
|
2014-04-28 21:18:02 -04:00
|
|
|
obj.install_path = bld.env['LIBDIR']
|
2016-02-28 15:16:44 -05:00
|
|
|
obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD OGG CURL DL XML'
|
2014-02-24 13:49:58 -05:00
|
|
|
obj.uselib += ' FFTW3F'
|
|
|
|
obj.uselib += ' AUDIOUNITS OSX LO '
|
|
|
|
obj.uselib += ' TAGLIB '
|
|
|
|
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
obj.uselib += ' AUDIOUNITS OSX'
|
|
|
|
obj.use += ' libappleutility'
|
|
|
|
obj.includes += ['../libs']
|
|
|
|
|
|
|
|
if bld.env['build_target'] == 'mingw':
|
2014-02-24 17:32:35 -05:00
|
|
|
if bld.env['DEBUG'] == False:
|
2014-02-24 13:49:58 -05:00
|
|
|
obj.linkflags = ['-mwindows']
|
|
|
|
|
|
|
|
if bld.is_defined('NEED_INTL'):
|
|
|
|
obj.linkflags = ' -lintl'
|
|
|
|
|
|
|
|
# Wrappers
|
|
|
|
|
|
|
|
wrapper_subst_dict = {
|
|
|
|
'INSTALL_PREFIX' : bld.env['PREFIX'],
|
|
|
|
'LIBDIR' : os.path.normpath(bld.env['LIBDIR']),
|
|
|
|
'DATADIR' : os.path.normpath(bld.env['DATADIR']),
|
2014-06-03 08:36:16 -04:00
|
|
|
'CONFDIR' : os.path.normpath(bld.env['CONFDIR']),
|
2014-02-24 13:49:58 -05:00
|
|
|
'LIBS' : 'build/libs',
|
|
|
|
'VERSION' : bld.env['VERSION'],
|
2014-07-13 08:36:11 -04:00
|
|
|
'EXECUTABLE' : 'build/headless/hardour-' + str(bld.env['VERSION'])
|
2014-02-24 13:49:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
def set_subst_dict(obj, dict):
|
|
|
|
for i in dict:
|
|
|
|
setattr(obj, i, dict[i])
|
|
|
|
|
2014-12-28 04:20:25 -05:00
|
|
|
obj = bld(features = 'subst')
|
2014-02-24 13:49:58 -05:00
|
|
|
obj.source = 'hardev_common.sh.in'
|
|
|
|
obj.target = 'hardev_common_waf.sh'
|
|
|
|
obj.chmod = Utils.O755
|
|
|
|
obj.dict = wrapper_subst_dict
|
|
|
|
set_subst_dict(obj, wrapper_subst_dict)
|