From e6a4ba53f06b1d84ca34976372d1f254562105d7 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Thu, 3 Jan 2019 17:59:42 +0800 Subject: [PATCH] [build] add options for gprof --- configure.ac | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d2ac9ad..54bae31 100644 --- a/configure.ac +++ b/configure.ac @@ -112,7 +112,18 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), AC_MSG_RESULT($DEBUG) if test x$DEBUG = xyes; then - CXXDEBUG_FLAG=-g + CXXDEBUG_FLAG+=" -g" +fi + +################################################################################ +dnl -- Enable gprof +AC_MSG_CHECKING(whether to enable gprof) +AC_ARG_ENABLE(gprof, AC_HELP_STRING([--enable-gprof], [enable gprof]), + GPROF=$enableval, GPROF=no) +AC_MSG_RESULT($GPROF) + +if test x$GPROF = xyes; then + CXXDEBUG_FLAG+=" -pg" fi ################################################################################