summaryrefslogtreecommitdiff
path: root/ext/mcrypt/config.m4
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2003-01-03 19:49:44 +0000
committerDerick Rethans <derick@php.net>2003-01-03 19:49:44 +0000
commit419af9f12a5d85eb9eb1636ef4e0ae6c76d2d48b (patch)
tree3eefbe11d7f290f10ca7c37900be44a6a0e77463 /ext/mcrypt/config.m4
parentf99fa7170eb39d4604424fdefd1d6556a99fe6bb (diff)
downloadphp-git-419af9f12a5d85eb9eb1636ef4e0ae6c76d2d48b.tar.gz
- Removed support for libmcrypt 2.2.x to allow cleaner code. Another reason
to upgrade libmcrypt to a 2.5.x series as the older ones have too much bugs to be safely used with PHP. - Updated macro's, php_errors and parameter parsing. @- Removed support for libmcrypt 2.2.x to allow cleaner code. Another reason @ to upgrade libmcrypt to a 2.5.x series as the older ones have too much bugs @ to be safely used with PHP. (Derick)
Diffstat (limited to 'ext/mcrypt/config.m4')
-rw-r--r--ext/mcrypt/config.m445
1 files changed, 20 insertions, 25 deletions
diff --git a/ext/mcrypt/config.m4 b/ext/mcrypt/config.m4
index bae44a3d4b..3aa176ff8a 100644
--- a/ext/mcrypt/config.m4
+++ b/ext/mcrypt/config.m4
@@ -2,6 +2,24 @@ dnl
dnl $Id$
dnl
+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>
+#if MCRYPT_API_VERSION >= 20020309
+ yes
+#endif
+ ],[
+ AC_MSG_RESULT(>= 2.5.3)
+ ],[
+ AC_MSG_ERROR(libmcrypt version 2.5.3 or greater required.)
+ ])
+ CPPFLAGS=$old_CPPFLAGS
+])
+
+
PHP_ARG_WITH(mcrypt, for mcrypt support,
[ --with-mcrypt[=DIR] Include mcrypt support.])
@@ -16,32 +34,9 @@ if test "$PHP_MCRYPT" != "no"; then
AC_MSG_ERROR(mcrypt.h not found. Please reinstall libmcrypt.)
fi
- PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open,
- [
- PHP_ADD_LIBRARY(ltdl,, MCRYPT_SHARED_LIBADD)
- AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ])
-
- PHP_CHECK_LIBRARY(mcrypt, mcrypt_generic_deinit,
- [
- AC_DEFINE(HAVE_MCRYPT_GENERIC_DEINIT,1,[ ])
- ],[],[
- -L$MCRYPT_DIR/lib
- ])
-
- ],[
- PHP_CHECK_LIBRARY(mcrypt, init_mcrypt,
- [
- AC_DEFINE(HAVE_LIBMCRYPT22,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
- ])
+ PHP_MCRYPT_CHECK_VERSION
+ PHP_ADD_LIBRARY(ltdl,, MCRYPT_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(mcrypt, $MCRYPT_DIR/lib, MCRYPT_SHARED_LIBADD)
PHP_ADD_INCLUDE($MCRYPT_DIR/include)
AC_DEFINE(HAVE_LIBMCRYPT,1,[ ])