diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-10-24 11:58:35 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-04-15 15:52:18 +0200 |
commit | 18a7a1d06295fe602672a5ce143c88260ea93930 (patch) | |
tree | 82dd83e3c81e9ec09a5bcd2c7e2818acf46fc603 /configure.ac | |
parent | 142a55042f556367b50d4ca1aca8c3b633db0343 (diff) |
gst: Add better support for static plugins
API: GST_PLUGIN_STATIC_DECLARE()
API: GST_PLUGIN_STATIC_REGISTER()
Based on a patch by Håvard Graff <havard.graff@tandberg.com>.
This now allows GST_PLUGIN_DEFINE() to create a static plugin if
GST_PLUGIN_BUILD_STATIC is defined. The resulting plugin can be
statically linked or dynamically linked during compilation but
can't be dynamically loaded during runtime.
Also adds GST_PLUGIN_STATIC_DECLARE() and GST_PLUGIN_STATIC_REGISTER(),
which allows to register a static linked plugin easily.
It is still required to manually register every single statically linked
plugin from inside the application as this can't be automated in a portable
way.
A new configure parameter --enable-static-plugins was added that allows
to build all plugins we build here as static plugins.
Fixes bug #667305.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 8a6ad13d3..170d6a60e 100644 --- a/configure.ac +++ b/configure.ac @@ -134,6 +134,28 @@ AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], ["${srcdir}/gstreamer.doap"], [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) +dnl build static plugins or not +AC_MSG_CHECKING([whether to build static plugins or not]) +AC_ARG_ENABLE( + static-plugins, + AC_HELP_STRING( + [--enable-static-plugins], + [build static plugins @<:@default=no@:>@]), + [AS_CASE( + [$enableval], [no], [], [yes], [], + [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])], + [enable_static_plugins=no]) +AC_MSG_RESULT([$enable_static_plugins]) +if test "x$enable_static_plugins" = xyes; then + AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1, + [Define if static plugins should be built]) + GST_PLUGIN_LIBTOOLFLAGS="" +else + GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static" +fi +AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS) +AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes") + dnl building of tests AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[disable building test apps]), @@ -727,7 +749,7 @@ AC_SUBST(GST_OBJ_LIBS) dnl GST_PLUGIN_LDFLAGS dnl LDFLAGS for plugins; includes GST_ALL_LDFLAGS -GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc.*' $GST_ALL_LDFLAGS" +GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS" AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS") dnl plugin scanner locations @@ -874,6 +896,7 @@ Configuration Allocation tracing : ${enable_alloc_trace} Plugin registry : ${enable_registry} Plugin support : ${enable_plugin} + Static plugins : ${enable_static_plugins} Unit testing support : ${BUILD_CHECK} Debug : ${USE_DEBUG} |