On Friday 07 December 2007, Stepan Kasal wrote: > Hello Mike, > > On Wed, Dec 05, 2007 at 03:17:11PM -0500, Mike Frysinger wrote: > > > On Tue, Dec 04, 2007 at 07:25:28PM -0500, Mike Frysinger wrote: > > > > this structure isnt portable shell: > > > > : ${VAR='foo'} > > > > i dont have any documentation to back up my claim, just code. ive never > > seen this construct in autoconf generated code [...] > > ... yet there is one instance in every configure script: > : ${CONFIG_STATUS=./config.status} > > But I admit that's not much. ;-) > > > especially considering this: > > - older automake used the form > > > > : ${VAR='foo'} > > > > - newer automake switched same code base to use > > test "${VAR+set}" = set || VAR="foo" > > I searched the Automake git and found one such changed, see the patch > attached to this mail. > > The comment explains that the intention was to expand the variable. > IOW they wanted to change > > : ${CCAS='$(CC)'} > > to > > : ${CCAS="$CC"} > > But since the _latter_ can cause problems on some weird systems, it > had to be rewritten using the ${VAR+set} pattern. > > BTW, I would not hesitate to use the latter form in > util-linux-ng/configure.ac, because IMHO the portability scope > of util-linux-ng is not as wide as the scope of the Autoconf itself. > (IOW, I think that no one builds util-linux-ng on Ultrix, which is the > only patform known to have problems wit ${CCAS="$CC"}.) while i agree in general that the target consumers of newer util-linux could probably get by with POSIX shell and not portable shell, i think it's best if we stick to "common" conventions that autotool / portable shell uses so as to reduce confusion/gotchas to new comers. other than the fact that it sucks we have to explicitly enumerate variables for every program, i think an updated patch would be OK. gnulib does something similar: gl_INCLUDE_EXCLUDE_PROG([prog_var_name], [list of progs]) and then at the bottom it runs [list of progs] through a loop ... perhaps we could do something like that ... or maybe it'll just complicate things ... -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.