[gcc(refs/users/marxin/heads/PR94259-zstd-detection-fix)] Fix handling of --with{, out}-zstd option.

Martin Liska marxin@gcc.gnu.org
Mon Mar 23 15:51:25 GMT 2020


https://gcc.gnu.org/g:3cf99c72046fc9fb71a01b3951f1763b6fbff60c

commit 3cf99c72046fc9fb71a01b3951f1763b6fbff60c
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Mar 23 16:49:57 2020 +0100

    Fix handling of --with{,out}-zstd option.
    
    gcc/ChangeLog:
    
    2020-03-23  Martin Liska  <mliska@suse.cz>
    
            PR lto/94259
            * configure.ac: Respect --without-zstd and report
            error when we can't find header file with --with-zstd.
            * configure: Regenerate.

Diff:
---
 gcc/configure    | 9 +++++++--
 gcc/configure.ac | 5 +++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index 5381e107bce..87a7eb4ade1 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -9969,6 +9969,8 @@ case "x$with_zstd" in
      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..8eb4cc1de11 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1341,6 +1341,8 @@ case "x$with_zstd" in
      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 <zstd.h> 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


More information about the Gcc-cvs mailing list