From d28f9cdffd64eccc907a788a61c75968eeb0e954 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 22 Jan 2003 23:50:35 +0000 Subject: Original patch by Tom Tromey and Jason Molenda . * Makefile.in (PROFILE_CFLAGS): Substitute from configure. (INTERNAL_LDFLAGS): Don't include PROFILE_CFLAGS. * NEWS: Mention profiling. * configure.in (--enable-gdbtk): Fix typo. (--enable-profiling): New. Set PROFILE_CFLAGS. * maint.c (maintenance_set_profile_cmd): Remove NOTYET. Fill in function. (profiling_state): New variable. (mcleanup_wrapper): New function. (_initialize_maint): Remove NOTYET, fix call to add_setshow_boolean_cmd for "maint set profile". * configure: Regenerated. --- gdb/configure.in | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'gdb/configure.in') diff --git a/gdb/configure.in b/gdb/configure.in index 96694de..309ca79 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -164,7 +164,7 @@ fi # Enable gdbtk. AC_ARG_ENABLE(gdbtk, -[ --enable-gtk enable gdbtk graphical user interface (GUI)], +[ --enable-gdbtk enable gdbtk graphical user interface (GUI)], [case $enableval in yes | no) ;; @@ -183,6 +183,31 @@ case $host_os in enable_gdbtk=no ;; esac +# Profiling support. +AC_ARG_ENABLE(profiling, +[ --enable-profiling enable profiling of GDB], + [case $enableval in + yes | no) + ;; + *) + AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;; + esac], + [enable_profiling=no]) + +if test "$enable_profiling" = yes ; then + PROFILE_CFLAGS=-pg + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PROFILE_CFLAGS" + + AC_CHECK_FUNC(monstartup, [], + AC_MSG_ERROR(monstartup necessary to use --enable-profiling.)) + + AC_CHECK_FUNC(_mcleanup, [], + AC_MSG_ERROR(_mcleanup necessary to use --enable-profiling.)) + + CFLAGS="$OLD_CFLAGS" +fi + # --------------------- # # Checks for programs. # # --------------------- # @@ -1164,6 +1189,7 @@ AC_SUBST(IGNORE_SIM) AC_SUBST(IGNORE_SIM_OBS) AC_SUBST(ENABLE_CFLAGS) +AC_SUBST(PROFILE_CFLAGS) AC_SUBST(CONFIG_OBS) AC_SUBST(CONFIG_LIB_OBS) -- cgit v1.1