r6128: fix the build
[bbaumbach/samba-autobuild/.git] / source4 / librpc / config.m4
1 ########################################################
2 # Compile with compression support
3
4 with_zlib_support=auto
5 ZLIB_LIBS=""
6 ZLIB_CFLAGS=""
7 ZLIB_CPPFLAGS=""
8 ZLIB_LDFLAGS=""
9
10 AC_MSG_CHECKING([for ZLIB support])
11
12 AC_ARG_WITH(zlib,
13 [  --with-zlib             ZLIB support (default yes)],
14 [ case "$withval" in
15     yes|no)
16         with_zlib_support=$withval
17         ;;
18   esac ])
19
20 AC_MSG_RESULT($with_zlib_support)
21
22 if test x"$with_zlib_support" != x"no"; then
23
24   AC_MSG_CHECKING(whether ZLIB support is available)AC_CHECK_HEADERS(zlib.h)  
25   if test x"$ac_cv_header_zlib_h" != x"yes"; then
26           with_zlib_support=no
27   fi
28
29   if test x"$with_zlib_support" != x"no"; then
30     AC_CHECK_LIB_EXT(z, ZLIB_LIBS, inflate)
31
32     if test x"$ac_cv_lib_ext_z_inflate" = x"yes"; then
33       AC_DEFINE(HAVE_ZLIB,1,[Whether zlib is available])
34       with_zlib_support=yes
35       SMB_EXT_LIB_ENABLE(ZLIB,YES)
36     else
37       ZLIB_LIBS=""
38       with_zlib_support=no
39     fi
40     LIBS=$ac_save_LIBS
41   fi
42
43   AC_MSG_RESULT($with_zlib_support)
44
45   # for now enable this always but maybe all fields are empty
46   # TODO: move compression methods to seperate files each
47   SMB_EXT_LIB_ENABLE(ZLIB,YES)
48
49   SMB_EXT_LIB(ZLIB,[${ZLIB_LIBS}],[${ZLIB_CFLAGS}],[${ZLIB_CPPFLAGS}],[${ZLIB_LDFLAGS}])
50 fi