["${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]),
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
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}
#define __GST_PACKAGE_RELEASE_DATETIME NULL
#endif
+/**
+ * GST_PLUGIN_STATIC_DECLARE:
+ * @name: short, but unique name of the plugin
+ *
+ * This macro can be used to initialize statically linked plugins. It is
+ * necessary to call this macro before the plugin can be used.
+ * It has to be used in combination with GST_PLUGIN_STATIC_REGISTER
+ * and must be placed outside any block to declare the plugin initialization
+ * function.
+ *
+ * Since: 1.2.0
+ */
+#define GST_PLUGIN_STATIC_DECLARE(name) \
+ extern void G_PASTE(gst_plugin_, G_PASTE(name, _register)) (void)
+
+/**
+ * GST_PLUGIN_STATIC_REGISTER:
+ * @name: short, but unique name of the plugin
+ *
+ * This macro can be used to initialize statically linked plugins. It is
+ * necessary to call this macro before the plugin can be used.
+ * It has to be used in combination with GST_PLUGIN_STATIC_DECLARE and
+ * calls the plugin initialization function.
+ *
+ * Since: 1.2.0
+ */
+#define GST_PLUGIN_STATIC_REGISTER(name) G_PASTE(gst_plugin_, G_PASTE(name, _register)) ()
+
/**
* GST_PLUGIN_DEFINE:
* @major: major version number of the gstreamer-core that plugin was compiled for
* If defined, the GST_PACKAGE_RELEASE_DATETIME will also be used for the
* #GstPluginDesc,release_datetime field.
*/
+#ifdef GST_PLUGIN_BUILD_STATIC
+#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin) \
+G_BEGIN_DECLS \
+GST_PLUGIN_EXPORT void G_PASTE(gst_plugin_, G_PASTE(name, _register)) (void); \
+ \
+void \
+G_PASTE(gst_plugin_, G_PASTE(name, _register)) (void) \
+{ \
+ gst_plugin_register_static (major, minor, G_STRINGIFY(name), \
+ description, init, version, license, \
+ PACKAGE, package, origin); \
+} \
+G_END_DECLS
+#else /* !GST_PLUGIN_BUILD_STATIC */
#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin) \
G_BEGIN_DECLS \
GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = { \
GST_PADDING_INIT \
}; \
G_END_DECLS
+#endif /* GST_PLUGIN_BUILD_STATIC */
/**
* GST_LICENSE_UNKNOWN: