This is the mail archive of the gcc@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]

Re: AC_CHECK_DECLS(basename) (Was: Re: Ping: patches required for --enable-build-with-cxx)


Quoting Paolo Bonzini <bonzini@gnu.org>:

Maybe we can use this in AC_CHECK_DECLS instead of having a new
separate macro. ÂIf there is a parenthesis in the name call the new
version, if there is none, call the old one.

You shouldn't need to keep the old version around, it's supposed to be a drop-in replacement. ÂThe reason I used a new name was that I'm not sure if GCC project can wait till we have a suitable macro in autoconf.

Yes, I saw that now in the libcpp part of your patch. That's even better!

I've attached the patch against autoconf 2.64.
2010-02-18  Joern Rennecke  <joern.rennecke@embecosm.com>

	* general.m4 (_AC_CHECK_DECL_BODY): Process trailing function
	argument types as arguments to use for C++.
	(_AC_CHECK_DECLS): Filter out trailing function argument types
	when henerating the HAVE_DECL_* macro.

--- autoconf-2.64/share/autoconf/autoconf/general.m4	2010-01-19 12:26:54.937745483 +0000
+++ /home/amylaar/general.m4-pr42798	2010-02-18 00:50:52.084941182 +0000
@@ -2806,10 +2806,16 @@ AC_DEFUN([AC_CHECK_FILES],
 # Shell function body for AC_CHECK_DECL.
 m4_define([_AC_CHECK_DECL_BODY],
 [  AS_LINENO_PUSH([$[]1])
-  AC_CACHE_CHECK([whether $[]2 is declared], [$[]3],
+  [as_decl_name=`echo $][2|sed 's/(.*//'`]
+  [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
+  AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
-[@%:@ifndef $[]2
-  (void) $[]2;
+[@%:@ifndef $[]as_decl_name
+@%:@ifdef __cplusplus
+  (void) $[]as_decl_use;
+@%:@else
+  (void) $[]as_decl_name;
+@%:@endif
 @%:@endif
 ])],
 		   [AS_VAR_SET([$[]3], [yes])],
@@ -2844,7 +2850,7 @@ AS_VAR_POPDEF([ac_Symbol])dnl
 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
 m4_define([_AC_CHECK_DECLS],
 [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
-[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_$1]), [$ac_have_decl],
+[AC_DEFINE_UNQUOTED(AS_TR_CPP(patsubst(HAVE_DECL_[$1],[(.*])), [$ac_have_decl],
   [Define to 1 if you have the declaration of `$1',
    and to 0 if you don't.])]dnl
 [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])

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