* configure.ac: Add check for "etext".
authorJoel Brobecker <brobecker@gnat.com>
Wed, 19 Sep 2007 22:00:34 +0000 (22:00 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 19 Sep 2007 22:00:34 +0000 (22:00 +0000)
        * configure, config.in: Regenerate.
        * maint.c (TEXTEND): Only define if either _etext or etext
        are available.
        Disable the profiling functionality if TEXTEND is not defined.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/maint.c

index cd8491ba0d5ab9ae56d6be474e40dfdf750a00e5..c8486c5d299de8d1bf2eefb31968597270738bfb 100644 (file)
@@ -1,3 +1,11 @@
+2007-09-19  Joel Brobecker  <brobecker@adacore.com>
+
+       * configure.ac: Add check for "etext".
+       * configure, config.in: Regenerate.
+       * maint.c (TEXTEND): Only define if either _etext or etext
+       are available.
+       Disable the profiling functionality if TEXTEND is not defined.
+
 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * mips-tdep.c (mips_stub_frame_cache): Correct the saved return
index 1534afe82754fa9e8b018ef3c88f4fec7286fea4..f58b70a6c14564997c2061ac13d1be38b444e8f7 100644 (file)
 /* 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 7b90943a15fd6b60b35812d6d1eb7258be29491c..1dd4fb466b3c78c707b6122c91dfabd09c2a25fe 100755 (executable)
@@ -4277,6 +4277,69 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE__ETEXT 1
 _ACEOF
 
+fi
+echo "$as_me:$LINENO: checking for etext" >&5
+echo $ECHO_N "checking for etext... $ECHO_C" >&6
+if test "${ac_cv_var_etext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+extern char etext;
+
+int
+main ()
+{
+free (&etext);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_var_etext=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_var_etext=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_var_etext" >&5
+echo "${ECHO_T}$ac_cv_var_etext" >&6
+if test $ac_cv_var_etext = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ETEXT 1
+_ACEOF
+
 fi
 if test "$enable_profiling" = yes ; then
   if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
index 6a150aa534af299de6d1d23a71e72c45c037a76f..eea0bc296233e9937a6df150886660728cc9c57c 100644 (file)
@@ -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 <stdlib.h>
+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 2f431fd405e641a0876f244a4b1738c071e2e3a0..5f3338ef1653c11ab0e5c1169157a9af31f4c3f1 100644 (file)
@@ -638,16 +638,16 @@ show_maintenance_profile_p (struct ui_file *file, int from_tty,
   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
This page took 0.036888 seconds and 4 git commands to generate.