diff mbox series

[29/30] configure: do not rerun the tests with -Werror

Message ID 20221209112409.184703-30-pbonzini@redhat.com
State New
Headers show
Series Meson changes for QEMU 8.0 | expand

Commit Message

Paolo Bonzini Dec. 9, 2022, 11:24 a.m. UTC
Tests run in configure are pretty trivial at this point, so
do not bother with the extra complication of running tests
both with and without -Werror.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

Comments

Marc-André Lureau Dec. 12, 2022, 2 p.m. UTC | #1
Hi

On Fri, Dec 9, 2022 at 3:44 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Tests run in configure are pretty trivial at this point, so
> do not bother with the extra complication of running tests
> both with and without -Werror.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  configure | 35 +----------------------------------
>  1 file changed, 1 insertion(+), 34 deletions(-)
>
> diff --git a/configure b/configure
> index a7c95535fd01..745745ded35b 100755
> --- a/configure
> +++ b/configure
> @@ -119,41 +119,8 @@ lines: ${BASH_LINENO[*]}"
>    $compiler "$@" >> config.log 2>&1 || return $?
>  }
>
> -do_compiler_werror() {
> -    # Run the compiler, capturing its output to the log. First argument
> -    # is compiler binary to execute.
> -    compiler="$1"
> -    shift
> -    if test -n "$BASH_VERSION"; then eval '
> -        echo >>config.log "
> -funcs: ${FUNCNAME[*]}
> -lines: ${BASH_LINENO[*]}"
> -    '; fi
> -    echo $compiler "$@" >> config.log
> -    $compiler "$@" >> config.log 2>&1 || return $?
> -    # Test passed. If this is an --enable-werror build, rerun
> -    # the test with -Werror and bail out if it fails. This
> -    # makes warning-generating-errors in configure test code
> -    # obvious to developers.
> -    if test "$werror" != "yes"; then
> -        return 0
> -    fi
> -    # Don't bother rerunning the compile if we were already using -Werror
> -    case "$*" in
> -        *-Werror*)
> -           return 0
> -        ;;
> -    esac
> -    echo $compiler -Werror "$@" >> config.log
> -    $compiler -Werror "$@" >> config.log 2>&1 && return $?
> -    error_exit "configure test passed without -Werror but failed with -Werror." \
> -        "This is probably a bug in the configure script. The failing command" \
> -        "will be at the bottom of config.log." \
> -        "You can run configure with --disable-werror to bypass this check."
> -}
> -
>  do_cc() {
> -    do_compiler_werror "$cc" $CPU_CFLAGS "$@"
> +    do_compiler "$cc" $CPU_CFLAGS "$@"
>  }
>
>  compile_object() {
> --
> 2.38.1
>
>
diff mbox series

Patch

diff --git a/configure b/configure
index a7c95535fd01..745745ded35b 100755
--- a/configure
+++ b/configure
@@ -119,41 +119,8 @@  lines: ${BASH_LINENO[*]}"
   $compiler "$@" >> config.log 2>&1 || return $?
 }
 
-do_compiler_werror() {
-    # Run the compiler, capturing its output to the log. First argument
-    # is compiler binary to execute.
-    compiler="$1"
-    shift
-    if test -n "$BASH_VERSION"; then eval '
-        echo >>config.log "
-funcs: ${FUNCNAME[*]}
-lines: ${BASH_LINENO[*]}"
-    '; fi
-    echo $compiler "$@" >> config.log
-    $compiler "$@" >> config.log 2>&1 || return $?
-    # Test passed. If this is an --enable-werror build, rerun
-    # the test with -Werror and bail out if it fails. This
-    # makes warning-generating-errors in configure test code
-    # obvious to developers.
-    if test "$werror" != "yes"; then
-        return 0
-    fi
-    # Don't bother rerunning the compile if we were already using -Werror
-    case "$*" in
-        *-Werror*)
-           return 0
-        ;;
-    esac
-    echo $compiler -Werror "$@" >> config.log
-    $compiler -Werror "$@" >> config.log 2>&1 && return $?
-    error_exit "configure test passed without -Werror but failed with -Werror." \
-        "This is probably a bug in the configure script. The failing command" \
-        "will be at the bottom of config.log." \
-        "You can run configure with --disable-werror to bypass this check."
-}
-
 do_cc() {
-    do_compiler_werror "$cc" $CPU_CFLAGS "$@"
+    do_compiler "$cc" $CPU_CFLAGS "$@"
 }
 
 compile_object() {