summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-06-21 19:49:15 +0530
committerTim-Philipp Müller <tim@centricular.com>2016-06-23 23:39:45 +0100
commit48088867db20094c8aafc7f50ce1bc0d8c633df5 (patch)
tree2ff6d2cff89e13e1d3caeaa0aa24284f0ea99087 /configure.ac
parent084bb505f4e045ffba3701615e2a073f9d8a5d57 (diff)
win32: Don't use dllexport/import when only building statically
If the prototypes in the public API have dllimport in them when building statically on Windows, the compiler will look for symbols with symbol mangling and indirection corresponding to a DLL. This will cause a build failure when trying to link tests/examples/etc. External users of GStreamer also need to define -DGST_STATIC_COMPILATION if they want to link to static gstreamer libraries on Windows. A similar version of this patch has been committed to all gstreamer repositories. https://bugzilla.gnome.org/show_bug.cgi?id=767463
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 8 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index d40d33aa8..6aa06e326 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,6 +188,12 @@ fi
AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
+dnl If only building static libraries, define GST_STATIC_COMPILATION. This is
+dnl needed only on Windows, but it doesn't hurt to have it everywhere.
+if test x$enable_static = xyes -a x$enable_shared = xno; then
+ GST_OBJ_STATIC_CFLAGS="-DGST_STATIC_COMPILATION"
+fi
+
dnl building of tests
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--disable-tests],[disable building test apps]),
@@ -950,8 +956,8 @@ AC_SUBST(GST_LIB_LDFLAGS)
dnl GST_OBJ_*
dnl default vars for all internal objects built on libgstreamer
dnl includes GST_ALL_*
-GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
-GST_OBJ_CXXFLAGS="\$(GST_ALL_CXXFLAGS)"
+GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS) $GST_OBJ_STATIC_CFLAGS"
+GST_OBJ_CXXFLAGS="\$(GST_ALL_CXXFLAGS) $GST_OBJ_STATIC_CFLAGS"
GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_API_VERSION.la \$(GST_ALL_LIBS)"
AC_SUBST(GST_OBJ_CFLAGS)
AC_SUBST(GST_OBJ_CXXFLAGS)