Compiling mcrypt on OSX 10.6 (Snow Leopard)

mac-osx

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?

Best Answer

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).

Related Topic