diff mbox series

Fix handling of --with{,out}-zstd option.

Message ID 50cfb79f-a857-4b06-db89-81f28f1db3ae@suse.cz
State New
Headers show
Series Fix handling of --with{,out}-zstd option. | expand

Commit Message

Martin Liška March 24, 2020, 6:34 a.m. UTC
Hi.

The patch respects --without-zstd and reports
an error when we can't find header file with --with-zstd.

Ready to be installed?
Thanks,
Martin

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.
---
  gcc/configure    | 13 +++++++++----
  gcc/configure.ac |  9 +++++++--
  2 files changed, 16 insertions(+), 6 deletions(-)

Comments

Li, Pan2 via Gcc-patches March 24, 2020, 5:19 p.m. UTC | #1
On Tue, 2020-03-24 at 07:34 +0100, Martin Liška wrote:
> Hi.
> 
> The patch respects --without-zstd and reports
> an error when we can't find header file with --with-zstd.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> 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.
OK
jeff
>
diff mbox series

Patch

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 <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