When compiling mcrypt under Mac, I always get an error.
First hint
Rm:conftest.dSYM:is a Directory
Checking if gcc supports-fno-rtti-fno-exceptions ... yes
Checking for GCC option to produce PIC ...-fno-common-dpic
Checking if gcc PIC flag-fno-common-dpic works ... yes
Checking if gcc static flag-static works ... no
Checking if GCC supports-c-o file.o ... yes
Checking if GCC supports-c-o file.o ... (cached) Yes
Checking whether the GCC linker (/APPLICATIONS/XCODE.APP/CONTENTS/DEVELOPER/TOOLCHAINS/XCODEDEFAULT.XCTOOLCHAIN/USR /BIN/LD) supports shared libraries ... yes
Checking dynamic linker characteristics ... darwin15.3.0 DYLD
Checking how to HardCode library paths into programs ... immediate
Checking whether stripping libraries is possible ... yes
Checking if Libtool supports shared libraries ... yes
Checking whether to build shared libraries ... yes
Checking whether to build static libraries ... yes
Checking for GCC ... (cached) GCC
Checking whether we are using the GNU C compiler ... (cached) Yes
Checking whether GCC accepts-g ... (cached) Yes
Checking for GCC option to accept ISO C89 ... (cached) None needed
Checking dependency style of gcc ... (cached) GCC3
Checking for libmcrypt-config .../usr/local/mnmp/libmcrypt//bin/libmcrypt-config
Checking for libmcrypt-version >= 2.5.0 ... Yes
Checking for Mhash_keygen In-lmhash ... no
Configure:error: "Need at least libmhash 0.8.15 to compile".
http://mhash.sf.net/"
It's done by adding environment variables.
Export ld_library_path=/usr/local/mnmp/libmcrypt/lib/:/usr/local/mnmp/mhash/lib/
Export ldflags= "-l/usr/local/mnmp/mhash/lib/-i/usr/local/mnmp/mhash/include"
Export cflags= "-i/usr/local/mnmp/mhash/include/"
Then the hint file cannot be found
Fix it by modifying the source code
#include <malloc.h>
Switch
#include <stdlib.h>
This article is from the "Ogo notes" blog, so be sure to keep this source http://zhixinhu.blog.51cto.com/3132199/1739369
Mac compiler MCrypt error malloc.h not present