Kaydet (Commit) 826a90d6 authored tarafından Rene Engelhard's avatar Rene Engelhard

configure25: #i111045# jemalloc

üst a80e89c5
......@@ -2383,7 +2383,7 @@ Optional Packages:
Usage: --with-build-version="Built by Jim"
--with-alloc Define which allocator to build with
(choices are oo, system, tcmalloc)
(choices are oo, system, tcmalloc, jemalloc)
--with-x use the X Window System
......@@ -10246,6 +10246,59 @@ fi
ALLOC="TCMALLOC";
fi
if test "$with_alloc" = "jemalloc"; then
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -pthread"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -ljemalloc" >&5
$as_echo_n "checking for malloc in -ljemalloc... " >&6; }
if test "${ac_cv_lib_jemalloc_malloc+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ljemalloc $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char malloc ();
int
main ()
{
return malloc ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_jemalloc_malloc=yes
else
ac_cv_lib_jemalloc_malloc=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jemalloc_malloc" >&5
$as_echo "$ac_cv_lib_jemalloc_malloc" >&6; }
if test "x$ac_cv_lib_jemalloc_malloc" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJEMALLOC 1
_ACEOF
LIBS="-ljemalloc $LIBS"
else
as_fn_error "jemalloc not found or functional. Install the jemalloc allocator." "$LINENO" 5
fi
ALLOC="JEMALLOC";
CFLAGS=$save_CFLAGS
fi
if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5
$as_echo "internal" >&6; }
......
......@@ -807,7 +807,7 @@ AC_ARG_WITH(build-version,
],with_build_version=$withval)
AC_ARG_WITH(alloc,
[ --with-alloc Define which allocator to build with
(choices are oo, system, tcmalloc)
(choices are oo, system, tcmalloc, jemalloc)
],,)
AC_ARG_ENABLE(verbose,
[ --enable-verbose Increase build verbosity.
......@@ -2677,6 +2677,14 @@ if test "$with_alloc" = "tcmalloc"; then
[AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
ALLOC="TCMALLOC";
fi
if test "$with_alloc" = "jemalloc"; then
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -pthread"
AC_CHECK_LIB(jemalloc, malloc, [],
[AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
ALLOC="JEMALLOC";
CFLAGS=$save_CFLAGS
fi
if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
AC_MSG_RESULT([internal])
fi
......
......@@ -198,6 +198,14 @@ STDLIBCUIMT+=-ltcmalloc
STDSHLGUIMT+=-ltcmalloc
STDSHLCUIMT+=-ltcmalloc
.ENDIF
.IF "$(ALLOC)" == "JEMALLOC"
STDLIBGUIMT+=-ljemalloc
STDLIBCUIMT+=-ljemalloc
STDSHLGUIMT+=-ljemalloc
STDSHLCUIMT+=-ljemalloc
.ENDIF
.IF "$(HAVE_LD_HASH_STYLE)" == "TRUE"
LINKFLAGS += -Wl,--hash-style=both
.ELSE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment