diff options
Diffstat (limited to 'gdb/configure.in')
-rw-r--r-- | gdb/configure.in | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gdb/configure.in b/gdb/configure.in index 96694dec91b..309ca79b0ad 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) |