Cannot compile mcrypt (configure failed: mhash_keygen in -lmhash ... no)

Problem solved by Sean Chin in response 1 . And what drives me crazy is that to compile the mcrypt extension, only libmcrypt is enough, there is no need to compile mhash and mcrypt :(


I want to compile mcrypt extension for php (RHEL5.1, Intel i5 650), here is my procedure

# libmcrypt
tar zxf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/home/felix021/lamp/libmcrypt/
make
make install

# mhash
tar jxf mhash-0.9.9.9.tar.bz2
cd mhash-0.9.9.9
./configure --prefix=/home/felix021/lamp/mhash/
make
make install 

# mcrypt
LD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib
./configure --prefix=/home/felix021/lamp/mcrypt/ \
    --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt

configure failure with notification:

checking for mhash_keygen in -lmhash... no
configure: error: "You need at least libmhash 0.8.15 to compile this program. \
http://mhash.sf.net/"

So, I downloaded mhash0.8.18 and mhash0.8.15, but an error occurred.

I looked at "mhash_keygen" in 0.8.15 / 8:

int mhash_keygen(xxx,xxx,xxx)

And this is in 0.9.9.9:

#if defined(PROTOTYPES)
mutils_error mhash_keygen(keygenid algorithm, ....)
#else
mutils_error mhash_keygen();
#endif
//typedef uint32 mutils_error

But, mcrypt-2.6.8 / configure +12114, this is:

char mhash_keygen ();

I changed char to mutils_error in configure, the error still appears.

What can I do more ....?

Thanks for reading my loooooooong question.

+3
source
1

RHEL5 .

config.log, , libmhash .

configure:12093: checking for mhash_keygen in -lmhash
configure:12128: gcc -o conftest -g -O2   conftest.c -lmhash   >&5
/usr/bin/ld: cannot find -lmhash
collect2: ld returned 1 exit status

, Mcrypt <23 > include Mhash CFLAGS <26 > .

# mcrypt
export LD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib
export LDFLAGS="-L/home/felix021/lamp/mhash/lib/ -I/home/felix021/lamp/mhash/include/"
export CFLAGS="-I/home/felix021/lamp/mhash/include/"
./configure --prefix=/home/felix021/lamp/mcrypt/ \
    --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt
+5

All Articles