GNU bug report logs -
#7990
Quoting problem with AM_COND_IF
Previous Next
Reported by: Dennis Schridde <devurandom <at> gmx.net>
Date: Sat, 5 Feb 2011 19:46:02 UTC
Severity: normal
Tags: notabug
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7990 in the body.
You can then email your comments to 7990 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7990
; Package
automake
.
(Sat, 05 Feb 2011 19:46:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Dennis Schridde <devurandom <at> gmx.net>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Sat, 05 Feb 2011 19:46:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
When I write configure.ac as quoted below and run:
aclocal -I m4
autoconf
automake
the latter will respond with:
"configure.ac:7: missing m4 quoting, macro depth 2"
Changing the AS_IF line to:
AS_IF([test -x /bin],[
fixes that. (Of course also insert the obvious ']')
When I then run ./configure (after running autoconf and automake again), I get
this error:
./configure: line 2428: syntax error near unexpected token `('
The cause is that the error message is cut off at (before) the ',' comma.
This can be fixed by changing the AM_COND_IF line to:
AM_COND_IF([CONDITION],,[
(Of course also insert the obvious ']')
Since other macros defined by autoconf and automake do not have to be quoted
in this way, I assume that there is a quoting problem specific to AM_COND_IF.
I.e. AM_COND_IF does not quote its arguments hard enough, or something
similar.
--- configure.ac ---
AC_INIT([test], [0])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AM_CONDITIONAL([CONDITION],[test -x /tmp])
AS_IF([test -x /bin],
AM_COND_IF([CONDITION],,
AC_MSG_ERROR([comma separated, message])
)
)
AC_OUTPUT([Makefile])
--- Makefile.am ---
ACLOCAL_AMFLAGS = -I m4
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7990
; Package
automake
.
(Sat, 05 Feb 2011 20:41:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 7990 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 02/05/2011 12:26 PM, Dennis Schridde wrote:
> AM_CONDITIONAL([CONDITION],[test -x /tmp])
> AS_IF([test -x /bin],
> AM_COND_IF([CONDITION],,
> AC_MSG_ERROR([comma separated, message])
> )
> )
The quoting problem is with you, not with AM_COND_IF. This should be
written:
AS_IF([test -x /bin],
[AM_COND_IF([CONDITION],,
[AC_MSG_ERROR([comma separated, message])
])
])
Remember the quoting rule of thumb - every argument to a macro should be
inside a single layer of quotes unless you really want the macro
expanded first (which is rare)
--
Eric Blake eblake <at> redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7990
; Package
automake
.
(Sat, 05 Feb 2011 21:06:02 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello Dennis.
Thanks for the report, but what you're describing is indeed a user
error, not an automake/autoconf bug. I'm thus closing this bug
report as invalid.
Details follow ...
On Saturday 05 February 2011, Dennis Schridde wrote:
> When I write configure.ac as quoted below and run:
> aclocal -I m4
> autoconf
> automake
> the latter will respond with:
> "configure.ac:7: missing m4 quoting, macro depth 2"
>
That's because you're underquoting the call to `AM_COND_IF'.
> Changing the AS_IF line to:
> AS_IF([test -x /bin],[
> fixes that. (Of course also insert the obvious ']')
>
It would be better to fix the `AM_COND_IF' line. See below.
> When I then run ./configure (after running autoconf and automake again), I get
> this error:
> ./configure: line 2428: syntax error near unexpected token `('
>
That's because you're underquoting the call to `AC_MSG_ERROR'.
> The cause is that the error message is cut off at (before) the ',' comma.
> This can be fixed by changing the AM_COND_IF line to:
> AM_COND_IF([CONDITION],,[
> (Of course also insert the obvious ']')
>
It would be better to fix the `AC_MSG_ERROR' line. See below.
> Since other macros defined by autoconf and automake do not have to be quoted
> in this way,
>
Yes, they do. See:
<http://www.gnu.org/software/autoconf/manual/html_node/Quotation-Rule-Of-Thumb.html>
and for more details:
<http://www.gnu.org/software/autoconf/manual/html_node/M4-Quotation.html>
> I assume that there is a quoting problem specific to AM_COND_IF.
> I.e. AM_COND_IF does not quote its arguments hard enough, or something
> similar.
>
No, the underquoting is in your macro calls.
>
> --- configure.ac ---
> AC_INIT([test], [0])
> AC_CONFIG_MACRO_DIR([m4])
> AM_INIT_AUTOMAKE
>
> AM_CONDITIONAL([CONDITION],[test -x /tmp])
> AS_IF([test -x /bin],
> AM_COND_IF([CONDITION],,
> AC_MSG_ERROR([comma separated, message])
> )
> )
>
> AC_OUTPUT([Makefile])
>
FWIW, I'd write this as:
AC_INIT([test], [0])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(foreign)
AM_CONDITIONAL([CONDITION],[test -x /tmp])
AS_IF([test -x /bin],
[AM_COND_IF([CONDITION], [],
[AC_MSG_ERROR([comma separated, message])])])
AC_OUTPUT([Makefile])
Sorry for the curt answer, but I'm in a hurry right now.
HTH,
Stefano
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7990
; Package
automake
.
(Sat, 05 Feb 2011 21:06:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to Dennis Schridde <devurandom <at> gmx.net>
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sat, 05 Feb 2011 21:07:01 GMT)
Full text and
rfc822 format available.
Added tag(s) notabug.
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sat, 05 Feb 2011 21:25:01 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 06 Mar 2011 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 108 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.