From 2857277a558feb6ac43b6366eee6f02844e2c2db Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Thu, 29 Jan 2009 20:39:40 +0000 Subject: [PATCH] Add --enable-profile and PROFILE_FLAGS to enable profiling, also fix s/--enable debug/--enable-debug/ in DEBUG_FLAGS comment. Originally committed to SVN as r2715. --- configure.in | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 60dd10258..7d468e48b 100644 --- a/configure.in +++ b/configure.in @@ -1025,7 +1025,7 @@ fi # If you want it earlier add it to your CXXFLAGS. ###################################################### -AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable debug (default: -g)]) +AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable-debug (default: -g)]) if test -z "$DEBUG_FLAGS"; then DEBUG_FLAGS="-g"; fi @@ -1042,6 +1042,26 @@ else fi +########### +# Profiling +########### + +AC_ARG_VAR([PROFILE_FLAGS], [Profile flag(s) to use with --enable-profiling (default: -pg)]) +if test -z "$PROFILE_FLAGS"; then + PROFILE_FLAGS="-pg"; +fi + +AC_MSG_CHECKING([whether to turn on profiling]) +AC_ARG_ENABLE(debug, [ --enable-profile turn on profiling (default=no)]) +if test "$enable_prifile" = "yes"; then + AC_MSG_RESULT([yes ($PROFILE_FLAGS)]) + CPPFLAGS="$PROFILE_FLAGS $CPPFLAGS" +else + enable_profile="no" + AC_MSG_RESULT([no]) +fi + + ############################## # Internationalisation support