summaryrefslogtreecommitdiffstats
path: root/autoconf
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-04-23 08:28:39 +0000
committerAlexey Samsonov <samsonov@google.com>2013-04-23 08:28:39 +0000
commitee03c949b85036b68c261dcc27dca064ee7e525d (patch)
tree14f060f70c0c6e5346a0f120c196f6718b060cd4 /autoconf
parenta8958769ea5583d58ae51931d8b1271c23fd20ea (diff)
downloadexternal_llvm-ee03c949b85036b68c261dcc27dca064ee7e525d.zip
external_llvm-ee03c949b85036b68c261dcc27dca064ee7e525d.tar.gz
external_llvm-ee03c949b85036b68c261dcc27dca064ee7e525d.tar.bz2
Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac27
1 files changed, 27 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index bfad23c..9c116f7 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -708,6 +708,21 @@ case "$enableval" in
*) AC_MSG_ERROR([Invalid setting for --enable-pthreads. Use "yes" or "no"]) ;;
esac
+dnl Allow disablement of zlib
+AC_ARG_ENABLE(zlib,
+ AS_HELP_STRING([--enable-zlib],
+ [Use zlib for compression/decompression if
+ available (default is YES)]),,
+ enableval=default)
+case "$enableval" in
+ yes) AC_SUBST(LLVM_ENABLE_ZLIB,[1]) ;;
+ no) AC_SUBST(LLVM_ENABLE_ZLIB,[0]) ;;
+ default) AC_SUBST(LLVM_ENABLE_ZLIB,[1]) ;;
+ *) AC_MSG_ERROR([Invalid setting for --enable-zlib. Use "yes" or "no"]) ;;
+esac
+AC_DEFINE_UNQUOTED([LLVM_ENABLE_ZLIB],$LLVM_ENABLE_ZLIB,
+ [Define if zlib is enabled])
+
dnl Allow building without position independent code
AC_ARG_ENABLE(pic,
AS_HELP_STRING([--enable-pic],
@@ -1368,6 +1383,11 @@ if test "$LLVM_ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
[Have pthread_getspecific]))
fi
+dnl zlib is optional; used for compression/uncompression
+if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
+ AC_CHECK_LIB(z, compress2)
+fi
+
dnl Allow extra x86-disassembler library
AC_ARG_WITH(udis86,
AS_HELP_STRING([--with-udis86=<path>],
@@ -1502,6 +1522,13 @@ if test "$LLVM_ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
else
AC_SUBST(HAVE_PTHREAD, 0)
fi
+if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
+ AC_CHECK_HEADERS(zlib.h,
+ AC_SUBST(HAVE_LIBZ, 1),
+ AC_SUBST(HAVE_LIBZ, 0))
+else
+ AC_SUBST(HAVE_LIBZ, 0)
+fi
dnl Try to find ffi.h.
if test "$llvm_cv_enable_libffi" = "yes" ; then