Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

link against tcmalloc if its available

  • Loading branch information...
commit a8b6dece389b871d7e65d44a32b1837e622d0b27 1 parent a11153a
@falconindy authored
Showing with 25 additions and 1 deletion.
  1. +3 −0  INSTALL
  2. +2 −1  Makefile.am
  3. +20 −0 configure.ac
View
3  INSTALL
@@ -3,3 +3,6 @@ Requirements:
- libarchive
- pcre
- pthreads
+
+Optional:
+ - libtcmalloc
View
3  Makefile.am
@@ -62,7 +62,8 @@ pkgfile_CFLAGS = \
pkgfile_LDADD = \
$(ARCHIVE_LIBS) \
$(CURL_LIBS) \
- $(PCRE_LIBS)
+ $(PCRE_LIBS) \
+ $(TCMALLOC_LIBS)
pkgfile.1: README.pod
$(AM_V_GEN)$(POD2MAN) \
View
20 configure.ac
@@ -35,6 +35,11 @@ AC_ARG_WITH(cachedir,
AC_DEFINE_UNQUOTED([CACHEPATH], "$CACHEPATH", [Path to .files cachedir])
AC_SUBST([CACHEPATH])
+AC_ARG_WITH(tcmalloc,
+ AS_HELP_STRING([--with-tcmalloc=check],
+ [enable use of libtcmalloc]),
+ [wanttcmalloc=$withval], [wanttcmalloc=check])
+
# Enable or disable use of git version in pkgfile version string
AC_MSG_CHECKING(whether to use git version if available)
if test "x$wantgitver" != "xno" ; then
@@ -52,6 +57,20 @@ else
fi
AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
+allocator=libc
+AC_MSG_CHECKING(whether to use tcmalloc)
+if test "x$wanttcmalloc" != "xno" ; then
+ PKG_CHECK_EXISTS([libtcmalloc], [havetcmalloc=yes], [havetcmalloc=no])
+ if test "x$havetcmalloc" = "xyes"; then
+ PKG_CHECK_MODULES(TCMALLOC, [libtcmalloc])
+ allocator=tcmalloc
+ else
+ if test "x$wanttcmalloc" = "xyes"; then
+ AC_MSG_ERROR([*** tcmalloc support requested but library not found])
+ fi
+ fi
+fi
+
CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
-g \
-pipe \
@@ -113,6 +132,7 @@ AC_MSG_RESULT([
cache directory: ${CACHEPATH}
using git version: ${usegitver}
+ allocator: ${allocator}
compiler: ${CC}
cflags: ${with_cflags} ${CFLAGS}
Please sign in to comment.
Something went wrong with that request. Please try again.