Debian Codegraph @

matio-1.5.0/config/matio_zlib.m4

raw
1 AC_DEFUN([MATIO_CHECK_ZLIB],
2 [
3 AC_ARG_WITH(zlib,AS_HELP_STRING([--with-zlib=DIR],
4 [Prefix where zlib Library is installed]))
5 if test "x$with_zlib" != "xno"
6 then
7 saved_LIBS="$LIBS"
8 saved_CFLAGS="$CFLAGS"
9
10 AC_MSG_CHECKING([for zlib Library])
11
12 if test "x$with_zlib" = "x" -o "x$with_zlib" = "xyes"
13 then
14 # Try system zlib
15 ZLIB_LDOPTS="-lz"
16 ZLIB_CFLAGS=""
17 else
18 ZLIB_LDOPTS="-L$with_zlib/$acl_libdirstem -lz"
19 ZLIB_CFLAGS="-I$with_zlib/include"
20 fi
21 LIBS="$saved_LIBS $ZLIB_LDOPTS"
22 CFLAGS="$saved_CFLAGS $ZLIB_CFLAGS"
23
24 Z_PREFIX=0
25 AC_TRY_LINK( [
26 #include <stdlib.h>
27 #include <zlib.h>
28 ],
29 [inflateCopy(NULL,NULL);], ac_have_zlib=yes, ac_have_zlib=no)
30
31 if test "$ac_have_zlib" = "no"
32 then
33 # Try again with Z_PREFIX
34 AC_TRY_LINK( [
35 #include <stdlib.h>
36 #define Z_PREFIX
37 #include <zlib.h>
38 ],[inflateCopy(NULL,NULL);],ac_have_zlib=yes,ac_have_zlib=no)
39 Z_PREFIX=1
40 fi
41
42 LIBS="$saved_LIBS"
43 CFLAGS="$saved_CFLAGS"
44
45 if test "$ac_have_zlib" = "yes"
46 then
47 ZLIB_LIBS="$ZLIB_LDOPTS"
48 AC_DEFINE_UNQUOTED([HAVE_ZLIB],[1],[Have zlib])
49 AC_SUBST(ZLIB_LIBS)
50 AC_SUBST(ZLIB_CFLAGS)
51 if test "$Z_PREFIX" = "1"
52 then
53 AC_DEFINE_UNQUOTED([Z_PREFIX],[1],[Z prefix])
54 fi
55 AC_MSG_RESULT([$ZLIB_LIBS])
56 else
57 AC_MSG_NOTICE($ac_have_zlib)
58 fi
59 else
60 ac_have_zlib=no
61 fi
62 AM_CONDITIONAL(HAVE_ZLIB, test "$ac_have_zlib" = "yes" )
63 ])