public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [rfa] Move some autoconf macros to bfd/bfd.m4?
@ 2005-01-10 20:02 Andrew Cagney
  2005-01-12 23:04 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2005-01-10 20:02 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

GDB uses a number of autoconf macros found in bfd/acinclude.m4.  It 
accesses them by sucking in the entire contents of that file (creating 
sinclude hell).

This patch moves those macros to a new file bfd/bfd.m4 so that GDB can 
include them directly.  After aclocal/autoconf this still rebuilt on a 
PPC and amd64 GNU/Linux systems.

Ok?

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 5279 bytes --]

2005-01-10  Andrew Cagney  <cagney@gnu.org>

	* bfd.m4: New file.
	* acinclude.m4: Move BFD_NEED_DECLARATION,
	BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
	the new file bfd.m4.  Include bfd.m4.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
	
Index: acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.12
diff -p -u -r1.12 acinclude.m4
--- acinclude.m4	11 Sep 2004 20:22:49 -0000	1.12
+++ acinclude.m4	10 Jan 2005 19:57:00 -0000
@@ -1,5 +1,6 @@
 sinclude(../config/accross.m4)
 sinclude(../config/acx.m4)
+sinclude(bfd.m4)
 
 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
 AC_DEFUN([BFD_BINARY_FOPEN],
@@ -44,73 +45,6 @@ else
 fi
 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
 
-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],
-[AC_MSG_CHECKING([for $1 in sys/procfs.h])
- AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
-   [AC_TRY_COMPILE([
-#define _SYSCALL32
-#include <sys/procfs.h>],
-      [$1 avar],
-      bfd_cv_have_sys_procfs_type_$1=yes,
-      bfd_cv_have_sys_procfs_type_$1=no
-   )])
- if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
-   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
-	     [Define if <sys/procfs.h> has $1.])
- fi
- AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
-])
-
-
-dnl Check for existence of member $2 in type $1 in sys/procfs.h
-
-AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
-[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
- AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
-   [AC_TRY_COMPILE([
-#define _SYSCALL32
-#include <sys/procfs.h>],
-      [$1 avar; void* aref = (void*) &avar.$2],
-      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
-      bfd_cv_have_sys_procfs_type_member_$1_$2=no
-   )])
- if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
-   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
-	     [Define if <sys/procfs.h> has $1.$2.])
- fi
- AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
-])
-
 sinclude(../libtool.m4)
 dnl The lines below arrange for aclocal not to bring libtool.m4
 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
