summaryrefslogtreecommitdiffstats
path: root/llvm/projects/sample/autoconf
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-08-18 01:55:15 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-08-18 01:55:15 +0000
commit46919be7819f4cf24bf0715644eabc2210609a3d (patch)
tree591ce48ec6a555d6e0279b209f7ea16dd639daf4 /llvm/projects/sample/autoconf
parent718d3f5e76838bd080d4ecbc60c3625e5ce416d6 (diff)
downloadbcm5719-llvm-46919be7819f4cf24bf0715644eabc2210609a3d.tar.gz
bcm5719-llvm-46919be7819f4cf24bf0715644eabc2210609a3d.zip
Port the detection of zlib from the main autoconf system to the sample
project's autoconf. This is the last of the missing optional checks used by libSupport that seemed to be missing from the sample project, but I could easily have missed some as this was done by inspection when Craig asked me to add the terminfo support. llvm-svn: 188618
Diffstat (limited to 'llvm/projects/sample/autoconf')
-rw-r--r--llvm/projects/sample/autoconf/configure.ac27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/projects/sample/autoconf/configure.ac b/llvm/projects/sample/autoconf/configure.ac
index 89527b3377e..46fd5490904 100644
--- a/llvm/projects/sample/autoconf/configure.ac
+++ b/llvm/projects/sample/autoconf/configure.ac
@@ -535,6 +535,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],
@@ -1118,6 +1133,11 @@ if test "$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>],
@@ -1203,6 +1223,13 @@ if test "$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
OpenPOWER on IntegriCloud