summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-08-11 15:58:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-08-11 15:58:47 -0700
commit8d28d0ac2af6f38abb588efb9f673d0e74768e8a (patch)
treef51e442e1ee64d29f663c16e7be91237df6b493e /configure.ac
parent3e41a054bf85132cbc84bb59f4461387dcb31972 (diff)
downloademacs-8d28d0ac2af6f38abb588efb9f673d0e74768e8a.tar.gz
Add --with-zlib to 'configure'.
* configure.ac: Add --with-zlib option to 'configure', so that Emacs can be built without zlib. Don't assume that -lz is needed on non-PNG hosts. Mention zlib configuration status in 'configure' output.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 17 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index ca30b38dab4..8b565320df5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,7 @@ OPTION_DEFAULT_ON([gconf],[don't compile with GConf support])
OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support])
OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support])
OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support])
+OPTION_DEFAULT_ON([zlib],[don't compile with zlib decompression support])
AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB],
[use a file notification library (LIB one of: yes, gfile, inotify, w32, no)])],
@@ -2944,19 +2945,23 @@ AC_SUBST(LIBPNG)
HAVE_ZLIB=no
LIBZ=
-if test "${HAVE_PNG}" = "yes"; then
- ### PNG depends on zlib, so if we have PNG, we have zlib.
- HAVE_ZLIB=yes
- AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if you have the zlib library (-lz).])
-else
- ### No PNG, so check zlib ourselves.
- LIBS="-lz $LIBS"
- AC_CHECK_LIB(z, inflateEnd, HAVE_ZLIB=yes, HAVE_ZLIB=no)
- if test "${HAVE_ZLIB}" = "yes"; then
- AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if you have the zlib library (-lz).])
- LIBZ=-lz
+if test "${with_zlib}" != "no"; then
+ if test "${HAVE_PNG}" = "yes"; then
+ ### PNG depends on zlib, so if we have PNG, we have zlib.
+ HAVE_ZLIB=yes
+ else
+ ### No PNG, so check zlib ourselves.
+ OLIBS=$LIBS
+ AC_SEARCH_LIBS([inflateEnd], [z], [HAVE_ZLIB=yes])
+ LIBS=$OLIBS
+ case $ac_cv_search_inflateEnd in
+ -*) LIBZ=$ac_cv_search_inflateEnd ;;
+ esac
fi
fi
+if test "${HAVE_ZLIB}" = "yes"; then
+ AC_DEFINE([HAVE_ZLIB], 1, [Define to 1 if you have the zlib library (-lz).])
+fi
AC_SUBST(LIBZ)
@@ -4812,6 +4817,7 @@ echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}
echo " Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}"
echo " Does Emacs use -lotf? ${HAVE_LIBOTF}"
echo " Does Emacs use -lxft? ${HAVE_XFT}"
+echo " Does Emacs directly use zlib? ${HAVE_ZLIB}"
echo " Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
echo