Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to compile mcrypt-2.6.8 on OSX 10.6

./configure --with-prefix=/opt/local/mcrypt
...
configure: error: "You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/"

I have successfully compiled mhash. It's located on /opt/local/mhash. Unfortunately the linker doesn't seem to find the libraries.

I already tried with exporting DYLD_LIBRARY_PATH, LD_LIBRARY_PATH, setting CFLAGS="$CFLAGS -L/opt/local/mhash", copying the lib files to /usr/local/lib, ...

UPDATE: ./configure works now with

export CFLAGS="$CFLAGS -I/opt/local/mhash/include -L/opt/local/mhash/lib"

But now "make" fails with

../config.h:219:1: warning: this is the location of the previous definition
rfc2440.c:26:20: error: malloc.h: No such file or directory
rfc2440.c: In function 'dek_load':
rfc2440.c:562: warning: pointer targets in passing argument 5 of 'mhash_keygen_ext' differ in signedness
rfc2440.c: In function 'dek_create':
rfc2440.c:613: warning: pointer targets in passing argument 5 of 'mhash_keygen_ext' differ in signedness
rfc2440.c: In function 'symkey_enc_decode':
rfc2440.c:631: warning: pointer targets in passing argument 2 of 'header_decode' differ in signedness
rfc2440.c:631: warning: pointer targets in passing argument 3 of 'header_decode' differ in signedness
rfc2440.c:631: warning: pointer targets in passing argument 4 of 'header_decode' differ in signedness
make[2]: *** [rfc2440.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Any idea out there?

share|improve this question

6 Answers 6

I found that I was able to get this working by changing the rfc2440.c source itself. Since my malloc.h file was located in /usr/include/malloc/malloc.h, I changed the line from #include < malloc.h> to #include < malloc/malloc.h> and compiled. There were no compiler errors, and it installed fine with make install afterward (technically, sudo make install).

share|improve this answer

MacPorts does have mcrypt available, and I just confirmed that it compiles fine. I always prefer that or Fink to doing it myself because it's as simple as port install mcrypt (when things are working).

share|improve this answer

Often the configure script looks for headers rather than libraries, and libraries are generally located in the $PREFIX/lib directory. Try something like CFLAGS="-I/opt/local/mhash/include -L/opt/local/mhash/lib" ./configure --with-prefix=/opt/local/mcrypt && make

share|improve this answer

Ok, I finally didn't need mcrypt but only libmcrypt. Worked with that.

share|improve this answer

If your make fails with this line:

rfc2440.c:26:20: error: malloc.h: No such file or directory

Then:

touch malloc.h;

In your build directory before running configure, make.

share|improve this answer

I had the same issue with mcrypt. Later on I installed mcrypt using brew (package manager for OS X). Made everything simpler and easier.

share|improve this answer
    
Maybe you could elaborate on how it made things easier? Just a thought. –  slm Aug 7 '13 at 23:04
    
Well, because brew does everything automatically. Configuration, Make and Install. Even if a required package is missing brew will install the missing package. After the installation you just have to add mcrypt extension to php.ini. So basically you have only 2 steps. Step 1: brew install mcrypt-php54 Step 2: add mcrypt extension to php.ini –  Dozz Aug 8 '13 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.