Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-10-18 Thread Paolo Bonzini
simple example: $ cat configure.ac AC_INIT AS_IF([:], [ : some random user stuff ],[ AC_PROG_LEX AC_DECL_YYTEXT ]) AC_OUTPUT $ autoconf --version autoconf (GNU Autoconf) 2.64 $ autoconf&& ./configure -q ./configure: line 2676: syntax error near unexpected token `fi' ./co

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-10-17 Thread Mike Frysinger
On Sunday 05 April 2009 20:46:03 Eric Blake wrote: > According to Mike Frysinger on 4/5/2009 4:10 PM: > > AC_TRY_COMPILE() is invoked with an empty 4th argument: []. i think > > > > [ sp_expire_available=yes ], [] > > ) > > That's not an empty fourth argument. Remember, trailing space IS

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [adding autoconf-patches, replies can drop autoconf] According to Eric Blake on 4/6/2009 8:25 PM: > According to Mike Frysinger on 4/6/2009 3:43 PM: > I'm also leaning towards omitting the else if $1 is provably blank, > otherwise providing the : in c

Re: AS_IF optimization (was: AC_TRY_COMPILE() annoyances with 2.63b)

2009-04-07 Thread Andreas Schwab
Eric Blake writes: > According to Andreas Schwab on 4/7/2009 3:47 AM: >>>From the autoconf manual: >> >> There are shells that do not reset the exit status from an `if': >> >> $ if (exit 42); then true; fi; echo $? >> 42 >> >> whereas a proper shell should have print

AS_IF optimization (was: AC_TRY_COMPILE() annoyances with 2.63b)

2009-04-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Andreas Schwab on 4/7/2009 3:47 AM: >>From the autoconf manual: > > There are shells that do not reset the exit status from an `if': > > $ if (exit 42); then true; fi; echo $? > 42 > > whereas a proper shel

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-07 Thread Andreas Schwab
Eric Blake writes: > I'm also leaning towards omitting the else if $1 is provably blank, > otherwise providing the : in case non-blank $1 ultimately expands to a > blank (unless someone finds a shell where 'if false ; then :; fi; echo $?' > fails to output 0). >From the autoconf manual: Th

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Mike Frysinger
On Monday 06 April 2009 22:25:12 Eric Blake wrote: > Now for a question - right now, m4_default([$1], [$2]) is a nice shorthand > for m4_ifval([$1], [$1], [$2]); is there any reason to create a shorthand > for m4_ifnblank([$1], [$1], [$2]) that likewise only needs two arguments? > And if so, what

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Tue, Apr 07, 2009 at 07:38:10AM CEST: > > But that isn't what you need here. There are situations in which you > cannot prove whether $1 is blank or not. In that case, we should add > both the ":\n" as well as $1. Actually, $1 can just expand to `#\n' (that is, commen

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Ralf Wildenhues
* Eric Blake wrote on Tue, Apr 07, 2009 at 04:25:12AM CEST: > I'm also leaning towards omitting the else if $1 is provably blank, OK with me. > otherwise providing the : in case non-blank $1 ultimately expands to a > blank (unless someone finds a shell where 'if false ; then :; fi; echo $?' > fai

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Mike Frysinger on 4/6/2009 3:43 PM: >>> m4_define([_AS_IF_ELSE], >>> [m4_ifvaln([$1], >>> -[else >>> +[else : >>>$1])]) >>> >>> m4_defun([AS_IF], >> I like this one, for simplicity and obvious correctness alone, but will >> defer to

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Mike Frysinger
On Monday 06 April 2009 14:09:29 Ralf Wildenhues wrote: > Hello Mike, Eric, > > * Mike Frysinger wrote on Mon, Apr 06, 2009 at 03:16:53PM CEST: > > --- a/lib/m4sugar/m4sh.m4 > > +++ b/lib/m4sugar/m4sh.m4 > > @@ -607,7 +607,7 @@ m4_define([_AS_IF], > > ]) > > m4_define([_AS_IF_ELSE], > > [m4_ifva

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Ralf Wildenhues
Hello Mike, Eric, * Mike Frysinger wrote on Mon, Apr 06, 2009 at 03:16:53PM CEST: > --- a/lib/m4sugar/m4sh.m4 > +++ b/lib/m4sugar/m4sh.m4 > @@ -607,7 +607,7 @@ m4_define([_AS_IF], > ]) > m4_define([_AS_IF_ELSE], > [m4_ifvaln([$1], > -[else > +[else : >$1])]) > > m4_defun([AS_IF], I like

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Mike Frysinger
On Monday 06 April 2009 08:59:32 Eric Blake wrote: > According to Mike Frysinger on 4/5/2009 7:19 PM: > >> i'm not an expert by any means with internal autoconf/m4. if there's a > >> m4 helper function to test whether an argument contains something other > >> than whitespace, then the change to m4

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-06 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Mike Frysinger on 4/5/2009 7:19 PM: >> i'm not an expert by any means with internal autoconf/m4. if there's a m4 >> helper function to test whether an argument contains something other than >> whitespace, then the change to m4sh.m4:_AS_IF

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-05 Thread Mike Frysinger
On Sunday 05 April 2009 21:01:29 Mike Frysinger wrote: > On Sunday 05 April 2009 20:46:03 Eric Blake wrote: > > That said, autoconf could probably be taught that, for some macros, an > > argument of all whitespace is morally equivalent to an empty argument. > > Patches welcome. > > i'm not an exper

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-05 Thread Mike Frysinger
On Sunday 05 April 2009 20:46:03 Eric Blake wrote: > According to Mike Frysinger on 4/5/2009 4:10 PM: > > AC_TRY_COMPILE() is invoked with an empty 4th argument: []. i think > > > > [ sp_expire_available=yes ], [] > > ) > > That's not an empty fourth argument. Remember, trailing space IS

Re: AC_TRY_COMPILE() annoyances with 2.63b

2009-04-05 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Mike Frysinger on 4/5/2009 4:10 PM: > AC_TRY_COMPILE() is invoked with an empty 4th argument: []. i think > > [ sp_expire_available=yes ], [] > ) That's not an empty fourth argument. Remember, trailing space IS significant,

AC_TRY_COMPILE() annoyances with 2.63b

2009-04-05 Thread Mike Frysinger
after upgrading from 2.63 to 2.63b, i noticed some code configure.ac files (like in openssh) results in invalid shell code. this is because AC_TRY_COMPILE() is invoked with an empty 4th argument: []. i think specifically, this: AC_TRY_COMPILE( [ #include #include stru