PHP 4.0 Bug #7941 Updated: mcrypt 2.2 detected when mcrypt 2.4 is installed

From: Date: Sun, 24 Dec 2000 01:41:43 +0000
Subject: PHP 4.0 Bug #7941 Updated: mcrypt 2.2 detected when mcrypt 2.4 is installed
Groups: php.dev 
Request: Send a blank email to php-dev+get-42192@lists.php.net to get a copy of this message
ID: 7941 Updated by: derick Reported By: astmail@yahoo.com Old-Status: Open Status: Closed Bug Type: *Install and Config Assigned To: Comments: This has been fixed in CVS Previous Comments: --------------------------------------------------------------------------- [2000-11-23 17:51:06] astmail@yahoo.com OK, here's the config.m4 patch though I didn't test it (it should be reasonable enough): ================ --- cmp/php-4.0.3pl1/ext/mcrypt/config.m4 Sat Sep 9 14:24:20 2000 +++ src/php-4.0.3pl1/ext/mcrypt/config.m4 Thu Nov 23 23:48:01 2000 @@ -27,11 +27,11 @@ AC_CHECK_LIB(mcrypt, mcrypt_module_open, [LIBS="$LIBS -lltdl"],[ ],) LIBS=$old_LIBS LDFLAGS="$old_LDFLAGS" - if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then - AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ]) - elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then + if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then AC_ADD_LIBRARY(ltdl) AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ]) + elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then + AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ]) else AC_MSG_ERROR(Sorry, I was not able to diagnose which libmcrypt version you have installed.) fi ================ Yes, I'm sure it is mcrypt 2.4: I detected the problem when I did build a system from scratch against glibc 2.2 so there never was a mcrypt version earlier than 2.4.7 on this system. Doing a grep against this version shows up init_mcrypt() and nm against libmcrypt.a shows, that init_mcrypt is exported in the static library whereas it is not in the dynamic one (libmcrypt.so). --------------------------------------------------------------------------- [2000-11-23 08:45:08] derick@php.net Patches to configure are not useful at all... would you be so kind and make a patch for the config.m4 file in php4/ext/mcrypt? BTW, I naver had any troubles with this. Are you sure the static lib has version 2.4 of mcrypt? --------------------------------------------------------------------------- [2000-11-23 08:24:06] astmail@yahoo.com Patch to configure (beware, not configure.in) to show how to fix the problem: --- cmp/php-4.0.3pl1/configure Sun Oct 15 13:47:10 2000 +++ src/php-4.0.3pl1/configure Sun Nov 12 20:30:17 2000 @@ -21675,12 +21675,7 @@ LIBS=$old_LIBS LDFLAGS="$old_LDFLAGS" - if test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then - cat >> confdefs.h <<EOF -#define HAVE_LIBMCRYPT22 1 -EOF - - elif test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then + if test "$ac_cv_lib_mcrypt_mcrypt_module_open" = "yes"; then case "ltdl" in c|c_r|pthread*) ;; @@ -21695,6 +21690,11 @@ cat >> confdefs.h <<EOF #define HAVE_LIBMCRYPT24 1 +EOF + + elif test "$ac_cv_lib_mcrypt_init_mcrypt" = "yes"; then + cat >> confdefs.h <<EOF +#define HAVE_LIBMCRYPT22 1 EOF else --------------------------------------------------------------------------- [2000-11-23 07:46:48] astmail@yahoo.com When mcrypt 2.4 is installed as static and as dynamic library, e.g. /usr/lib/libmcrypt.a and /usr/lib/libmcrypt.so, configure detects mcrypt_module_open *AND* init_mcrypt (the latter is contained in the static lib). In this case HAVE_LIBMCRYPT22 gets defined instead of HAVE_LIBMCRYPT24 resulting in a build failure. The solution is to define HAVE_LIBMCRYPT24 when mcrypt_module_open is detected prior to checking for the results for init_mcrypt (change of sequence in configure script). Note: For linux the path to the mcrypt modules must be in ld.so.conf to prevent mcrypt failures in general. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7941

« previous php.dev (#42192) next »