2007-03-22 04:44:18 +00:00
|
|
|
## Process this file with automake to produce Makefile.in
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
# Note: for every library we create, we're explicit about what symbols
|
|
|
|
# we export. In order to avoid complications with C++ mangling, we always
|
|
|
|
# use the regexp for of specifying symbols.
|
|
|
|
|
|
|
|
# Make sure that when we re-make ./configure, we get the macros we need
|
2007-07-18 18:30:50 +00:00
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
2014-12-22 02:49:47 +00:00
|
|
|
AUTOMAKE_OPTIONS = subdir-objects
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2012-02-04 00:07:36 +00:00
|
|
|
# This is so we can #include <gperftools/foo>
|
2007-03-22 03:00:33 +00:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/src
|
2007-08-17 20:56:15 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
if !WITH_STACK_TRACE
|
|
|
|
AM_CPPFLAGS += -DNO_TCMALLOC_SAMPLES
|
|
|
|
endif !WITH_STACK_TRACE
|
|
|
|
|
2007-08-17 20:56:15 +00:00
|
|
|
# This is mostly based on configure options
|
|
|
|
AM_CXXFLAGS =
|
|
|
|
|
2020-04-20 05:21:07 +00:00
|
|
|
# These are good warnings to turn on by default.
|
2007-08-17 20:56:15 +00:00
|
|
|
if GCC
|
2011-03-02 08:10:05 +00:00
|
|
|
AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual \
|
2020-04-20 05:21:07 +00:00
|
|
|
-Wno-sign-compare
|
2008-12-13 01:35:42 +00:00
|
|
|
endif GCC
|
2023-07-02 23:35:46 +00:00
|
|
|
|
2015-10-04 18:15:37 +00:00
|
|
|
if HAVE_SIZED_DEALLOCATION
|
|
|
|
AM_CXXFLAGS += -fsized-deallocation
|
|
|
|
endif HAVE_SIZED_DEALLOCATION
|
2008-12-13 01:35:42 +00:00
|
|
|
|
2024-02-04 18:37:53 +00:00
|
|
|
if ENABLE_W_THREAD_SAFETY
|
|
|
|
AM_CXXFLAGS += -Wthread-safety
|
|
|
|
endif ENABLE_W_THREAD_SAFETY
|
|
|
|
|
2009-04-18 00:02:25 +00:00
|
|
|
# The -no-undefined flag allows libtool to generate shared libraries for
|
2024-01-29 03:01:01 +00:00
|
|
|
# Cygwin and MinGW.
|
|
|
|
AM_LDFLAGS = -no-undefined
|
2009-04-18 00:02:25 +00:00
|
|
|
|
2021-02-06 21:21:12 +00:00
|
|
|
# respect --enable-frame-pointers regardless of architecture
|
|
|
|
if ENABLE_FRAME_POINTERS
|
2023-07-02 23:35:46 +00:00
|
|
|
AM_CXXFLAGS += -fno-omit-frame-pointer -DFORCED_FRAME_POINTERS
|
2023-08-06 18:44:05 +00:00
|
|
|
|
|
|
|
else !ENABLE_FRAME_POINTERS
|
|
|
|
|
|
|
|
if ENABLE_FP_FLAGS
|
|
|
|
AM_CXXFLAGS += -fno-omit-frame-pointer -momit-leaf-frame-pointer
|
|
|
|
endif ENABLE_FP_FLAGS
|
|
|
|
|
|
|
|
endif !ENABLE_FRAME_POINTERS
|
2008-12-13 01:35:42 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
# For windows systems (at least, mingw), we need to tell all our
|
2008-12-13 01:35:42 +00:00
|
|
|
# tests to link in libtcmalloc using -u. This is because libtcmalloc
|
|
|
|
# accomplishes its tasks via patching, leaving no work for the linker
|
|
|
|
# to identify, so the linker will ignore libtcmalloc by default unless
|
|
|
|
# we explicitly create a dependency via -u.
|
|
|
|
TCMALLOC_FLAGS =
|
|
|
|
if MINGW
|
|
|
|
TCMALLOC_FLAGS += -Wl,-u__tcmalloc
|
|
|
|
endif MINGW
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2012-02-04 00:07:36 +00:00
|
|
|
perftoolsincludedir = $(includedir)/gperftools
|
2007-03-22 03:00:33 +00:00
|
|
|
# The .h files you want to install (that is, .h files that people
|
|
|
|
# who install this package can include in their own applications.)
|
|
|
|
# We'll add to this later, on a library-by-library basis
|
2012-02-04 00:07:36 +00:00
|
|
|
perftoolsinclude_HEADERS =
|
2009-06-10 02:04:26 +00:00
|
|
|
# tcmalloc.h is a special case, because it's a .h.in file
|
2012-02-04 00:07:36 +00:00
|
|
|
nodist_perftoolsinclude_HEADERS = src/gperftools/tcmalloc.h
|
|
|
|
noinst_HEADERS = src/gperftools/tcmalloc.h.in
|
|
|
|
|
2023-07-31 19:40:13 +00:00
|
|
|
# This is for HTML and other documentation you want to install. Add
|
|
|
|
# your documentation files (in doc/) in addition to these top-level
|
|
|
|
# boilerplate files. We'll add to this later, on a library-by-library
|
|
|
|
# basis
|
2023-06-27 05:43:44 +00:00
|
|
|
dist_doc_DATA = AUTHORS COPYING INSTALL NEWS README README_windows.txt \
|
2023-07-31 19:40:13 +00:00
|
|
|
ChangeLog.old
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
# The libraries (.so's) you want to install
|
|
|
|
# We'll add to this later, on a library-by-library basis
|
|
|
|
lib_LTLIBRARIES =
|
2007-04-16 20:49:32 +00:00
|
|
|
# This is for 'convenience libraries' -- basically just a container for sources
|
|
|
|
noinst_LTLIBRARIES =
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
# unittests you want to run when people type 'make check'.
|
2007-04-16 20:49:32 +00:00
|
|
|
# Note: tests cannot take any arguments!
|
2007-03-22 03:00:33 +00:00
|
|
|
TESTS =
|
2007-04-16 20:49:32 +00:00
|
|
|
# TESTS_ENVIRONMENT sets environment variables for when you run unittest.
|
|
|
|
# We always get "srcdir" set for free.
|
|
|
|
# We'll add to this later, on a library-by-library basis.
|
2007-03-22 03:00:33 +00:00
|
|
|
TESTS_ENVIRONMENT =
|
2007-07-18 18:30:50 +00:00
|
|
|
# All script tests should be added here
|
2007-03-22 03:00:33 +00:00
|
|
|
noinst_SCRIPTS =
|
2007-04-16 20:49:32 +00:00
|
|
|
# If your test calls another program that, like the test itself, shouldn't
|
|
|
|
# be installed, add it here. (Stuff in TESTS is automatically added later).
|
|
|
|
noinst_PROGRAMS =
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
# Binaries we might build that should be installed
|
|
|
|
bin_PROGRAMS =
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2009-04-18 00:02:25 +00:00
|
|
|
# This is my own var, used for extra libraries I make that I need installed
|
|
|
|
EXTRA_INSTALL =
|
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
|
|
|
|
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_doc_DATA += docs/index.html docs/designstyle.css
|
2007-04-16 20:49:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
### ------- library routines, in src/base
|
|
|
|
|
2007-11-29 23:39:24 +00:00
|
|
|
# This is a 'convenience library' -- it's not actually installed or anything
|
|
|
|
noinst_LTLIBRARIES += liblogging.la
|
|
|
|
liblogging_la_SOURCES = src/base/logging.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/base/generic_writer.cc
|
|
|
|
|
2008-02-13 00:55:09 +00:00
|
|
|
noinst_LTLIBRARIES += libsysinfo.la
|
|
|
|
libsysinfo_la_SOURCES = src/base/sysinfo.cc \
|
2024-01-28 00:05:38 +00:00
|
|
|
src/base/proc_maps_iterator.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/base/dynamic_annotations.cc
|
2009-03-11 20:50:03 +00:00
|
|
|
libsysinfo_la_LIBADD = $(NANOSLEEP_LIBS)
|
2008-02-13 00:55:09 +00:00
|
|
|
|
2009-06-10 02:04:26 +00:00
|
|
|
# For MinGW, we use also have to use libwindows Luckily, we need the
|
|
|
|
# windows.a library in exactly the same place we need spinlock.a
|
|
|
|
# (pretty much everywhere), so we can use the same variable name for
|
|
|
|
# each. We can also optimize the MinGW rule a bit by leaving out
|
2023-06-21 14:39:18 +00:00
|
|
|
# files we know aren't used on windows. libwindows also obsoletes the
|
|
|
|
# need for other files like system_alloc.cc.
|
2007-11-29 23:39:24 +00:00
|
|
|
if MINGW
|
|
|
|
noinst_LTLIBRARIES += libwindows.la
|
2024-02-05 03:00:42 +00:00
|
|
|
libwindows_la_SOURCES = src/windows/port.cc \
|
2013-08-23 20:53:35 +00:00
|
|
|
src/windows/system-alloc.cc \
|
2007-11-29 23:39:24 +00:00
|
|
|
src/windows/ia32_modrm_map.cc \
|
|
|
|
src/windows/ia32_opcode_map.cc \
|
|
|
|
src/windows/mini_disassembler.cc \
|
|
|
|
src/windows/patch_functions.cc \
|
|
|
|
src/windows/preamble_patcher.cc \
|
|
|
|
src/windows/preamble_patcher_with_stub.cc
|
2010-01-14 16:26:05 +00:00
|
|
|
# patch_functions.cc uses Psapi.lib. MSVC has a #pragma for that, but not us.
|
2013-03-11 19:13:13 +00:00
|
|
|
libwindows_la_LIBADD = -lpsapi
|
2009-06-10 02:04:26 +00:00
|
|
|
|
|
|
|
noinst_LTLIBRARIES += libspinlock.la
|
|
|
|
libspinlock_la_SOURCES = src/base/spinlock.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/base/spinlock_internal.cc
|
2023-09-19 06:53:16 +00:00
|
|
|
libspinlock_la_LIBADD = -lsynchronization
|
2009-06-10 02:04:26 +00:00
|
|
|
|
|
|
|
LIBSPINLOCK = libwindows.la libspinlock.la libsysinfo.la liblogging.la
|
2007-11-29 23:39:24 +00:00
|
|
|
|
2008-12-13 01:35:42 +00:00
|
|
|
# We also need to tell mingw that sysinfo.cc needs shlwapi.lib.
|
|
|
|
# (We do this via a #pragma for msvc, but need to do it here for mingw).
|
2009-03-11 20:50:03 +00:00
|
|
|
libsysinfo_la_LIBADD += -lshlwapi
|
2008-12-13 01:35:42 +00:00
|
|
|
|
2009-04-18 00:02:25 +00:00
|
|
|
# patch_functions.cc #includes tcmalloc.cc, so no need to link it in.
|
|
|
|
TCMALLOC_CC =
|
2007-11-29 23:39:24 +00:00
|
|
|
SYSTEM_ALLOC_CC =
|
2008-12-13 01:35:42 +00:00
|
|
|
else !MINGW
|
2007-04-16 20:49:32 +00:00
|
|
|
noinst_LTLIBRARIES += libspinlock.la
|
|
|
|
libspinlock_la_SOURCES = src/base/spinlock.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/base/spinlock_internal.cc
|
2009-03-11 20:50:03 +00:00
|
|
|
libspinlock_la_LIBADD = $(NANOSLEEP_LIBS)
|
2008-02-13 00:55:09 +00:00
|
|
|
# spinlock also needs NumCPUs, from libsysinfo, which in turn needs liblogging
|
|
|
|
LIBSPINLOCK = libspinlock.la libsysinfo.la liblogging.la
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2009-04-18 00:02:25 +00:00
|
|
|
TCMALLOC_CC = src/tcmalloc.cc
|
2007-11-29 23:39:24 +00:00
|
|
|
SYSTEM_ALLOC_CC = src/system-alloc.cc
|
2008-12-13 01:35:42 +00:00
|
|
|
endif !MINGW
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2024-02-05 03:31:07 +00:00
|
|
|
# On MSVC, we need our own versions of addr2line and nm to work with
|
|
|
|
# pprof, plus couple more tests.
|
|
|
|
WINDOWS_EXTRA = src/windows/preamble_patcher_test.cc \
|
|
|
|
src/windows/shortproc.asm \
|
|
|
|
src/windows/auto_testing_hook.h \
|
|
|
|
src/windows/nm-pdb.c \
|
|
|
|
src/windows/addr2line-pdb.c
|
2023-08-24 18:06:25 +00:00
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
### Unittests
|
2023-08-24 18:06:25 +00:00
|
|
|
|
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
TESTS += low_level_alloc_unittest
|
2007-04-16 20:49:32 +00:00
|
|
|
low_level_alloc_unittest_SOURCES = src/base/low_level_alloc.cc \
|
|
|
|
src/malloc_hook.cc \
|
2023-07-21 18:18:12 +00:00
|
|
|
src/mmap_hook.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/low_level_alloc_unittest.cc
|
2009-03-11 20:50:03 +00:00
|
|
|
# By default, MallocHook takes stack traces for use by the heap-checker.
|
|
|
|
# We don't need that functionality here, so we turn it off to reduce deps.
|
|
|
|
low_level_alloc_unittest_CXXFLAGS = -DNO_TCMALLOC_SAMPLES
|
2023-07-14 06:19:21 +00:00
|
|
|
low_level_alloc_unittest_LDADD = $(LIBSPINLOCK)
|
2023-08-24 18:06:25 +00:00
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### ------- stack trace
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
if WITH_STACK_TRACE
|
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### The header files we use. We divide into categories based on directory
|
2024-02-05 03:00:42 +00:00
|
|
|
|
|
|
|
perftoolsinclude_HEADERS += src/gperftools/stacktrace.h
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
### Making the library
|
2008-03-19 23:35:27 +00:00
|
|
|
noinst_LTLIBRARIES += libstacktrace.la
|
2007-03-22 03:00:33 +00:00
|
|
|
libstacktrace_la_SOURCES = src/stacktrace.cc \
|
2011-07-16 01:07:10 +00:00
|
|
|
src/base/elf_mem_image.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/base/vdso_support.cc
|
2007-11-29 23:39:24 +00:00
|
|
|
libstacktrace_la_LIBADD = $(UNWIND_LIBS) $(LIBSPINLOCK)
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2016-02-01 07:17:50 +00:00
|
|
|
noinst_LTLIBRARIES += libfake_stacktrace_scope.la
|
|
|
|
libfake_stacktrace_scope_la_SOURCES = src/fake_stacktrace_scope.cc
|
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### Unittests
|
|
|
|
TESTS += stacktrace_unittest
|
|
|
|
stacktrace_unittest_SOURCES = src/tests/stacktrace_unittest.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
$(libstacktrace_la_SOURCES)
|
2023-10-23 14:14:16 +00:00
|
|
|
stacktrace_unittest_CXXFLAGS = $(AM_CXXFLAGS) -DSTACKTRACE_IS_TESTED
|
|
|
|
stacktrace_unittest_LDADD = $(libstacktrace_la_LIBADD) liblogging.la libfake_stacktrace_scope.la $(STACKTRACE_UNITTEST_LIBS)
|
2023-06-27 20:37:59 +00:00
|
|
|
# nice to have. Allows glibc's backtrace_symbols to work.
|
|
|
|
stacktrace_unittest_LDFLAGS = -export-dynamic
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2023-09-08 23:47:17 +00:00
|
|
|
TESTS += check_address_unittest
|
|
|
|
check_address_unittest_SOURCES = src/tests/check_address_test.cc
|
|
|
|
check_address_unittest_LDADD = liblogging.la $(LIBSPINLOCK)
|
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### Documentation
|
2007-03-22 04:44:18 +00:00
|
|
|
dist_doc_DATA +=
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_STACK_TRACE
|
2007-04-16 20:49:32 +00:00
|
|
|
|
|
|
|
### ------- pprof
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
# If we are not compiling with stacktrace support, pprof is worthless
|
|
|
|
if WITH_STACK_TRACE
|
|
|
|
|
2018-08-26 18:37:59 +00:00
|
|
|
bin_SCRIPTS = pprof-symbolize
|
|
|
|
|
|
|
|
pprof-symbolize : $(top_srcdir)/src/pprof
|
|
|
|
cp -p $(top_srcdir)/src/pprof $@
|
2007-04-16 20:49:32 +00:00
|
|
|
|
|
|
|
### Unittests
|
2007-11-29 23:39:24 +00:00
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
# Let unittests find pprof if they need to run it
|
|
|
|
TESTS_ENVIRONMENT += PPROF_PATH=$(top_srcdir)/src/pprof
|
|
|
|
|
2018-08-26 18:37:59 +00:00
|
|
|
if INSTALL_PPROF
|
|
|
|
bin_SCRIPTS += src/pprof
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_man_MANS = docs/pprof.1
|
|
|
|
dist_doc_DATA += docs/pprof_remote_servers.html
|
2018-08-26 18:37:59 +00:00
|
|
|
endif INSTALL_PPROF
|
|
|
|
|
|
|
|
### Documentation
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_STACK_TRACE
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
### ------- tcmalloc_minimal (thread-caching malloc)
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2024-02-05 03:00:42 +00:00
|
|
|
perftoolsinclude_HEADERS += src/gperftools/malloc_hook.h \
|
|
|
|
src/gperftools/malloc_hook_c.h \
|
|
|
|
src/gperftools/malloc_extension.h \
|
|
|
|
src/gperftools/malloc_extension_c.h \
|
|
|
|
src/gperftools/nallocx.h
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
### Making the library
|
2008-12-13 01:35:42 +00:00
|
|
|
|
|
|
|
noinst_LTLIBRARIES += libtcmalloc_minimal_internal.la
|
|
|
|
libtcmalloc_minimal_internal_la_SOURCES = src/common.cc \
|
|
|
|
src/internal_logging.cc \
|
|
|
|
$(SYSTEM_ALLOC_CC) \
|
|
|
|
src/memfs_malloc.cc \
|
2023-07-03 21:36:47 +00:00
|
|
|
src/safe_strerror.cc \
|
2008-12-13 01:35:42 +00:00
|
|
|
src/central_freelist.cc \
|
|
|
|
src/page_heap.cc \
|
2009-03-11 20:50:03 +00:00
|
|
|
src/sampler.cc \
|
2008-12-13 01:35:42 +00:00
|
|
|
src/span.cc \
|
2009-03-11 20:50:03 +00:00
|
|
|
src/stack_trace_table.cc \
|
2008-12-13 01:35:42 +00:00
|
|
|
src/static_vars.cc \
|
2009-09-11 18:42:32 +00:00
|
|
|
src/symbolize.cc \
|
2008-12-13 01:35:42 +00:00
|
|
|
src/thread_cache.cc \
|
2024-02-01 03:10:21 +00:00
|
|
|
src/thread_cache_ptr.cc \
|
2008-12-13 01:35:42 +00:00
|
|
|
src/malloc_hook.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/malloc_extension.cc
|
2008-12-13 01:35:42 +00:00
|
|
|
# We #define NO_TCMALLOC_SAMPLES, since sampling is turned off for _minimal.
|
|
|
|
libtcmalloc_minimal_internal_la_CXXFLAGS = -DNO_TCMALLOC_SAMPLES \
|
2009-09-11 18:42:32 +00:00
|
|
|
-DNO_HEAP_CHECK \
|
2015-09-12 23:20:53 +00:00
|
|
|
-DNDEBUG \
|
2017-02-13 01:12:44 +00:00
|
|
|
$(AM_CXXFLAGS)
|
2015-09-12 23:20:53 +00:00
|
|
|
libtcmalloc_minimal_internal_la_LDFLAGS = $(AM_LDFLAGS)
|
2023-07-14 06:19:21 +00:00
|
|
|
libtcmalloc_minimal_internal_la_LIBADD = $(LIBSPINLOCK)
|
2008-12-13 01:35:42 +00:00
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
lib_LTLIBRARIES += libtcmalloc_minimal.la
|
2024-02-05 03:00:42 +00:00
|
|
|
libtcmalloc_minimal_la_SOURCES = $(TCMALLOC_CC)
|
2008-06-14 02:30:53 +00:00
|
|
|
libtcmalloc_minimal_la_CXXFLAGS = -DNO_TCMALLOC_SAMPLES \
|
|
|
|
$(PTHREAD_CFLAGS) -DNDEBUG $(AM_CXXFLAGS)
|
2010-11-18 01:07:25 +00:00
|
|
|
# -version-info gets passed to libtool
|
2015-09-12 23:20:53 +00:00
|
|
|
libtcmalloc_minimal_la_LDFLAGS = -version-info @TCMALLOC_SO_VERSION@ $(AM_LDFLAGS)
|
|
|
|
libtcmalloc_minimal_la_LIBADD = libtcmalloc_minimal_internal.la
|
2008-03-19 23:35:27 +00:00
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### Unittests
|
2007-03-22 04:55:49 +00:00
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
TESTS += tcmalloc_minimal_unittest
|
|
|
|
tcmalloc_minimal_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/testutil.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_minimal_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
tcmalloc_minimal_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2010-06-21 15:59:56 +00:00
|
|
|
# We want libtcmalloc last on the link line, but due to a bug in
|
|
|
|
# libtool involving convenience libs, they need to come last on the
|
|
|
|
# link line in order to get dependency ordering right. This is ok:
|
|
|
|
# convenience libraries are .a's, so tcmalloc is still the last .so.
|
|
|
|
# We also put pthreads after tcmalloc, because some pthread
|
|
|
|
# implementations define their own malloc, and we need to go on the
|
|
|
|
# first linkline to make sure our malloc 'wins'.
|
2023-07-27 23:23:15 +00:00
|
|
|
tcmalloc_minimal_unittest_LDADD = libtcmalloc_minimal.la \
|
2007-04-16 20:49:32 +00:00
|
|
|
liblogging.la $(PTHREAD_LIBS)
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2017-02-13 01:54:59 +00:00
|
|
|
# lets make sure we exerice ASSERTs in at least in statically linked
|
|
|
|
# configuration
|
|
|
|
TESTS += tcm_min_asserts_unittest
|
|
|
|
tcm_min_asserts_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/testutil.cc \
|
2017-02-13 01:54:59 +00:00
|
|
|
$(libtcmalloc_minimal_internal_la_SOURCES) \
|
2024-02-05 03:00:42 +00:00
|
|
|
$(libtcmalloc_minimal_la_SOURCES)
|
2017-02-13 01:54:59 +00:00
|
|
|
tcm_min_asserts_unittest_CXXFLAGS = -DNO_TCMALLOC_SAMPLES -DNO_HEAP_CHECK \
|
2020-04-20 05:21:07 +00:00
|
|
|
$(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2017-02-13 01:54:59 +00:00
|
|
|
tcm_min_asserts_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-14 06:19:21 +00:00
|
|
|
tcm_min_asserts_unittest_LDADD = $(LIBSPINLOCK) \
|
2017-02-13 01:54:59 +00:00
|
|
|
liblogging.la $(PTHREAD_LIBS)
|
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
TESTS += tcmalloc_minimal_large_unittest
|
|
|
|
tcmalloc_minimal_large_unittest_SOURCES = src/tests/tcmalloc_large_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_minimal_large_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
tcmalloc_minimal_large_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
tcmalloc_minimal_large_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2013-05-06 19:50:59 +00:00
|
|
|
TESTS += tcmalloc_minimal_large_heap_fragmentation_unittest
|
|
|
|
tcmalloc_minimal_large_heap_fragmentation_unittest_SOURCES = src/tests/large_heap_fragmentation_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_minimal_large_heap_fragmentation_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2013-05-06 19:50:59 +00:00
|
|
|
tcmalloc_minimal_large_heap_fragmentation_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
tcmalloc_minimal_large_heap_fragmentation_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2013-05-06 19:50:59 +00:00
|
|
|
|
2007-11-29 23:39:24 +00:00
|
|
|
# These all tests components of tcmalloc_minimal
|
|
|
|
|
|
|
|
TESTS += addressmap_unittest
|
2024-02-05 03:00:42 +00:00
|
|
|
addressmap_unittest_SOURCES = src/tests/addressmap_unittest.cc
|
2009-10-27 17:30:52 +00:00
|
|
|
if MINGW
|
|
|
|
addressmap_unittest_SOURCES += src/windows/port.h src/windows/port.cc
|
|
|
|
endif MINGW
|
2007-11-29 23:39:24 +00:00
|
|
|
addressmap_unittest_CXXFLAGS = -g $(AM_CXXFLAGS)
|
|
|
|
addressmap_unittest_LDADD = liblogging.la
|
|
|
|
|
|
|
|
if !MINGW
|
2007-07-18 18:30:50 +00:00
|
|
|
TESTS += system_alloc_unittest
|
|
|
|
system_alloc_unittest_SOURCES = src/config_for_unittests.h \
|
|
|
|
src/tests/system-alloc_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
system_alloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
system_alloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
system_alloc_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2007-07-18 18:30:50 +00:00
|
|
|
|
2023-08-09 17:18:59 +00:00
|
|
|
# Note, we skip this test on mingw (and windows in general). It uses
|
|
|
|
# unsetenv, which is not available on win32.
|
2023-07-14 00:43:29 +00:00
|
|
|
TESTS += unique_path_unittest
|
2023-08-09 17:18:59 +00:00
|
|
|
unique_path_unittest_SOURCES = src/tests/unique_path_unittest.cc
|
2023-07-14 00:43:29 +00:00
|
|
|
unique_path_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2023-08-09 17:18:59 +00:00
|
|
|
unique_path_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
|
|
|
|
unique_path_unittest_LDADD = libsysinfo.la liblogging.la $(PTHREAD_LIBS)
|
|
|
|
endif !MINGW
|
2023-07-14 00:43:29 +00:00
|
|
|
|
2007-07-18 18:30:50 +00:00
|
|
|
TESTS += packed_cache_test
|
2009-09-11 18:42:32 +00:00
|
|
|
packed_cache_test_SOURCES = src/tests/packed-cache_test.cc
|
|
|
|
packed_cache_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
packed_cache_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
packed_cache_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2007-07-18 18:30:50 +00:00
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
TESTS += frag_unittest
|
2007-07-18 18:30:50 +00:00
|
|
|
frag_unittest_SOURCES = src/tests/frag_unittest.cc src/config_for_unittests.h
|
2020-04-20 05:21:07 +00:00
|
|
|
frag_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
frag_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
frag_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2007-04-16 20:49:32 +00:00
|
|
|
|
|
|
|
TESTS += markidle_unittest
|
|
|
|
markidle_unittest_SOURCES = src/tests/markidle_unittest.cc \
|
2007-07-18 18:30:50 +00:00
|
|
|
src/config_for_unittests.h \
|
2007-04-16 20:49:32 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
markidle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
markidle_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
markidle_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2011-03-21 21:41:55 +00:00
|
|
|
TESTS += current_allocated_bytes_test
|
|
|
|
current_allocated_bytes_test_SOURCES = src/tests/current_allocated_bytes_test.cc \
|
|
|
|
src/config_for_unittests.h
|
|
|
|
current_allocated_bytes_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
current_allocated_bytes_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
current_allocated_bytes_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2011-03-21 21:41:55 +00:00
|
|
|
|
2011-05-19 21:37:12 +00:00
|
|
|
TESTS += malloc_hook_test
|
|
|
|
malloc_hook_test_SOURCES = src/tests/malloc_hook_test.cc \
|
|
|
|
src/config_for_unittests.h \
|
|
|
|
src/base/logging.h \
|
2012-02-04 00:07:36 +00:00
|
|
|
src/gperftools/malloc_hook.h \
|
2011-05-19 21:37:12 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
|
|
|
malloc_hook_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
malloc_hook_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
malloc_hook_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2011-05-19 21:37:12 +00:00
|
|
|
|
2023-08-24 18:06:25 +00:00
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
2023-07-21 18:18:12 +00:00
|
|
|
if !MINGW
|
|
|
|
TESTS += mmap_hook_test
|
|
|
|
mmap_hook_test_SOURCES = src/tests/mmap_hook_test.cc \
|
|
|
|
src/mmap_hook.cc
|
|
|
|
mmap_hook_test_LDADD = $(LIBSPINLOCK)
|
|
|
|
endif !MINGW
|
2023-08-24 18:06:25 +00:00
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
2023-07-21 18:18:12 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += malloc_extension_test
|
|
|
|
malloc_extension_test_SOURCES = src/tests/malloc_extension_test.cc \
|
|
|
|
src/config_for_unittests.h \
|
|
|
|
src/base/logging.h \
|
2012-02-04 00:07:36 +00:00
|
|
|
src/gperftools/malloc_extension.h \
|
|
|
|
src/gperftools/malloc_extension_c.h
|
2009-03-11 20:50:03 +00:00
|
|
|
malloc_extension_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
malloc_extension_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
malloc_extension_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
|
2014-12-22 03:52:34 +00:00
|
|
|
# This doesn't work with mingw, which links foo.a even though it
|
|
|
|
# doesn't set ENABLE_STATIC. TODO(csilvers): set enable_static=true
|
|
|
|
# in configure.ac:36?
|
2010-01-14 16:26:05 +00:00
|
|
|
if !MINGW
|
2009-10-27 17:30:52 +00:00
|
|
|
TESTS += malloc_extension_c_test
|
2023-06-26 18:28:02 +00:00
|
|
|
malloc_extension_c_test_SOURCES = src/tests/malloc_extension_c_test.cc \
|
2012-02-04 00:07:36 +00:00
|
|
|
src/gperftools/malloc_extension.h \
|
|
|
|
src/gperftools/malloc_extension_c.h
|
2009-10-27 17:30:52 +00:00
|
|
|
malloc_extension_c_test_CFLAGS = $(PTHREAD_CFLAGS) $(AM_CFLAGS)
|
|
|
|
malloc_extension_c_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-09 20:11:51 +00:00
|
|
|
malloc_extension_c_test_LDADD = libtcmalloc_minimal.la
|
2010-01-14 16:26:05 +00:00
|
|
|
endif !MINGW
|
2009-10-27 17:30:52 +00:00
|
|
|
|
2008-12-13 01:35:42 +00:00
|
|
|
if !MINGW
|
2011-07-16 01:07:10 +00:00
|
|
|
if !OSX
|
2007-04-16 20:49:32 +00:00
|
|
|
TESTS += memalign_unittest
|
2007-07-18 18:30:50 +00:00
|
|
|
memalign_unittest_SOURCES = src/tests/memalign_unittest.cc \
|
2024-01-27 11:28:45 +00:00
|
|
|
src/tcmalloc_internal.h \
|
2009-06-10 02:04:26 +00:00
|
|
|
src/config_for_unittests.h \
|
2008-06-14 02:30:53 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
memalign_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
memalign_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
memalign_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2011-07-16 01:07:10 +00:00
|
|
|
endif !OSX
|
2008-12-13 01:35:42 +00:00
|
|
|
endif !MINGW
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2009-11-10 16:24:57 +00:00
|
|
|
TESTS += page_heap_test
|
|
|
|
page_heap_test_SOURCES = src/tests/page_heap_test.cc \
|
|
|
|
src/config_for_unittests.h \
|
|
|
|
src/base/logging.h \
|
|
|
|
src/common.h \
|
|
|
|
src/page_heap.h
|
|
|
|
page_heap_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
page_heap_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
page_heap_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2009-11-10 16:24:57 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += pagemap_unittest
|
|
|
|
pagemap_unittest_SOURCES = src/tests/pagemap_unittest.cc \
|
|
|
|
src/config_for_unittests.h \
|
|
|
|
src/base/logging.h \
|
|
|
|
src/pagemap.h
|
2020-04-20 05:21:07 +00:00
|
|
|
pagemap_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2009-03-11 20:50:03 +00:00
|
|
|
pagemap_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
pagemap_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
|
2023-07-03 21:36:47 +00:00
|
|
|
TESTS += safe_strerror_test
|
|
|
|
safe_strerror_test_SOURCES = src/tests/safe_strerror_test.cc \
|
|
|
|
src/safe_strerror.cc
|
|
|
|
safe_strerror_test_LDADD = liblogging.la
|
|
|
|
|
2024-01-23 21:53:17 +00:00
|
|
|
TESTS += generic_writer_test
|
|
|
|
generic_writer_test_SOURCES = src/tests/generic_writer_test.cc
|
|
|
|
generic_writer_test_LDADD = liblogging.la
|
|
|
|
|
2024-01-28 00:05:38 +00:00
|
|
|
TESTS += proc_maps_iterator_test
|
|
|
|
proc_maps_iterator_test_SOURCES = src/tests/proc_maps_iterator_test.cc
|
|
|
|
proc_maps_iterator_test_LDADD = libsysinfo.la liblogging.la
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += realloc_unittest
|
|
|
|
realloc_unittest_SOURCES = src/tests/realloc_unittest.cc \
|
|
|
|
src/config_for_unittests.h \
|
|
|
|
src/base/logging.h
|
2020-04-20 05:21:07 +00:00
|
|
|
realloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2009-03-11 20:50:03 +00:00
|
|
|
realloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
realloc_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
|
|
|
|
TESTS += stack_trace_table_test
|
|
|
|
stack_trace_table_test_SOURCES = src/tests/stack_trace_table_test.cc \
|
|
|
|
src/config_for_unittests.h
|
|
|
|
stack_trace_table_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
stack_trace_table_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
stack_trace_table_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
TESTS += thread_dealloc_unittest
|
|
|
|
thread_dealloc_unittest_SOURCES = src/tests/thread_dealloc_unittest.cc \
|
2007-07-18 18:30:50 +00:00
|
|
|
src/config_for_unittests.h \
|
2007-04-16 20:49:32 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
thread_dealloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
thread_dealloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2023-07-27 23:23:15 +00:00
|
|
|
thread_dealloc_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### Documentation
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_doc_DATA += docs/tcmalloc.html \
|
|
|
|
docs/overview.gif \
|
|
|
|
docs/pageheap.gif \
|
|
|
|
docs/spanmap.gif \
|
|
|
|
docs/threadheap.gif \
|
|
|
|
docs/t-test1.times.txt \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.1024.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.128.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.131072.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.16384.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.2048.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.256.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.32768.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.4096.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.512.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.64.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.65536.bytes.png \
|
|
|
|
docs/tcmalloc-opspercpusec.vs.threads.8192.bytes.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.1.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.12.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.16.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.2.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.20.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.3.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.4.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.5.threads.png \
|
|
|
|
docs/tcmalloc-opspersec.vs.size.8.threads.png
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
# I don't know how to say "distribute the .dot files but don't install them";
|
|
|
|
# noinst doesn't seem to work with data. I separate them out anyway, in case
|
|
|
|
# one day we figure it out. Regardless, installing the dot files isn't the
|
|
|
|
# end of the world.
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_doc_DATA += docs/overview.dot \
|
|
|
|
docs/pageheap.dot \
|
|
|
|
docs/spanmap.dot \
|
|
|
|
docs/threadheap.dot
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2009-09-11 18:42:32 +00:00
|
|
|
|
|
|
|
### ------- tcmalloc_minimal_debug (thread-caching malloc with debugallocation)
|
|
|
|
|
|
|
|
if WITH_DEBUGALLOC
|
|
|
|
|
|
|
|
lib_LTLIBRARIES += libtcmalloc_minimal_debug.la
|
2024-02-05 03:00:42 +00:00
|
|
|
libtcmalloc_minimal_debug_la_SOURCES = src/debugallocation.cc
|
2009-09-11 18:42:32 +00:00
|
|
|
libtcmalloc_minimal_debug_la_CXXFLAGS = $(libtcmalloc_minimal_la_CXXFLAGS) \
|
|
|
|
-DTCMALLOC_FOR_DEBUGALLOCATION
|
2010-11-18 01:07:25 +00:00
|
|
|
# version_info gets passed to libtool
|
|
|
|
libtcmalloc_minimal_debug_la_LDFLAGS = $(libtcmalloc_minimal_la_LDFLAGS) \
|
|
|
|
-version-info @TCMALLOC_SO_VERSION@
|
2009-09-11 18:42:32 +00:00
|
|
|
libtcmalloc_minimal_debug_la_LIBADD = $(libtcmalloc_minimal_la_LIBADD)
|
|
|
|
|
|
|
|
### Unittests
|
|
|
|
|
|
|
|
TESTS += tcmalloc_minimal_debug_unittest
|
|
|
|
tcmalloc_minimal_debug_unittest_SOURCES = $(tcmalloc_minimal_unittest_SOURCES)
|
|
|
|
tcmalloc_minimal_debug_unittest_CXXFLAGS = $(tcmalloc_minimal_unittest_CXXFLAGS) \
|
|
|
|
-DDEBUGALLOCATION
|
|
|
|
tcmalloc_minimal_debug_unittest_LDFLAGS = $(tcmalloc_minimal_unittest_LDFLAGS)
|
|
|
|
tcmalloc_minimal_debug_unittest_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
|
|
|
|
|
|
|
|
TESTS += malloc_extension_debug_test
|
|
|
|
malloc_extension_debug_test_SOURCES = $(malloc_extension_test_SOURCES)
|
|
|
|
malloc_extension_debug_test_CXXFLAGS = $(malloc_extension_test_CXXFLAGS)
|
|
|
|
malloc_extension_debug_test_LDFLAGS = $(malloc_extension_test_LDFLAGS)
|
|
|
|
malloc_extension_debug_test_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
|
|
|
|
|
2011-07-16 01:07:10 +00:00
|
|
|
if !MINGW
|
|
|
|
if !OSX
|
2009-09-11 18:42:32 +00:00
|
|
|
TESTS += memalign_debug_unittest
|
|
|
|
memalign_debug_unittest_SOURCES = $(memalign_unittest_SOURCES)
|
|
|
|
memalign_debug_unittest_CXXFLAGS = $(memalign_unittest_CXXFLAGS)
|
|
|
|
memalign_debug_unittest_LDFLAGS = $(memalign_unittest_LDFLAGS)
|
|
|
|
memalign_debug_unittest_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
|
2011-07-16 01:07:10 +00:00
|
|
|
endif !OSX
|
|
|
|
endif !MINGW
|
2009-09-11 18:42:32 +00:00
|
|
|
|
|
|
|
TESTS += realloc_debug_unittest
|
|
|
|
realloc_debug_unittest_SOURCES = $(realloc_unittest_SOURCES)
|
|
|
|
realloc_debug_unittest_CXXFLAGS = $(realloc_unittest_CXXFLAGS)
|
|
|
|
realloc_debug_unittest_LDFLAGS = $(realloc_unittest_LDFLAGS)
|
|
|
|
realloc_debug_unittest_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
|
|
|
|
|
2011-03-02 08:10:05 +00:00
|
|
|
# debugallocation_test checks that we print a proper stacktrace when
|
|
|
|
# debug-allocs fail, so we can't run it if we don't have stacktrace info.
|
|
|
|
if WITH_STACK_TRACE
|
2009-09-11 18:42:32 +00:00
|
|
|
TESTS += debugallocation_test.sh$(EXEEXT)
|
|
|
|
debugallocation_test_sh_SOURCES = src/tests/debugallocation_test.sh
|
|
|
|
noinst_SCRIPTS += $(debugallocation_test_sh_SOURCES)
|
|
|
|
debugallocation_test.sh$(EXEEXT): $(top_srcdir)/$(debugallocation_test_sh_SOURCES) \
|
|
|
|
debugallocation_test
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(debugallocation_test_sh_SOURCES) $@
|
|
|
|
|
|
|
|
# This is the sub-program used by debugallocation_test.sh
|
|
|
|
noinst_PROGRAMS += debugallocation_test
|
|
|
|
debugallocation_test_SOURCES = src/tests/debugallocation_test.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
debugallocation_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2009-09-11 18:42:32 +00:00
|
|
|
debugallocation_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2011-02-05 00:19:37 +00:00
|
|
|
debugallocation_test_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
|
2011-03-02 08:10:05 +00:00
|
|
|
endif WITH_STACK_TRACE
|
2009-09-11 18:42:32 +00:00
|
|
|
|
|
|
|
endif WITH_DEBUGALLOC
|
|
|
|
|
2015-10-11 03:31:50 +00:00
|
|
|
if !MINGW
|
|
|
|
noinst_LTLIBRARIES += librun_benchmark.la
|
|
|
|
librun_benchmark_la_SOURCES = \
|
2023-06-26 18:28:02 +00:00
|
|
|
benchmark/run_benchmark.cc benchmark/run_benchmark.h
|
2015-10-11 03:31:50 +00:00
|
|
|
|
2015-10-24 05:09:25 +00:00
|
|
|
noinst_PROGRAMS += malloc_bench malloc_bench_shared \
|
|
|
|
binary_trees binary_trees_shared
|
2015-05-03 19:55:47 +00:00
|
|
|
|
|
|
|
malloc_bench_SOURCES = benchmark/malloc_bench.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
malloc_bench_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2018-04-22 17:17:12 +00:00
|
|
|
malloc_bench_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
if ENABLE_STATIC
|
|
|
|
malloc_bench_LDFLAGS += -static
|
|
|
|
endif ENABLE_STATIC
|
2015-10-11 03:31:50 +00:00
|
|
|
malloc_bench_LDADD = librun_benchmark.la libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2015-05-03 19:55:47 +00:00
|
|
|
|
|
|
|
malloc_bench_shared_SOURCES = benchmark/malloc_bench.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
malloc_bench_shared_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2015-05-03 19:55:47 +00:00
|
|
|
malloc_bench_shared_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2015-10-11 03:31:50 +00:00
|
|
|
malloc_bench_shared_LDADD = librun_benchmark.la libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2015-10-24 05:09:25 +00:00
|
|
|
|
2017-02-20 22:25:18 +00:00
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
|
|
|
noinst_PROGRAMS += malloc_bench_shared_full
|
2016-02-01 06:42:20 +00:00
|
|
|
malloc_bench_shared_full_SOURCES = benchmark/malloc_bench.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
malloc_bench_shared_full_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2016-02-01 06:42:20 +00:00
|
|
|
malloc_bench_shared_full_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
malloc_bench_shared_full_LDADD = librun_benchmark.la libtcmalloc.la $(PTHREAD_LIBS)
|
|
|
|
|
2023-07-02 23:31:27 +00:00
|
|
|
noinst_PROGRAMS += unwind_bench
|
|
|
|
unwind_bench_SOURCES = benchmark/unwind_bench.cc
|
|
|
|
unwind_bench_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS) $(NO_BUILTIN_CXXFLAGS)
|
|
|
|
unwind_bench_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
unwind_bench_LDADD = librun_benchmark.la libtcmalloc.la $(PTHREAD_LIBS)
|
|
|
|
|
2017-02-20 22:25:18 +00:00
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
2015-10-24 05:09:25 +00:00
|
|
|
binary_trees_SOURCES = benchmark/binary_trees.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
binary_trees_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2018-04-22 17:17:12 +00:00
|
|
|
binary_trees_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
if ENABLE_STATIC
|
|
|
|
binary_trees_LDFLAGS += -static
|
|
|
|
endif ENABLE_STATIC
|
2015-10-24 05:09:25 +00:00
|
|
|
binary_trees_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
|
|
|
|
|
|
|
binary_trees_shared_SOURCES = benchmark/binary_trees.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
binary_trees_shared_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2015-10-24 05:09:25 +00:00
|
|
|
binary_trees_shared_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
binary_trees_shared_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS)
|
2015-10-11 03:31:50 +00:00
|
|
|
endif !MINGW
|
2009-09-11 18:42:32 +00:00
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
### ------- tcmalloc (thread-caching malloc + heap profiler + heap checker)
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
2007-11-29 23:39:24 +00:00
|
|
|
|
2024-02-05 03:00:42 +00:00
|
|
|
perftoolsinclude_HEADERS += src/gperftools/heap-profiler.h \
|
|
|
|
src/gperftools/heap-checker.h
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2016-02-01 07:17:50 +00:00
|
|
|
if BUILD_EMERGENCY_MALLOC
|
|
|
|
EMERGENCY_MALLOC_CC = src/emergency_malloc.cc src/emergency_malloc_for_stacktrace.cc
|
|
|
|
EMERGENCY_MALLOC_DEFINE = -DENABLE_EMERGENCY_MALLOC
|
|
|
|
else !BUILD_EMERGENCY_MALLOC
|
|
|
|
EMERGENCY_MALLOC_CC = src/fake_stacktrace_scope.cc
|
|
|
|
EMERGENCY_MALLOC_DEFINE =
|
|
|
|
endif !BUILD_EMERGENCY_MALLOC
|
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
### Making the library
|
2009-03-11 20:50:03 +00:00
|
|
|
|
2021-02-28 23:42:00 +00:00
|
|
|
if WITH_HEAP_CHECKER
|
|
|
|
# heap-checker-bcad is last, in hopes its global ctor will run first.
|
|
|
|
# (Note this is added to libtcmalloc.la, not libtcmalloc_internal.la,
|
|
|
|
# but that's ok; the internal/external distinction is only useful for
|
|
|
|
# cygwin, and cygwin doesn't use HEAP_CHECKER anyway.)
|
2023-06-21 14:39:38 +00:00
|
|
|
HEAP_CHECKER_SOURCES = src/base/linuxthreads.cc \
|
2021-02-28 23:42:00 +00:00
|
|
|
src/heap-checker.cc \
|
|
|
|
src/heap-checker-bcad.cc
|
|
|
|
MAYBE_NO_HEAP_CHECK =
|
|
|
|
else !WITH_HEAP_CHECKER
|
|
|
|
HEAP_CHECKER_SOURCES =
|
|
|
|
MAYBE_NO_HEAP_CHECK = -DNO_HEAP_CHECK
|
|
|
|
endif !WITH_HEAP_CHECKER
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
noinst_LTLIBRARIES += libtcmalloc_internal.la
|
|
|
|
libtcmalloc_internal_la_SOURCES = $(libtcmalloc_minimal_internal_la_SOURCES) \
|
|
|
|
src/base/low_level_alloc.cc \
|
|
|
|
src/heap-profile-table.cc \
|
|
|
|
src/heap-profiler.cc \
|
|
|
|
src/raw_printer.cc \
|
2016-02-01 07:17:50 +00:00
|
|
|
$(EMERGENCY_MALLOC_CC) \
|
2023-07-21 18:18:12 +00:00
|
|
|
src/mmap_hook.cc \
|
2009-03-11 20:50:03 +00:00
|
|
|
src/memory_region_map.cc
|
|
|
|
libtcmalloc_internal_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG \
|
2021-02-28 23:42:00 +00:00
|
|
|
$(AM_CXXFLAGS) $(EMERGENCY_MALLOC_DEFINE) \
|
|
|
|
$(MAYBE_NO_HEAP_CHECK)
|
2017-09-23 21:55:20 +00:00
|
|
|
libtcmalloc_internal_la_LDFLAGS = $(PTHREAD_CFLAGS)
|
2010-06-21 15:59:56 +00:00
|
|
|
libtcmalloc_internal_la_LIBADD = libstacktrace.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
lib_LTLIBRARIES += libtcmalloc.la
|
2024-02-05 03:00:42 +00:00
|
|
|
libtcmalloc_la_SOURCES = $(TCMALLOC_CC) \
|
2021-02-28 23:42:00 +00:00
|
|
|
$(HEAP_CHECKER_SOURCES)
|
|
|
|
libtcmalloc_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG $(AM_CXXFLAGS) \
|
|
|
|
$(MAYBE_NO_HEAP_CHECK) $(EMERGENCY_MALLOC_DEFINE)
|
2017-09-23 21:55:20 +00:00
|
|
|
libtcmalloc_la_LDFLAGS = $(PTHREAD_CFLAGS) -version-info @TCMALLOC_SO_VERSION@
|
2023-07-14 06:19:21 +00:00
|
|
|
libtcmalloc_la_LIBADD = libtcmalloc_internal.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
|
2021-02-28 23:42:00 +00:00
|
|
|
# same as above with without -DNDEBUG
|
|
|
|
noinst_LTLIBRARIES += libtcmalloc_internal_with_asserts.la
|
|
|
|
libtcmalloc_internal_with_asserts_la_SOURCES = $(libtcmalloc_internal_la_SOURCES)
|
|
|
|
libtcmalloc_internal_with_asserts_la_CXXFLAGS = $(PTHREAD_CFLAGS) \
|
|
|
|
$(AM_CXXFLAGS) $(EMERGENCY_MALLOC_DEFINE) \
|
|
|
|
$(MAYBE_NO_HEAP_CHECK)
|
|
|
|
libtcmalloc_internal_with_asserts_la_LDFLAGS = $(PTHREAD_CFLAGS)
|
|
|
|
libtcmalloc_internal_with_asserts_la_LIBADD = libstacktrace.la $(PTHREAD_LIBS)
|
|
|
|
|
|
|
|
noinst_LTLIBRARIES += libtcmalloc_with_asserts.la
|
|
|
|
libtcmalloc_with_asserts_la_SOURCES = $(libtcmalloc_la_SOURCES)
|
|
|
|
libtcmalloc_with_asserts_la_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS) \
|
|
|
|
$(MAYBE_NO_HEAP_CHECK) $(EMERGENCY_MALLOC_DEFINE)
|
|
|
|
libtcmalloc_with_asserts_la_LDFLAGS = $(PTHREAD_CFLAGS)
|
2023-07-14 06:19:21 +00:00
|
|
|
libtcmalloc_with_asserts_la_LIBADD = libtcmalloc_internal_with_asserts.la $(PTHREAD_LIBS)
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2008-03-19 23:35:27 +00:00
|
|
|
LIBTCMALLOC = libtcmalloc.la
|
2007-08-17 20:56:15 +00:00
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
### Unittests
|
2007-04-16 20:49:32 +00:00
|
|
|
|
2013-03-10 19:44:43 +00:00
|
|
|
TESTS += tcmalloc_unittest.sh$(EXEEXT)
|
|
|
|
tcmalloc_unittest_sh_SOURCES = src/tests/tcmalloc_unittest.sh
|
|
|
|
noinst_SCRIPTS += $(tcmalloc_unittest_sh_SOURCES)
|
|
|
|
tcmalloc_unittest.sh$(EXEEXT): $(top_srcdir)/$(tcmalloc_unittest_sh_SOURCES) \
|
|
|
|
tcmalloc_unittest
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(tcmalloc_unittest_sh_SOURCES) $@
|
|
|
|
|
|
|
|
noinst_PROGRAMS += tcmalloc_unittest
|
2007-11-29 23:39:24 +00:00
|
|
|
tcmalloc_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
|
2024-01-27 11:28:45 +00:00
|
|
|
src/tcmalloc_internal.h \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
tcmalloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2010-06-21 15:59:56 +00:00
|
|
|
# We want libtcmalloc last on the link line, but due to a bug in
|
|
|
|
# libtool involving convenience libs, they need to come last on the
|
|
|
|
# link line in order to get dependency ordering right. This is ok:
|
|
|
|
# convenience libraries are .a's, so tcmalloc is still the last .so.
|
|
|
|
# We also put pthreads after tcmalloc, because some pthread
|
|
|
|
# implementations define their own malloc, and we need to go on the
|
|
|
|
# first linkline to make sure our malloc 'wins'.
|
2007-11-29 23:39:24 +00:00
|
|
|
tcmalloc_unittest_LDADD = $(LIBTCMALLOC) liblogging.la $(PTHREAD_LIBS)
|
|
|
|
|
2021-02-28 23:42:00 +00:00
|
|
|
TESTS += tcm_asserts_unittest
|
|
|
|
tcm_asserts_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
|
2024-01-27 11:28:45 +00:00
|
|
|
src/tcmalloc_internal.h \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2021-02-28 23:42:00 +00:00
|
|
|
tcm_asserts_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
tcm_asserts_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
tcm_asserts_unittest_LDADD = libtcmalloc_with_asserts.la liblogging.la $(PTHREAD_LIBS)
|
2017-02-13 01:54:59 +00:00
|
|
|
|
2008-06-14 02:30:53 +00:00
|
|
|
# This makes sure it's safe to link in both tcmalloc and
|
|
|
|
# tcmalloc_minimal. (One would never do this on purpose, but perhaps
|
|
|
|
# by accident...) When we can compile libprofiler, we also link it in
|
2011-07-16 01:07:10 +00:00
|
|
|
# to make sure that works too. NOTE: On OS X, it's *not* safe to
|
|
|
|
# link both in (we end up with two copies of every global var, and
|
|
|
|
# the code tends to pick one arbitrarily), so don't run the test there.
|
|
|
|
# (We define these outside the 'if' because they're reused below.)
|
|
|
|
tcmalloc_both_unittest_srcs = src/tests/tcmalloc_unittest.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_both_unittest_cflags = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2011-07-16 01:07:10 +00:00
|
|
|
tcmalloc_both_unittest_lflags = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2009-03-11 20:50:03 +00:00
|
|
|
if WITH_CPU_PROFILER
|
2010-06-21 15:59:56 +00:00
|
|
|
# We want libtcmalloc last on the link line, but due to a bug in
|
|
|
|
# libtool involving convenience libs, they need to come last on the
|
|
|
|
# link line in order to get dependency ordering right. This is ok:
|
|
|
|
# convenience libraries are .a's, so tcmalloc is still the last .so.
|
|
|
|
# We also put pthreads after tcmalloc, because some pthread
|
|
|
|
# implementations define their own malloc, and we need to go on the
|
|
|
|
# first linkline to make sure our malloc 'wins'.
|
2023-07-27 23:23:15 +00:00
|
|
|
tcmalloc_both_unittest_ladd = $(LIBTCMALLOC) libtcmalloc_minimal.la \
|
2011-07-16 01:07:10 +00:00
|
|
|
libprofiler.la liblogging.la $(PTHREAD_LIBS)
|
2008-06-14 02:30:53 +00:00
|
|
|
else
|
2023-07-27 23:23:15 +00:00
|
|
|
tcmalloc_both_unittest_ladd = $(LIBTCMALLOC) libtcmalloc_minimal.la \
|
2011-07-16 01:07:10 +00:00
|
|
|
liblogging.la $(PTHREAD_LIBS)
|
2009-03-11 20:50:03 +00:00
|
|
|
endif !WITH_CPU_PROFILER
|
2011-07-16 01:07:10 +00:00
|
|
|
if !OSX
|
|
|
|
TESTS += tcmalloc_both_unittest
|
|
|
|
tcmalloc_both_unittest_SOURCES = $(tcmalloc_both_unittest_srcs)
|
|
|
|
tcmalloc_both_unittest_CXXFLAGS = $(tcmalloc_both_unittest_cflags)
|
|
|
|
tcmalloc_both_unittest_LDFLAGS = $(tcmalloc_both_unittest_lflags)
|
|
|
|
tcmalloc_both_unittest_LDADD = $(tcmalloc_both_unittest_ladd)
|
|
|
|
endif !OSX
|
2007-11-29 23:39:24 +00:00
|
|
|
|
|
|
|
TESTS += tcmalloc_large_unittest
|
|
|
|
tcmalloc_large_unittest_SOURCES = src/tests/tcmalloc_large_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_large_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
tcmalloc_large_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2007-11-29 23:39:24 +00:00
|
|
|
tcmalloc_large_unittest_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
|
|
|
|
|
2013-05-06 19:50:59 +00:00
|
|
|
TESTS += tcmalloc_large_heap_fragmentation_unittest
|
|
|
|
tcmalloc_large_heap_fragmentation_unittest_SOURCES = src/tests/large_heap_fragmentation_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
tcmalloc_large_heap_fragmentation_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2013-05-06 19:50:59 +00:00
|
|
|
tcmalloc_large_heap_fragmentation_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
tcmalloc_large_heap_fragmentation_unittest_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += raw_printer_test
|
|
|
|
raw_printer_test_SOURCES = src/tests/raw_printer_test.cc
|
|
|
|
raw_printer_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
raw_printer_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
raw_printer_test_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
|
|
|
|
|
2010-06-21 15:59:56 +00:00
|
|
|
# sampler_test and sampling_test both require sampling to be turned
|
|
|
|
# on, which it's not by default. Use the "standard" value of 2^19.
|
|
|
|
TESTS_ENVIRONMENT += TCMALLOC_SAMPLE_PARAMETER=524288
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += sampler_test
|
|
|
|
sampler_test_SOURCES = src/tests/sampler_test.cc \
|
|
|
|
src/config_for_unittests.h
|
|
|
|
sampler_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
sampler_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
sampler_test_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS) -lm
|
|
|
|
|
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
# These unittests often need to run binaries. They're in the current dir
|
|
|
|
TESTS_ENVIRONMENT += BINDIR=.
|
2007-11-29 23:39:24 +00:00
|
|
|
TESTS_ENVIRONMENT += TMPDIR=/tmp/perftools
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += sampling_test.sh$(EXEEXT)
|
2008-12-13 01:35:42 +00:00
|
|
|
sampling_test_sh_SOURCES = src/tests/sampling_test.sh
|
|
|
|
noinst_SCRIPTS += $(sampling_test_sh_SOURCES)
|
|
|
|
sampling_test.sh$(EXEEXT): $(top_srcdir)/$(sampling_test_sh_SOURCES) \
|
|
|
|
sampling_test
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(sampling_test_sh_SOURCES) $@
|
|
|
|
|
2009-09-11 18:42:32 +00:00
|
|
|
# This is the sub-program used by sampling_test.sh
|
2008-12-13 01:35:42 +00:00
|
|
|
# The -g is so pprof can get symbol information.
|
|
|
|
noinst_PROGRAMS += sampling_test
|
2024-02-05 03:00:42 +00:00
|
|
|
sampling_test_SOURCES = src/tests/sampling_test.cc
|
2008-12-13 01:35:42 +00:00
|
|
|
sampling_test_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
sampling_test_LDFLAGS = -g $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
|
|
|
sampling_test_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
|
|
|
if WITH_HEAP_PROFILER
|
2008-12-13 01:35:42 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += heap-profiler_unittest.sh$(EXEEXT)
|
2007-04-16 20:49:32 +00:00
|
|
|
heap_profiler_unittest_sh_SOURCES = src/tests/heap-profiler_unittest.sh
|
|
|
|
noinst_SCRIPTS += $(heap_profiler_unittest_sh_SOURCES)
|
2007-07-18 18:30:50 +00:00
|
|
|
heap-profiler_unittest.sh$(EXEEXT): $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) \
|
|
|
|
heap-profiler_unittest
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) $@
|
2007-03-22 03:28:56 +00:00
|
|
|
|
|
|
|
# These are sub-programs used by heap-profiler_unittest.sh
|
2007-04-16 20:49:32 +00:00
|
|
|
noinst_PROGRAMS += heap-profiler_unittest
|
2024-02-05 03:00:42 +00:00
|
|
|
heap_profiler_unittest_SOURCES = src/tests/heap-profiler_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
heap_profiler_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
heap_profiler_unittest_LDFLAGS = -g $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2007-08-17 20:56:15 +00:00
|
|
|
heap_profiler_unittest_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_HEAP_PROFILER
|
|
|
|
|
|
|
|
if WITH_HEAP_CHECKER
|
|
|
|
|
|
|
|
TESTS += heap-checker-death_unittest.sh$(EXEEXT)
|
2007-04-16 20:49:32 +00:00
|
|
|
heap_checker_death_unittest_sh_SOURCES = src/tests/heap-checker-death_unittest.sh
|
2007-07-18 18:30:50 +00:00
|
|
|
noinst_SCRIPTS += $(top_srcdir)/$(heap_checker_death_unittest_sh_SOURCES)
|
|
|
|
heap-checker-death_unittest.sh$(EXEEXT): $(heap_checker_death_unittest_sh_SOURCES) \
|
|
|
|
heap-checker_unittest
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(heap_checker_death_unittest_sh_SOURCES) $@
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2007-04-16 20:49:32 +00:00
|
|
|
# These are sub-programs used by heap-checker_unittest.sh
|
2023-06-21 14:39:35 +00:00
|
|
|
TESTS += heap-checker_unittest
|
2024-02-05 03:00:42 +00:00
|
|
|
heap_checker_unittest_SOURCES = src/tests/heap-checker_unittest.cc
|
2020-04-20 05:21:07 +00:00
|
|
|
heap_checker_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2008-12-13 01:35:42 +00:00
|
|
|
heap_checker_unittest_LDFLAGS = -g $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
|
2010-06-21 15:59:56 +00:00
|
|
|
# We want libtcmalloc last on the link line, but due to a bug in
|
|
|
|
# libtool involving convenience libs, they need to come last on the
|
|
|
|
# link line in order to get dependency ordering right. This is ok:
|
|
|
|
# convenience libraries are .a's, so tcmalloc is still the last .so.
|
|
|
|
# We also put pthreads after tcmalloc, because some pthread
|
|
|
|
# implementations define their own malloc, and we need to go on the
|
|
|
|
# first linkline to make sure our malloc 'wins'.
|
|
|
|
heap_checker_unittest_LDADD = $(LIBTCMALLOC) liblogging.la $(PTHREAD_LIBS)
|
2007-03-22 03:28:56 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_HEAP_CHECKER
|
|
|
|
|
2007-03-22 03:28:56 +00:00
|
|
|
### Documentation (above and beyond tcmalloc_minimal documentation)
|
2009-03-11 20:50:03 +00:00
|
|
|
if WITH_HEAP_PROFILER
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_doc_DATA += docs/heapprofile.html docs/heap-example1.png
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_HEAP_PROFILER
|
|
|
|
|
|
|
|
if WITH_HEAP_CHECKER
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_doc_DATA += docs/heap_checker.html
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_HEAP_CHECKER
|
2007-03-22 03:28:56 +00:00
|
|
|
|
|
|
|
|
2009-09-11 18:42:32 +00:00
|
|
|
### ------- tcmalloc with debugallocation
|
|
|
|
|
|
|
|
if WITH_DEBUGALLOC
|
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
|
|
|
lib_LTLIBRARIES += libtcmalloc_debug.la
|
2024-02-05 03:00:42 +00:00
|
|
|
libtcmalloc_debug_la_SOURCES = src/debugallocation.cc $(HEAP_CHECKER_SOURCES)
|
2009-09-11 18:42:32 +00:00
|
|
|
libtcmalloc_debug_la_CXXFLAGS = $(libtcmalloc_la_CXXFLAGS) \
|
|
|
|
-DTCMALLOC_FOR_DEBUGALLOCATION
|
2010-11-18 01:07:25 +00:00
|
|
|
libtcmalloc_debug_la_LDFLAGS = $(libtcmalloc_la_LDFLAGS) \
|
|
|
|
-version-info @TCMALLOC_SO_VERSION@
|
2009-09-11 18:42:32 +00:00
|
|
|
libtcmalloc_debug_la_LIBADD = $(libtcmalloc_la_LIBADD)
|
|
|
|
|
|
|
|
### Unittests
|
|
|
|
|
|
|
|
TESTS += tcmalloc_debug_unittest
|
|
|
|
tcmalloc_debug_unittest_SOURCES = $(tcmalloc_unittest_SOURCES)
|
|
|
|
tcmalloc_debug_unittest_CXXFLAGS = $(tcmalloc_unittest_CXXFLAGS) \
|
|
|
|
-DDEBUGALLOCATION
|
|
|
|
tcmalloc_debug_unittest_LDFLAGS = $(tcmalloc_unittest_LDFLAGS)
|
|
|
|
tcmalloc_debug_unittest_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
|
|
|
|
|
|
|
|
TESTS += sampler_debug_test
|
|
|
|
sampler_debug_test_SOURCES = $(sampler_test_SOURCES)
|
|
|
|
sampler_debug_test_CXXFLAGS = $(samples_test_CXXFLAGS)
|
|
|
|
sampler_debug_test_LDFLAGS = $(sampler_test_LDFLAGS)
|
|
|
|
sampler_debug_test_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS) -lm
|
|
|
|
|
|
|
|
TESTS += sampling_debug_test.sh$(EXEEXT)
|
|
|
|
sampling_debug_test_sh_SOURCES = src/tests/sampling_test.sh
|
|
|
|
sampling_debug_test.sh$(EXEEXT): $(top_srcdir)/$(sampling_test_sh_SOURCES) \
|
|
|
|
sampling_debug_test
|
|
|
|
rm -f $@
|
2023-09-10 22:12:45 +00:00
|
|
|
sed -e 's/sampling_test/sampling_debug_test/g' <$(top_srcdir)/$(sampling_test_sh_SOURCES) >$@
|
|
|
|
chmod +x $@
|
2009-09-11 18:42:32 +00:00
|
|
|
|
|
|
|
# This is the sub-program using by sampling_debug_test.sh
|
|
|
|
# The -g is so pprof can get symbol information.
|
|
|
|
noinst_PROGRAMS += sampling_debug_test
|
|
|
|
sampling_debug_test_SOURCES = $(sampling_test_SOURCES)
|
|
|
|
sampling_debug_test_CXXFLAGS = $(sampling_test_CXXFLAGS)
|
|
|
|
sampling_debug_test_LDFLAGS = $(sampling_test_LDFLAGS)
|
|
|
|
sampling_debug_test_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
|
|
|
|
|
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
|
|
|
if WITH_HEAP_PROFILER
|
|
|
|
|
|
|
|
TESTS += heap-profiler_debug_unittest.sh$(EXEEXT)
|
|
|
|
heap_profiler_debug_unittest_sh_SOURCES = src/tests/heap-profiler_unittest.sh
|
|
|
|
heap-profiler_debug_unittest.sh$(EXEEXT): $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) \
|
|
|
|
heap-profiler_debug_unittest
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) $@
|
|
|
|
|
|
|
|
# These are sub-programs used by heap-profiler_debug_unittest.sh
|
|
|
|
noinst_PROGRAMS += heap-profiler_debug_unittest
|
|
|
|
heap_profiler_debug_unittest_SOURCES = $(heap_profiler_unittest_SOURCES)
|
|
|
|
heap_profiler_debug_unittest_CXXFLAGS = $(heap_profiler_unittest_CXXFLAGS)
|
|
|
|
heap_profiler_debug_unittest_LDFLAGS = $(heap_profiler_unittest_LDFLAGS)
|
|
|
|
heap_profiler_debug_unittest_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
|
|
|
|
|
|
|
|
endif WITH_HEAP_PROFILER
|
|
|
|
|
|
|
|
if WITH_HEAP_CHECKER
|
|
|
|
|
2023-06-21 14:39:35 +00:00
|
|
|
TESTS += heap-checker_debug_unittest
|
2009-09-11 18:42:32 +00:00
|
|
|
heap_checker_debug_unittest_SOURCES = $(heap_checker_unittest_SOURCES)
|
|
|
|
heap_checker_debug_unittest_CXXFLAGS = $(heap_checker_unittest_CXXFLAGS)
|
|
|
|
heap_checker_debug_unittest_LDFLAGS = $(heap_checker_unittest_LDFLAGS)
|
2010-06-21 15:59:56 +00:00
|
|
|
# We want libtcmalloc last on the link line, but due to a bug in
|
|
|
|
# libtool involving convenience libs, they need to come last on the
|
|
|
|
# link line in order to get dependency ordering right. This is ok:
|
|
|
|
# convenience libraries are .a's, so tcmalloc is still the last .so.
|
|
|
|
heap_checker_debug_unittest_LDADD = libtcmalloc_debug.la liblogging.la \
|
|
|
|
$(PTHREAD_LIBS)
|
2009-09-11 18:42:32 +00:00
|
|
|
|
|
|
|
endif WITH_HEAP_CHECKER
|
|
|
|
endif WITH_DEBUGALLOC
|
|
|
|
|
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
### ------- CPU profiler
|
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
if WITH_CPU_PROFILER
|
2007-11-29 23:39:24 +00:00
|
|
|
|
2024-02-05 03:00:42 +00:00
|
|
|
perftoolsinclude_HEADERS += src/gperftools/profiler.h
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
### Making the library
|
|
|
|
lib_LTLIBRARIES += libprofiler.la
|
|
|
|
libprofiler_la_SOURCES = src/profiler.cc \
|
2009-04-18 00:02:25 +00:00
|
|
|
src/profile-handler.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/profiledata.cc
|
2023-08-10 02:11:41 +00:00
|
|
|
libprofiler_la_LIBADD = libstacktrace.la libfake_stacktrace_scope.la $(PTHREAD_LIBS)
|
|
|
|
libprofiler_la_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2007-11-29 23:39:24 +00:00
|
|
|
# We have to include ProfileData for profiledata_unittest
|
2020-02-25 08:09:22 +00:00
|
|
|
CPU_PROFILER_SYMBOLS = '(ProfilerStart|ProfilerStartWithOptions|ProfilerStop|ProfilerFlush|ProfilerEnable|ProfilerDisable|ProfilingIsEnabledForAllThreads|ProfilerRegisterThread|ProfilerGetCurrentState|ProfilerState|ProfileData|ProfileHandler|ProfilerGetStackTrace)'
|
2010-11-18 01:07:25 +00:00
|
|
|
libprofiler_la_LDFLAGS = -export-symbols-regex $(CPU_PROFILER_SYMBOLS) \
|
|
|
|
-version-info @PROFILER_SO_VERSION@
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
### Unittests
|
2007-08-17 20:56:15 +00:00
|
|
|
TESTS += getpc_test
|
|
|
|
getpc_test_SOURCES = src/tests/getpc_test.cc src/getpc.h
|
|
|
|
|
2007-11-29 23:39:24 +00:00
|
|
|
TESTS += profiledata_unittest
|
|
|
|
profiledata_unittest_SOURCES = src/tests/profiledata_unittest.cc \
|
|
|
|
src/profiledata.h \
|
|
|
|
src/base/commandlineflags.h \
|
|
|
|
src/base/logging.h \
|
2024-01-25 02:47:06 +00:00
|
|
|
src/base/threading.h \
|
2007-11-29 23:39:24 +00:00
|
|
|
src/base/basictypes.h
|
2023-08-10 02:11:41 +00:00
|
|
|
profiledata_unittest_LDADD = libprofiler.la
|
2007-11-29 23:39:24 +00:00
|
|
|
|
2009-04-18 00:02:25 +00:00
|
|
|
TESTS += profile_handler_unittest
|
|
|
|
profile_handler_unittest_SOURCES = src/tests/profile-handler_unittest.cc \
|
|
|
|
src/profile-handler.h
|
2023-08-10 02:11:41 +00:00
|
|
|
profile_handler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
|
|
|
profile_handler_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
|
|
|
|
profile_handler_unittest_LDADD = libprofiler.la $(PTHREAD_LIBS)
|
2009-04-18 00:02:25 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
TESTS += profiler_unittest.sh$(EXEEXT)
|
2007-04-16 20:49:32 +00:00
|
|
|
profiler_unittest_sh_SOURCES = src/tests/profiler_unittest.sh
|
|
|
|
noinst_SCRIPTS += $(profiler_unittest_sh_SOURCES)
|
2007-07-18 18:30:50 +00:00
|
|
|
profiler_unittest.sh$(EXEEXT): $(top_srcdir)/$(profiler_unittest_sh_SOURCES) \
|
|
|
|
profiler1_unittest profiler2_unittest \
|
|
|
|
profiler3_unittest profiler4_unittest
|
|
|
|
rm -f $@
|
|
|
|
cp -p $(top_srcdir)/$(profiler_unittest_sh_SOURCES) $@
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
# These are sub-programs used by profiler_unittest.sh
|
2007-04-16 20:49:32 +00:00
|
|
|
noinst_PROGRAMS += profiler1_unittest profiler2_unittest profiler3_unittest \
|
|
|
|
profiler4_unittest
|
2007-03-22 03:00:33 +00:00
|
|
|
PROFILER_UNITTEST_SRCS = src/tests/profiler_unittest.cc \
|
2024-02-05 03:00:42 +00:00
|
|
|
src/tests/testutil.h src/tests/testutil.cc
|
2007-03-22 03:00:33 +00:00
|
|
|
profiler1_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
|
2007-08-17 20:56:15 +00:00
|
|
|
profiler1_unittest_CXXFLAGS = -g -DNO_THREADS $(AM_CXXFLAGS)
|
2023-08-10 02:11:41 +00:00
|
|
|
profiler1_unittest_LDADD = libprofiler.la
|
2007-03-22 03:00:33 +00:00
|
|
|
profiler2_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
|
2007-08-17 20:56:15 +00:00
|
|
|
profiler2_unittest_CXXFLAGS = -g -DNO_THREADS $(AM_CXXFLAGS)
|
|
|
|
profiler2_unittest_LDADD = -lstacktrace -lprofiler
|
2007-07-18 18:30:50 +00:00
|
|
|
# We depend on -lprofiler but haven't yet said how to build it. Do so now.
|
2023-08-10 02:11:41 +00:00
|
|
|
profiler2_unittest_DEPENDENCIES = libprofiler.la
|
2007-03-22 03:00:33 +00:00
|
|
|
profiler3_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
|
2007-08-17 20:56:15 +00:00
|
|
|
profiler3_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2007-03-22 03:00:33 +00:00
|
|
|
profiler3_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
|
2023-08-10 02:11:41 +00:00
|
|
|
profiler3_unittest_LDADD = libprofiler.la $(PTHREAD_LIBS)
|
2007-03-22 03:00:33 +00:00
|
|
|
profiler4_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
|
2007-08-17 20:56:15 +00:00
|
|
|
profiler4_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
|
2007-03-22 03:00:33 +00:00
|
|
|
profiler4_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
|
2007-08-17 20:56:15 +00:00
|
|
|
profiler4_unittest_LDADD = -lstacktrace -lprofiler $(PTHREAD_LIBS)
|
2007-07-18 18:30:50 +00:00
|
|
|
# We depend on -lprofiler but haven't yet said how to build it. Do so now.
|
2023-08-10 02:11:41 +00:00
|
|
|
profiler4_unittest_DEPENDENCIES = libprofiler.la
|
2007-07-18 18:30:50 +00:00
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
|
|
|
|
### Documentation
|
2016-11-15 08:58:11 +00:00
|
|
|
dist_doc_DATA += docs/cpuprofile.html \
|
|
|
|
docs/cpuprofile-fileformat.html \
|
|
|
|
docs/pprof-test-big.gif \
|
|
|
|
docs/pprof-test.gif \
|
|
|
|
docs/pprof-vsnprintf-big.gif \
|
|
|
|
docs/pprof-vsnprintf.gif
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2009-03-11 20:50:03 +00:00
|
|
|
endif WITH_CPU_PROFILER
|
2008-12-13 01:35:42 +00:00
|
|
|
|
2009-09-11 18:42:32 +00:00
|
|
|
|
2009-06-10 02:04:26 +00:00
|
|
|
### ------- CPU profiler and heap checker, in one!
|
|
|
|
|
|
|
|
# Ideally, folks who wanted to use both tcmalloc and libprofiler,
|
|
|
|
# could just link them both into their application. But while this
|
|
|
|
# works fine for .so files, it does not for .a files. The easiest way
|
|
|
|
# around this -- and I've tried a bunch of the hard ways -- is to just
|
|
|
|
# to create another set of libraries that has both functionality in it.
|
|
|
|
|
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
if WITH_CPU_PROFILER
|
|
|
|
|
|
|
|
lib_LTLIBRARIES += libtcmalloc_and_profiler.la
|
|
|
|
libtcmalloc_and_profiler_la_SOURCES = $(libtcmalloc_la_SOURCES) $(libprofiler_la_SOURCES)
|
|
|
|
libtcmalloc_and_profiler_la_CXXFLAGS = $(libtcmalloc_la_CXXFLAGS) $(libprofiler_la_CXXFLAGS)
|
2010-11-18 01:07:25 +00:00
|
|
|
# Since this library is meant to be used as a .a, I don't worry as much
|
|
|
|
# about .so versioning. I just give the libtcmalloc version number.
|
2009-06-10 02:04:26 +00:00
|
|
|
# TODO(csilvers): use -export-symbols-regex?
|
2010-11-18 01:07:25 +00:00
|
|
|
libtcmalloc_and_profiler_la_LDFLAGS = $(PTHREAD_CFLAGS) \
|
2020-07-06 09:51:43 +00:00
|
|
|
-version-info @TCMALLOC_AND_PROFILER_SO_VERSION@
|
2009-06-10 02:04:26 +00:00
|
|
|
# We don't include libprofiler_la_LIBADD here because all it adds is
|
|
|
|
# libstacktrace.la, which we already get via libtcmalloc. Trying to
|
|
|
|
# specify it twice causes link-time duplicate-definition errors. :-(
|
|
|
|
libtcmalloc_and_profiler_la_LIBADD = $(libtcmalloc_la_LIBADD)
|
|
|
|
|
|
|
|
TESTS += tcmalloc_and_profiler_unittest
|
2011-07-16 01:07:10 +00:00
|
|
|
tcmalloc_and_profiler_unittest_SOURCES = $(tcmalloc_both_unittest_srcs)
|
|
|
|
tcmalloc_and_profiler_unittest_CXXFLAGS = $(tcmalloc_both_unittest_cflags)
|
|
|
|
tcmalloc_and_profiler_unittest_LDFLAGS = $(tcmalloc_both_unittest_lflags)
|
2009-06-10 02:04:26 +00:00
|
|
|
tcmalloc_and_profiler_unittest_LDADD = libtcmalloc_and_profiler.la
|
|
|
|
|
|
|
|
endif WITH_CPU_PROFILER
|
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
2007-03-22 03:00:33 +00:00
|
|
|
## ^^^^ END OF RULES TO MAKE YOUR LIBRARIES, BINARIES, AND UNITTESTS
|
|
|
|
|
|
|
|
# This should always include $(TESTS), but may also include other
|
|
|
|
# binaries that you compile but don't want automatically installed.
|
|
|
|
# We'll add to this later, on a library-by-library basis
|
2007-04-16 20:49:32 +00:00
|
|
|
noinst_PROGRAMS += $(TESTS)
|
2007-03-22 03:00:33 +00:00
|
|
|
|
2010-11-18 01:07:25 +00:00
|
|
|
# http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki
|
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
2023-07-03 19:29:56 +00:00
|
|
|
pkgconfig_DATA = libtcmalloc_minimal.pc
|
|
|
|
if WITH_DEBUGALLOC
|
|
|
|
pkgconfig_DATA += libtcmalloc_minimal_debug.pc
|
|
|
|
endif WITH_DEBUGALLOC
|
|
|
|
|
|
|
|
if WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
pkgconfig_DATA += libtcmalloc.pc
|
|
|
|
if WITH_DEBUGALLOC
|
|
|
|
pkgconfig_DATA += libtcmalloc_debug.pc
|
|
|
|
endif WITH_DEBUGALLOC
|
|
|
|
endif WITH_HEAP_PROFILER_OR_CHECKER
|
|
|
|
|
|
|
|
if WITH_CPU_PROFILER
|
|
|
|
pkgconfig_DATA += libprofiler.pc
|
|
|
|
endif WITH_CPU_PROFILER
|
2010-11-18 01:07:25 +00:00
|
|
|
CLEANFILES = $(pkgconfig_DATA)
|
|
|
|
|
2023-07-31 18:28:40 +00:00
|
|
|
libtcmalloc.pc: Makefile
|
2010-11-18 01:07:25 +00:00
|
|
|
echo 'prefix=$(prefix)' > "$@".tmp
|
|
|
|
echo 'exec_prefix='`echo '$(exec_prefix)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
|
|
|
|
echo 'libdir='`echo '$(libdir)' | sed 's@^$(exec_prefix)@$${exec_prefix}@'` >> "$@".tmp
|
|
|
|
echo 'includedir='`echo '$(includedir)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
|
|
|
|
echo '' >> "$@".tmp
|
|
|
|
echo 'Name: $(PACKAGE)' >> "$@".tmp
|
|
|
|
echo 'Version: $(VERSION)' >> "$@".tmp
|
2023-08-15 23:21:47 +00:00
|
|
|
echo 'Description: Performance tools for C++' >> "$@".tmp
|
2023-07-31 18:28:40 +00:00
|
|
|
echo 'URL: https://github.com/gperftools/gperftools' >> "$@".tmp
|
2010-11-18 01:07:25 +00:00
|
|
|
echo 'Requires:' >> "$@".tmp
|
|
|
|
echo 'Libs: -L$${libdir} -ltcmalloc' >> "$@".tmp
|
|
|
|
echo 'Libs.private: $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)' >> "$@".tmp
|
|
|
|
echo 'Cflags: -I$${includedir}' >> "$@".tmp
|
|
|
|
mv -f "$@".tmp "$@"
|
|
|
|
|
|
|
|
libtcmalloc_minimal.pc: libtcmalloc.pc
|
|
|
|
cat libtcmalloc.pc | sed s/-ltcmalloc/-ltcmalloc_minimal/ > "$@"
|
|
|
|
|
|
|
|
libtcmalloc_debug.pc: libtcmalloc.pc
|
|
|
|
cat libtcmalloc.pc | sed s/-ltcmalloc/-ltcmalloc_debug/ > "$@"
|
|
|
|
|
|
|
|
libtcmalloc_minimal_debug.pc: libtcmalloc.pc
|
|
|
|
cat libtcmalloc.pc | sed s/-ltcmalloc/-ltcmalloc_minimal_debug/ > "$@"
|
|
|
|
|
|
|
|
libprofiler.pc: libtcmalloc.pc
|
|
|
|
cat libtcmalloc.pc | sed s/-ltcmalloc/-lprofiler/ > "$@"
|
|
|
|
|
2023-06-27 05:43:44 +00:00
|
|
|
$(top_distdir)/ChangeLog:
|
|
|
|
if test ! -f $(top_srcdir)/ChangeLog ; \
|
|
|
|
then git --git-dir=$(top_srcdir)/.git --work-tree=$(top_srcdir) \
|
|
|
|
log --stat -M -C --name-status --no-color \
|
|
|
|
| fmt --split-only >$(top_distdir)/ChangeLog; \
|
|
|
|
else cp $(top_srcdir)/ChangeLog $(top_distdir)/ChangeLog; fi
|
2016-06-25 23:24:40 +00:00
|
|
|
|
2023-07-31 18:28:40 +00:00
|
|
|
EXTRA_DIST = $(SCRIPTS) \
|
2009-06-10 02:04:26 +00:00
|
|
|
src/windows/get_mangled_names.cc src/windows/override_functions.cc \
|
2016-11-15 08:58:11 +00:00
|
|
|
docs/pprof.see_also src/windows/TODO \
|
2024-02-05 03:31:07 +00:00
|
|
|
$(WINDOWS_EXTRA) \
|
|
|
|
gperftools.sln vsprojects \
|
2024-02-05 03:00:42 +00:00
|
|
|
$(top_srcdir)/src/*h $(top_srcdir)/src/base/*h \
|
|
|
|
$(top_srcdir)/src/windows/*h $(top_srcdir)/src/gperftools/*h \
|
2022-01-15 07:08:57 +00:00
|
|
|
CMakeLists.txt cmake
|
2024-02-05 03:00:42 +00:00
|
|
|
|
|
|
|
# Windows wants write permission to .vcxproj files and maybe even sln files.
|
|
|
|
dist-hook: $(top_distdir)/ChangeLog
|
|
|
|
test -e "$(distdir)/vsprojects" \
|
|
|
|
&& chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/
|
|
|
|
rm -f $(distdir)/src/config.h $(distdir)/src/gperftools/tcmalloc.h
|