+
+AC_LANG_PUSH(C)
+dnl see if we have to include malloc/malloc.h
+AC_MSG_CHECKING([do we need malloc/malloc.h])
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <stdlib.h>]],
+ [[malloc(1)]]
+ ),
+ [ AC_MSG_RESULT([nope, works out of the box]) ],
+ [ AC_LINK_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ #include <malloc/malloc.h>]],
+ [[malloc(1)]]
+ ),
+ [AC_DEFINE(NEED_MALLOC_MALLOC_H)
+ AC_MSG_RESULT([yes we do])],
+ [AC_MSG_ERROR([Can not figure how to compile malloc])]
+ )
+ ]
+)
+AC_LANG_POP(C)
+
+CONFIGURE_PART(Findr 3rd-Party Libraries)
+
+
+AM_CONDITIONAL(BUILD_RRDCGI,[test $enable_rrdcgi != no])
+
+CORE_LIBS="$LIBS"
+
+EX_CHECK_ALL(art_lgpl_2, art_vpath_add_point, libart_lgpl/libart.h, libart-2.0, 2.3.17, ftp://ftp.gnome.org/pub/GNOME/sources/libart_lgpl/2.3/, /usr/include/libart-2.0)
+EX_CHECK_ALL(z, zlibVersion, zlib.h, zlib, 1.2.3, http://www.gzip.org/zlib/, "")
+EX_CHECK_ALL(png, png_access_version_number, png.h, libpng, 1.2.10, http://prdownloads.sourceforge.net/libpng/, "")
+EX_CHECK_ALL(freetype, FT_Init_FreeType, ft2build.h, freetype2, 2.1.10, http://prdownloads.sourceforge.net/freetype/, /usr/include/freetype2)
+
+if test "$EX_CHECK_ALL_ERR" = "YES"; then
+ AC_MSG_ERROR([Please fix the library issues listed above and try again.])
+fi
+
+ALL_LIBS="$LIBS"
+LIBS=
+
+AC_SUBST(CORE_LIBS)
+AC_SUBST(ALL_LIBS)
+
+CONFIGURE_PART(Prep for Building Language Bindings)