* [RFA] obsoleting BFD_NEED_DECLARATION
@ 2005-04-21 12:16 Jerome Guitton
2005-04-22 9:54 ` Nick Clifton
0 siblings, 1 reply; 5+ messages in thread
From: Jerome Guitton @ 2005-04-21 12:16 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
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
[-- Attachment #2: ac_check_decl.dif --]
[-- Type: text/plain, Size: 3011 bytes --]
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],
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] obsoleting BFD_NEED_DECLARATION
2005-04-21 12:16 [RFA] obsoleting BFD_NEED_DECLARATION Jerome Guitton
@ 2005-04-22 9:54 ` Nick Clifton
2005-04-22 13:59 ` Jerome Guitton
0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2005-04-22 9:54 UTC (permalink / raw)
To: Jerome Guitton; +Cc: binutils
Hi Jerome,
> 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.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] obsoleting BFD_NEED_DECLARATION
2005-04-22 9:54 ` Nick Clifton
@ 2005-04-22 13:59 ` Jerome Guitton
2005-04-25 1:41 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Jerome Guitton @ 2005-04-22 13:59 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
Nick Clifton (nickc@redhat.com):
> > 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.
>
> Approved - please apply.
Done. Thanks!
Jerome
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] obsoleting BFD_NEED_DECLARATION
2005-04-22 13:59 ` Jerome Guitton
@ 2005-04-25 1:41 ` Daniel Jacobowitz
2005-04-26 9:48 ` Jerome Guitton
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-04-25 1:41 UTC (permalink / raw)
To: Jerome Guitton; +Cc: Nick Clifton, binutils
On Fri, Apr 22, 2005 at 03:58:51PM +0200, Jerome Guitton wrote:
> Nick Clifton (nickc@redhat.com):
>
> > > 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.
> >
> > Approved - please apply.
>
> Done. Thanks!
> Jerome
Jerome, could you please revert the bfd.m4 parts of this patch for now?
binutils/, ld/, and mmalloc/ all use this. Those directories still use
autoconf 2.13.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] obsoleting BFD_NEED_DECLARATION
2005-04-25 1:41 ` Daniel Jacobowitz
@ 2005-04-26 9:48 ` Jerome Guitton
0 siblings, 0 replies; 5+ messages in thread
From: Jerome Guitton @ 2005-04-26 9:48 UTC (permalink / raw)
To: binutils
Daniel Jacobowitz (drow@false.org):
> Jerome, could you please revert the bfd.m4 parts of this patch for now?
> binutils/, ld/, and mmalloc/ all use this. Those directories still use
> autoconf 2.13.
Mmmm, indeed; sorry for that. Thanks for noticing it.
FYI, here is the patch that I checked in:
2005-04-26 Jerome Guitton <guitton@gnat.com>
* bfd.m4 (BFD_NEED_DECLARATION): Restore.
Index: bfd.m4
===================================================================
RCS file: /cvs/src/src/bfd/bfd.m4,v
retrieving revision 1.2
diff -u -r1.2 bfd.m4
--- bfd.m4 22 Apr 2005 13:58:11 -0000 1.2
+++ bfd.m4 26 Apr 2005 09:18:42 -0000
@@ -1,6 +1,36 @@
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],
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-04-26 9:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-21 12:16 [RFA] obsoleting BFD_NEED_DECLARATION Jerome Guitton
2005-04-22 9:54 ` Nick Clifton
2005-04-22 13:59 ` Jerome Guitton
2005-04-25 1:41 ` Daniel Jacobowitz
2005-04-26 9:48 ` Jerome Guitton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).