ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/Solaris/which_sparc
(Generate patch)

Comparing BasiliskII/src/Unix/Solaris/which_sparc (file contents):
Revision 1.1 by cebix, 1999-10-21T13:19:26Z vs.
Revision 1.2 by cebix, 1999-10-21T15:27:07Z

# Line 1 | Line 1
1   #!/bin/sh
2  
3 < # WHICH_SPARC
3 > # which_sparc
4   #
5   # This script generates a program that tests for a SPARC processor class
6   # Program returns:
7 < # 0             unknown SPARC processor
8 < # 8             SPARC V8 `compliant' processor  (umul instruction is legal)
9 < # 9             SPARC V9 `compliant' processor  (popc instruction is legal)
7 > #  0 unknown SPARC processor
8 > #  8 SPARC V8 `compliant' processor     (umul instruction is legal)
9 > #  9 SPARC V9 `compliant' processor     (popc instruction is legal)
10 > #
11 > # The script prints:
12 > #  "unknown SPARC architecture"
13 > #  SPARC_V8
14 > #  SPARC_V9
15   #
16   # I hope this works for other machines and OS. Tested machines are:
17   # Sun Ultra 10 (Solaris 7), SPARC Station 5 (Solaris 2.5.1)
# Line 19 | Line 24 | PROG=./conftest
24   SOURCE=./conftest.c
25  
26   if [ ! -x $PROG ]; then
22 echo "Compiling the test program"
27   cat > $SOURCE << EOF
28   #include <stdio.h>
29   #include <signal.h>
# Line 107 | Line 111 | fi
111   $PROG
112   case $? in
113          0) echo "unknown SPARC architecture";;
114 <        8) echo "SPARC V8 compliant processor";;
115 <        9) echo "SPARC V9 compliant processor";;
114 >        8) echo "SPARC_V8";;
115 >        9) echo "SPARC_V9";;
116   esac
117  
118   rm -f $PROG

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines