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
|
|
|
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([PHP_MCRYPT_CHECK_VERSION],[
|
2003-01-04 03:49:44 +08:00
|
|
|
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,
|
2005-05-30 07:17:16 +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
|
2003-10-01 10:53:23 +08:00
|
|
|
test -f $i/include/mcrypt.h && MCRYPT_DIR=$i && break
|
2000-03-28 07:43:00 +08:00
|
|
|
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,[ ])
|
|
|
|
],[
|
|
|
|
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.])
|
|
|
|
],[
|
2006-12-24 01:58:47 +08:00
|
|
|
-L$MCRYPT_DIR/$PHP_LIBDIR
|
2003-02-01 07:01:36 +08:00
|
|
|
])
|
|
|
|
],[
|
2006-12-24 01:58:47 +08:00
|
|
|
-L$MCRYPT_DIR/$PHP_LIBDIR -lltdl
|
2003-02-01 07:01:36 +08:00
|
|
|
])
|
|
|
|
|
2006-12-24 01:58:47 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(mcrypt, $MCRYPT_DIR/$PHP_LIBDIR, 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)
|
2010-01-16 05:02:20 +08:00
|
|
|
PHP_NEW_EXTENSION(mcrypt, mcrypt.c mcrypt_filter.c, $ext_shared)
|
2000-03-28 07:43:00 +08:00
|
|
|
fi
|