bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_LINK_IFELSE does not quote properly


From: Stepan Kasal
Subject: Re: AC_LINK_IFELSE does not quote properly
Date: Sat, 23 Jul 2005 19:14:41 +0200
User-agent: Mutt/1.4.1i

Hello,
  thank you for writing your report.  However, this is not a bug;
let me explain:

On Fri, Jul 22, 2005 at 11:55:19PM +0200, Roland Illig wrote:
> AC_LINK_IFELSE([
> int main(int argc, char **argv)
> {
>         return argv[0][0];
> }])

You have to quote the parameter twice; one pair of quotes is stripped before
the parameter is passed to AC_LINK_IFELSE, another one after the expansion
of AC_LINK_IFELSE.

Try:
AC_LINK_IFELSE([[
int main(int argc, char **argv)
{
        return argv[0][0];
}]])

Please look at the section "M4 Quotation" in the Autoconf manual. 

> Using the (deprecated) AC_TRY_LINK instead of AC_LINK_IFELSE works fine.

Yes, AC_TRY_LINK double quoted its parameters.  When you read carefully
the description of AC_TRY_LINK in the "Obsolete Macros" section, you'll
see that there are some spare pairs of quotes in the description:
     Same as `AC_LINK_IFELSE([AC_LANG_SOURCE([[INCLUDES]],
     [[FUNCTION-BODY]])], [ACTION-IF-TRUE], [ACTION-IF-FALSE])'

But it is better visible if you put the working AC_TRY_LINK into your
configure.ac and then run "autoupdate".  The updated configure.ac will
show you how your code should probably look like.

Have a nice day,
        Stepan Kasal




reply via email to

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