Fix handling of --with{,out}-zstd option.
authorMartin Liska <mliska@suse.cz>
Wed, 25 Mar 2020 10:01:43 +0000 (11:01 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 25 Mar 2020 10:01:43 +0000 (11:01 +0100)
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
gcc/configure
gcc/configure.ac

index 3a1bfce..89cfb07 100644 (file)
@@ -1,3 +1,10 @@
+2020-03-25  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.
+
 2020-03-25  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/94303
index 5381e10..b4231fe 100755 (executable)
@@ -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
index 0d6230e..0051963 100644 (file)
@@ -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 <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