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.
This commit is contained in:
Amar Takhar 2009-01-29 20:39:40 +00:00
parent f876084c51
commit 2857277a55
1 changed files with 21 additions and 1 deletions

View File

@ -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