2001-05-10 08:55:48 +08:00
|
|
|
dnl
|
1999-04-26 00:50:40 +08:00
|
|
|
dnl $Id$
|
2001-05-10 08:55:48 +08:00
|
|
|
dnl
|
1999-04-26 00:50:40 +08:00
|
|
|
|
2003-01-04 03:49:44 +08:00
|
|
|
AC_DEFUN(PHP_MCRYPT_CHECK_VERSION,[
|
|
|
|
old_CPPFLAGS=$CPPFLAGS
|
|
|
|
CPPFLAGS=-I$MCRYPT_DIR/include
|
|
|
|
AC_MSG_CHECKING(for libmcrypt version)
|
|
|
|
AC_EGREP_CPP(yes,[
|
|
|
|
#include <mcrypt.h>
|
2003-02-01 07:01:36 +08:00
|
|
|
#if MCRYPT_API_VERSION >= 20021217
|
2003-01-04 03:49:44 +08:00
|
|
|
yes
|
|
|
|
#endif
|
|
|
|
],[
|
2003-02-01 07:01:36 +08:00
|
|
|
AC_MSG_RESULT(>= 2.5.6)
|
2003-01-04 03:49:44 +08:00
|
|
|
],[
|
2003-02-01 07:01:36 +08:00
|
|
|
AC_MSG_ERROR(libmcrypt version 2.5.6 or greater required.)
|
2003-01-04 03:49:44 +08:00
|
|
|
])
|
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2000-03-28 07:43:00 +08:00
|
|
|
PHP_ARG_WITH(mcrypt, for mcrypt support,
|
2001-12-01 03:00:13 +08:00
|
|
|
[ --with-mcrypt[=DIR] Include mcrypt support.])
|
1999-04-26 00:50:40 +08:00
|
|
|
|
2000-03-28 07:43:00 +08:00
|
|
|
if test "$PHP_MCRYPT" != "no"; then
|
2003-10-01 06:36:43 +08:00
|
|
|
for i in $PHP_MCRYPT /usr/local /usr; do
|
2000-03-28 07:43:00 +08:00
|
|
|
if test -f $i/include/mcrypt.h; then
|
|
|
|
MCRYPT_DIR=$i
|
|
|
|
fi
|
|
|
|
done
|
1999-04-26 00:50:40 +08:00
|
|
|
|
2000-03-28 07:43:00 +08:00
|
|
|
if test -z "$MCRYPT_DIR"; then
|
2001-05-10 08:55:48 +08:00
|
|
|
AC_MSG_ERROR(mcrypt.h not found. Please reinstall libmcrypt.)
|
1999-04-26 00:50:40 +08:00
|
|
|
fi
|
2000-03-28 07:43:00 +08:00
|
|
|
|
2003-01-04 03:49:44 +08:00
|
|
|
PHP_MCRYPT_CHECK_VERSION
|
2001-05-10 08:55:48 +08:00
|
|
|
|
2003-02-01 07:01:36 +08:00
|
|
|
PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open,
|
|
|
|
[
|
|
|
|
PHP_ADD_LIBRARY(ltdl,, MCRYPT_SHARED_LIBADD)
|
|
|
|
AC_DEFINE(HAVE_LIBMCRYPT,1,[ ])
|
|
|
|
],[
|
|
|
|
unset found
|
|
|
|
unset ac_cv_lib_mcrypt_mcrypt_module_open
|
|
|
|
PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_LIBMCRYPT,1,[ ])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([Sorry, I was not able to diagnose which libmcrypt version you have installed.])
|
|
|
|
],[
|
|
|
|
-L$MCRYPT_DIR/lib
|
|
|
|
])
|
|
|
|
],[
|
|
|
|
-L$MCRYPT_DIR/lib -lltdl
|
|
|
|
])
|
|
|
|
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(mcrypt, $MCRYPT_DIR/lib, MCRYPT_SHARED_LIBADD)
|
2001-05-10 08:55:48 +08:00
|
|
|
PHP_ADD_INCLUDE($MCRYPT_DIR/include)
|
2000-03-28 07:43:00 +08:00
|
|
|
|
2001-05-10 08:55:48 +08:00
|
|
|
PHP_SUBST(MCRYPT_SHARED_LIBADD)
|
2002-03-13 00:44:00 +08:00
|
|
|
PHP_NEW_EXTENSION(mcrypt, mcrypt.c, $ext_shared)
|
2000-03-28 07:43:00 +08:00
|
|
|
fi
|