diff --git a/gtk2_ardour/arluadoc b/gtk2_ardour/arluadoc new file mode 100755 index 0000000000..2983cf9103 --- /dev/null +++ b/gtk2_ardour/arluadoc @@ -0,0 +1,9 @@ +#!/bin/sh +TOP=`dirname "$0"`/.. +. $TOP/build/gtk2_ardour/ardev_common_waf.sh +export UBUNTU_MENUPROXY="" + +$TOP/build/gtk2_ardour/luadoc "$@" \ + | sed 's/__cxx11:://g;' \ + | sed 's/std::basic_string\, std::allocator >/std::string/g;' \ + | sed 's/, std::allocator<[^>]*> //g;' diff --git a/gtk2_ardour/luadoc.cc b/gtk2_ardour/luadoc.cc new file mode 100644 index 0000000000..794740eeda --- /dev/null +++ b/gtk2_ardour/luadoc.cc @@ -0,0 +1,26 @@ +#include +#include +#include + +#include "ardour/luabindings.h" +#include "luainstance.h" + +int main (int argc, char **argv) +{ + luabridge::setPrintBindings (true); + LuaState lua; + lua_State* L = lua.getState (); +#ifdef LUADOCOUT + printf ("doc = {\n"); +#else + printf ("[\n"); +#endif + LuaInstance::register_classes (L); + ARDOUR::LuaBindings::dsp (L); +#ifdef LUADOCOUT + printf ("}\n"); +#else + printf ("{} ]\n"); +#endif + return 0; +} diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 6a8347fb1d..83f8491855 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -273,6 +273,8 @@ extern "C" { int ardour_main (int argc, char *argv[]) +#elif defined NOMAIN +int nomain (int argc, char *argv[]) #else int main (int argc, char *argv[]) #endif diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 36223bd2cb..72e8120585 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -405,6 +405,44 @@ def build(bld): VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR']) I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR'] + # Tool to dump lua-bindings (of gtk2ardour + libs) + if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']: + obj = bld (features = 'cxx c cxxprogram') + obj.install_path = None + obj.source = list(gtk2_ardour_sources) + obj.target = 'luadoc' + obj.includes = ['.', '../libs'] + obj.ldflags = ['-no-undefined'] + obj.use = [ + 'libpbd', + 'libardour', + 'libardour_cp', + 'libtimecode', + 'libmidipp', + 'libgtkmm2ext', + 'libcanvas', + 'libptformat', + ] + obj.defines = [ + 'NOMAIN', + 'PACKAGE="' + I18N_PACKAGE + '"', + 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', + 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', + 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"', + ] + obj.linkflags = '' + obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL GTKMM CANVAS FFTW3F LO TAGLIB XML ' + obj.source += [ 'luadoc.cc', 'bundle_env_linux.cc' ] + if bld.is_defined('HAVE_SUIL'): + obj.source += [ 'lv2_plugin_ui.cc' ] + obj.use += [ 'SUIL' ] + if bld.is_defined('LXVST_SUPPORT'): + obj.source += [ 'vst_plugin_ui.cc' ] + obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ] + obj.defines += [ 'LXVST_SUPPORT' ] + obj.use += [ 'X11' ] + + if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw': # Windows VST support w/wine # If we require VST support we build a stub main() and the FST library diff --git a/wscript b/wscript index 077e924ea9..926e6feed6 100644 --- a/wscript +++ b/wscript @@ -682,6 +682,8 @@ def options(opt): help='Build internal libs as static libraries') opt.add_option('--use-external-libs', action='store_true', default=False, dest='use_external_libs', help='Use external/system versions of some bundled libraries') + opt.add_option('--luadoc', action='store_true', default=False, dest='luadoc', + help='Compile Tool to dump LuaBindings (needs C++11)') opt.add_option('--lv2', action='store_true', default=True, dest='lv2', help='Compile with support for LV2 (if Lilv+Suil is available)') opt.add_option('--no-lv2', action='store_false', dest='lv2', @@ -898,6 +900,10 @@ def configure(conf): print ('No Carbon support available for this build\n') + if Options.options.luadoc: + conf.env['LUABINDINGDOC'] = True + conf.define ('LUABINDINGDOC', 1) + if Options.options.internal_shared_libs: conf.define('INTERNAL_SHARED_LIBS', 1) @@ -1166,6 +1172,7 @@ const char* const ardour_config_info = "\\n\\ write_config_text('Freedesktop files', opts.freedesktop) write_config_text('Libjack linking', conf.env['libjack_link']) write_config_text('Libjack metadata', conf.is_defined ('HAVE_JACK_METADATA')) + write_config_text('Lua Binding Doc', conf.is_defined('LUABINDINGDOC')) write_config_text('LV2 UI embedding', conf.is_defined('HAVE_SUIL')) write_config_text('LV2 support', conf.is_defined('LV2_SUPPORT')) write_config_text('LV2 extensions', conf.is_defined('LV2_EXTENDED'))