[lfs-support] can't compile gcc pass 1

Simon Geard delgarde at ihug.co.nz
Sun Jan 6 23:12:29 PST 2013

On Sun, 2013-01-06 at 12:35 +0100, Tobias Gasser wrote:
> > AWK=`readlink -f /usr/bin/awk`
> > awk=/usr/bin/awk
> > [ "$AWK" ==  "/usr/bin/gawk" ] || die "$awk is not a symlink to gawk"
> some distros started to drop the /usr hierarchy
> the script should be a little smarter to accept the files not only in 
> /usr/bin but just anywhere in $PATH
> something like
> awk=$( which awk )
> AWK=$( readlink -f "${awk}" )
> [ "${AWK%%\/gawk}" == "${AWK}" ] && die...

Thinking about it, that's still unnecessarily complicated. Because for
all the talk about symlinks, what we actually care about is that running
'awk' results in running 'gawk'. And to test that, we don't need to mess
with readlink and stuff - we just need to run it and ask it what it

        $ awk --version | head -n 1
        GNU Awk 4.0.1
Likewise the bash/dash thing, for that matter - we don't care about
symlinks, we care that 'sh' is the same thing as bash.

        $ sh --version | head -n 1
        GNU bash, version 4.2.39(1)-release (x86_64-unknown-linux-gnu)

No need to worry about /bin vs /usr/bin, or whether files might be
symlinked, hardlinked, or outright copies.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-support/attachments/20130107/e6547b62/attachment.sig>

More information about the lfs-support mailing list