Update to util-macros 1.16.2

This commit is contained in:
matthieu 2012-03-10 11:51:27 +00:00
parent 16eedf3d78
commit 8e371f90da
4 changed files with 236 additions and 106 deletions

View File

@ -1,3 +1,80 @@
commit db238c632bb7136e3e44345820d514106e317420
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Mon Mar 5 09:39:17 2012 -0500
Version bump: 1.16.2
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 44aa8e75c8e54c5bc09d0cbff2f7207abe80c980
Author: Chase Douglas <chase.douglas@canonical.com>
Date: Wed Feb 29 12:18:51 2012 -0800
Define BASE_CXXFLAGS when C++ is the chosen language
You can use this functionality by setting the language to C++ before
calling XORG_DEFAULT_OPTIONS. This can accomplished with AC_LANG(C++).
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
commit 543ce698747dc998ca0ed987ef1ab0c35fb501b1
Author: Chase Douglas <chase.douglas@canonical.com>
Date: Wed Feb 29 09:51:02 2012 -0800
Make XORG_TESTSET_CFLAG work for multiple languages
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Gaetan Nadon<memsize@videotron.ca>
commit 52ef6f666a4fb46b693c81dc7a44612e6b78239d
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Tue Feb 14 21:59:38 2012 +0000
Use AS_ECHO rather than AS_ECHO_N in XORG_TESTSET_CFLAG
The AS_ECHO_N macro was only introduced in autoconf 2.62.
Backticks remove trailing newlines, so we don't need to use echo -n
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
commit a1809fde56e45639556a44fd3c3ef9213204c5a9
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Mon Jan 2 19:42:10 2012 +0000
Cache the results of checking compiler flag support in XORG_TESTSET_CFLAG
Since checking all those warning flags takes an amount of time I find irritating,
here is an attempt at caching the results of checking compiler warning flag support
A couple of aspects which need definitely need review or testing:
* I've tried to get things right when not the first flag in the list of alternates is
supported, but this really needs testing with a compiler other than gcc
* The cache variable naming policy is a bit opaque me, so the names used may need corecting
* I've tried to be careful, but who knows what portability sins I have committed :-)
This change reduces the time to run the ./configure script produced from a configure.ac
containing just
AC_INIT([test], 1.0)
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
AC_OUTPUT()
from ~60s to ~20s on my cygwin machine, and from ~15s to ~9s on a linux VM running on the
same hardware
v2: AS_TR_SH transforms characters which are invalid in shell variable names, so we don't
have to use sed to transform spaces ourself
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
commit 214132d470ef98b5d3cdc71662cb586025746bb5
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Fri Jan 20 23:46:56 2012 -0800

