This regex is too greedy: uname -m | sed -e s/[i]*.86/i386/ -e s/x86_64/amd64/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ I would venture to guess that there isn't any arch called i386_64. Did 64-bit even exist back then? Anyway, that's what it outputs when using the amd64 arch. The regular expressions in those files should be changed to this: uname -m | sed -e s/i[3-6]86/i386/ -e s/x86_64/amd64/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/
The fallback uname call makes no sense to me, because $ARCH should be always fine as set by profiles, unless somebody overrides it with bogus in make.conf, in which case it should better die.
(In reply to comment #1) > The fallback uname call makes no sense to me, because $ARCH should be always > fine as set by profiles, unless somebody overrides it with bogus in make.conf, > in which case it should better die. > Agreed.
(In reply to comment #2) > (In reply to comment #1) > > The fallback uname call makes no sense to me, because $ARCH should be always > > fine as set by profiles, unless somebody overrides it with bogus in make.conf, > > in which case it should better die. > > > > Agreed. > Using uname also doesn't work in a cross compiling scenario.
So it should just substitute x86 to i386 (that's how the dirs are named) and probably x86-fbsd -> i386?
(In reply to comment #4) > So it should just substitute x86 to i386 (that's how the dirs are named) and > probably x86-fbsd -> i386? > Something like that yes.
I've now rewritten the function so that it is ABI-aware and doesn't generally suck. :)