2 # $Cambridge: exim/src/scripts/arch-type,v 1.1 2004/10/06 15:07:40 ph10 Exp $
4 # Shell script to determine the architecture type.
6 # If EXIM_ARCHTYPE is set, use it. This allows a manual override.
8 case "$EXIM_ARCHTYPE" in ?*) arch="$EXIM_ARCHTYPE";; esac
10 # Otherwise, try to get a value from the uname command. When uname -p gives
11 # "unknown" or something containing spaces, try -m.
13 case "$arch" in '') arch=`uname -p 2> /dev/null`;; esac
14 case "$arch" in ''|unknown|*\ *) arch=`uname -m 2> /dev/null`;; esac
16 # Otherwise, see if ARCHTYPE is set. Some versions of NetBSD set it to
17 # "NetBSD", which isn't very helpful. However, we expect uname to have
18 # worked under NetBSD, so this shouldn't matter.
20 case "$arch" in '') arch="$ARCHTYPE";; esac
22 # Otherwise, as a cheap test, try shell's HOSTTYPE, but as tcsh sometimes sets
23 # it to the OS name, ignore it if running with tcsh.
25 case "$SHELL" in ?*tcsh) HOSTTYPE="";; esac
27 case "$arch++$HOSTTYPE" in
28 ++?*) arch="$HOSTTYPE"
29 # Fix up disagreements :-)
33 # Comment by Vadim Vygonets:
34 # Maybe sun4/sun4c/sun4m and sun4u (or whatever else they call the
35 # Ultras, sparc64?) should be different platforms. Maybe not.
36 # NetBSD and OpenBSD (the latter is not supported) think about them
37 # as different platforms. Solaris doesn't seem to. I have no idea
50 echo "*** Failed to determine the machine architecture type." 1>&2
56 # Get rid of any gash characters in the string
58 arch=`echo $arch | sed 's,[^-+_.a-zA-Z0-9],,g'`
60 # Some further fixups needed
63 i[3456]86*) arch=i386;;
64 RISC) arch=mips;; # MIPS Ultrix
66 9000[78][0-9][0-9]) arch=hp9000s700;;
67 9000[34][0-9][0-9]) arch=hp9000s400;;
71 # OK, the script seems to have worked. Pass the value back.