Better error message for missing vst files
[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 a = fst.Object ('fst', 'fst.c')
15 b = fst.Object ('fstinfofile', 'fstinfofile.c')
16 c = fst.Object ('vstwin', 'vstwin.c')
17 d = fst.Object ('vsti', 'vsti.c')
18
19 if fst['VST']:
20     if os.access ('vst_sdk2_3.zip', os.F_OK):
21         fst.Execute ("unzip -o vst_sdk2_3.zip vstsdk2.3.zip")
22     if os.access ('vstsdk2.3.zip', os.F_OK):
23         fst.Execute ("unzip -o vstsdk2.3.zip")
24     else:
25         print 'Did not find vst_sdk2_3.zip or vstsdk2.3.zip in libs/fst.  Make sure the correct file is in the correct location and correctly named'
26         print 'Please see http://ardour.org/building_vst_support for more information'
27         sys.exit (1)    
28     fst.Execute (Delete ("vst"))
29     fst.Execute (Copy ("vst", "vstsdk2.3/source/common"))
30     fst.Execute ("sed -i '/struct VstFileType\|struct VstFileSelect/,/};/d' vst/aeffectx.h")
31     Default([a,b,c,d])
32     
33     
34 env.Alias('tarball', env.Distribute (env['DISTTREE'],
35                                      fst_src + ['SConscript',
36                                                 'fst.h',
37                                                 'jackvst.h'
38                                                 ] ))
39