[gstreamermm] Allow the build to succeed for MinGW32.



commit 79bc3c0b8540b2adf68fcd2758e53f956e532b8c
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Sun Feb 19 18:03:22 2012 -0500

    Allow the build to succeed for MinGW32.
    
    	* configure.ac: Add logic to define the GSTREAMERMM_STATIC_LIB macro
    	if the --enable-static option is passed to configure.
    	* gstreamer/gstreamermmconfig.h.in: Add logic to decide how to build
    	certain constants in Windows.
    	* gstreamer/src/clock.ccg:
    	* gstreamer/src/clock.hg: Correct the declaration and definition of
    	the ClockTime constants so that it uses the above logic (namely the
    	GSTREAMERMM_API macro) to decide how these constants should be linked
    	when building in Windows.  Also correct the use of 'static' in the
    	declaration.
    	* gstreamer/gstreamermm/wrap.h: Use the new GSTREAMERMM_API macro here
    	also.
    
    	Bug #669045 (Joao Paulo Pizani Flor).

 ChangeLog                        |   21 ++++++++++++++++++++-
 configure.ac                     |    6 ++++++
 gstreamer/gstreamermm/wrap.h     |    5 +++--
 gstreamer/gstreamermmconfig.h.in |   27 +++++++++++++++++++++++++++
 gstreamer/src/clock.ccg          |    7 +++++++
 gstreamer/src/clock.hg           |   11 ++++++-----
 6 files changed, 69 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f6ff427..81f7557 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2012-02-19  Josà Alburquerque  <jaalburquerque gmail com>
+
+	Allow the build to succeed for MinGW32.
+
+	* configure.ac: Add logic to define the GSTREAMERMM_STATIC_LIB macro
+	if the --enable-static option is passed to configure.
+	* gstreamer/gstreamermmconfig.h.in: Add logic to decide how to build
+	certain constants in Windows.
+	* gstreamer/src/clock.ccg:
+	* gstreamer/src/clock.hg: Correct the declaration and definition of
+	the ClockTime constants so that it uses the above logic (namely the
+	GSTREAMERMM_API macro) to decide how these constants should be linked
+	when building in Windows.  Also correct the use of 'static' in the
+	declaration.
+	* gstreamer/gstreamermm/wrap.h: Use the new GSTREAMERMM_API macro here
+	also.
+
+	Bug #669045 (Joao Paulo Pizani Flor).
+
 2012-01-31  Josà Alburquerque  <jaalburquerque gmail com>
 
 	Regenerate signals and properties.
@@ -6,7 +25,7 @@
 	of plugins.
 	* gstreamer/src/gst_signals.defs.patch: Update the patch file to
 	include a fix for the "discovered" signal of GstDiscoverer.
-
+S
 2012-01-16  Josà Alburquerque  <jaalburquerque gmail com>
 
 	Fix the build with the latest GStreamer sources and glibmm.
diff --git a/configure.ac b/configure.ac
index 0beea20..2d8ccb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,12 @@ AC_PROG_LIBTOOL
 AC_CHECK_PROGS([M4], [gm4 m4], [m4])
 AC_PROG_SED
 
+# TODO: This makes no sense. --danielk
+AS_IF([test "x$enable_static" = xyes],
+[
+  AC_DEFINE([GSTREAMERMM_STATIC_LIB], [1], [Define if gstreamermm is built as a static library])
+])
+
 # The format below is used so that the requirements appear nicely in the .pc
 # file.
 AC_SUBST([GSTREAMERMM_MODULES],
diff --git a/gstreamer/gstreamermm/wrap.h b/gstreamer/gstreamermm/wrap.h
index d682e74..cf0456d 100644
--- a/gstreamer/gstreamermm/wrap.h
+++ b/gstreamer/gstreamermm/wrap.h
@@ -24,6 +24,7 @@
 
 #include <gst/gstminiobject.h>
 #include <glibmm/refptr.h>
+#include <gstreamermmconfig.h>
 
 namespace Gst
 {
@@ -156,8 +157,8 @@ const typename T::BaseObjectType* unwrap_copy(const Glib::RefPtr<const T>& ptr)
   return (ptr) ? ptr->gobj_copy() : 0;
 }
 
-extern GLIBMM_API GQuark quark_;
-extern GLIBMM_API GQuark quark_cpp_wrapper_deleted_;
+extern GSTREAMERMM_API GQuark quark_;
+extern GSTREAMERMM_API GQuark quark_cpp_wrapper_deleted_;
 
 } // namespace Gst
 
