+ #
+ # We have to ask GCC for the target architecture, because it may
+ # differ from what uname tells us. This can happen even if we are
+ # not cross-compiling, for example on Linux with amd64 kernel, but
+ # i386 userspace.
+ #
+ my $gcc = Get("CC");
+ my $mach = `$gcc -dumpmachine 2>/dev/null`;
+ if (!$? && $mach ne "") {
+ $mach =~ s/-.*//;
+ } else {
+ $mach = `uname -m`;
+ Fail "Unable to determine machine type" if $? || $mach eq "";
+ }