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
:*:* )
53 echo ${UNAME_MACHINE}-unknown-sco3.2v
${UNAME_VERSION}
57 echo '(No uname command or uname output not recognized.)' 1>&2
58 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
66 printf("m68k-sony-newsos\n"); exit(0);
73 ${CC-cc} dummy.c
-o dummy
&& dummy
&& rm dummy.c dummy
&& exit 0
76 echo '(Unable to guess system type)' 1>&2