1 --- exiv2-0.17.1/acinclude.m4.orig 1970-01-01 01:00:00.000000000 +0100
2 +++ exiv2-0.17.1/acinclude.m4 2008-07-21 13:52:55.923794430 +0200
4 +dnl @synopsis CHECK_ZLIB()
6 +dnl This macro searches for an installed zlib library. If nothing
7 +dnl was specified when calling configure, it searches first in /usr/local
8 +dnl and then in /usr. If the --with-zlib=DIR is specified, it will try
9 +dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib
10 +dnl is specified, the library is not searched at all.
12 +dnl If either the header file (zlib.h) or the library (libz) is not
13 +dnl found, the configuration exits on error, asking for a valid
14 +dnl zlib installation directory or --without-zlib.
16 +dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should
17 +dnl use autoheader to include a definition for this symbol in a config.h
18 +dnl file. Sample usage in a C/C++ source is as follows:
21 +dnl #include <zlib.h>
22 +dnl #endif /* HAVE_LIBZ */
25 +dnl @author Loic Dachary <loic@senga.org>
26 +dnl with modifications by Andreas Huggel <ahuggel@gmx.net>
28 +AC_DEFUN([CHECK_ZLIB],
32 +[AC_MSG_CHECKING(if zlib is wanted)
34 +[ --with-zlib=DIR root directory path of zlib installation [defaults to
35 + /usr/local or /usr if not found in /usr/local]
36 + --without-zlib to disable zlib usage completely],
37 +[if test "$withval" != no ; then
39 + ZLIB_HOME="$withval"
45 +if test ! -f "${ZLIB_HOME}/include/zlib.h"
51 +# Locate zlib, if wanted
53 +if test -n "${ZLIB_HOME}"
55 + ZLIB_OLD_LDFLAGS=$LDFLAGS
56 + ZLIB_OLD_CPPFLAGS=$CPPFLAGS
58 + # Adding /usr/lib or /usr/include to the flags/libs may
59 + # hurt if using a compiler not installed in the standard
62 + if test "${ZLIB_HOME}" != "/usr"
64 + LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
65 + CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
69 + AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
70 + AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
72 + if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
75 + # If both library and header were found, use them
77 + AC_CHECK_LIB(z, inflateEnd)
78 + AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
83 + # If either header or library was not found, revert and bomb
85 + AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
86 + LDFLAGS="$ZLIB_OLD_LDFLAGS"
87 + CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
88 + AC_MSG_RESULT(failed)
89 + AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)