summaryrefslogtreecommitdiff
path: root/session_utils/wscript
blob: 5fe944542601861bdcafb17b47ccb2e26e8bc445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/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'

def options(opt):
    autowaf.set_options(opt)

def configure(conf):
    if not "dummy" in conf.env['BACKENDS']:
        print ('session-utils depend on the dummy backend.')
        autowaf.display_msg(conf, 'build session-utils', 'no')
        return
    # no wine
    if Options.options.windows_vst and Options.options.dist_target != 'mingw':
        autowaf.display_msg(conf, 'build session-utils', 'no')
        return
    autowaf.display_msg(conf, 'build session-utils', 'yes')
    conf.load('misc')
    conf.load('compiler_cxx')
    autowaf.configure(conf)

def build_ardour_util(bld, util):
    pgmprefix = bld.env['PROGRAM_NAME'].lower() + str(bld.env['MAJOR'])

    # just the normal executable version of the GTK GUI
    obj = bld (features = 'cxx c cxxprogram')
    # this program does not do the whole hidden symbols thing
    obj.cxxflags = [ '-fvisibility=default' ]
    obj.source   = ['common.cc', util + '.cc' ]
    obj.target   = pgmprefix + '-' + util
    obj.includes = ['.']
    obj.use      = [ 'libpbd',
                     'libardour',
                     'libardour_cp',
                     'libtimecode',
                     'libmidipp',
                     ]
    obj.defines = [
        'VERSIONSTRING="' + str(bld.env['VERSION']) + '"',
        'UTILNAME="'   + str(pgmprefix + '-' + util) + '"',
        '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') + '"',
        'PACKAGE="'    + "ARDOURUTILS" + '"',
        ]
    obj.install_path = bld.env['LIBDIR'] + '/utils'
    obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD OGG CURL DL XML'
    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':
        obj.install_path = bld.env['BINDIR']

    if bld.is_defined('NEED_INTL'):
        obj.linkflags = ' -lintl'


def build(bld):
    VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
    # session-utils depend on the dummy backend
    if not "dummy" in bld.env['BACKENDS']:
        return
    # no wine
    if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
        return

    pgmprefix = bld.env['PROGRAM_NAME'].lower() + str(bld.env['MAJOR'])

    utils = bld.path.ant_glob('*.cc', excl=['example.cc', 'common.cc'])

    for util in utils:
        fn = str(util)[:-3]
        build_ardour_util(bld, fn)
        if bld.env['build_target'] != 'mingw':
            bld.symlink_as(bld.env['BINDIR'] + '/' + pgmprefix + "-" + fn, bld.env['LIBDIR'] + '/utils/ardour-util.sh')

    if bld.env['build_target'] == 'mingw':
        return

    obj              = bld(features = 'subst')
    obj.source       = 'ardour-util.sh.in'
    obj.target       = 'ardour-util.sh'
    obj.chmod        = Utils.O755
    obj.install_path = bld.env['LIBDIR']  + '/utils'
    obj.LIBDIR       = os.path.normpath(bld.env['DLLDIR'])
    obj.DATADIR      = os.path.normpath(bld.env['DATADIR'])
    obj.CONFDIR      = os.path.normpath(bld.env['CONFDIR'])