[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH 19/57] tools/configure.ac: Create ZLIB_LIBS and ZLIB_CFLAGS


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Mon, 6 Dec 2021 17:02:02 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Mon, 06 Dec 2021 17:07:37 +0000
  • Ironport-data: A9a23:ejcUyqNr2ibBIcDvrR1UkMFynXyQoLVcMsEvi/4bfWQNrUoj0TEHz mRJDTvTP/vYMDHzftF3Odu1801TupPRn4dlQAto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdpJYz/uUGuCJQUNUjMlkfZKhTr6bUsxNbVU8En5400o9w7RRbrNA2rBVPSvc4 bsenOWHULOV82Yc3rU8sv/rRLtH5ZweiRtA1rAMTakjUGz2zhH5OKk3N6CpR0YUd6EPdgKMq 0Qv+5nilo/R109F5tpICd8XeGVSKlLZFVDmZna7x8FOK/WNz8A/+v9TCRYSVatYoyi1rfVSw tdOjMyTdwk1bojjg88dbSANRkmSPYUekFPGCX22sMjVxEzaaXr8hf5pCSnaP6VBpLwxWzsXs 6VFdnZdNXhvhMrvqF6/YuBqmsQkKtitJI4Fs2ts5TrYEewnUdbIRKCiCdpwgWZr3JwWR6a2i 8wxWSo/MyrQWkJzCnwSJ8wQhPy5mGDfWmgNwL6SjfVuuDWCpOBr65DyNPLFd9rMQt9a9m6aq XjB5H/RGQwBOZqUzj/t2nOzhMffkCXjQoUQGbaksPlwjzW71mEVTREbS1a/if24kVKlHcJSL VQO/SgjprR081akJvH0WQG4p3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ewK/yXcW2+ks1N6ZNWGM0ldARLsSibcKqAePJ8SRzIJgPN 9bAstDNOE=
  • Ironport-sdr: aRgDtDW9+i7arDAhUgwN9Wt3ZP+K9bzn48v7bdjUxgCDVK4pTw3RyGQ/3ZpDYguReP0VIyqa8g P+AMN+z2PsPWPaBKj2RNfhnMiKc/q+YpE9wEJ0eCYZYcrEwvC8D6evICfZaAcSWZvUfl+UAgpj tiesAr6vB1vHb2CtvL5UEVbgBJDFERpA/7T8s47WHyug4QkBleYKfDj4npuUULkHrMIxoCy/oF X37WQBIXSp5FNrSOo7AGmwf49WYlWBZnI8xZicEgk5R4VqII/lvsMxu0s+CTnlOtribpmLBRrn 4sy7WHlXmCM8U2pSY/0RXVZ5
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Use both ZLIB_CFLAGS and ZLIB_LIBS instead of cherry-picking flags
from a single "ZLIB" variable.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/configure.ac        | 19 ++++++++++++++-----
 config/Tools.mk.in        |  3 ++-
 tools/configure           | 22 ++++++++++++++--------
 tools/libs/guest/Makefile | 12 +++++-------
 4 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index 5a4fb9022d..56afe7930d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -391,17 +391,26 @@ AX_CHECK_FETCHER
 
 # Checks for libraries.
 AC_CHECK_HEADER([bzlib.h], [
-AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
+    AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit],
+        [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_BZLIB"
+         ZLIB_LIBS="$ZLIB_LIBS -lbz2"])
 ])
 AC_CHECK_HEADER([lzma.h], [
-AC_CHECK_LIB([lzma], [lzma_stream_decoder], [zlib="$zlib -DHAVE_LZMA -llzma"])
+    AC_CHECK_LIB([lzma], [lzma_stream_decoder],
+        [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZMA"
+         ZLIB_LIBS="$ZLIB_LIBS -llzma"])
 ])
 AC_CHECK_HEADER([lzo/lzo1x.h], [
-AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
+    AC_CHECK_LIB([lzo2], [lzo1x_decompress],
+        [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZO1X"
+         ZLIB_LIBS="$ZLIB_LIBS -llzo2"])
 ])
 PKG_CHECK_MODULES([libzstd], [libzstd],
-    [zlib="$zlib -DHAVE_ZSTD $libzstd_CFLAGS $libzstd_LIBS"], [true])
-AC_SUBST(zlib)
+    [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_ZSTD $libzstd_CFLAGS"
+     ZLIB_LIBS="$ZLIB_LIBS $libzstd_LIBS"],
+    [true])
+AC_SUBST([ZLIB_CFLAGS])
+AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
 AX_CHECK_PTYFUNCS
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 934d899967..6c1a0a676f 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -66,7 +66,8 @@ CONFIG_9PFS         := @ninepfs@
 LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
 
 #System options
