new headless (GUI-free) version of ardour. run waf, cd headless and run ./hardev...
[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     
34     # just the normal executable version of the GTK GUI
35     obj = bld (features = 'cxx c cxxprogram')
36     obj.source    = hardour_sources
37     obj.target = 'hardour-' + bld.env['VERSION']
38     obj.includes = ['.']
39
40     # at this point, "obj" refers to either the normal native executable
41     # OR the shared library built for use with wine on linux.
42
43     obj.use      = [ 'libpbd',
44                      'libardour',
45                      'libardour_cp',
46                      'libtimecode',
47                      'libmidipp',
48                      ]
49
50     obj.defines = [
51         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
52         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
53         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
54         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
55         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
56         ]
57     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
58     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD OGG CURL DL'
59     obj.uselib       += ' FFTW3F'
60     obj.uselib       += ' AUDIOUNITS OSX LO '
61     obj.uselib       += ' TAGLIB '
62
63     if sys.platform == 'darwin':
64         obj.uselib += ' AUDIOUNITS OSX'
65         obj.use    += ' libappleutility'
66     obj.includes += ['../libs']
67
68     if bld.env['build_target'] == 'mingw':
69         if bld.env['DEBUG'] == False:
70             obj.linkflags = ['-mwindows']
71
72     if bld.is_defined('NEED_INTL'):
73         obj.linkflags = ' -lintl'
74
75     # Wrappers
76
77     wrapper_subst_dict = {
78             'INSTALL_PREFIX' : bld.env['PREFIX'],
79             'LIBDIR'         : os.path.normpath(bld.env['LIBDIR']),
80             'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
81             'SYSCONFDIR'     : os.path.normpath(bld.env['SYSCONFDIR']),
82             'LIBS'           : 'build/libs',
83             'VERSION'        : bld.env['VERSION'],
84             'EXECUTABLE'     : 'build/headless/hardour-' + bld.env['VERSION']
85     }
86
87     def set_subst_dict(obj, dict):
88         for i in dict:
89             setattr(obj, i, dict[i])
90
91     obj              = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
92     obj.source       = 'hardev_common.sh.in'
93     obj.target       = 'hardev_common_waf.sh'
94     obj.chmod        = Utils.O755
95     obj.dict         = wrapper_subst_dict
96     set_subst_dict(obj, wrapper_subst_dict)