autoconf
[Top][All Lists]
Advanced

[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: Ralf Wildenhues
Subject: Re: AC_CHECK_DECLS(basename) (Was: Re: Ping: patches required for --enable-build-with-cxx)
Date: Wed, 17 Feb 2010 08:03:25 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

[ 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  <address@hidden>
> 
> 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],
> address@hidden:@ifndef $[]as_decl_name
> address@hidden:@ifdef __cplusplus
> +  $[]as_decl_type

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

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

Cheers,
Ralf




reply via email to

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