3 # This script attempts to guess a canonical system name
4 # similar to the output of config.sub.
5 # If it succeeds, it prints the system name on stdout, and exits with 0.
6 # Otherwise, it prints an error message on stderr, and exits with 1.
8 # The plan is that this can be called by configure scripts if you don't
9 # specify an explicit system type (host/target name).
11 # Only a few systems have been added to this list;
12 # please add others (but try to keep the structure clean).
14 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
15 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
16 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
17 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
19 # Note: order is significant - the case branches are not exclusive.
21 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
22 sun4*:SunOS:[5-9].*:*)
23 echo sparc-sun-solaris2
26 echo sparc-sun-sunos${UNAME_RELEASE}
29 echo m68k-sun-sunos${UNAME_RELEASE}
32 echo mips-dec-ultrix${UNAME_RELEASE}
35 echo mips-sgi-irix${UNAME_RELEASE}
46 9000/7??:HP-UX:*:* | 9000/8?7:HP-UX:*:* )
65 echo cray2-cray-unicos
68 echo ${UNAME_MACHINE}-unknown-linux
71 if uname -X 2>/dev/null >/dev/null ; then
72 UNAME_REL=`(uname -X|egrep Release|sed -e 's/.*= //')`
73 (uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
74 echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
76 echo ${UNAME_MACHINE}-unknown-sysv3.2
81 echo '(No uname command or uname output not recognized.)' 1>&2
82 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
90 printf("m68k-sony-newsos\n"); exit(0);
94 #if defined(hp300) && !defined(hpux)
95 printf("m68k-hp-bsd\n"); exit(0);
98 #if defined (MULTIMAX) || defined (n16)
100 printf("ns32k-encore-sysv\n"); exit(0);
103 printf("ns32k-encore-mach\n"); exit(0);
105 printf("ns32k-encore-bsd\n"); exit(0);
114 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
117 echo '(Unable to guess system type)' 1>&2