2014-02-24 23:37:55 -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'
|
|
|
|
|
|
|
|
scanner_app_src = [
|
|
|
|
'scanner.cc',
|
|
|
|
]
|
|
|
|
|
|
|
|
# needed for code used from libardour
|
2015-01-08 10:57:46 -05:00
|
|
|
I18N_PACKAGE = 'ardour'
|
2014-02-24 23:37:55 -05:00
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
autowaf.set_options(opt)
|
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
conf.load('misc')
|
|
|
|
conf.load('compiler_cxx')
|
|
|
|
autowaf.configure(conf)
|
2014-03-04 12:53:43 -05:00
|
|
|
if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
|
2014-03-04 09:25:58 -05:00
|
|
|
conf.check(compiler='cxx',
|
|
|
|
lib='gdi32',
|
|
|
|
mandatory=True,
|
|
|
|
uselib_store='GDI32')
|
2014-02-24 23:37:55 -05:00
|
|
|
|
|
|
|
# Add a waf `feature' to allow compilation of things using winegcc
|
|
|
|
from waflib.TaskGen import feature
|
|
|
|
@feature("wine")
|
|
|
|
def set_winegcc(self):
|
|
|
|
self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
|
|
|
|
self.env.CC = 'winegcc'
|
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
|
|
|
|
if not (bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT')):
|
|
|
|
return
|
|
|
|
|
|
|
|
if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
|
|
|
|
# wine exec wrapper script
|
2014-12-28 04:20:25 -05:00
|
|
|
obj = bld(features = 'subst')
|
2014-02-24 23:37:55 -05:00
|
|
|
obj.source = 'scanner.wine'
|
2014-02-25 03:43:40 -05:00
|
|
|
obj.target = 'ardour-vst-scanner'
|
2014-02-24 23:37:55 -05:00
|
|
|
obj.chmod = Utils.O755
|
2014-11-13 13:57:40 -05:00
|
|
|
obj.install_path = os.path.join(bld.env['LIBDIR'])
|
2014-02-24 23:37:55 -05:00
|
|
|
obj.dict = {
|
|
|
|
'VERSION' : bld.env['VERSION'],
|
|
|
|
}
|
|
|
|
|
|
|
|
obj = bld (features = 'c cxx cxxprogram wine')
|
|
|
|
obj.source = (
|
|
|
|
'scanner.cc',
|
|
|
|
'vstwin.c',
|
|
|
|
)
|
|
|
|
obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
|
2014-12-28 09:18:39 -05:00
|
|
|
obj.linkflags += bld.env['LDFLAGS']
|
2014-02-25 03:43:40 -05:00
|
|
|
obj.target = 'ardour-vst-scanner.exe.so'
|
2014-03-04 09:25:58 -05:00
|
|
|
obj.uselib = ['GIOMM', 'DL']
|
2014-03-10 17:28:18 -04:00
|
|
|
obj.use = [ 'libpbd' ]
|
2015-12-17 14:22:02 -05:00
|
|
|
obj.cxxflags = [ '-fPIC' ]
|
2014-02-24 23:37:55 -05:00
|
|
|
else:
|
|
|
|
obj = bld (features = 'cxx c cxxprogram')
|
2015-01-17 12:19:25 -05:00
|
|
|
obj.source = ( 'scanner.cc' )
|
|
|
|
obj.target = 'ardour-vst-scanner'
|
2014-03-04 09:25:58 -05:00
|
|
|
if bld.is_defined('WINDOWS_VST_SUPPORT'):
|
2015-01-17 12:19:25 -05:00
|
|
|
bld (features = 'c', name='vstwin', source='vstwin.c', uselib = 'GIOMM', includes = [ '../pbd/', '../ardour/', '.' ])
|
2014-03-04 09:25:58 -05:00
|
|
|
obj.uselib = ['GIOMM', 'DL', 'GDI32']
|
2015-02-13 22:18:56 -05:00
|
|
|
obj.linkflags = ['-mwindows']
|
2015-01-17 12:19:25 -05:00
|
|
|
obj.use = [ 'libpbd', 'vstwin' ]
|
2014-03-04 09:25:58 -05:00
|
|
|
else:
|
|
|
|
obj.uselib = ['GIOMM', 'DL']
|
2015-01-17 12:19:25 -05:00
|
|
|
obj.use = [ 'libpbd' ]
|
2014-02-24 23:37:55 -05:00
|
|
|
|
|
|
|
obj.includes = [ '../pbd/', '../ardour/', '.' ]
|
|
|
|
obj.defines = [
|
|
|
|
'_POSIX_SOURCE',
|
|
|
|
'USE_WS_PREFIX',
|
|
|
|
'VST_SCANNER_APP',
|
2015-01-08 10:57:46 -05:00
|
|
|
'PACKAGE="' + I18N_PACKAGE + str(bld.env['MAJOR']) + '"',
|
2015-01-05 13:07:24 -05:00
|
|
|
'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"',
|
2014-02-24 23:37:55 -05:00
|
|
|
]
|
2016-09-05 14:14:29 -04:00
|
|
|
if re.search ("freebsd", sys.platform) != None:
|
|
|
|
obj.defines.append('_POSIX_C_SOURCE=200809')
|
|
|
|
obj.defines.append('_XOPEN_SOURCE=700')
|
|
|
|
|
2014-11-13 13:57:40 -05:00
|
|
|
obj.install_path = os.path.join(bld.env['LIBDIR'])
|