diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-11-07 18:17:20 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-07 18:17:20 -0800 |
commit | 03800743156fe4f331a10c0983b9d633bed3a687 (patch) | |
tree | 56b7e501ff7ebaf057849108c839fff569aa8f39 /configure.ac | |
parent | Merge branch 'cp/p4' (diff) | |
parent | Improve accuracy of check for presence of deflateBound. (diff) | |
download | tgif-03800743156fe4f331a10c0983b9d633bed3a687.tar.xz |
Merge branch 'ds/maint-deflatebound'
* ds/maint-deflatebound:
Improve accuracy of check for presence of deflateBound.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index bd80517667..53e9a17c73 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,26 @@ AC_SUBST(NEEDS_LIBICONV) AC_SUBST(NO_ICONV) test -n "$NEEDS_LIBICONV" && LIBS="$LIBS -liconv" # +# Define NO_DEFLATE_BOUND if deflateBound is missing from zlib. +AC_DEFUN([ZLIBTEST_SRC], [ +#include <zlib.h> + +int main(void) +{ + deflateBound(0, 0); + return 0; +} +]) +AC_MSG_CHECKING([for deflateBound in -lz]) +old_LIBS="$LIBS" +LIBS="$LIBS -lz" +AC_LINK_IFELSE(ZLIBTEST_SRC, + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + NO_DEFLATE_BOUND=yes]) +LIBS="$old_LIBS" +AC_SUBST(NO_DEFLATE_BOUND) +# # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, # Patrick Mauritz). AC_CHECK_LIB([c], [socket], |