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

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

 



[ trimming Cc: ]

Hello,

* Joern Rennecke wrote on Tue, Feb 09, 2010 at 11:46:15AM CET:
> However, I wonder if there is a better way to do the string processing -
> I only do autoconf hacking sporadically, and my code looks somewhat
> different from the original style.

I haven't had a chance to look at it in detail, but:

> 2010-02-09  Joern Rennecke  <joern.rennecke@xxxxxxxxxxxx>
> 
> libcpp:
> 	* aclocal (_AC_CHECK_PROTO_BODY): New shell function.
> 	(AC_CHECK_PROTO, _AC_CHECK_PROTOS, AC_CHECK_PROTOS): New macros.
> 	* configure.ac: Use AC_CHECK_PROTOS instead of AC_CHECK_DECLS.
> 	* configure: Regenerate.

> --- libcpp/aclocal.m4	(revision 156598)
> +++ libcpp/aclocal.m4	(working copy)
> @@ -22,3 +22,75 @@ m4_include([../config/lib-link.m4])
>  m4_include([../config/lib-prefix.m4])
>  m4_include([../config/override.m4])
>  m4_include([../config/warnings.m4])
> +
> +## ---------------------------------------------------------------- ##
> +## Checking for declared symbols.                                   ##
> +## This is like *AC_CHECK_DECL*, except that for c++, we may use a  ##
> +## prototype to check for a (possibly overloaded) function.         ##
> +## ---------------------------------------------------------------- ##
> +
> +
> +# _AC_CHECK_PROTO_BODY
> +# -------------------
> +# Shell function body for AC_CHECK_PROTO.
> +m4_define([_AC_CHECK_PROTO_BODY],
> +[  AS_LINENO_PUSH([$[]1])
> +  [as_decl_name=`echo $][2|sed 's/(.*//'`]
> +  [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/\()\|,\)/) 0&/'`]

sed alternation \| is not portable.

> +  AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
> +  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
> +[@%:@ifndef $[]as_decl_name
> +@%:@ifdef __cplusplus
> +  $[]as_decl_type

What is this variable?  It doesn't seem to be defined anywhere.

> +  (void) $[]as_decl_use;
> +@%:@else
> +  (void) $[]as_decl_name;
> +@%:@endif
> +@%:@endif
> +])],
> +		   [AS_VAR_SET([$[]3], [yes])],
> +		   [AS_VAR_SET([$[]3], [no])])])
> +  AS_LINENO_POP
> +])# _AC_CHECK_PROTO_BODY
[...]

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux