Fix compiler warning due to missing function prototype.
[svn.git] / build / ac-macros / zlib.m4
blob51b211f0ca6a2d67b0b84822116a724d412100bc
1 dnl
2 dnl  SVN_LIB_Z
3 dnl
4 dnl  Check configure options and assign variables related to
5 dnl  the zlib library.
6 dnl
8 AC_DEFUN(SVN_LIB_Z,
10   zlib_found=no
12   AC_ARG_WITH(zlib,AS_HELP_STRING([--with-zlib=PREFIX],
13                                   [zlib compression library]),
14   [
15     if test "$withval" = "yes" ; then
16       AC_MSG_ERROR([--with-zlib requires an argument.])
17     else
18       AC_MSG_NOTICE([zlib library configuration])
19       zlib_prefix=$withval
20       save_cppflags="$CPPFLAGS"
21       CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include"
22       AC_CHECK_HEADERS(zlib.h,[
23         save_ldflags="$LDFLAGS"
24         LDFLAGS="-L$zlib_prefix/lib"
25         AC_CHECK_LIB(z, inflate, [zlib_found="yes"])
26         LDFLAGS="$save_ldflags"
27       ])
28       CPPFLAGS="$save_cppflags"
29     fi
30   ],
31   [
32     AC_CHECK_HEADER(zlib.h, [
33       AC_CHECK_LIB(z, inflate, [zlib_found="builtin"])
34     ])
35   ])
37   if test "$zlib_found" = "no"; then
38     AC_MSG_ERROR([subversion requires zlib])
39   fi
41   if test "$zlib_found" = "yes"; then
42     SVN_ZLIB_PREFIX="$zlib_prefix"
43     SVN_ZLIB_INCLUDES="-I$zlib_prefix/include"
44     LDFLAGS="-L$zlib_prefix/lib"
45   fi
47   SVN_ZLIB_LIBS="-lz"
49   AC_SUBST(SVN_ZLIB_PREFIX)
50   AC_SUBST(SVN_ZLIB_INCLUDES)
51   AC_SUBST(SVN_ZLIB_LIBS)