20
util/macros/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.62 for util-macros 1.16.1.
# Generated by GNU Autoconf 2.62 for util-macros 1.16.2.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='util-macros'
PACKAGE_TARNAME='util-macros'
PACKAGE_VERSION='1.16.1'
PACKAGE_STRING='util-macros 1.16.1'
PACKAGE_VERSION='1.16.2'
PACKAGE_STRING='util-macros 1.16.2'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@ -1225,7 +1225,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures util-macros 1.16.1 to adapt to many kinds of systems.
\`configure' configures util-macros 1.16.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1291,7 +1291,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of util-macros 1.16.1:";;
short | recursive ) echo "Configuration of util-macros 1.16.2:";;
esac
cat <<\_ACEOF
@ -1365,7 +1365,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
util-macros configure 1.16.1
util-macros configure 1.16.2
generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1379,7 +1379,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by util-macros $as_me 1.16.1, which was
It was created by util-macros $as_me 1.16.2, which was
generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
@ -2029,7 +2029,7 @@ fi
# Define the identity of the package.
PACKAGE='util-macros'
VERSION='1.16.1'
VERSION='1.16.2'
cat >>confdefs.h <<_ACEOF
@ -2812,7 +2812,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by util-macros $as_me 1.16.1, which was
This file was extended by util-macros $as_me 1.16.2, which was
generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -2855,7 +2855,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
util-macros config.status 1.16.1
util-macros config.status 1.16.2
configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure.
AC_PREREQ([2.60])
AC_INIT([util-macros],
[1.16.1],
[1.16.2],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[util-macros])
AC_CONFIG_SRCDIR([Makefile.am])

View File

@ -1424,12 +1424,20 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
#
# Checks for various brands of compilers and sets flags as appropriate:
# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
# clang compiler - sets CLANGCC to "yes"
# Intel compiler - sets INTELCC to "yes"
# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
#
AC_DEFUN([XORG_COMPILER_BRAND], [
AC_REQUIRE([AC_PROG_CC_C99])
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
],
[C++], [
AC_REQUIRE([AC_PROG_CXX])
]
)
AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
@ -1449,54 +1457,73 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
# -Werror=unused-command-line-argument
#
AC_DEFUN([XORG_TESTSET_CFLAG], [
AC_REQUIRE([AC_PROG_CC_C99])
m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
xorg_testset_save_CFLAGS="$CFLAGS"
AC_LANG_COMPILER_REQUIRE
AC_LANG_CASE(
[C], [
AC_REQUIRE([AC_PROG_CC_C99])
define([PREFIX], [C])
],
[C++], [
define([PREFIX], [CXX])
]
)
[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
if test "x$xorg_testset_unknown_warning_option" = "x" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
AC_MSG_CHECKING([if $CC supports -Werror=unknown-warning-option])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
[xorg_testset_unknown_warning_option=yes],
[xorg_testset_unknown_warning_option=no])
AC_MSG_RESULT([$xorg_testset_unknown_warning_option])
CFLAGS="$xorg_testset_save_CFLAGS"
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
AC_CACHE_CHECK([if compiler supports -Werror=unknown-warning-option],
xorg_cv_compiler_flag_unknown_warning_option,
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
[xorg_cv_compiler_flag_unknown_warning_option=yes],
[xorg_cv_compiler_flag_unknown_warning_option=no]))
xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
fi
if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
fi
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
AC_MSG_CHECKING([if $CC supports -Werror=unused-command-line-argument])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
[xorg_testset_unused_command_line_argument=yes],
[xorg_testset_unused_command_line_argument=no])
AC_MSG_RESULT([$xorg_testset_unused_command_line_argument])
CFLAGS="$xorg_testset_save_CFLAGS"
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
AC_CACHE_CHECK([if compiler supports -Werror=unused-command-line-argument],
xorg_cv_compiler_flag_unused_command_line_argument,
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
[xorg_cv_compiler_flag_unused_command_line_argument=yes],
[xorg_cv_compiler_flag_unused_command_line_argument=no]))
xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
fi
found="no"
m4_foreach([flag], m4_cdr($@), [
if test $found = "no" ; then
if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
fi
if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
fi
CFLAGS="$CFLAGS ]flag["
PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
AC_MSG_CHECKING([if $CC supports ]flag[])
AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
[supported=yes], [supported=no])
AC_MSG_RESULT([$supported])
CFLAGS="$xorg_testset_save_CFLAGS"
cacheid=`AS_ECHO([xorg_cv_cc_flag_]flag[])`
AC_CACHE_VAL(AS_TR_SH($cacheid),
[AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
[eval AS_TR_SH($cacheid)=yes],
[eval AS_TR_SH($cacheid)=no])])
PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
eval supported=$AS_TR_SH($cacheid)
AC_MSG_RESULT([$supported])
if test "$supported" = "yes" ; then
$1="$$1 ]flag["
found="yes"
@ -1509,13 +1536,13 @@ m4_foreach([flag], m4_cdr($@), [
# ---------------
# Minimum version: 1.16.0
#
# Defines BASE_CFLAGS to contain a set of command line arguments supported
# by the selected compiler which do NOT alter the generated code. These
# arguments will cause the compiler to print various warnings during
# compilation AND turn a conservative set of warnings into errors.
# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
# arguments supported by the selected compiler which do NOT alter the generated
# code. These arguments will cause the compiler to print various warnings
# during compilation AND turn a conservative set of warnings into errors.
#
# The set of flags supported by BASE_CFLAGS will grow in future
# versions of util-macros as options are added to new compilers.
# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
# future versions of util-macros as options are added to new compilers.
#
AC_DEFUN([XORG_COMPILER_FLAGS], [
AC_REQUIRE([XORG_COMPILER_BRAND])
@ -1526,76 +1553,89 @@ AC_ARG_ENABLE(selective-werror,
[SELECTIVE_WERROR=$enableval],
[SELECTIVE_WERROR=yes])
AC_LANG_CASE(
[C], [
define([PREFIX], [C])
],
[C++], [
define([PREFIX], [CXX])
]
)
# -v is too short to test reliably with XORG_TESTSET_CFLAG
if test "x$SUNCC" = "xyes"; then
BASE_CFLAGS="-v"
[BASE_]PREFIX[FLAGS]="-v"
else
BASE_CFLAGS=""
[BASE_]PREFIX[FLAGS]=""
fi
# This chunk of warnings were those that existed in the legacy CWARNFLAGS
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wall])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-arith])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wstrict-prototypes])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-prototypes])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-declarations])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnested-externs])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wbad-function-cast])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wformat=2], [-Wformat])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wold-style-definition])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdeclaration-after-statement])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
AC_LANG_CASE(
[C], [
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
]
)
# This chunk adds additional warnings that could catch undesired effects.
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wunused])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wuninitialized])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wshadow])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-qual])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-noreturn])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-format-attribute])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wredundant-decls])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
# These are currently disabled because they are noisy. They will be enabled
# in the future once the codebase is sufficiently modernized to silence
# them. For now, I don't want them to drown out the other warnings.
# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wlogical-op])
# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wparentheses])
# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-align])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
# Turn some warnings into errors, so we don't accidently get successful builds
# when there are problems that should be fixed.
if test "x$SELECTIVE_WERROR" = "xyes" ; then
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=nonnull])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=init-self])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=main])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=missing-braces])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=sequence-point])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=trigraphs])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=array-bounds])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=write-strings])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=address])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
else
AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wimplicit])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnonnull])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Winit-self])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmain])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-braces])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wsequence-point])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wreturn-type])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wtrigraphs])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Warray-bounds])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wwrite-strings])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Waddress])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wint-to-pointer-cast])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-to-int-cast])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
fi
AC_SUBST([BASE_CFLAGS])
AC_SUBST([BASE_]PREFIX[FLAGS])
]) # XORG_COMPILER_FLAGS
# XORG_CWARNFLAGS
@ -1613,11 +1653,15 @@ AC_SUBST([BASE_CFLAGS])
AC_DEFUN([XORG_CWARNFLAGS], [
AC_REQUIRE([XORG_COMPILER_FLAGS])
AC_REQUIRE([XORG_COMPILER_BRAND])
CWARNFLAGS="$BASE_CFLAGS"
if test "x$GCC" = xyes ; then
CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
fi
AC_SUBST(CWARNFLAGS)
AC_LANG_CASE(
[C], [
CWARNFLAGS="$BASE_CFLAGS"
if test "x$GCC" = xyes ; then
CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
fi
AC_SUBST(CWARNFLAGS)
]
)
]) # XORG_CWARNFLAGS
# XORG_STRICT_OPTION
@ -1627,7 +1671,7 @@ AC_SUBST(CWARNFLAGS)
# 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
# $BASE_CFLAGS and the deprecated $CWARNFLAGS.
# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
#
# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
# when strict compilation is unconditionally desired.
@ -1640,21 +1684,30 @@ AC_ARG_ENABLE(strict-compilation,
[Enable all warnings from compiler and make them errors (default: disabled)]),
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
STRICT_CFLAGS=""
XORG_TESTSET_CFLAG([STRICT_CFLAGS], [-pedantic])
XORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror], [-errwarn])
AC_LANG_CASE(
[C], [
define([PREFIX], [C])
],
[C++], [
define([PREFIX], [CXX])
]
)
[STRICT_]PREFIX[FLAGS]=""
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
# activate it with -Werror, so we add it here explicitly.
XORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror=attributes])
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
if test "x$STRICT_COMPILE" = "xyes"; then
BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS"
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
[BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
fi
AC_SUBST([STRICT_CFLAGS])
AC_SUBST([BASE_CFLAGS])
AC_SUBST([CWARNFLAGS])
AC_SUBST([STRICT_]PREFIX[FLAGS])
AC_SUBST([BASE_]PREFIX[FLAGS])
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
]) # XORG_STRICT_OPTION
# XORG_DEFAULT_OPTIONS