diff --git a/gstreamer/gstreamermmconfig.h.in b/gstreamer/gstreamermmconfig.h.in
index 9fbb2ca..c3b4db2 100644
--- a/gstreamer/gstreamermmconfig.h.in
+++ b/gstreamer/gstreamermmconfig.h.in
@@ -5,8 +5,35 @@
 
 #include "glibmmconfig.h"
 
+/* Major version of gstreamermm */
 #undef GSTREAMERMM_MAJOR_VERSION
+
+/* Minor version of gstreamermm */
 #undef GSTREAMERMM_MINOR_VERSION
+
+/* Micro version of gstreamermm */
 #undef GSTREAMERMM_MICRO_VERSION
 
+/* Define when building gstreamermm as a static library. */
+#undef GSTREAMERMM_STATIC_LIB
+
+/* Enable DLL-specific stuff only when not building a static library. */
+#if (!defined(GSTREAMERMM_STATIC_LIB) && !defined(__CYGWIN__) && defined(_WIN32))
+# define GSTREAMERMM_DLL 1
+#endif
+
+#ifdef GSTREAMERMM_DLL
+# if defined(GSTREAMERMM_BUILD) && defined(_WINDLL)
+   /* Do not dllexport as it is handled by gendef on MSVC. */
+#  define GSTREAMERMM_API
+# elif !defined(GSTREAMERMM_BUILD)
+#  define GSTREAMERMM_API __declspec(dllimport)
+# else
+   /* Build a static library. */
+#  define GSTREAMERMM_API
+# endif /* GSTREAMERMM_BUILD - _WINDLL */
+#else
+# define GSTREAMERMM_API
+#endif /* GSTREAMERMM_DLL */
+
 #endif /* _GSTREAMERMM_CONFIG_H */
diff --git a/gstreamer/src/clock.ccg b/gstreamer/src/clock.ccg
index 27cbaf5..d026706 100644
--- a/gstreamer/src/clock.ccg
+++ b/gstreamer/src/clock.ccg
@@ -56,6 +56,13 @@ static gboolean ClockID_Clock_gstreamermm_callback(GstClock* clock, GstClockTime
 namespace Gst
 {
 
+const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
+const ClockTime SECOND = GST_SECOND;
+const ClockTime MILLI_SECOND = GST_MSECOND;
+const ClockTime MICRO_SECOND = GST_USECOND;
+const ClockTime NANO_SECOND = GST_NSECOND;
+
+
 guint get_hours(ClockTime time)
 {
   return GST_CLOCK_TIME_IS_VALID (time) ? time / (GST_SECOND * 60 * 60) : 99;
diff --git a/gstreamer/src/clock.hg b/gstreamer/src/clock.hg
index 8250182..94c6267 100644
--- a/gstreamer/src/clock.hg
+++ b/gstreamer/src/clock.hg
@@ -19,6 +19,7 @@
 
 #include <gst/gstclock.h>
 #include <gstreamermm/object.h>
+#include <gstreamermmconfig.h>
 
 _DEFS(gstreamermm,gst)
 
@@ -37,23 +38,23 @@ typedef GstClockTimeDiff ClockTimeDiff;
 
 /** A constant to define an undefined clock time.
  */
-static GLIBMM_API const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
+extern GSTREAMERMM_API const ClockTime CLOCK_TIME_NONE;
 
 /** A constant that defines one GStreamer second.
  */
-static GLIBMM_API const ClockTime SECOND = GST_SECOND;
+extern GSTREAMERMM_API const ClockTime SECOND;
 
 /** A constant that defines one GStreamer millisecond.
  */
-static GLIBMM_API const ClockTime MILLI_SECOND = GST_MSECOND;
+extern GSTREAMERMM_API const ClockTime MILLI_SECOND;
 
 /** A constant that defines one GStreamer microsecond.
  */
-static GLIBMM_API const ClockTime MICRO_SECOND = GST_USECOND;
+extern GSTREAMERMM_API const ClockTime MICRO_SECOND;
 
 /** A constant that defines one GStreamer nanosecond.
  */
-static GLIBMM_API const ClockTime NANO_SECOND = GST_NSECOND;
+extern GSTREAMERMM_API const ClockTime NANO_SECOND;
 
 _WRAP_ENUM(ClockEntryType, GstClockEntryType)
 _WRAP_ENUM(ClockReturn, GstClockReturn)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]