summaryrefslogtreecommitdiff
path: root/source4/librpc/config.m4
blob: 290b0d16f2f62b35cf02683abb0bbedf99f05483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
########################################################
# Compile with compression support

with_zlib_support=auto
ZLIB_LIBS=""
ZLIB_CFLAGS=""
ZLIB_CPPFLAGS=""
ZLIB_LDFLAGS=""

AC_MSG_CHECKING([for ZLIB support])

AC_ARG_WITH(zlib,
[  --with-zlib             ZLIB support (default yes)],
[ case "$withval" in
    yes|no)
	with_zlib_support=$withval
	;;
  esac ])

AC_MSG_RESULT($with_zlib_support)

if test x"$with_zlib_support" != x"no"; then

  AC_MSG_CHECKING(whether ZLIB support is available)AC_CHECK_HEADERS(zlib.h)  
  if test x"$ac_cv_header_zlib_h" != x"yes"; then
	  with_zlib_support=no
  fi

  if test x"$with_zlib_support" != x"no"; then
    AC_CHECK_LIB_EXT(z, ZLIB_LIBS, inflate)

    if test x"$ac_cv_lib_ext_z_inflate" = x"yes"; then
      AC_DEFINE(HAVE_ZLIB,1,[Whether zlib is available])
      with_zlib_support=yes
      SMB_EXT_LIB_ENABLE(ZLIB,YES)
    else
      ZLIB_LIBS=""
      with_zlib_support=no
    fi
    LIBS=$ac_save_LIBS
  fi

  AC_MSG_RESULT($with_zlib_support)

  # for now enable this always but maybe all fields are empty
  # TODO: move compression methods to seperate files each
  SMB_EXT_LIB_ENABLE(ZLIB,YES)

  SMB_EXT_LIB(ZLIB,[${ZLIB_LIBS}],[${ZLIB_CFLAGS}],[${ZLIB_CPPFLAGS}],[${ZLIB_LDFLAGS}])
fi