try that one on for size (VST build fu)
[ardour.git] / libs / fst / SConscript
1 # -*- python -*-
2
3 import os
4 import os.path
5 import sys
6 import glob
7
8 fst_src = glob.glob('*.c')
9
10 Import('env install_prefix')
11 fst = env.Copy(CC="winegcc")
12 fst.Append (CPPPATH=".")
13
14 if fst['VST']:
15     vst_sdk = File ('vstsdk2.3.zip')
16     vst_dir = Dir ('libs/vst')
17     vst_sdk_dir = Dir ('vstsdk2.3')
18
19     if os.access ('vst_sdk2_3.zip', os.F_OK):
20         vst_sdk_zip = fst.Command (vst_sdk, 'vst_sdk2_3.zip',  "unzip -o -d ${TARGET.dir} $SOURCES vstsdk2.3.zip" )
21     else:
22         if os.access ('vstsdk2.3.zip', os.F_OK) != 1:
23             print 'Did not find vst_sdk2_3.zip or vstsdk2.3.zip in libs/fst.'
24             print 'Make sure the correct file is in the correct location and correctly named.'
25             print 'Please see http://ardour.org/building_vst_support for more information.'
26             sys.exit (1)    
27
28     vst_headers = fst.Command ([ 'vst/aeffectx.h', 'vst/AEffect.h' ], vst_sdk_zip, [
29         "unzip -qq -d ${SOURCE.dir} -o $SOURCE",
30         Delete ('$TARGET.dir'),
31         Copy ('${TARGET.dir}', 'libs/fst/vstsdk2.3/source/common'),
32         "sed -i '/struct VstFileType\|struct VstFileSelect/,/};/d' $TARGET"
33         ])
34
35     a = fst.Object ('fst', 'fst.c')
36     b = fst.Object ('fstinfofile', 'fstinfofile.c')
37     c = fst.Object ('vstwin', 'vstwin.c')
38     d = fst.Object ('vsti', 'vsti.c')
39
40     Default([vst_headers,a,b,c,d])
41     
42 env.Alias('tarball', env.Distribute (env['DISTTREE'],
43                                      fst_src + ['SConscript',
44                                                 'fst.h',
45                                                 'jackvst.h'
46                                                 ] ))
47