In http://www.open-mpi.org/community/lists/devel/2014/01/13619.php,
Paul Hargrove found a compiler warning on OpenBSD where <malloc.h>
exists, but is not intended to be used (and doesn't error out, so
AC_CHECK_HEADERS says its ok).
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
+/* <malloc.h> is only needed if we don't have posix_memalign() */
+#if defined(hwloc_getpagesize) && !defined(HAVE_POSIX_MEMALIGN) && defined(HAVE_MEMALIGN) && defined(HAVE_MALLOC_H)
+#include <malloc.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>