| 368 |
AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1]) |
AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1]) |
| 369 |
AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1]) |
AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1]) |
| 370 |
|
|
| 371 |
# Check for the availability of libbz2 |
# Check for the availability of libbz2. Originally we just used AC_CHECK_LIB, |
| 372 |
|
# as for libz. However, this had the following problem, diagnosed and fixed by |
| 373 |
|
# a user: |
| 374 |
|
# |
| 375 |
|
# - libbz2 uses the Pascal calling convention (WINAPI) for the functions |
| 376 |
|
# under Win32. |
| 377 |
|
# - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h", |
| 378 |
|
# therefore missing the function definition. |
| 379 |
|
# - The compiler thus generates a "C" signature for the test function. |
| 380 |
|
# - The linker fails to find the "C" function. |
| 381 |
|
# - PCRE fails to configure if asked to do so against libbz2. |
| 382 |
|
# |
| 383 |
|
# Solution: |
| 384 |
|
# |
| 385 |
|
# - Replace the AC_CHECK_LIB test with a custom test. |
| 386 |
|
|
| 387 |
AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1]) |
AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1]) |
| 388 |
AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1]) |
# Original test |
| 389 |
|
# AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1]) |
| 390 |
|
# |
| 391 |
|
# Custom test follows |
| 392 |
|
|
| 393 |
|
AC_MSG_CHECKING([for libbz2]) |
| 394 |
|
OLD_LIBS="$LIBS" |
| 395 |
|
LIBS="$LIBS -lbz2" |
| 396 |
|
AC_LINK_IFELSE( AC_LANG_PROGRAM([[ |
| 397 |
|
#ifdef HAVE_BZLIB_H |
| 398 |
|
#include <bzlib.h> |
| 399 |
|
#endif]], |
| 400 |
|
[[return (int)BZ2_bzopen("conftest", "rb");]]), |
| 401 |
|
[AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;], |
| 402 |
|
AC_MSG_RESULT([no])) |
| 403 |
|
LIBS="$OLD_LIBS" |
| 404 |
|
|
| 405 |
# Check for the availabiity of libreadline |
# Check for the availabiity of libreadline |
| 406 |
|
|