gst-args: add AG_GST_ARG_DISABLE_FATAL_WARNINGS to provide --disable-fatal-warnings...
authorColin Walters <walters@verbum.org>
Thu, 19 Jan 2012 13:37:12 +0000 (13:37 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 19 Jan 2012 13:43:01 +0000 (13:43 +0000)
It's reasonable to build from git, but not want to turn all compiler
warnings into fatal errors.  For example, GNOME's jhbuild helps people
get newer versions of software than came from their distribution, but
they may not necessarily want to hack on it.

m4/gst-args.m4

index 030e7ac..357379c 100644 (file)
@@ -19,6 +19,7 @@ dnl AG_GST_ARG_ENABLE_EXTERNAL
 dnl AG_GST_ARG_ENABLE_EXPERIMENTAL
 dnl AG_GST_ARG_ENABLE_BROKEN
 
+dnl AG_GST_ARG_DISABLE_FATAL_WARNINGS
 AC_DEFUN([AG_GST_ARG_DEBUG],
 [
   dnl debugging stuff
@@ -325,3 +326,20 @@ AC_DEFUN([AG_GST_ARG_ENABLE_BROKEN],
       AC_MSG_NOTICE([not building broken plug-ins])
     ])
 ])
+
+dnl allow people (or build tools) to override default behaviour
+dnl for fatal compiler warnings
+AC_DEFUN([AG_GST_ARG_DISABLE_FATAL_WARNINGS],
+[
+  AC_ARG_ENABLE(fatal-warnings,
+    AC_HELP_STRING([--disable-fatal-warnings],
+                   [Don't turn compiler warnings into fatal errors]),
+    [
+      case "${enableval}" in
+        yes) FATAL_WARNINGS=yes ;;
+        no)  FATAL_WARNINGS=no ;;
+        *)   AC_MSG_ERROR(bad value ${enableval} for --disable-fatal-warnings) ;;
+      esac
+    ],
+    [FATAL_WARNINGS=$GST_GIT]) dnl Default value
+])