Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.51 diff -u -p -r1.51 configure.ac --- configure.ac 3 Sep 2007 20:47:37 -0000 1.51 +++ configure.ac 19 Sep 2007 19:22:07 -0000 @@ -242,6 +242,16 @@ if test $ac_cv_var__etext = yes; then AC_DEFINE(HAVE__ETEXT, 1, [Define to 1 if your system has the _etext variable. ]) fi +AC_CACHE_CHECK([for etext], ac_cv_var_etext, +[AC_TRY_LINK( +[#include +extern char etext; +], +[free (&etext);], ac_cv_var_etext=yes, ac_cv_var_etext=no)]) +if test $ac_cv_var_etext = yes; then + AC_DEFINE(HAVE_ETEXT, 1, + [Define to 1 if your system has the etext variable. ]) +fi if test "$enable_profiling" = yes ; then if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup) Index: config.in =================================================================== RCS file: /cvs/src/src/gdb/config.in,v retrieving revision 1.91 diff -u -p -r1.91 config.in --- config.in 18 Jun 2007 15:46:37 -0000 1.91 +++ config.in 19 Sep 2007 19:22:07 -0000 @@ -113,6 +113,9 @@ /* Define if ELF support should be included. */ #undef HAVE_ELF +/* Define to 1 if your system has the etext variable. */ +#undef HAVE_ETEXT + /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK Index: maint.c =================================================================== RCS file: /cvs/src/src/gdb/maint.c,v retrieving revision 1.60 diff -u -p -r1.60 maint.c --- maint.c 23 Aug 2007 18:08:36 -0000 1.60 +++ maint.c 19 Sep 2007 19:22:07 -0000 @@ -638,16 +638,16 @@ show_maintenance_profile_p (struct ui_fi fprintf_filtered (file, _("Internal profiling is %s.\n"), value); } -#if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP) - #ifdef HAVE__ETEXT extern char _etext; #define TEXTEND &_etext -#else +#elif defined (HAVE_ETEXT) extern char etext; #define TEXTEND &etext #endif +#if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP) && defined (TEXTEND) + static int profiling_state; static void