[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bad m4 quotation?
From: |
Stepan Kasal |
Subject: |
Re: bad m4 quotation? |
Date: |
Wed, 29 Mar 2006 12:57:10 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello Ralf,
On Tue, Mar 28, 2006 at 03:36:25PM +0200, Ralf Wildenhues wrote:
> > As we both know, the reason is that the first parameter of
> > AC_CONFIG_FOOS is split by whitespace before any expansion.
this was also true for Autoconf 2.59.
> Backwards compatible to what?
To previous version, of course.
Let me make some experiments with Autoconf 2.59:
Your overquoted example:
$ cat configure.ac
AC_INIT(a,1,b)
AC_DEFUN([FOO],
[AC_CONFIG_FILES([m4_default([$1], [foobar])])])
FOO
FOO([baz])
AC_OUTPUT
$ ../autoconf
configure.ac:4: /usr/bin/m4: Warning: Too few arguments to built-in
`m4_bpatsubst'
autom4te: /usr/bin/m4 failed with exit status: 1
$
If I remove the extra quotes around m4_default, things work.
And what about the `ifelse' case? Let's try this:
$ cat configure.ac
AC_INIT(a,1,b)
AC_DEFUN([FOO],
[AC_CONFIG_FILES([ifelse([$1],,[foobar],[$1])])])
FOO
FOO([baz])
AC_OUTPUT
$ ../autoconf
$
Wow! It worked! But please note that the real reason is that there are
no spaces in the argument list of `ifelse'.
And the generated configure is corrupted:
$ grep foobar configure
ac_config_files="$ac_config_files ifelse([],,[foobar],[])"
ac_config_files="$ac_config_files ifelse([baz],,[foobar],[baz])"
"foobar" ) CONFIG_FILES="$CONFIG_FILES foobar" ;;
$
> It breaks the AC_PREFIX_CONFIG_H macro.
Well I haven't tried this macro specifically.
But because of the above, I believe that things are reasonably backward
compatible. In the examples above, you have to use m4_default/m4_if
unquoted and it was this way in 2.59, too.
Hope this clarifies it,
Stepan
- Re: echo "enhancement" leads to confused legacy script tools..., (continued)
- Re: echo "enhancement" leads to confused legacy script tools..., Henrik Nordstrom, 2006/03/20
- Re: echo "enhancement" leads to confused legacy script tools..., Linda W, 2006/03/20
- Re: echo "enhancement" leads to confused legacy script tools..., Ralf Wildenhues, 2006/03/21
- Re: echo "enhancement" leads to confused legacy script tools..., Ralf Wildenhues, 2006/03/21
- Re: echo "enhancement" leads to confused legacy script tools..., Ralf Wildenhues, 2006/03/21
- Re: echo "enhancement" leads to confused legacy script tools..., Henrik Nordstrom, 2006/03/21
- bad m4 quotation? (was: echo "enhancement" leads to confused legacy script tools...), Ralf Wildenhues, 2006/03/27
- Re: bad m4 quotation? (was: echo "enhancement" leads to confused legacy script tools...), Stepan Kasal, 2006/03/28
- Re: bad m4 quotation?, Ralf Wildenhues, 2006/03/28
- Re: bad m4 quotation?, Stepan Kasal, 2006/03/28
- Re: bad m4 quotation?,
Stepan Kasal <=
- AX_PREFIX_CONFIG_H and m4 quoting (was: bad m4 quotation?), Ralf Wildenhues, 2006/03/30
- Re: echo "enhancement" leads to confused legacy script tools..., Chet Ramey, 2006/03/31
- Re: echo "enhancement" leads to confused legacy script tools..., Henrik Nordstrom, 2006/03/20
Re: echo "enhancement" leads to confused legacy script tools..., Andreas Schwab, 2006/03/22
Re: echo "enhancement" leads to confused legacy script tools..., Chet Ramey, 2006/03/28
Re: echo "enhancement" leads to confused legacy script tools..., Andreas Schwab, 2006/03/23