diff options
author | Lukas Larsson <lukas@erlang.org> | 2020-11-02 16:30:46 +0100 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2021-01-07 14:37:28 +0100 |
commit | 2e8ea6a10dc81d1d3c623dcf8921fe93bec0f445 (patch) | |
tree | d1a3c4d28dedd3f48c8b8e3d0cd4d5ca9c60ff8b | |
parent | c8ef47c44282d1261366c8272038152afd17c65f (diff) | |
download | erlang-2e8ea6a10dc81d1d3c623dcf8921fe93bec0f445.tar.gz |
erts: Remove -Werror from CFLAGS during configure
We don't want the configure checks to run with -Werror in CFLAGS
so remove it and re-add it before compiling the emulator.
-rw-r--r-- | erts/configure.in | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/erts/configure.in b/erts/configure.in index 09b4c0473d..f60bbd515e 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -26,6 +26,15 @@ AC_PREREQ(2.59) LM_PRECIOUS_VARS +dnl We check if -Werror was given on command line and if so +dnl we disable it for the configure and only use it when +dnl actually building erts +no_werror_CFLAGS=$(echo "$CFLAGS" | sed 's/-Werror\([[^=]]\|$\)/ /g') +if test "$CFLAGS" != "$no_werror_CFLAGS"; then + CFLAGS="$no_werror_CFLAGS" + WERRORFLAGS=-Werror +fi + dnl How to set srcdir absolute is taken from the GNU Emacs distribution #### Make srcdir absolute, if it isn't already. It's important to #### avoid running the path through pwd unnecessary, since pwd can @@ -570,7 +579,7 @@ if test "x$GCC" = xyes; then LM_TRY_ENABLE_CFLAG([-fno-common], [CFLAGS]) else WFLAGS="" - WERRORFLAGS="" + WERRORFLAGS=${WERRORFLAGS:-""} fi AC_MSG_CHECKING([C99 support]) @@ -3512,6 +3521,15 @@ AH_BOTTOM([ #endif /* __ERTS_CONFIG_H__ */ ]) +dnl ---------------------------------------------------------------------- +dnl Check for log2 +dnl ---------------------------------------------------------------------- +AC_CHECK_FUNCS([log2]) + +dnl ---------------------------------------------------------------------- +dnl Enable any -Werror flags +dnl ---------------------------------------------------------------------- + if test "x$GCC" = xyes; then CFLAGS="$WERRORFLAGS $CFLAGS" fi @@ -3537,11 +3555,6 @@ LDFLAGS="$LDFLAGS $sanitizers" ]) dnl ---------------------------------------------------------------------- -dnl Check for log2 -dnl ---------------------------------------------------------------------- -AC_CHECK_FUNCS([log2]) - -dnl ---------------------------------------------------------------------- dnl Output the result. dnl ---------------------------------------------------------------------- |