From 0fb0240a051df91d3c24385d1d3c17548b266544 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 25 Mar 2020 11:01:43 +0100 Subject: [PATCH] Fix handling of --with{,out}-zstd option. PR lto/94259 * configure.ac: Respect --without-zstd and report error when we can't find header file with --with-zstd. * configure: Regenerate. --- gcc/ChangeLog | 7 +++++++ gcc/configure | 13 +++++++++---- gcc/configure.ac | 9 +++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a1bfcef39b..89cfb07b457 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2020-03-25 Martin Liska + + PR lto/94259 + * configure.ac: Respect --without-zstd and report + error when we can't find header file with --with-zstd. + * configure: Regenerate. + 2020-03-25 Jakub Jelinek PR middle-end/94303 diff --git a/gcc/configure b/gcc/configure index 5381e107bce..b4231fe7b7e 100755 --- a/gcc/configure +++ b/gcc/configure @@ -9962,13 +9962,15 @@ fi case "x$with_zstd" in x) ;; xno) - ZSTD_INCLUDE=no - ZSTD_LIB=no + ZSTD_INCLUDE= + ZSTD_LIB= ;; *) ZSTD_INCLUDE=$with_zstd/include ZSTD_LIB=$with_zstd/lib ;; esac + +if test "x$with_zstd" != xno; then if test "x$with_zstd_include" != x; then ZSTD_INCLUDE=$with_zstd_include fi @@ -10017,6 +10019,8 @@ if test $gcc_cv_header_zstd_h = yes; then $as_echo "#define HAVE_ZSTD_H 1" >>confdefs.h +else + as_fn_error $? "Unable to find zstd.h. See config.log for details." "$LINENO" 5 fi # LTO can use zstd compression algorithm @@ -10081,6 +10085,7 @@ fi ZSTD_LIB="$LIBS" LIBS="$save_LIBS" +fi @@ -18980,7 +18985,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18983 "configure" +#line 18988 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19086,7 +19091,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19089 "configure" +#line 19094 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 0d6230e0ca1..0051963c85d 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1334,13 +1334,15 @@ AC_ARG_WITH(zstd-lib, case "x$with_zstd" in x) ;; xno) - ZSTD_INCLUDE=no - ZSTD_LIB=no + ZSTD_INCLUDE= + ZSTD_LIB= ;; *) ZSTD_INCLUDE=$with_zstd/include ZSTD_LIB=$with_zstd/lib ;; esac + +if test "x$with_zstd" != xno; then if test "x$with_zstd_include" != x; then ZSTD_INCLUDE=$with_zstd_include fi @@ -1369,6 +1371,8 @@ AC_MSG_RESULT($gcc_cv_header_zstd_h) if test $gcc_cv_header_zstd_h = yes; then AC_DEFINE(HAVE_ZSTD_H, 1, [Define if you have a working header file.]) +else + as_fn_error $? "Unable to find zstd.h. See config.log for details." "$LINENO" 5 fi # LTO can use zstd compression algorithm @@ -1378,6 +1382,7 @@ AC_SEARCH_LIBS(ZSTD_compress, zstd) ZSTD_LIB="$LIBS" LIBS="$save_LIBS" AC_SUBST(ZSTD_LIB) +fi dnl Disabled until we have a complete test for buggy enum bitfields. dnl gcc_AC_C_ENUM_BF_UNSIGNED -- 2.30.2