]> xenbits.xensource.com Git - xen.git/commitdiff
autoconf: add missing compression checks for libxc
authorRoger Pau Monne <roger.pau@entel.upc.edu>
Wed, 14 Mar 2012 14:20:58 +0000 (14:20 +0000)
committerRoger Pau Monne <roger.pau@entel.upc.edu>
Wed, 14 Mar 2012 14:20:58 +0000 (14:20 +0000)
Move missing checks from tools/libxc/Makefile to configure script.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
config/Tools.mk.in
tools/configure
tools/configure.ac
tools/libxc/Makefile

index 68de1e4cf0facffa3b631aaea0d4efece0b609cf..057b0554acd3579d8d22a563a4a001230681e6e3 100644 (file)
@@ -40,6 +40,7 @@ CONFIG_LOMOUNT      := @lomount@
 
 #System options
 CONFIG_SYSTEM_LIBAIO:= @system_aio@
+ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 CONFIG_EXT2FS       := @libext2fs@
index 0678d0437d78b587a62776c59d12658a21709c79..c6861303226ea7cf755a7537e01df66a83217e7f 100755 (executable)
@@ -605,6 +605,7 @@ libiconv
 libgcrypt
 libext2fs
 system_aio
+zlib
 LIB_PATH
 glib_LIBS
 glib_CFLAGS
@@ -6691,6 +6692,148 @@ fi
 
 
 # Checks for libraries.
+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" = x""yes; then :
+
+{ $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 test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzDecompressInit ();
+int
+main ()
+{
+return BZ2_bzDecompressInit ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_bz2_BZ2_bzDecompressInit=yes
+else
+  ac_cv_lib_bz2_BZ2_bzDecompressInit=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+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" = x""yes; then :
+  zlib="$zlib -DHAVE_BZLIB -lbz2"
+fi
+
+
+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" = x""yes; then :
+
+{ $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 test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_stream_decoder ();
+int
+main ()
+{
+return lzma_stream_decoder ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzma_lzma_stream_decoder=yes
+else
+  ac_cv_lib_lzma_lzma_stream_decoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+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" = x""yes; then :
+  zlib="$zlib -DHAVE_LZMA -llzma"
+fi
+
+
+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" = x""yes; then :
+
+{ $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 test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzo2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzo1x_decompress ();
+int
+main ()
+{
+return lzo1x_decompress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzo2_lzo1x_decompress=yes
+else
+  ac_cv_lib_lzo2_lzo1x_decompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+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" = x""yes; then :
+  zlib="$zlib -DHAVE_LZO1X -llzo2"
+fi
+
+
+fi
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
 if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
index aeeb7b07c23e16a13fc3f7fd7f00caa17fdc03b0..3d53a9536d4be38d14b6077e984de39548407325 100644 (file)
@@ -106,6 +106,16 @@ PKG_CHECK_MODULES(glib, glib-2.0)
 AX_DEFAULT_LIB
 
 # Checks for libraries.
+AC_CHECK_HEADER([bzlib.h], [
+AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
+])
+AC_CHECK_HEADER([lzma.h], [
+AC_CHECK_LIB([lzma], [lzma_stream_decoder], [zlib="$zlib -DHAVE_LZMA -llzma"])
+])
+AC_CHECK_HEADER([lzo/lzo1x.h], [
+AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
+])
+AC_SUBST(zlib)
 AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"])
 AC_SUBST(system_aio)
 AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])])
index f2e1ba78a8489d1bcd620d3efea1ea81e16f5275..55eb755059ef48e193788670b93dd654553c2e64 100644 (file)
@@ -172,20 +172,7 @@ libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
 ifeq ($(CONFIG_MiniOS),y)
 zlib-options =
 else
-zlib-options = $(shell                                 \
-       (. ../check/funcs.sh;                           \
-        if has_header bzlib.h; then                    \
-           echo "-DHAVE_BZLIB";                                \
-          echo "-lbz2";                                \
-        fi;                                            \
-        if has_header lzma.h; then                     \
-          echo "-DHAVE_LZMA";                          \
-          echo "-llzma";                               \
-        fi;                                            \
-        if has_header lzo/lzo1x.h; then                \
-          echo "-DHAVE_LZO1X";                         \
-          echo "-llzo2";                               \
-        fi) | grep $(1))
+zlib-options = $(ZLIB)
 endif
 
 xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)