aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-01-15 15:46:39 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-01-15 15:46:39 -0800
commit297fafa078a8a43a4ddb693129b8e25b9d0bf618 (patch)
treed02a54023ea8b9b56669b36c8b287f045998c202 /Makefile
parentfbf4051ef2d08d53cdb486722c1111d614865d63 (diff)
Opportunistically use perftools if installed.
Allows us to collect profiles of the open source build using gprof.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b43cb734ba..ab1ba14bb3 100644
--- a/Makefile
+++ b/Makefile
@@ -172,6 +172,13 @@ endif
OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS)
ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/zlib.c -lz $(LDFLAGS)
+PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/perftools.c -lprofiler $(LDFLAGS)
+
+HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
+ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
+DEFINES += GRPC_HAVE_PERFTOOLS
+LIBS += profiler
+endif
ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
HAS_SYSTEM_OPENSSL_ALPN = $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false)