X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=vst%2FSConscript;h=d0f1ff7487d657171142a6a21745b23801d84d4d;hb=ff26317d4f7904c071d7ecfb96fd84e71728f6d0;hp=02ae15eb0c9646b2565b5a70628e867e5f08dabd;hpb=aebd64bb6abb52cf0feb15a654c9f6a14f29698d;p=ardour.git diff --git a/vst/SConscript b/vst/SConscript index 02ae15eb0c..d0f1ff7487 100644 --- a/vst/SConscript +++ b/vst/SConscript @@ -4,9 +4,11 @@ import os import os.path import glob -Import('env install_prefix final_prefix config_prefix libraries') +from stat import * -ardour_vst = env.Copy() +Import('env install_prefix final_prefix config_prefix subst_dict libraries') + +ardour_vst = env.Clone() sources = Split (""" winmain.c @@ -17,8 +19,8 @@ winmain.c """ ) -ardour_vst.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst", LIBPATH='#gtk2_ardour') -ardour_vst.Append (LINKFLAGS='-L/usr/X11R6/lib -lasound -lardourgtk -lX11 -lpthread') +ardour_vst.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst", LIBPATH='#gtk2_ardour', LIBS="ardourgtk") +ardour_vst.Append (LINKFLAGS='-L/usr/X11R6/lib -lasound -lX11 -lpthread') ardour_vst["CC"] ="winegcc" ardour_vst["LINK"] ="wineg++ -mwindows" @@ -34,7 +36,6 @@ ardour_vst.Merge ([ libraries['libgnomecanvasmm'], libraries['sysmidi'], libraries['sndfile'], - libraries['flac'], libraries['lrdf'], libraries['glibmm2'], libraries['pangomm'], @@ -49,6 +50,35 @@ ardour_vst.Merge ([ libraries['jack'] ]) -wine_executable = ardour_vst.Program (target = 'ardour_vst', source = sources) +# +# run winegcc to build a mini-win32 executable that wine can run. note: this also +# generates a script called 'ardour_vst' which we don't use +# + +wine_generated_executable = ardour_vst.Program (target = 'ardour_vst', source = sources) + +# +# generate a shell script that will run the .exe file correctly +# + +wine_executable = ardour_vst.SubstInFile ('ardourvst', 'ardourvst.in', SUBST_DICT = subst_dict) + +# make sure the scripts are executable + +if ardour_vst['VST']: + ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod ('vst/ardevst', 0755))) + ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod ("vst/" + str(wine_executable[0]), 0755))) + Default([wine_generated_executable, wine_executable]) + + # the wine script - into the bin dir + env.Alias('install', env.Install(os.path.join(install_prefix, 'bin'), wine_executable)) + # the win32 executable - into the lib dir since the wine script will look for it there + env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), 'ardour_vst.exe.so')) + +env.Alias ('tarball', env.Distribute (env['DISTTREE'], + [ 'SConscript', + 'winmain.c', + 'ardourvst.in', + 'ardevst' + ])) -Default(wine_executable)