diff options
author | Robin Gareus <robin@gareus.org> | 2014-02-25 05:37:55 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-02-25 14:57:57 +0100 |
commit | 993ed5670175870c5b5930860e82db0efe158820 (patch) | |
tree | 1b3f6c0ceef4e98a03ef998e74e8e5ff40487c64 /libs/fst | |
parent | 1c402f943f1f1c460f099f91aed011967f883bee (diff) |
prepare standalone VST scanner tool.. part one
Diffstat (limited to 'libs/fst')
-rw-r--r-- | libs/fst/scanner.cc | 59 | ||||
-rw-r--r-- | libs/fst/scanner.wine | 2 | ||||
-rw-r--r-- | libs/fst/wscript | 75 |
3 files changed, 136 insertions, 0 deletions
diff --git a/libs/fst/scanner.cc b/libs/fst/scanner.cc new file mode 100644 index 0000000000..8225993b4e --- /dev/null +++ b/libs/fst/scanner.cc @@ -0,0 +1,59 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <vector> + +#include "ardour/filesystem_paths.h" +#include "ardour/linux_vst_support.h" +#include "ardour/vst_info_file.h" + +/* make stupid waf happy. + * waf cannot build multiple variants of .o object files from the same + * source using different wscripts.. it mingles e.g. + * build/libs/ardour/vst_info_file.cc.1.o for + * both lib/ardour/wscript and lib/fst/wscript + * + * ...but waf does track include dependencies. + */ +#include "../ardour/vst_info_file.cc" +#include "../ardour/linux_vst_support.cc" +#include "../ardour/filesystem_paths.cc" +#include "../ardour/directory_names.cc" +#include "../pbd/error.cc" +#include "../pbd/basename.cc" +#include "../pbd/search_path.cc" +#include "../pbd/transmitter.cc" +#include "../pbd/whitespace.cc" + +#ifdef LXVST_SUPPORT +void +vstfx_destroy_editor (VSTState* /*vstfx*/) { } +#endif + +int main (int argc, char **argv) { + if (argc != 2) { + fprintf(stderr, "usage: %s <vst>\n", argv[0]); + return EXIT_FAILURE; + } + + char *dllpath = argv[1]; + std::vector<VSTInfo *> *infos; +#ifdef LXVST_SUPPORT + if (strstr (dllpath, ".so" ) == 0) { + infos = vstfx_get_info_lx(dllpath); + } +#endif + +#ifdef WINDOWS_VST_SUPPORT + if (strstr (dllpath, ".dll" ) == 0) { + infos = vstfx_get_info_fst(dllpath); + } +#endif + + if (infos->empty()) { + return EXIT_FAILURE; + } else { + return EXIT_SUCCESS; + } +} + diff --git a/libs/fst/scanner.wine b/libs/fst/scanner.wine new file mode 100644 index 0000000000..1e3b5e627f --- /dev/null +++ b/libs/fst/scanner.wine @@ -0,0 +1,2 @@ +#/bin/sh +exec wine "`dirname "$0"`/ardour-@VERSION@-vst-scanner.exe.so" "$@" diff --git a/libs/fst/wscript b/libs/fst/wscript new file mode 100644 index 0000000000..4f4de4e2ff --- /dev/null +++ b/libs/fst/wscript @@ -0,0 +1,75 @@ +#!/usr/bin/env python +from waflib.extras import autowaf as autowaf +from waflib import Options, TaskGen +import waflib.Logs as Logs, waflib.Utils as Utils +import os +import shutil +import sys +import re +import time +from waflib.Task import Task + +# Mandatory variables +top = '.' +out = 'build' + +scanner_app_src = [ + 'scanner.cc', + ] + +# needed for code used from libardour +I18N_PACKAGE = 'ardour3' + +def options(opt): + autowaf.set_options(opt) + +def configure(conf): + conf.load('misc') + conf.load('compiler_cxx') + autowaf.configure(conf) + +# Add a waf `feature' to allow compilation of things using winegcc +from waflib.TaskGen import feature +@feature("wine") +def set_winegcc(self): + self.env.LINK_CXX = self.env.LINK_CC = 'wineg++' + self.env.CC = 'winegcc' + +def build(bld): + VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR']) + if not (bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT')): + return + + if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw': + # wine exec wrapper script + obj = bld(features = 'subst', rule= 'chmod 0755 ${TGT}') + obj.source = 'scanner.wine' + obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner' + obj.chmod = Utils.O755 + obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3') + obj.dict = { + 'VERSION' : bld.env['VERSION'], + } + + obj = bld (features = 'c cxx cxxprogram wine') + obj.source = ( + 'scanner.cc', + 'fst.c', + 'vstwin.c', + ) + obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner.exe.so' + obj.linkflags = ['-mwindows', '-Wl,--export-dynamic'] + else: + obj = bld (features = 'cxx c cxxprogram') + obj.source = ( 'scanner.cc' ) + obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner' + + obj.includes = [ '../pbd/', '../ardour/', '.' ] + obj.defines = [ + '_POSIX_SOURCE', + 'USE_WS_PREFIX', + 'VST_SCANNER_APP', + 'PACKAGE="' + I18N_PACKAGE + '"', + ] + obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3') + obj.uselib = ['GIOMM', 'DL'] |