[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_CHECK_DECLS(basename) (Was: Re: Ping: patches required for --enab

From: Joern Rennecke
Subject: Re: AC_CHECK_DECLS(basename) (Was: Re: Ping: patches required for --enable-build-with-cxx)
Date: Wed, 17 Feb 2010 20:07:04 -0500
User-agent: Internet Messaging Program (IMP) H3 (4.1.4)

Quoting Paolo Bonzini <address@hidden>:

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  <address@hidden>

        * 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.
 [  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],
address@hidden:@ifndef $[]2
-  (void) $[]2;
address@hidden:@ifndef $[]as_decl_name
address@hidden:@ifdef __cplusplus
+  (void) $[]as_decl_use;
+  (void) $[]as_decl_name;
                   [AS_VAR_SET([$[]3], [yes])],
@@ -2844,7 +2850,7 @@ AS_VAR_POPDEF([ac_Symbol])dnl
 [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])])])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]