[RFA] obsoleting BFD_NEED_DECLARATION

Jerome Guitton guitton@adacore.com
Thu Apr 21 12:16:00 GMT 2005


Replacing BFD_NEEDED_DECLARATION by AC_CHECK_DECL, as proposed here:

http://sources.redhat.com/ml/binutils/2005-04/msg00554.html

OK to apply?

-- 
Jerome
-------------- next part --------------
2005-04-21  Jerome Guitton  <guitton@gnat.com>

	* configure.in: Replace BFD_NEED_DECLARATION checks by the
	corresponding AC_CHECK_DECLS.
	* sysdep.h: Replace NEED_DECLARATION_* checks by the corresponding
	HAVE_DECL_*.
	* bfd.m4 (BFD_NEED_DECLARATION): Remove, obsolete.
	* configure: Regenerate.
	* config.in: Ditto.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.177
diff -u -r1.177 configure.in
--- configure.in	20 Apr 2005 15:00:12 -0000	1.177
+++ configure.in	21 Apr 2005 12:08:07 -0000
@@ -135,12 +135,12 @@
 
 BFD_BINARY_FOPEN
 
-BFD_NEED_DECLARATION(ffs)
-BFD_NEED_DECLARATION(free)
-BFD_NEED_DECLARATION(getenv)
-BFD_NEED_DECLARATION(malloc)
-BFD_NEED_DECLARATION(realloc)
-BFD_NEED_DECLARATION(strstr)
+AC_CHECK_DECLS(ffs)
+AC_CHECK_DECLS(free)
+AC_CHECK_DECLS(getenv)
+AC_CHECK_DECLS(malloc)
+AC_CHECK_DECLS(realloc)
+AC_CHECK_DECLS(strstr)
 
 # If we are configured native, pick a core file support file.
 COREFILE=
Index: sysdep.h
===================================================================
RCS file: /cvs/src/src/bfd/sysdep.h,v
retrieving revision 1.9
diff -u -r1.9 sysdep.h
--- sysdep.h	20 Apr 2005 15:00:15 -0000	1.9
+++ sysdep.h	21 Apr 2005 12:08:07 -0000
@@ -105,27 +105,27 @@
 
 #include "filenames.h"
 
-#ifdef NEED_DECLARATION_FFS
+#if !HAVE_DECL_FFS
 extern int ffs (int);
 #endif
 
-#ifdef NEED_DECLARATION_FREE
+#if !HAVE_DECL_FREE
 extern void free ();
 #endif
 
-#ifdef NEED_DECLARATION_GETENV
+#if !HAVE_DECL_GETENV
 extern char *getenv ();
 #endif
 
-#ifdef NEED_DECLARATION_MALLOC
+#if !HAVE_DECL_MALLOC
 extern PTR malloc ();
 #endif
 
-#ifdef NEED_DECLARATION_REALLOC
+#if !HAVE_DECL_REALLOC
 extern PTR realloc ();
 #endif
 
-#ifdef NEED_DECLARATION_STRSTR
+#if !HAVE_DECL_STRSTR
 extern char *strstr ();
 #endif
 
Index: bfd.m4
===================================================================
RCS file: /cvs/src/src/bfd/bfd.m4,v
retrieving revision 1.1
diff -u -r1.1 bfd.m4
--- bfd.m4	15 Jan 2005 19:14:54 -0000	1.1
+++ bfd.m4	21 Apr 2005 12:08:07 -0000
@@ -1,36 +1,6 @@
 dnl This file was derived from acinclude.m4.
 
 
-dnl See whether we need a declaration for a function.
-
-AC_DEFUN([BFD_NEED_DECLARATION],
-[AC_MSG_CHECKING([whether $1 must be declared])
-AC_CACHE_VAL(bfd_cv_decl_needed_$1,
-[AC_TRY_COMPILE([
-#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],
-[char *(*pfn) = (char *(*)) $1],
-bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
-AC_MSG_RESULT($bfd_cv_decl_needed_$1)
-if test $bfd_cv_decl_needed_$1 = yes; then
-  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
-	    [Define if $1 is not declared in system header files.])
-fi
-])dnl
-
-
 dnl Check for existence of a type $1 in sys/procfs.h
 
 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],


More information about the Binutils mailing list