-ZLIB                := @zlib@
+ZLIB_CFLAGS         := @ZLIB_CFLAGS@
+ZLIB_LIBS           := @ZLIB_LIBS@
 CONFIG_LIBICONV     := @libiconv@
 EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
diff --git a/tools/configure b/tools/configure
index 829753b5dd..a052c186a5 100755
--- a/tools/configure
+++ b/tools/configure
@@ -641,7 +641,8 @@ PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
 EXTFS_LIBS
-zlib
+ZLIB_LIBS
+ZLIB_CFLAGS
 libzstd_LIBS
 libzstd_CFLAGS
 FETCHER
@@ -8605,7 +8606,7 @@ fi
 ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" 
"$ac_includes_default"
 if test "x$ac_cv_header_bzlib_h" = xyes; then :
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in 
-lbz2" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit 
in -lbz2" >&5
 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
 if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -8642,7 +8643,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
 if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then :
-  zlib="$zlib -DHAVE_BZLIB -lbz2"
+  ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_BZLIB"
+         ZLIB_LIBS="$ZLIB_LIBS -lbz2"
 fi
 
 
@@ -8652,7 +8654,7 @@ fi
 ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" 
"$ac_includes_default"
 if test "x$ac_cv_header_lzma_h" = xyes; then :
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in 
-llzma" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder 
in -llzma" >&5
 $as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
 if ${ac_cv_lib_lzma_lzma_stream_decoder+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -8689,7 +8691,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$ac_cv_lib_lzma_lzma_stream_decoder" >&5
 $as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
 if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = xyes; then :
-  zlib="$zlib -DHAVE_LZMA -llzma"
+  ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZMA"
+         ZLIB_LIBS="$ZLIB_LIBS -llzma"
 fi
 
 
@@ -8699,7 +8702,7 @@ fi
 ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" 
"ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
 if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then :
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in 
-llzo2" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in 
-llzo2" >&5
 $as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
 if ${ac_cv_lib_lzo2_lzo1x_decompress+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -8736,7 +8739,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$ac_cv_lib_lzo2_lzo1x_decompress" >&5
 $as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
 if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = xyes; then :
-  zlib="$zlib -DHAVE_LZO1X -llzo2"
+  ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZO1X"
+         ZLIB_LIBS="$ZLIB_LIBS -llzo2"
 fi
 
 
@@ -8812,10 +8816,12 @@ else
        libzstd_LIBS=$pkg_cv_libzstd_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       zlib="$zlib -DHAVE_ZSTD $libzstd_CFLAGS $libzstd_LIBS"
+       ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_ZSTD $libzstd_CFLAGS"
+     ZLIB_LIBS="$ZLIB_LIBS $libzstd_LIBS"
 fi
 
 
+
 ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" 
"ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
 if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
 
diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 8f5f3acd21..1f4b7f7c58 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -89,13 +89,12 @@ CFLAGS      += $(CFLAGS_libxendevicemodel)
 CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
 
 ifeq ($(CONFIG_MiniOS),y)
-zlib-options =
-else
-zlib-options = $(ZLIB)
+ZLIB_CFLAGS :=
+ZLIB_LIBS :=
 endif
 
-xg_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options))
-xg_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options))
+xg_dom_bzimageloader.o: CFLAGS += $(ZLIB_CFLAGS)
+xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
 
 LIBHEADER := xenguest.h
 
@@ -103,8 +102,7 @@ NO_HEADERS_CHK := y
 
 include $(XEN_ROOT)/tools/libs/libs.mk
 
-libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter 
-l%,$(zlib-options))
-libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz
+libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(ZLIB_LIBS) -lz
 
 -include $(DEPS_INCLUDE)
 
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.