Index: bfd.m4
===================================================================
RCS file: bfd.m4
diff -N bfd.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd.m4	10 Jan 2005 19:57:00 -0000
@@ -0,0 +1,72 @@
+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],
+[AC_MSG_CHECKING([for $1 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
+   [AC_TRY_COMPILE([
+#define _SYSCALL32
+#include <sys/procfs.h>],
+      [$1 avar],
+      bfd_cv_have_sys_procfs_type_$1=yes,
+      bfd_cv_have_sys_procfs_type_$1=no
+   )])
+ if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
+   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
+	     [Define if <sys/procfs.h> has $1.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
+])
+
+
+dnl Check for existence of member $2 in type $1 in sys/procfs.h
+
+AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
+[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
+   [AC_TRY_COMPILE([
+#define _SYSCALL32
+#include <sys/procfs.h>],
+      [$1 avar; void* aref = (void*) &avar.$2],
+      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
+      bfd_cv_have_sys_procfs_type_member_$1_$2=no
+   )])
+ if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
+   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
+	     [Define if <sys/procfs.h> has $1.$2.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
+])
+

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [rfa] Move some autoconf macros to bfd/bfd.m4?
  2005-01-10 20:02 [rfa] Move some autoconf macros to bfd/bfd.m4? Andrew Cagney
@ 2005-01-12 23:04 ` Alan Modra
  2005-01-15 19:19   ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2005-01-12 23:04 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

On Mon, Jan 10, 2005 at 03:00:40PM -0500, Andrew Cagney wrote:
> 	* bfd.m4: New file.
> 	* acinclude.m4: Move BFD_NEED_DECLARATION,
> 	BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
> 	the new file bfd.m4.  Include bfd.m4.
> 	* aclocal.m4: Re-generate.
> 	* configure: Re-generate.

OK.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [rfa] Move some autoconf macros to bfd/bfd.m4?
  2005-01-12 23:04 ` Alan Modra
@ 2005-01-15 19:19   ` Andrew Cagney
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2005-01-15 19:19 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

Alan Modra wrote:
> On Mon, Jan 10, 2005 at 03:00:40PM -0500, Andrew Cagney wrote:
> 
>>	* bfd.m4: New file.
>>	* acinclude.m4: Move BFD_NEED_DECLARATION,
>>	BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
>>	the new file bfd.m4.  Include bfd.m4.
>>	* aclocal.m4: Re-generate.
>>	* configure: Re-generate.
> 
> 
> OK.

I tweaked it slightly before committing: changed sinclude(bfd.m4) to 
sinclude(../bfd/bfd.m4) since I really don't trust this new autoconf; 
and apparently aclocal.m4 didn't need regenerating.

committed,
Thanks

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 5265 bytes --]

2005-01-15  Andrew Cagney  <cagney@gnu.org>

	* bfd.m4: New file.
	* acinclude.m4: Move BFD_NEED_DECLARATION,
	BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
	the new file bfd.m4.  Include ../bfd/bfd.m4.
	* configure: Re-generate.
	
Index: acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.12
diff -p -u -r1.12 acinclude.m4
--- acinclude.m4	11 Sep 2004 20:22:49 -0000	1.12
+++ acinclude.m4	15 Jan 2005 19:13:11 -0000
@@ -1,5 +1,6 @@
 sinclude(../config/accross.m4)
 sinclude(../config/acx.m4)
+sinclude(../bfd/bfd.m4)
 
 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
 AC_DEFUN([BFD_BINARY_FOPEN],
@@ -44,73 +45,6 @@ else
 fi
 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
 
-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],
-[AC_MSG_CHECKING([for $1 in sys/procfs.h])
- AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
-   [AC_TRY_COMPILE([
-#define _SYSCALL32
-#include <sys/procfs.h>],
-      [$1 avar],
-      bfd_cv_have_sys_procfs_type_$1=yes,
-      bfd_cv_have_sys_procfs_type_$1=no
-   )])
- if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
-   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
-	     [Define if <sys/procfs.h> has $1.])
- fi
- AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
-])
-
-
-dnl Check for existence of member $2 in type $1 in sys/procfs.h
-
-AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
-[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
- AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
-   [AC_TRY_COMPILE([
-#define _SYSCALL32
-#include <sys/procfs.h>],
-      [$1 avar; void* aref = (void*) &avar.$2],
-      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
-      bfd_cv_have_sys_procfs_type_member_$1_$2=no
-   )])
- if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
-   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
-	     [Define if <sys/procfs.h> has $1.$2.])
- fi
- AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
-])
-
 sinclude(../libtool.m4)
 dnl The lines below arrange for aclocal not to bring libtool.m4
 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
Index: bfd.m4
===================================================================
RCS file: bfd.m4
diff -N bfd.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd.m4	15 Jan 2005 19:13:11 -0000
@@ -0,0 +1,72 @@
+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],
+[AC_MSG_CHECKING([for $1 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
+   [AC_TRY_COMPILE([
+#define _SYSCALL32
+#include <sys/procfs.h>],
+      [$1 avar],
+      bfd_cv_have_sys_procfs_type_$1=yes,
+      bfd_cv_have_sys_procfs_type_$1=no
+   )])
+ if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
+   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
+	     [Define if <sys/procfs.h> has $1.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
+])
+
+
+dnl Check for existence of member $2 in type $1 in sys/procfs.h
+
+AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
+[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
+   [AC_TRY_COMPILE([
+#define _SYSCALL32
+#include <sys/procfs.h>],
+      [$1 avar; void* aref = (void*) &avar.$2],
+      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
+      bfd_cv_have_sys_procfs_type_member_$1_$2=no
+   )])
+ if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
+   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
+	     [Define if <sys/procfs.h> has $1.$2.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
+])
+

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-15 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-10 20:02 [rfa] Move some autoconf macros to bfd/bfd.m4? Andrew Cagney
2005-01-12 23:04 ` Alan Modra
2005-01-15 19:19   ` Andrew Cagney

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).