diff options
author | Craig Tiller <ctiller@google.com> | 2015-01-15 15:46:39 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-01-15 15:46:39 -0800 |
commit | 297fafa078a8a43a4ddb693129b8e25b9d0bf618 (patch) | |
tree | d02a54023ea8b9b56669b36c8b287f045998c202 /Makefile | |
parent | fbf4051ef2d08d53cdb486722c1111d614865d63 (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-- | Makefile | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) |