]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
configure: detect new gperftool
authorKefu Chai <kchai@redhat.com>
Tue, 12 Jan 2016 09:19:42 +0000 (17:19 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 18 Jan 2016 04:31:31 +0000 (12:31 +0800)
this is a follow-up of 6edaf4e, when tcmalloc is enabled,
perfglue/heap_profiler.cc is also compiled, it includes the
google/heap-profiler.h. so to silence the the warnings like
 warning: /usr/include/google/heap-profiler.h:35:2: #warning
 "google/heap-profiler.h is deprecated. Use gperftools/heap-profiler.h
 instead" [-Wcpp]
we also check the new location of these header files if tcmalloc
is enabled.

Signed-off-by: Kefu Chai <kchai@redhat.com>
configure.ac

index b79f6ff3ce7fdf2fd2ff24e72e3261e40891c3cf..57d73e2360103ff54fe9ad35eb92938965faf003 100644 (file)
@@ -454,11 +454,6 @@ AC_ARG_WITH([profiler],
 AS_IF([test "x$with_profiler" = xyes],
            [AC_CHECK_LIB([profiler], [ProfilerFlush], [],
                          [AC_MSG_FAILURE([--with-profiler was given but libprofiler (libgoogle-perftools-dev on debian) not found])])
-             AC_LANG_PUSH([C++])
-             AC_CHECK_HEADERS([gperftools/heap-profiler.h \
-               gperftools/malloc_extension.h \
-               gperftools/profiler.h])
-             AC_LANG_POP([C++])
             ],
            [])
 AM_CONDITIONAL(WITH_PROFILER, test "$with_profiler" = "yes")
@@ -591,6 +586,15 @@ AS_IF([test "x$with_tcmalloc" != xno],
                  [no tcmalloc found (use --without-tcmalloc to disable)])])])
 AM_CONDITIONAL(WITH_TCMALLOC, [test "$HAVE_LIBTCMALLOC" = "1"])
 
+AS_IF([test "$with_profiler" = yes -o \
+            "$HAVE_LIBTCMALLOC" = "1" -o \
+            "$HAVE_LIBTCMALLOC_MINIMAL" = "1"],
+      [AC_LANG_PUSH([C++])
+       AC_CHECK_HEADERS([gperftools/heap-profiler.h \
+                         gperftools/malloc_extension.h \
+                         gperftools/profiler.h])
+       AC_LANG_POP([C++])])
+
 # error out if --with-jemalloc and ! --without-tcmalloc
 if test "x$with_jemalloc" = "xyes"; then
        if test "x$with_tcmalloc" != "xno"; then