~yadi/squid/te-gzip

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Amos Jeffries
  • Date: 2016-11-21 08:02:45 UTC
  • Revision ID: squid3@treenet.co.nz-20161121080245-89piizd5npg4ezxe
Add zlib library detection

- add ./configure option to detect zlib
- update build tests for the new options
- link zlib (if any) to squid binary
- release notes documentation for build changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
3678
3678
SQUID_DEFINE_BOOL(USE_ERR_LOCALES,$enable_auto_locale,
3679
3679
   [Use multi-language support on error pages])
3680
3680
 
 
3681
dnl check for compression library zlib
 
3682
AC_ARG_WITH(zlib,
 
3683
  AS_HELP_STRING([--without-zlib],[Do not use zlib for compression. Default: auto-detect]), [
 
3684
AS_CASE("$withval",
 
3685
  [yes|no],[:],
 
3686
  [ AS_IF(test ! -d "$withval", AC_MSG_ERROR([--with-zlib path does not point to a directory]))
 
3687
    LIBZLIB_PATH="-L$withval/lib"
 
3688
    CPPFLAGS="-I$withval/include $CPPFLAGS"
 
3689
    with_zlib="yes"
 
3690
  ])
 
3691
])
 
3692
AH_TEMPLATE(USE_ZLIB,[zlib support is available])
 
3693
ZLIB=""
 
3694
AS_IF(test "x$with_zlib" != "xno", [
 
3695
  SQUID_STATE_SAVE(squid_zlib_state)
 
3696
  LIBS="$LIBS $LIBZLIB_PATH"
 
3697
  PKG_CHECK_MODULES([LIBZLIB],[zlib],[ CPPFLAGS="$CPPFLAGS $LIBZLIB_CFLAGS" ])
 
3698
  AC_CHECK_HEADERS(zlib.h)
 
3699
  SQUID_STATE_ROLLBACK(squid_zlib_state) #de-pollute LIBS
 
3700
 
 
3701
  AS_IF(test "x$with_zlib" = "xyes" -a "x$LIBZLIB_LIBS" = "x",
 
3702
    AC_MSG_ERROR([Required zlib library not found])
 
3703
  , test "x$LIBZLIB_LIBS" != "x", [
 
3704
    CXXFLAGS="$LIBZLIB_CFLAGS $CXXFLAGS"
 
3705
    ZLIB="$LIBZLIB_PATH $LIBZLIB_LIBS $ZLIB"
 
3706
    AC_DEFINE(USE_ZLIB,1,[zlib support is available])]
 
3707
  ,[with_zlib="no"])
 
3708
])
 
3709
AC_MSG_NOTICE([zlib support: ${with_zlib:=auto} ${LIBZLIB_PATH} ${LIBZLIB_LIBS}])
 
3710
AC_SUBST(ZLIB)
3681
3711
 
3682
3712
dnl Need the debugging version of malloc if available
3683
3713
XTRA_OBJS=''