Add optional use of Google Profiler.

See https://code.google.com/p/gperftools
This commit is contained in:
John Ralls 2014-05-02 16:29:29 -07:00
parent 8a899fc47a
commit 8e25412d20
2 changed files with 16 additions and 0 deletions

View File

@ -741,6 +741,18 @@ AC_ARG_ENABLE( profile,
CXXFLAGS="${CXXFLAGS} -pg"
LDFLAGS="${LDFLAGS} -pg")
###---------------------------------------------------------------------------
### Google Profiler Support: https://code.google.com/p/gperftools/
###---------------------------------------------------------------------------
enable_google_profile=no
AC_ARG_ENABLE( google-profiler,
[AS_HELP_STRING([--enable-google-profiler], [link in Google Performance Tools profiler; allows enabling profiling by setting $CPUPROFILE=/path/to/logfile.])],
[AC_MSG_CHECKING([Google PerfTools Profiler])
AC_CHECK_LIB([profiler], enable_google_profile=yes)],
[AC_MSG_WARN([Google Profiling Enabled but the library wasn\'t found.])
])
AM_CONDITIONAL(WITH_GOOGLE_PROFILER, [test x$enable_google_profile = xyes])
### --------------------------------------------------------------------------
### Register2
AC_ARG_ENABLE( register2,

View File

@ -58,6 +58,10 @@ gnucash_LDADD = \
${GLIB_LIBS} \
${GTK_LIBS}
if WITH_GOOGLE_PROFILER
gnucash_LDADD += -lprofiler
endif
GNUCASH_BIN_INSTALL_NAME=`echo ${BIN_NAME} | sed -e '$(transform)'`
gnucash-valgrind: gnucash-valgrind.in ${top_builddir}/config.status Makefile