Add API allowing plugin preset load to affect automation
[ardour.git] / headless / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options, TaskGen
4 import waflib.Logs as Logs, waflib.Utils as Utils
5 import os
6 import shutil
7 import sys
8 import re
9 import time
10 from waflib.Task import Task
11
12 # Mandatory variables
13 top = '.'
14 out = 'build'
15
16 hardour_sources = [
17         'load_session.cc',
18         'misc.cc',
19 ]
20
21 def options(opt):
22     autowaf.set_options(opt)
23
24 def configure(conf):
25     conf.load('misc')
26     conf.load('compiler_cxx')
27     autowaf.configure(conf)
28
29
30 def build(bld):
31
32     VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
33     if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
34         return
35
36     # just the normal executable version of the GTK GUI
37     obj = bld (features = 'cxx c cxxprogram')
38     # this program does not do the whole hidden symbols thing
39     obj.cxxflags = [ '-fvisibility=default' ]
40     obj.source    = hardour_sources
41     obj.target = 'hardour-' + str (bld.env['VERSION'])
42     obj.includes = ['.']
43
44     # at this point, "obj" refers to either the normal native executable
45     # OR the shared library built for use with wine on linux.
46
47     obj.use      = [ 'libpbd',
48                      'libardour',
49                      'libardour_cp',
50                      'libtimecode',
51                      'libmidipp',
52                      ]
53
54     obj.defines = [
55         'VERSIONSTRING="' + str(bld.env['VERSION']) + '"',
56         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
57         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
58         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
59         ]
60     obj.install_path = bld.env['LIBDIR']
61     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD OGG CURL DL XML'
62     obj.uselib       += ' FFTW3F'
63     obj.uselib       += ' AUDIOUNITS OSX LO '
64     obj.uselib       += ' TAGLIB '
65
66     if sys.platform == 'darwin':
67         obj.uselib += ' AUDIOUNITS OSX'
68         obj.use    += ' libappleutility'
69     obj.includes += ['../libs']
70
71     if bld.env['build_target'] == 'mingw':
72         if bld.env['DEBUG'] == False:
73             obj.linkflags = ['-mwindows']
74
75     if bld.is_defined('NEED_INTL'):
76         obj.linkflags = ' -lintl'
77
78     # Wrappers
79
80     wrapper_subst_dict = {
81             'INSTALL_PREFIX' : bld.env['PREFIX'],
82             'LIBDIR'         : os.path.normpath(bld.env['LIBDIR']),
83             'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
84             'CONFDIR'        : os.path.normpath(bld.env['CONFDIR']),
85             'LIBS'           : 'build/libs',
86             'VERSION'        : bld.env['VERSION'],
87             'EXECUTABLE'     : 'build/headless/hardour-' + str(bld.env['VERSION'])
88     }
89
90     def set_subst_dict(obj, dict):
91         for i in dict:
92             setattr(obj, i, dict[i])
93
94     obj              = bld(features = 'subst')
95     obj.source       = 'hardev_common.sh.in'
96     obj.target       = 'hardev_common_waf.sh'
97     obj.chmod        = Utils.O755
98     obj.dict         = wrapper_subst_dict
99     set_subst_dict(obj, wrapper_subst_dict)