[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
config.guess problem on MacOS X with coreutils "uname" command
From: |
Paul Eggert |
Subject: |
config.guess problem on MacOS X with coreutils "uname" command |
Date: |
Tue, 03 Aug 2004 22:45:49 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
I'm responding to this old MacOS-X-related bug that mentions config.guess:
http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
Here, the underlying problem is that on MacOS X, the system call
sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
returns a negative number, which causes the coreutils command "uname -p"
to report "unknown". This confuses config.guess.
config.guess should fixed regardless of what change we make to
coreutils uname, since the stable coreutils uname has been out in the
wild for over a year.
Ben, can you please install this patch into config.guess? The current
config.guess is clearly wrong in some sense, since it outputs
"-apple-darwin-..." (with a leading "-") when uname -p outputs
anything other than "powerpc" or something ending in "86".
I'm CC'ing this to Stuart Hastings of Apple since he proposed the old
config.guess code here.
Thanks.
2004-08-03 Paul Eggert <address@hidden>
* config.guess (*:Darwin:*:*): If uname -p reports "unknown",
assume the processor is a powerpc. This is because coreutils
uname (at least versions 4.5.7 through 5.2.1) outputs "unknown"
in this case, due to a MacOS X bug that causes
sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
to return a negative number.
Problem reported by Petter Reinholdtsen in:
http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
--- old/config.guess 2004-08-02 17:08:23 -0700
+++ new/config.guess 2004-08-03 22:25:01 -0700
@@ -1179,9 +1179,10 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
- case `uname -p` in
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
- config.guess problem on MacOS X with coreutils "uname" command,
Paul Eggert <=