Only add -fno-strict-aliasing for GLib version before 2.19.8
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 21 Feb 2009 16:57:55 +0000 (17:57 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 21 Feb 2009 16:57:55 +0000 (17:57 +0100)
GLib since 2.19.8 has again warning clean headers so we don't
add -fno-strict-aliasing to the ERROR_CFLAGS as it might hide
some bugs (because we build releases with -fstrict-aliasing).

m4/gst-error.m4

index c5ce242..50a964d 100644 (file)
@@ -70,8 +70,13 @@ AC_DEFUN([AG_GST_SET_ERROR_CFLAGS],
           done
       ])
     else
-      AS_COMPILER_FLAG(-fno-strict-aliasing,
-          ERROR_CFLAGS="$ERROR_CFLAGS -fno-strict-aliasing")
+      dnl Add -fno-strict-aliasing for GLib versions before 2.19.8
+      dnl as before G_LOCK and friends caused strict aliasing compiler
+      dnl warnings.
+      PKG_CHECK_EXISTS([glib-2.0 < 2.19.8], [
+        AS_COMPILER_FLAG(-fno-strict-aliasing,
+            ERROR_CFLAGS="$ERROR_CFLAGS -fno-strict-aliasing")
+       ])
     fi
   fi