aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-08-21 01:02:53 +0000
committerIan Lance Taylor <ian@airs.com>1996-08-21 01:02:53 +0000
commitfef1696ffcfaeb438ebd8c519edd3baf212b76e7 (patch)
treee16e4e7a49cef8a194aea6c7828b359beeed04c4
parentdbc4eefc3dcccd9f8759540505e3fb9c466c7d62 (diff)
downloadfsf-binutils-gdb-fef1696ffcfaeb438ebd8c519edd3baf212b76e7.zip
fsf-binutils-gdb-fef1696ffcfaeb438ebd8c519edd3baf212b76e7.tar.gz
fsf-binutils-gdb-fef1696ffcfaeb438ebd8c519edd3baf212b76e7.tar.bz2
* aclocal.m4: Include ../bfd/aclocal.m4.
* configure.in: Add stdlib.h to AC_CHECK_HEADERS. Call BFD_NEED_DECLARATION on malloc, realloc, and free. * acconfig.h: Add NEED_DECLARATION_MALLOC, NEED_DECLARATION_REALLOC, and NEED_DECLARATION_FREE. * configure, config.in: Rebuild. * defs.h: Include <stddef.h> and <stdlib.h> based on HAVE_*_H rather than __STDC__. Only declare malloc, realloc, and free if NEED_DECLARATION_* is defined.
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/acconfig.h10
-rw-r--r--gdb/aclocal.m42
-rw-r--r--gdb/config.in15
-rwxr-xr-xgdb/configure152
-rw-r--r--gdb/configure.in6
6 files changed, 191 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ce80109..12c9c28 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+Tue Aug 20 17:59:42 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4: Include ../bfd/aclocal.m4.
+ * configure.in: Add stdlib.h to AC_CHECK_HEADERS. Call
+ BFD_NEED_DECLARATION on malloc, realloc, and free.
+ * acconfig.h: Add NEED_DECLARATION_MALLOC,
+ NEED_DECLARATION_REALLOC, and NEED_DECLARATION_FREE.
+ * configure, config.in: Rebuild.
+ * defs.h: Include <stddef.h> and <stdlib.h> based on HAVE_*_H
+ rather than __STDC__. Only declare malloc, realloc, and free if
+ NEED_DECLARATION_* is defined.
+
Tue Aug 20 15:37:03 1996 Fred Fish <fnf@taarna.cygnus.com>
* solib.c (_initialize_solib): Add missing '\' chars at ends of
diff --git a/gdb/acconfig.h b/gdb/acconfig.h
index 34fa8c8..fc7ce7c 100644
--- a/gdb/acconfig.h
+++ b/gdb/acconfig.h
@@ -1,4 +1,14 @@
+/* Whether malloc must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_MALLOC
+
+/* Whether realloc must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_REALLOC
+
+/* Whether free must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_FREE
+@TOP@
+
/* Define if fpregset_t type is available. */
#undef HAVE_FPREGSET_T
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
index 5cfd7d4..770d148 100644
--- a/gdb/aclocal.m4
+++ b/gdb/aclocal.m4
@@ -1,6 +1,8 @@
dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
+sinclude(../bfd/aclocal.m4)
+
dnl CY_AC_PATH_TCLCONFIG and CY_AC_LOAD_TCLCONFIG should be invoked
dnl (in that order) before any other TCL macros. Similarly for TK.
diff --git a/gdb/config.in b/gdb/config.in
index ef77c89..a3b3e51 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -1,5 +1,14 @@
/* config.in. Generated automatically from configure.in by autoheader. */
+/* Whether malloc must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_MALLOC
+
+/* Whether realloc must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_REALLOC
+
+/* Whether free must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_FREE
+
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
@@ -7,6 +16,9 @@
#undef _ALL_SOURCE
#endif
+/* Define to empty if the keyword does not work. */
+#undef const
+
/* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE
@@ -77,6 +89,9 @@
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
diff --git a/gdb/configure b/gdb/configure
index 75f6d46..a836d32 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -1333,7 +1333,7 @@ EOF
fi
-for ac_hdr in limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h endian.h
+for ac_hdr in limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h stdlib.h sys/procfs.h link.h endian.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -1913,6 +1913,148 @@ EOF
fi
+echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1922 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() { return 0; }
+int t() {
+char *(*pfn) = (char *(*)) malloc
+; return 0; }
+EOF
+if { (eval echo configure:1944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_malloc=no
+else
+ rm -rf conftest*
+ bfd_cv_decl_needed_malloc=yes
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
+if test $bfd_cv_decl_needed_malloc = yes; then
+ bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $bfd_tr_decl 1
+EOF
+
+fi
+
+echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1969 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() { return 0; }
+int t() {
+char *(*pfn) = (char *(*)) realloc
+; return 0; }
+EOF
+if { (eval echo configure:1991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_realloc=no
+else
+ rm -rf conftest*
+ bfd_cv_decl_needed_realloc=yes
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
+if test $bfd_cv_decl_needed_realloc = yes; then
+ bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $bfd_tr_decl 1
+EOF
+
+fi
+
+echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2016 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() { return 0; }
+int t() {
+char *(*pfn) = (char *(*)) free
+; return 0; }
+EOF
+if { (eval echo configure:2038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_free=no
+else
+ rm -rf conftest*
+ bfd_cv_decl_needed_free=yes
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
+if test $bfd_cv_decl_needed_free = yes; then
+ bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $bfd_tr_decl 1
+EOF
+
+fi
+
+
if test ${build} = ${host} -a ${host} = ${target} ; then
@@ -2307,12 +2449,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2311 "configure"
+#line 2453 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2439,12 +2581,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2443 "configure"
+#line 2585 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
diff --git a/gdb/configure.in b/gdb/configure.in
index a8ffc6a..42ffb2e 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -39,7 +39,7 @@ AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AC_HEADER_STDC
-AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h endian.h)
+AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h stdlib.h sys/procfs.h link.h endian.h)
AC_HEADER_STAT
AC_C_CONST
@@ -133,6 +133,10 @@ AC_MSG_RESULT($gdb_cv_printf_has_long_double)
AC_FUNC_MMAP
+BFD_NEED_DECLARATION(malloc)
+BFD_NEED_DECLARATION(realloc)
+BFD_NEED_DECLARATION(free)
+
dnl See if thread_db library is around for Solaris thread debugging. Note that
dnl we must explicitly test for version 1 of the library because version 0
dnl (present on Solaris 2.4 or earlier) doesn't have the same API.