diff options
author | Fabrice Fontaine <fontaine.fabrice@gmail.com> | 2018-04-22 19:17:12 +0200 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2018-04-29 14:29:16 -0700 |
commit | 30e5e614a846d5f046454341f108bc4cb2b70189 (patch) | |
tree | 1477479ca1950b3d894d14dca9d222e1f440b203 /Makefile.am | |
parent | 836c4f29a585e4b176738f64cf8d312171be5fe0 (diff) | |
download | gperftools-30e5e614a846d5f046454341f108bc4cb2b70189.tar.gz |
Fix build without static libraries
Only add -static to malloc_bench_LDFLAGS and binary_trees_LDFLAGS if
ENABLE_STATC is set otherwise build with some compilers will fail if
user has decided to build only the shared version of gperftools
libraries
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Diffstat (limited to 'Makefile.am')
-rwxr-xr-x | Makefile.am | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 98cd147..c79227a 100755 --- a/Makefile.am +++ b/Makefile.am @@ -862,7 +862,10 @@ noinst_PROGRAMS += malloc_bench malloc_bench_shared \ malloc_bench_SOURCES = benchmark/malloc_bench.cc malloc_bench_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS) $(NO_BUILTIN_CXXFLAGS) -malloc_bench_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) -static +malloc_bench_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) +if ENABLE_STATIC +malloc_bench_LDFLAGS += -static +endif ENABLE_STATIC malloc_bench_LDADD = librun_benchmark.la libtcmalloc_minimal.la $(PTHREAD_LIBS) malloc_bench_shared_SOURCES = benchmark/malloc_bench.cc @@ -890,7 +893,10 @@ endif WITH_HEAP_PROFILER_OR_CHECKER binary_trees_SOURCES = benchmark/binary_trees.cc binary_trees_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS) $(NO_BUILTIN_CXXFLAGS) -binary_trees_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) -static +binary_trees_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) +if ENABLE_STATIC +binary_trees_LDFLAGS += -static +endif ENABLE_STATIC binary_trees_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS) binary_trees_shared_SOURCES = benchmark/binary_trees.cc |