Author: zwoop
Date: Wed Sep 7 01:39:09 2011
New Revision: 1165952
URL: http://svn.apache.org/viewvc?rev=1165952&view=rev
Log:
TS-567 Add support for tcmalloc, --with-tcmalloc
Added:
trafficserver/traffic/trunk/build/tcmalloc.m4
Modified:
trafficserver/traffic/trunk/configure.ac
Added: trafficserver/traffic/trunk/build/tcmalloc.m4
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/build/tcmalloc.m4?rev=1165952&view=auto
==============================================================================
--- trafficserver/traffic/trunk/build/tcmalloc.m4 (added)
+++ trafficserver/traffic/trunk/build/tcmalloc.m4 Wed Sep 7 01:39:09 2011
@@ -0,0 +1,51 @@
+dnl -------------------------------------------------------- -*- autoconf -*-
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements. See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License. You may obtain a copy of the License at
+dnl
+dnl http://www.apache.org/licenses/LICENSE-2.0
+dnl
+dnl Unless required by applicable law or agreed to in writing, software
+dnl distributed under the License is distributed on an "AS IS" BASIS,
+dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+dnl See the License for the specific language governing permissions and
+dnl limitations under the License.
+
+dnl
+dnl tcmalloc.m4: Trafficserver's tcmalloc autoconf macros
+dnl
+
+dnl
+dnl TS_CHECK_TCMALLOC: look for tcmalloc libraries
+dnl
+dnl This is kinda fugly, but need a way to both specify a directory and which
+dnl of the many tcmalloc libraries to use ...
+AC_DEFUN([TS_CHECK_TCMALLOC], [
+AC_ARG_WITH([tcmalloc-lib],
+ [AS_HELP_STRING([--with-tcmalloc-lib],[specify the tcmalloc library to use
[default=tcmalloc]])],
+ [
+ with_tcmalloc_lib="$withval"
+ ],[
+ with_tcmalloc_lib="tcmalloc"
+ ]
+)
+
+AC_ARG_WITH(tcmalloc, [AC_HELP_STRING([--with-tcmalloc=DIR], [use the tcmalloc
library])],
+[
+ if test "$withval" != "no"; then
+ tcmalloc_have_libs=0
+ if test "x$withval" != "xyes" && test "x$withval" != "x"; then
+ tcmalloc_ldflags="$withval/lib"
+ TS_ADDTO(LDFLAGS, [-L${tcmalloc_ldflags}])
+ TS_ADDTO(LIBTOOL_LINK_FLAGS, [-rpath ${tcmalloc_ldflags}])
+ fi
+ AC_CHECK_LIB(${with_tcmalloc_lib}, tc_cfree , [tcmalloc_have_lib=1])
+ if test "$tcmalloc_have_lib" != "0"; then
+ TS_ADDTO(LIBS, [-l${with_tcmalloc_lib}])
+ fi
+ fi
+])
+])
Modified: trafficserver/traffic/trunk/configure.ac
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/configure.ac?rev=1165952&r1=1165951&r2=1165952&view=diff
==============================================================================
--- trafficserver/traffic/trunk/configure.ac (original)
+++ trafficserver/traffic/trunk/configure.ac Wed Sep 7 01:39:09 2011
@@ -766,6 +766,10 @@ AC_CHECK_LIB([iconv],[libiconv_open],[AC
AC_CHECK_LIB([ev],[ev_sleep],[AC_SUBST([LIBEV],["-lev"])])
#
+# Check for tcmalloc
+TS_CHECK_TCMALLOC
+
+#
# Check for SSL presence and usability
TS_CHECK_CRYPTO
if test "x${enable_crypto}" != "xyes"; then
@@ -963,7 +967,6 @@ AS_IF([test "x$enable_hwloc" = "xyes"],
)
AC_SUBST(use_hwloc)
-
# -----------------------------------------------------------------------------
# 5. CHECK FOR HEADER FILES