This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use AH_TEMPLATE to generate config.in


This patch removes useless code from gcc's configure, relying instead on Autoconf 2.5x's autoheader specific directive, AH_TEMPLATE. The code is mostly based on Autoconf's AC_CHECK_FUNCS.

Bootstrapped/regtested i686-pc-linux-gnu. Since config.in needed to be regenerated, I have just committed a regeneration (of course without this patch): after applying the patch and rerunning autoheader, the new config.in only differs in comments.

Ok for mainline?

Paolo

2004-06-02 Paolo Bonzini <bonzini@gnu.org>

	* aclocal.m4 (gcc_AC_CHECK_DECLS): Generate
	autoheader templates without leaving dummy code
	in configure.
	* configure: Regenerate.
	* config.in: Regenerate.

Index: aclocal.m4
===================================================================
RCS file: /cvs/gcc/gcc/gcc/aclocal.m4,v
retrieving revision 1.90
diff -u -r1.90 aclocal.m4
--- aclocal.m4	24 May 2004 10:50:33 -0000	1.90
+++ aclocal.m4	3 Jun 2004 09:30:38 -0000
@@ -28,11 +28,13 @@
 dnl gcc_AC_CHECK_DECLS(SYMBOLS,
 dnl 	[ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]])
 AC_DEFUN([gcc_AC_CHECK_DECLS],
-[for ac_func in $1
+[AC_FOREACH([gcc_AC_Func], [$1],
+  [AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_[]gcc_AC_Func),
+  [Define to 1 if we found a declaration for ']gcc_AC_Func[', otherwise
+   define to 0.])])dnl
+for ac_func in $1
 do
-changequote(, )dnl
-  ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-changequote([, ])dnl
+  ac_tr_decl=AS_TR_CPP([HAVE_DECL_$ac_func])
 gcc_AC_CHECK_DECL($ac_func,
   [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2],
   [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3],
@@ -48,12 +50,6 @@
   $4
 )
 done
-dnl Automatically generate config.h entries via autoheader.
-if test x = y ; then
-  patsubst(translit([$1], [a-z], [A-Z]), [\w+],
-    [AC_DEFINE([HAVE_DECL_\&], 1,
-      [Define to 1 if we found this declaration otherwise define to 0.])])dnl
-fi
 ])
 
 dnl 'make compare' can be significantly faster, if cmp itself can

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]