[PATCH util-macros 3/6] Use XORG_TESTSET_CFLAG in XORG_STRICT_OPTION
Jeremy Huddleston
jeremyhu at apple.com
Tue Nov 1 13:28:45 PDT 2011
Please ignore the bad grammar in the comment in this change. I'll fix it ;)
On Nov 1, 2011, at 1:16 PM, Jeremy Huddleston wrote:
> Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
> ---
> xorg-macros.m4.in | 28 +++++++++-------------------
> 1 files changed, 9 insertions(+), 19 deletions(-)
>
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index c4a521f..456f78f 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -1443,31 +1443,21 @@ AC_SUBST(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])
> -AC_REQUIRE([XORG_COMPILER_BRAND])
> AC_REQUIRE([XORG_CWARNFLAGS])
>
> 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"
> - # Add -Werror=attributes if supported (gcc 4.2 & later)
> - AC_MSG_CHECKING([if $CC supports -Werror=attributes])
> - save_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
> - AC_COMPILE_IFELSE([AC_LANG_SOURCE([], [return 0;])],
> - [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
> - AC_MSG_RESULT([yes])],
> - [AC_MSG_RESULT([no])])
> - CFLAGS="$save_CFLAGS"
> -elif test "x$SUNCC" = "xyes"; then
> - STRICT_CFLAGS="-errwarn"
> -elif test "x$INTELCC" = "xyes"; then
> - STRICT_CFLAGS="-Werror"
> -fi
> +
> +STRICT_CFLAGS=""
> +XORG_TESTSET_CFLAG(STRICT_CFLAGS, -pedantic)
> +XORG_TESTSET_CFLAG(STRICT_CFLAGS, -Werror, -errwarn)
> +
> +# Earlier versions of gcc (eg: 4.2) supports -Werror=attributes, but does
> +# not include activate it with -Werror, so we add it here explicitly.
> +XORG_TESTSET_CFLAG(STRICT_CFLAGS, -Werror=attributes)
> +
> if test "x$STRICT_COMPILE" = "xyes"; then
> CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
> fi
> --
> 1.7.7
>
More information about the xorg-devel
mailing list