home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.sbin / amd / config / arch next >
Encoding:
Text File  |  1991-05-12  |  3.8 KB  |  126 lines

  1. #! /bin/sh
  2. #
  3. # Copyright (c) 1989 Jan-Simon Pendry
  4. # Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  5. # Copyright (c) 1989 The Regents of the University of California.
  6. # All rights reserved.
  7. #
  8. # This code is derived from software contributed to Berkeley by
  9. # Jan-Simon Pendry at Imperial College, London.
  10. #
  11. # Redistribution and use in source and binary forms, with or without
  12. # modification, are permitted provided that the following conditions
  13. # are met:
  14. # 1. Redistributions of source code must retain the above copyright
  15. #    notice, this list of conditions and the following disclaimer.
  16. # 2. Redistributions in binary form must reproduce the above copyright
  17. #    notice, this list of conditions and the following disclaimer in the
  18. #    documentation and/or other materials provided with the distribution.
  19. # 3. All advertising materials mentioning features or use of this software
  20. #    must display the following acknowledgement:
  21. #    This product includes software developed by the University of
  22. #    California, Berkeley and its contributors.
  23. # 4. Neither the name of the University nor the names of its contributors
  24. #    may be used to endorse or promote products derived from this software
  25. #    without specific prior written permission.
  26. #
  27. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  28. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  30. # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  31. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  32. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  33. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  34. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  35. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  36. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  37. # SUCH DAMAGE.
  38. #
  39. #    @(#)arch    5.3 (Berkeley) 5/12/91
  40. #
  41. # $Id: arch,v 5.2.1.4 91/05/07 22:20:31 jsp Alpha $
  42. #
  43. # Figure out machine architecture
  44. #
  45.  
  46. PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/local/bin:${PATH} export PATH
  47.  
  48. #
  49. # First try to find a standard command
  50. #
  51. a=arch        # Sun compat
  52. m=machine    # BSD compat
  53. u=uname        # Sys5 compat
  54.  
  55. if [ -f /etc/$a -o -f /bin/$a -o -f /usr/bin/$a -o -f /usr/local/bin/$a ]
  56. then
  57.     exec $a
  58. elif [ -f /etc/$m -o -f /bin/$m -o -f /usr/bin/$m -o -f /usr/ucb/$m -o -f /usr/local/bin/$m ]
  59. then
  60.     exec $m
  61. elif [ -f /etc/$u -o -f /bin/$u -o -f /usr/bin/$u -o -f /usr/local/bin/$u ]
  62. then
  63.     ARCH="`uname`"
  64.     case "$ARCH" in
  65.         "HP-UX") echo hp9000; exit 0;;
  66.         AIX*) MACH="`uname -m`"
  67.             case "$MACH" in
  68.             00*) echo ibm6000; exit 0;;
  69.             10*) echo ibm032; exit 0;;
  70.             20*) echo ibm032; exit 0;;
  71.             esac
  72.             ;;
  73.         A/UX) echo macII ; exit 0 ;;
  74.         dgux) MACH="`uname -m`"
  75.             case "$MACH" in
  76.             AViiON) echo aviion; exit 0;;
  77.             esac
  78.             ;;
  79.         *) MACH="`uname -m`"
  80.             case "$MACH" in
  81.             IP6) echo mips; exit 0;;
  82.             *) ;;
  83.             esac
  84.             ;;
  85.     esac
  86. fi
  87.  
  88. #
  89. # Take a pot-shot at your machine architecture
  90. #
  91. echo "#    ... No ARCH= option specified; dynamically determining architecture" >&2
  92.  
  93. case "`exec 2>/dev/null; head -2 /etc/motd`" in
  94. *"HP-UX"*)        ARCH=hp9000;;
  95. *"Iris"*)        ARCH=iris4d;;
  96. *"Ultrix"*)        ARCH=vax;;
  97. *"RISC iX"*)        ARCH=arm;;
  98. *"Umax 4.2"*)        ARCH=encore;;
  99. *"Alliant Concentrix"*)    ARCH=alliant;;
  100. *"FPS Model 500"*)    ARCH=fps500;;
  101. *"HCX/UX"*)        ARCH=harris;;
  102. *)            ARCH=unknown;
  103.             if [ -d /usr/include/caif ]; then
  104.                 ARCH=ibm032
  105.             elif [ -f /bin/pyr ]; then
  106.                 if /bin/pyr; then
  107.                     ARCH=pyr
  108.                 fi
  109.             elif [ -d /NextApps ]; then
  110.                 ARCH=next
  111.             elif [ -f /etc/comply ]; then
  112.                 # Tex 4300 is essentially a sun 3.
  113.                 ARCH=sun3
  114.             fi
  115.             ;;
  116. esac
  117.  
  118. echo "#    ... architecture appears to be \"${ARCH}\"" >&2
  119. echo $ARCH
  120.  
  121. case "$ARCH" in
  122. unknown) exit 1
  123. esac
  124.  
  125. exit 0
  126.