2003-05-17 22:27:07 +08:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
|
|
|
|
|
|
|
PHP_ARG_WITH(bz2, for BZip2 support,
|
|
|
|
[ --with-bz2[=DIR] Include BZip2 support])
|
|
|
|
|
|
|
|
if test "$PHP_BZ2" != "no"; then
|
|
|
|
if test -r $PHP_BZ2/include/bzlib.h; then
|
|
|
|
BZIP_DIR=$PHP_BZ2
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING(for BZip2 in default path)
|
|
|
|
for i in /usr/local /usr; do
|
|
|
|
if test -r $i/include/bzlib.h; then
|
|
|
|
BZIP_DIR=$i
|
|
|
|
AC_MSG_RESULT(found in $i)
|
2004-01-21 13:04:30 +08:00
|
|
|
break
|
2003-05-17 22:27:07 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$BZIP_DIR"; then
|
|
|
|
AC_MSG_RESULT(not found)
|
|
|
|
AC_MSG_ERROR(Please reinstall the BZip2 distribution)
|
|
|
|
fi
|
|
|
|
|
2003-08-20 16:14:24 +08:00
|
|
|
PHP_CHECK_LIBRARY(bz2, BZ2_bzerror,
|
|
|
|
[
|
|
|
|
PHP_ADD_INCLUDE($BZIP_DIR/include)
|
2004-11-03 22:32:52 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/$PHP_LIBDIR, BZ2_SHARED_LIBADD)
|
2003-08-20 16:14:24 +08:00
|
|
|
AC_DEFINE(HAVE_BZ2,1,[ ])
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)
|
|
|
|
], [
|
2004-11-03 22:32:52 +08:00
|
|
|
-L$BZIP_DIR/$PHP_LIBDIR
|
2003-08-20 16:14:24 +08:00
|
|
|
])
|
2003-05-17 22:27:07 +08:00
|
|
|
|
2004-07-20 13:26:33 +08:00
|
|
|
PHP_NEW_EXTENSION(bz2, bz2.c bz2_filter.c, $ext_shared)
|
2003-08-20 16:14:24 +08:00
|
|
|
PHP_SUBST(BZ2_SHARED_LIBADD)
|
2003-05-17 22:27:07 +08:00
|
|
|
fi
|