As per other programs, freetype too includes malloc.h file. This makes it incompatible with FreeBSD (where this files throws an #error). The include is useless, as stdlib.h is the real provider of malloc() and company, also on Linux, OSX and other *BSD (iirc just Dos/Windows uses malloc.h right now). The attached patch allows to compile it on Gentoo/FreeBSD. Thanks, Diego
Created attachment 67056 [details, diff] freetype-1.3.1-malloc.patch
looks fine, added the patch to 1.3.1-r5