Make internal clearlooks work for VST enabled Ardour
[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.Copy()
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-ardour'],
39     libraries['flac'],
40     libraries['lrdf'],
41     libraries['glibmm2'],
42     libraries['pangomm'],
43     libraries['atkmm'],
44     libraries['gdkmm2'],
45     libraries['sigc2'],
46     libraries['gtk2'],
47     libraries['xml'],
48     libraries['xslt'],
49     libraries['soundtouch'],
50     libraries['samplerate'],
51     libraries['jack']
52 ])
53
54 #
55 # run winegcc to build a mini-win32 executable that wine can run. note: this also
56 # generates a script called 'ardour_vst' which we don't use
57 #
58
59 wine_generated_executable = ardour_vst.Program (target = 'ardour_vst', source = sources)
60
61 #
62 # generate a shell script that will run the .exe file correctly
63
64
65 wine_executable = ardour_vst.SubstInFile ('ardourvst', 'ardourvst.in', SUBST_DICT = subst_dict)
66
67 # make sure the scripts are executable
68
69 if ardour_vst['VST']:
70     ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod ('vst/ardevst', 0755)))
71     ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod (wine_executable, 0755)))
72     Default([wine_generated_executable, wine_executable])
73     
74     # the wine script - into the bin dir
75     env.Alias('install', env.Install(os.path.join(install_prefix, 'bin'), wine_executable))
76     # the win32 executable - into the lib dir since the wine script will look for it there
77     env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), 'ardour_vst.exe.so'))
78
79 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
80                                       [ 'SConscript',
81                                         'winmain.c',
82                                         'ardourvst.in',
83                                         'ardevst'
84                                         ]))
85