9 # oper-:arch-:syst-:chip-:kern-
10 # oper = operating system type; e.g., sunos-4.1.4
11 # arch = machine language; e.g., sparc
12 # syst = which binaries can run; e.g., sun4
13 # chip = chip model; e.g., micro-2-80
14 # kern = kernel version; e.g., sun4m
15 # dependence: arch --- chip
17 # oper --- syst --- kern
18 # so, for example, syst is interpreted in light of oper, but chip is not.
19 # anyway, no slashes, no extra colons, no uppercase letters.
20 # the point of the extra -'s is to ease parsing: can add hierarchies later.
21 # e.g., *:i386-*:*:pentium-*:* would handle pentium-100 as well as pentium,
22 # and i386-486 (486s do have more instructions, you know) as well as i386.
23 # the idea here is to include ALL useful available information.
25 sys="`uname -s 2>/dev/null | tr '/:[A-Z]' '..[a-z]'`"
28 unamer="`uname -r 2>/dev/null | tr /: ..`"
29 unamem="`uname -m 2>/dev/null | tr /: ..`"
30 unamev="`uname -v 2>/dev/null | tr /: ..`"
34 # in bsd 4.4, uname -v does not have useful info.
35 # in bsd 4.4, uname -m is arch, not chip.
39 chip="`sysctl -n hw.model 2>/dev/null`"
43 # see above about bsd 4.4
47 chip="`sysctl -n hw.model 2>/dev/null`" # hopefully
51 # see above about bsd 4.4
55 chip="`sysctl -n hw.model 2>/dev/null`" # hopefully
59 # i'd really like to know what distribution the user has ...
61 # as in bsd 4.4, uname -v does not have useful info.
62 oper="$sys-$unamer" # not oper!
75 # naturally IBM has to get uname -r and uname -v backwards. dorks.
76 oper="$sys-$unamev-$unamer"
77 arch="`arch 2>/dev/null | tr /: ..`"
83 oper="$sys-$unamer-$unamev"
84 arch="`(uname -p 2>/dev/null || mach 2>/dev/null ) | tr /: ..`"
85 syst="`arch 2>/dev/null | tr /: ..`"
86 chip="$unamem" # this is wrong; is there any way to get the real info?
87 kern="`arch -k 2>/dev/null | tr /: ..`"
90 oper="$sys-$unamer-$unamev"
91 arch="`uname -m 2>/dev/null`"
97 oper="$sys-$unamer-$unamev"
102 if /bin/sysinfo -cpu 2>/dev/null >/dev/null ; then
103 (/bin/sysinfo -cpu 2>/dev/null |grep PentiumPro >/dev/null) && chip=ppro;
104 test "$chip" = "" && \
105 (/bin/sysinfo -cpu 2>/dev/null |grep Pentium >/dev/null) && chip=pentium;
118 if test "x$need_config_guess" = x1 ; then
119 cg=`$srcdir/config.guess` # cpu-company-system
120 if test "x$cg" = x ; then
121 # damned, config.guess does nothing if it doesn't support the
123 oper="`uname -s 2>/dev/null | tr '/:[A-Z]' '..[a-z]'`"
124 chip="`uname -m 2>/dev/null | tr /: ..`"
125 if test "x$oper" = x ; then
130 # chip-useless-oper+version
131 # i586-unknown-sco3.2v4.2
134 chip="`echo $cg | sed s/-.*//`"
135 oper="`echo $cg | sed s/.*-// | tr '[A-Z]' '[a-z]'`"
140 x="`echo $oper|sed 's/[0-9].*//'`"
141 y="`echo $oper|sed 's/^[a-z]*//'`"
145 oper=linux-"`uname -r`"
154 # let's try to be consistent here. (BSD/OS)
158 # respect the hyphen hierarchy. (FreeBSD)
162 # respect the hyphen hierarchy. (FreeBSD)
166 # no, you nitwits, there is no such chip. (NeXTStep)
170 # no, you nitwits, there is no such chip. (Linux)
172 # djb, stop bashing linux alone, bash to GNU people too ...
173 # config.guess also does this!
176 # STOP SAYING THAT! (Linux)
179 if test "x$arch" = x ; then
180 if test "x$chip" = i386 -o "x$chip" = i486 -o "x$chip" = "pentium" \
181 -o "x$chip" = "ppro" ; then
186 x=`echo "$oper-:$arch-:$syst-:$chip-:$kern-" | tr ' [A-Z]' '.[a-z]'`
188 if test x"$@" = x ; then
189 echo "Future @PACKAGE@ versions will include a list of systems this version" >&2
190 echo "was compiled under (that's what you send this message for). In case" >&2
191 echo "want to see a shorthand expression of your real name in this list" >&2
192 echo "you may provide it here:" >&2
193 echo "Realname: " >&2
199 echo # BeOS /bin/mail doesn't generate any header ...
202 echo "PACKAGE: @PACKAGE@ @VERSION@"
203 cc="`echo \"$CC\"|sed 's/ .*//'`"
204 x=`$CC --version </dev/null 2>/dev/null`
206 echo "CFLAGS: $CFLAGS"
207 if test "x$realname" = x ; then
210 echo "REALNAME: $realname"