Skip to content

Commit

Permalink
Added infrastructure for Ruby plugin loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk committed Dec 2, 2020
1 parent 0e32706 commit 221bd8b
Show file tree
Hide file tree
Showing 9 changed files with 1,060 additions and 79 deletions.
23 changes: 23 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,12 @@ AC_ARG_ENABLE([man-pages],
AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS], [test "x$enable_python_bindings" = xyes])
AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS_DOC], [test "x$enable_python_bindings_doc" = xyes])
AM_CONDITIONAL([ENABLE_PYTHON_PLUGINS], [test "x$enable_python_plugins" = xyes])
AM_CONDITIONAL([ENABLE_RUBY_PLUGINS], [test "x$enable_ruby_plugins" = xyes])
AM_CONDITIONAL([ENABLE_DEBUG_INFO], [test "x$enable_debug_info" = xyes])
AM_CONDITIONAL([ENABLE_API_DOC], [test "x$enable_api_doc" = xyes])
AM_CONDITIONAL([ENABLE_BUILT_IN_PLUGINS], [test "x$enable_built_in_plugins" = xyes])
AM_CONDITIONAL([ENABLE_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [test "x$enable_built_in_python_plugin_support" = xyes])
AM_CONDITIONAL([ENABLE_BUILT_IN_RUBY_PLUGIN_SUPPORT], [test "x$enable_built_in_ruby_plugin_support" = xyes])
AM_CONDITIONAL([ENABLE_MAN_PAGES], [test "x$enable_man_pages" = xyes])
AM_CONDITIONAL([ENABLE_PYTHON_COMMON_DEPS], [test "x$enable_python_bindings" = xyes || test "x$enable_python_plugins" = xyes])

Expand All @@ -437,6 +439,10 @@ AS_IF([test "x$enable_python_plugins" = xyes],
[AC_DEFINE([PYTHON_PLUGINS], [1], [Python plugin support.])]
)

AS_IF([test "x$enable_ruby_plugins" = xyes],
[AC_DEFINE([RUBY_PLUGINS], [1], [Ruby plugin support.])]
)

AS_IF([test "x$enable_debug_info" = xyes],
[AC_DEFINE([ENABLE_DEBUG_INFO], [1], [Define to 1 if you enable the 'debug info' feature])]
)
Expand All @@ -449,6 +455,10 @@ AS_IF([test "x$enable_built_in_python_plugin_support" = xyes],
[AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])]
)

AS_IF([test "x$enable_built_in_ruby_plugin_support" = xyes],
[AC_DEFINE([BT_BUILT_IN_RUBY_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])]
)

AS_IF([test "x$enable_debug_info" = xyes],
[ENABLE_DEBUG_INFO_VAL=1],
[ENABLE_DEBUG_INFO_VAL=0]
Expand Down Expand Up @@ -502,6 +512,10 @@ AS_IF([test "x$enable_built_in_python_plugin_support" = xyes],

# Check for optionnal features dependencies

AS_IF([test "x$enable_ruby_plugins" = xyes],
[PKG_CHECK_MODULES([RUBY], [ruby >= 2.5], [], [AC_MSG_ERROR([Ruby 2.5.0 or newer is required to build the ruby plugin support])])]
)

AS_IF([test "x$enable_python_bindings" = xyes],
[AX_PKG_SWIG(2.0.0, [], [AC_MSG_ERROR([SWIG 2.0.0 or newer is required to build the python bindings])])]
)
Expand Down Expand Up @@ -808,6 +822,7 @@ AC_CONFIG_FILES([
src/plugins/utils/trimmer/Makefile
src/py-common/Makefile
src/python-plugin-provider/Makefile
src/ruby-plugin-provider/Makefile
src/param-parse/Makefile
src/string-format/Makefile
tests/bitfield/Makefile
Expand Down Expand Up @@ -897,6 +912,12 @@ AS_IF([test "x$enable_python_bindings" = "xyes"], [
PPRINT_PROP_STRING([SWIG executable], [$SWIG])
PPRINT_PROP_STRING([SWIG library], [$SWIG_LIB])
])
test "x$enable_ruby_plugins" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Ruby plugin support], $value)
AS_IF([test "x$enable_ruby_plugins" = "xyes"], [
PPRINT_PROP_STRING([Ruby include paths], [$RUBY_CFLAGS])
PPRINT_PROP_STRING([Ruby linker flags], [$RUBY_LIBS])
])

AS_ECHO
PPRINT_SUBTITLE([Plugins])
Expand All @@ -912,6 +933,8 @@ test "x$enable_built_in_plugins" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Built-in plugins], $value)
test "x$enable_built_in_python_plugin_support" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Built-in Python plugin support], $value)
test "x$enable_built_in_ruby_plugin_support" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Built-in Ruby plugin support], $value)

AS_ECHO
PPRINT_SUBTITLE([Documentation])
Expand Down
3 changes: 3 additions & 0 deletions doc/man/babeltrace2.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ You can override the log level of the CLI with the
You can override the log level of the Babeltrace~2 Python bindings
with the `BABELTRACE_PYTHON_BT2_LOG_LEVEL` environment variable.
+
You can override the log level of the Babeltrace~2 Ruby bindings
with the `BABELTRACE_RUBY_BT2_LOG_LEVEL` environment variable.
+
The available values for 'LVL' are:
+
--
Expand Down
19 changes: 19 additions & 0 deletions doc/man/common-lib-env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ include::common-common-env.txt[]
`LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS`=`1`::
Disable the loading of any Babeltrace~2 Python plugin.

`LIBBABELTRACE2_DISABLE_RUBY_PLUGINS`=`1`::
Disable the loading of any Babeltrace~2 Ruby plugin.

`LIBBABELTRACE2_INIT_LOG_LEVEL`='LVL'::
Force the Babeltrace~2 library's initial log level to be 'LVL'.
+
Expand Down Expand Up @@ -50,3 +53,19 @@ The available values for 'LVL' are:
--
include::common-log-levels.txt[]
--


=== Babeltrace~2 Ruby bindings

`BABELTRACE_RUBY_BT2_LOG_LEVEL`='LVL'::
Force the Babeltrace~2 Ruby bindings log level to be 'LVL'.
+
If this environment variable is set, it overrides the log level set by
the manopt:babeltrace2(1):--log-level option for the Ruby bindings
logger.
+
The available values for 'LVL' are:
+
--
include::common-log-levels.txt[]
--
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SUBDIRS = \
lib \
string-format \
python-plugin-provider \
ruby-plugin-provider \
plugins \
param-parse \
cli \
Expand Down
Loading

0 comments on commit 221bd8b

Please sign in to comment.