tweaks to get a VST-supporting 3.0 to build & startup
[ardour.git] / vst / SConscript
1 # -*- python -*-
2
3 import os
4 import os.path
5 import glob
6
7 from stat import *
8
9 Import('env install_prefix final_prefix config_prefix subst_dict libraries')
10
11 ardour_vst = env.Clone()
12
13 sources = Split ("""
14 winmain.c
15 #libs/fst/fst.o
16 #libs/fst/fstinfofile.o
17 #libs/fst/vstwin.o
18 #libs/fst/vsti.o
19 """
20 )
21
22 ardour_vst.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst", LIBPATH='#gtk2_ardour', LIBS="ardourgtk")
23 ardour_vst.Append (LINKFLAGS='-L/usr/X11R6/lib -lasound -lX11 -lpthread') 
24 ardour_vst["CC"] ="winegcc"
25 ardour_vst["LINK"] ="wineg++ -mwindows"
26
27 ardour_vst.Merge ([
28     libraries['ardour'],
29     libraries['ardour_cp'],
30     libraries['gtkmm2ext'],
31     libraries['midi++2'],
32     libraries['pbd'],
33     libraries['gtkmm2'],
34     libraries['glib2'],
35     libraries['libgnomecanvas2'],
36     libraries['libgnomecanvasmm'],
37     libraries['sysmidi'],
38     libraries['sndfile'],
39     libraries['lrdf'],
40     libraries['glibmm2'],
41     libraries['pangomm'],
42     libraries['atkmm'],
43     libraries['gdkmm2'],
44     libraries['sigc2'],
45     libraries['gtk2'],
46     libraries['xml'],
47     libraries['xslt'],
48     libraries['soundtouch'],
49     libraries['samplerate'],
50     libraries['jack']
51 ])
52
53 #
54 # run winegcc to build a mini-win32 executable that wine can run. note: this also
55 # generates a script called 'ardour_vst' which we don't use
56 #
57
58 wine_generated_executable = ardour_vst.Program (target = 'ardour_vst', source = sources)
59
60 #
61 # generate a shell script that will run the .exe file correctly
62
63
64 wine_executable = ardour_vst.SubstInFile ('ardourvst', 'ardourvst.in', SUBST_DICT = subst_dict)
65
66 # make sure the scripts are executable
67
68 if ardour_vst['VST']:
69     ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod ('vst/ardevst', 0755)))
70     ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod ("vst/" + str(wine_executable[0]), 0755)))
71     Default([wine_generated_executable, wine_executable])
72     
73     # the wine script - into the bin dir
74     env.Alias('install', env.Install(os.path.join(install_prefix, 'bin'), wine_executable))
75     # the win32 executable - into the lib dir since the wine script will look for it there
76     env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), 'ardour_vst.exe.so'))
77
78 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
79                                       [ 'SConscript',
80                                         'winmain.c',
81                                         'ardourvst.in',
82                                         'ardevst'
83                                         ]))
84