diff options
author | Mike Hommey <mh@glandium.org> | 2014-05-27 23:10:12 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2014-05-27 23:13:21 (GMT) |
commit | affe009e3765384805a23d804152fbf04151b117 (patch) | |
tree | 18211d72aef850562269cd2d65ed3baaf7310fad /configure.ac | |
parent | 22bc570fba00c4dd04cb4962e219d4230f137a4c (diff) | |
download | jemalloc-affe009e3765384805a23d804152fbf04151b117.zip jemalloc-affe009e3765384805a23d804152fbf04151b117.tar.gz jemalloc-affe009e3765384805a23d804152fbf04151b117.tar.bz2 |
Use a configure test to detect the form of malloc_usable_size in malloc.h
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 57015d1..04bb294 100644 --- a/configure.ac +++ b/configure.ac @@ -258,7 +258,6 @@ dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the dnl definitions need to be seen before any headers are included, which is a pain dnl to make happen otherwise. default_munmap="1" -JEMALLOC_USABLE_SIZE_CONST="const" case "${host}" in *-*-darwin*) CFLAGS="$CFLAGS" @@ -286,7 +285,6 @@ case "${host}" in AC_DEFINE([JEMALLOC_HAS_ALLOCA_H]) AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ]) AC_DEFINE([JEMALLOC_THREADED_INIT], [ ]) - JEMALLOC_USABLE_SIZE_CONST="" default_munmap="0" ;; *-*-netbsd*) @@ -351,6 +349,22 @@ case "${host}" in abi="elf" ;; esac + +JEMALLOC_USABLE_SIZE_CONST=const +AC_CHECK_HEADERS([malloc.h], [ + AC_MSG_CHECKING([whether malloc_usable_size definition can use const argument]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [#include <malloc.h> + #include <stddef.h> + size_t malloc_usable_size(const void *ptr); + ], + [])],[ + AC_MSG_RESULT([yes]) + ],[ + JEMALLOC_USABLE_SIZE_CONST= + AC_MSG_RESULT([no]) + ]) +]) AC_DEFINE_UNQUOTED([JEMALLOC_USABLE_SIZE_CONST], [$JEMALLOC_USABLE_SIZE_CONST]) AC_SUBST([abi]) AC_SUBST([RPATH]) |