At Thursday 10 June 2010, Eric Blake wrote:
> On 06/10/2010 03:13 AM, Stefano Lattarini wrote:
> >> Will that always work on mingw, where you are not guaranteed the
> >> existence of /bin/sh?
> >
> > Honestly, I dind't think that there were systems missing /bin/sh
> > which could be targets for automake :-(
> > Anyway, the old bootstrap script too assumed existence of
> > /bin/sh, since the temporary script `boot$$.sh' contained the
> > shebang line "#! /bin/sh". Right?
>
> Not necessarily. If I understand correctly, the MSYS environment
> knows that if a file is not a PE-COFF executable, but does have a
> she-bang, that it must be a shell script. So rather than invoking
> /bin/sh, which doesn't necessarily exist, it invokes sh (relying
> on a PATH search to find it). For that matter, it could always
> invoke sh, regardless of the she-bang, because bash knows how to
> re-invoke an interpreter based on the she-bang (or, it is pretty
> easy to patch the MSYS port of bash to do that). But the point is
> that the MSYS environment tries hard to avoid dictating layout of
> the file system, and does everything relative to PATH, since
> Windows systems do not have nearly the same notion of a common
> layout as Unix-like systems.
>
> >> Then again, mingw is one of the platforms where you want the
> >> path separator to be detected as ; rather than :.
> >
> > True; thus the script still works correctly, even if just by
> > chance.
>
> So I guess I'm okay with your patch as is, but it's up to Ralf at
> this point.
Well, after having read your considerations, I'm no more OK with the
patch myself; maybe I'll amend it later, to keep just the spacing and
comsetic changes, and adding a comment about the reason we can't
assume existence of /bin/sh.
But... I note that autoconf-generated configure scripts determine PATH
separator in (more or less) the same way my pached bootstrap script
does:
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
If we assume autoconf is correct, I think that it would be better to
just copy this code snippet in the bootstrap script.
WDYT?
Regards,
Stefano