config.sub quoting issue

Sebastian Freundt hroptatyr at gna.org
Tue Oct 28 18:25:09 CET 2008


Torbjorn Granlund <tg at swox.com> writes:

> Sebastian Freundt <hroptatyr at gna.org> writes:
>
>   Hey there,
>   we've had a report regarding one of your build chain scripts, config.sub.
>   
>   Basic facts: NetBSD4, login shell is ksh, macharchos: sparc-sun-sunos4.1.1
>   
>   Basically this is what happens:
>   
>   [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 > /bin/sh ./config.sub sun4
>   sparc-sun-sunos4.1.1
>   [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 > /bin/ksh ./config.sub sun4
>   "./config.sub" not found
>   [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 > /usr/pkg/bin/bash ./config.sub sun4
>   sparc-sun-sunos4.1.1
>   [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 >
>   
>   we nailed it down to a quoting issue, config.sub:44
>   
>   configfsf_sub="`echo \"$0\" | sed 's/config.sub$/configfsf.sub/'`"
>   
>   our fix is to use the more quoting-tolerant $(...) syntax:
>   configfsf_sub=$(echo "$0" | sed 's/config.sub$/configfsf.sub/')
>   
> I don't think you can expect that quoting style to work in
> all /bin/sh out there, unfortunately.

Likewise, I don't think you can expect your quoting style to work in all
/bin/sh's :P

> Why do you explicitly use /bin/ksh, why don't you simply let the !# in
> the file determine that interpreter to use?  Then things should work.

I have no idea, it's not me who's seeing the issue, I'm just reporting
it.  But I think it's an autoconf issue at last, config.sub is called with
CONFIG_SHELL (which in turn sets SHELL) set to something that is
considered `shell enough' to cope with config.sub.  While this may be true
for the FSF config.sub it's not really working with yours, we've found a
way to work around: using SHELL=... ./configure or
CONFIG_SHELL=... ./configure, and I think all his shells (including
/bin/ksh) worked, just /bin/sh didn't.  Odd I know. :)

Cheers
Sebastian



More information about the gmp-bugs mailing list