* aclocal.m4: Include ../bfd/aclocal.m4.
authorIan Lance Taylor <ian@airs.com>
Wed, 21 Aug 1996 01:02:53 +0000 (01:02 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 21 Aug 1996 01:02:53 +0000 (01:02 +0000)
* 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.

gdb/ChangeLog
gdb/acconfig.h
gdb/aclocal.m4
gdb/config.in
gdb/configure
gdb/configure.in

index ce80109091e4392517d51f6601e23eff094f9fe7..12c9c288d286e7813e3f755a7d4c14b088b6edb2 100644 (file)
@@ -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
index 34fa8c8dd3c2f6be446a8e023ed01e493a066075..fc7ce7c6207c238295da7635ac1810ff15c8709f 100644 (file)
@@ -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
 
index 5cfd7d470f7d6ccc4196cfbce92f6bfbd74a4971..770d1488524adeede5a9e5ea24b859aeae956122 100644 (file)
@@ -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.
 
index ef77c89954d7c202a632ba0ca6fb0328fd95ad88..a3b3e51f175dbd182a70547a1f329a0494c8d2fe 100644 (file)
@@ -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
 
index 75f6d4601104a0c7d665e757c35abf0a11d74655..a836d32ba07ad04316812c49bac111e2b8adef41 100755 (executable)
@@ -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*
index a8ffc6ad726afcfedcba4d4e15a00ce12607c596..42ffb2e1a5e0b1d8ba06ac907d13dd7c3e15857a 100644 (file)
@@ -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.
This page took 0.032873 seconds and 4 git commands to generate.