diff options
author | Filipe Brandenburger <filbranden@google.com> | 2016-05-02 13:26:13 -0700 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2016-05-03 11:00:27 +0200 |
commit | 239cd48bc87ffbf95e6fe2dd6bd708b3fc9b1855 (patch) | |
tree | 068d85517c3ebf837f397f5794562b4de3ec1b0f | |
parent | afeccd48a738ebae5645dded4dd13f053747d008 (diff) | |
download | elfutils-239cd48bc87ffbf95e6fe2dd6bd708b3fc9b1855.tar.gz |
config: Pass the compiler -Werror during warning detection
Otherwise the compilation prints a warning but exits with 0 return code.
However, later during the compilation, when -Werror is enforced to about
every file, the unsupported options start breaking the builds.
Tested: Ran configure with clang-3.5 and built libelf/ tree with it.
$ autoreconf -i
$ ./configure CC=clang-3.5 ...
$ make -C libelf
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | configure.ac | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -1,6 +1,9 @@ 2016-05-02 Filipe Brandenburger <filbranden@google.com> * configure.ac (argp check): Pass pass &argv. + * configure.ac (-W<...> checks): Pass -Werror to the warning checks, + to ensure unsupported warning options are noticed during ./configure + time and not only later during build. 2016-03-31 Mark Wielaard <mjw@redhat.com> diff --git a/configure.ac b/configure.ac index 72cb22e8..07c04637 100644 --- a/configure.ac +++ b/configure.ac @@ -298,7 +298,7 @@ AS_IF([test "x$enable_symbol_versioning" = "xno"], AC_CACHE_CHECK([whether gcc accepts -Wstack-usage], ac_cv_stack_usage, [dnl old_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wstack-usage=262144" +CFLAGS="$CFLAGS -Wstack-usage=262144 -Werror" AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], ac_cv_stack_usage=yes, ac_cv_stack_usage=no) CFLAGS="$old_CFLAGS"]) @@ -319,7 +319,7 @@ AM_CONDITIONAL(SANE_LOGICAL_OP_WARNING, # -Wduplicated-cond was added by GCC6 AC_CACHE_CHECK([whether gcc accepts -Wduplicated-cond], ac_cv_duplicated_cond, [dnl old_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wduplicated-cond" +CFLAGS="$CFLAGS -Wduplicated-cond -Werror" AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], ac_cv_duplicated_cond=yes, ac_cv_duplicated_cond=no) CFLAGS="$old_CFLAGS"]) @@ -329,7 +329,7 @@ AM_CONDITIONAL(HAVE_DUPLICATED_COND_WARNING, # -Wnull-dereference was added by GCC6 AC_CACHE_CHECK([whether gcc accepts -Wnull-dereference], ac_cv_null_dereference, [dnl old_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wnull-dereference" +CFLAGS="$CFLAGS -Wnull-dereference -Werror" AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], ac_cv_null_dereference=yes, ac_cv_null_dereference=no) CFLAGS="$old_CFLAGS"]) |