summaryrefslogtreecommitdiff
path: root/xorg-macros.m4.in
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-macros.m4.in')
-rw-r--r--xorg-macros.m4.in25
1 files changed, 16 insertions, 9 deletions
diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index bdf734e..ccbe931 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -1337,7 +1337,13 @@ AC_SUBST(CWARNFLAGS)
# -----------------------
# Minimum version: 1.3.0
#
-# Add configure option to enable strict compilation
+# Add configure option to enable strict compilation flags, such as treating
+# warnings as fatal errors.
+# If --enable-strict-compilation is passed to configure, adds strict flags to
+# $CWARNFLAGS.
+#
+# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
+# when strict compilation is unconditionally desired.
AC_DEFUN([XORG_STRICT_OPTION], [
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
AC_REQUIRE([AC_PROG_CC_C99])
@@ -1348,16 +1354,17 @@ AC_ARG_ENABLE(strict-compilation,
AS_HELP_STRING([--enable-strict-compilation],
[Enable all warnings from compiler and make them errors (default: disabled)]),
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$GCC" = xyes ; then
+ STRICT_CFLAGS="-pedantic -Werror"
+elif test "x$SUNCC" = "xyes"; then
+ STRICT_CFLAGS="-errwarn"
+elif test "x$INTELCC" = "xyes"; then
+ STRICT_CFLAGS="-Werror"
+fi
if test "x$STRICT_COMPILE" = "xyes"; then
- if test "x$GCC" = xyes ; then
- STRICT_CFLAGS="-pedantic -Werror"
- elif test "x$SUNCC" = "xyes"; then
- STRICT_CFLAGS="-errwarn"
- elif test "x$INTELCC" = "xyes"; then
- STRICT_CFLAGS="-Werror"
- fi
+ CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
fi
-CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([STRICT_CFLAGS])
AC_SUBST([CWARNFLAGS])
]) # XORG_STRICT_OPTION