Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure: add an option to build with tcmalloc library #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,19 @@ else
BUILD_TSAN=no
fi

# Initialize CFLAGS before usage
BUILD_TCMALLOC=no
AC_ARG_ENABLE([tcmalloc],
AC_HELP_STRING([--enable-tcmalloc],
[Enable linking with tcmalloc library.]))
if test "x$enable_tcmalloc" = "xyes"; then
BUILD_TCMALLOC=yes
GF_CFLAGS="${GF_CFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
AC_CHECK_LIB([tcmalloc], [malloc], [],
[AC_MSG_ERROR([when --enable-tcmalloc is used, tcmalloc library needs to be present])])
GF_LDFLAGS="-ltcmalloc ${GF_LDFLAGS}"
fi


dnl When possible, prefer libtirpc over glibc rpc.
dnl
Expand Down Expand Up @@ -1584,6 +1597,7 @@ echo "IPV6 default : $with_ipv6_default"
echo "Use TIRPC : $with_libtirpc"
echo "With Python : ${PYTHON_VERSION}"
echo "Cloudsync : $BUILD_CLOUDSYNC"
echo "Link with TCMALLOC : $BUILD_TCMALLOC"
echo

if test "x$BUILD_ASAN" = "xyes"; then
Expand Down