add new sigc++2 directory
[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_dir     = Dir ('libs/vst')
16     vst_sdk_dir = Dir ('vstsdk2.3')
17     #
18     # if it exists, try to use the Steinberg zip package
19     #
20     vst_sdk_zip = File ('vstsdk2.3.zip')
21
22     if os.access (vst_sdk_zip.abspath, os.F_OK):
23         print 'VST package discovered.'
24     elif os.access ('vst_sdk2_3.zip', os.F_OK):
25         #
26         # add a build target that unpacks the zip package the Steinberg "meta" zip package
27         #
28         vst_meta_zip = fst.Command (vst_sdk_zip, 'vst_sdk2_3.zip',  "unzip -o -d ${TARGET.dir} $SOURCES vstsdk2.3.zip" )
29         print 'VST meta-package discovered.'
30     else:
31         if os.access ('vstsdk2.3.zip', os.F_OK) != 1:
32             print 'Did not find vst_sdk2_3.zip or vstsdk2.3.zip in libs/fst.'
33             print 'Make sure the correct file is in the correct location and correctly named.'
34             print 'Please see http://ardour.org/building_vst_support for more information.'
35             sys.exit (1)    
36
37     vst_headers = fst.Command ([ 'vst/aeffectx.h', 'vst/AEffect.h' ], vst_sdk_zip, [
38         "unzip -qq -d ${SOURCE.dir} -o $SOURCE",
39         Delete ('$TARGET.dir'),
40         Copy ('${TARGET.dir}', 'libs/fst/vstsdk2.3/source/common'),
41         "sed -i '/struct VstFileType\|struct VstFileSelect/,/};/d' $TARGET"
42         ])
43
44     a = fst.Object ('fst', 'fst.c')
45     b = fst.Object ('fstinfofile', 'fstinfofile.c')
46     c = fst.Object ('vstwin', 'vstwin.c')
47     d = fst.Object ('vsti', 'vsti.c')
48
49     Default([vst_headers,a,b,c,d])
50     
51 env.Alias('tarball', env.Distribute (env['DISTTREE'],
52                                      fst_src + ['SConscript',
53                                                 'fst.h',
54                                                 'jackvst.h'
55                                                 ] ))
56