summaryrefslogtreecommitdiff
path: root/config.guess
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-08-09 22:42:36 +0000
committerRichard M. Stallman <rms@gnu.org>1998-08-09 22:42:36 +0000
commit05d5ca258f91e8bf55c473b4243cd5424ddc655c (patch)
tree7ee5178d8cb7d54e84daac9630aba0dda0119d81 /config.guess
parentdf902b62cdaa3fcb75b0113de87a8fcf2b459ba7 (diff)
downloademacs-05d5ca258f91e8bf55c473b4243cd5424ddc655c.tar.gz
Detect HPPA 2.0 architecture.
Diffstat (limited to 'config.guess')
-rwxr-xr-xconfig.guess36
1 files changed, 34 insertions, 2 deletions
diff --git a/config.guess b/config.guess
index e31f37dcbdf..d1e5604cc23 100755
--- a/config.guess
+++ b/config.guess
@@ -364,8 +364,40 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
- 9000/8?? ) HP_ARCH=hppa1.0 ;;
+ 9000/7?? | 9000/8?[1679] )
+ sed 's/^ //' << EOF >dummy.c
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && HP_ARCH=`./dummy`
+ rm -f dummy.c dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}