[tex-live] configure bug WRT shell selection (was: libtool stuff)

Alexis Ballier aballier at gentoo.org
Fri Aug 7 00:01:04 CEST 2009


> > can anyone tell me (or tell me who could know) how the libtool
> > script is generated?  It contains a bashism in our latest builds
> > (Debian uses dash as /bin/sh since a couple of weeks ago).  
> The problem seems to be that, the check whether the shell understands
> variable appending syntax using += is successful at configure time,
> but fails at compile time.  On Debian systems, /bin/bash is usually
> present, but /bin/sh points to dash (a minimalistic, fast
> POSIX-compliant shell).
> export CONFIG_SHELL=/bin/sh
> before running ./Build seems to fix the problem (I'm not yet through
> with the build).
> This seems to be a bug in the configure script. If I understood it
> right, it has a list of candidate shells, starting with /bin/sh;
> /bin/bash comes next. Instead of stopping with the first match, it
> also tries and sticks with the second (the others are probably not
> installed).  Thus, bash is used by configure.
> Later on, the generated libtool script just uses /bin/sh which doesn't
> understand bash-specific syntax.

I've seen the exact same problem here [1]. I only workarounded it for
now, but my understanding of the issue is:

configure checks for the current shell, if it likes it, it uses it. I
suppose it assumes the first one is /bin/sh as that's what the #! at
the top of the script wants.
If it doesn't like it, it tries other shells: bash, etc.

It doesn't like dash so it uses bash and sets SHELL as bash. Fine.

After that it's getting more amusing: Makefiles (see web2c/Makefile.am)
do call configure scripts as '$(SHELL) configure'. Now the configure
script likes the current shell since it's bash and believes it
is /bin/sh. libtool checks for everything, the += syntax is supported,
etc, *but* it also believes /bin/sh is fine. The libtool script is
created as #!/bin/sh and assumes bash syntax because the configure
script has generated it while thinking that way.

While setting CONFIG_SHELL seems fine it is probably still better to
let the autoconf checks chose what they prefer. The fix I would propose
would be to remove the '$(SHELL)' from the recursive configure
invocations in Makefile.am files, leaving the #! and the executable bit
do the job but maybe, if it has been done that way, there were some
reasons that I failed to see.



[1] https://bugs.gentoo.org/show_bug.cgi?id=274802
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex-live/attachments/20090807/e044d7ae/attachment.bin>

More information about the tex-live mailing list