autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Extract rm out of shell functions for AC_*_IFELSE


From: Eric Blake
Subject: Re: [PATCH] Extract rm out of shell functions for AC_*_IFELSE
Date: Thu, 23 Oct 2008 16:00:07 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> > -m4_ifvaln([$1], [rm -f conftest.$ac_ext])dnl
> > +rm -f conftest.err[]m4_ifvaln([$1], [ conftest.$ac_ext])dnl
> >  ])# _AC_PREPROC_IFELSE
> 
> m4_ifvaln is primarily useful in situations where you want to avoid an empty 
> newline when $1 is empty.  But here, you want to conditionally add content to 
a 
> line that needs a newline terminator no matter what.  I'm worried that people 
> might be using dnl after AC_PREPROC_IFELSE to delete a second newline; which 
> means we would be causing a shell syntax error if we don't supply a first 
> newline.

On closer inspection, the original code before patches 1-4 had the dnl there 
(in other words, _AC_*_IFELSE did not end in a newline, because all clients 
always supplied it, so we were actually adding a blank newline by swapping over 
to m4_ifvaln).  So I would restore the []dnl from the original code, and write 
this as:

rm -f conftest.err[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
])# _AC_PREPROC_IFELSE

-- 
Eric Blake







reply via email to

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