home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / config / config.guess < prev    next >
Encoding:
Text File  |  1998-04-08  |  10.0 KB  |  374 lines

  1. #!/bin/sh
  2. # This script attempts to guess a canonical system name.
  3. #   Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
  4. #
  5. # This file is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #
  20. # This script attempts to guess a canonical system name similar to
  21. # config.sub.  If it succeeds, it prints the system name on stdout, and
  22. # exits with 0.  Otherwise, it exits with 1.
  23. #
  24. # The plan is that this can be called by configure scripts if you
  25. # don't specify an explicit system type (host/target name).
  26. #
  27. # Only a few systems have been added to this list; please add others
  28. # (but try to keep the structure clean).
  29. #
  30.  
  31. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  32. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  33. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  34. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  35.  
  36. # Note: order is significant - the case branches are not exclusive.
  37.  
  38. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  39.     alpha:OSF1:1.*:*)
  40.     # 1.2 uses "1.2" for uname -r.
  41.     echo alpha-dec-osf${UNAME_RELEASE}
  42.         exit 0 ;;
  43.     # lemacs change from Dirk Grunwald <grunwald@foobar.cs.colorado.edu>
  44.     alpha:OSF1:V[123].*:*)
  45.     # 1.3 uses "V1.3" for uname -r.
  46.     echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
  47.     exit 0 ;;
  48.     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  49.     echo arm-acorn-riscix${UNAME_RELEASE}
  50.     exit 0;;
  51.     sun4*:SunOS:5.*:*)
  52.     echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  53.     exit 0 ;;
  54.     sun4*:SunOS:6*:*)
  55.     # According to config.sub, this is the proper way to canonicalize
  56.     # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
  57.     # it's likely to be more like Solaris than SunOS4.
  58.     echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  59.     exit 0 ;;
  60.     i86pc*:SunOS:5.*:*)
  61.         echo x86-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  62.         exit 0 ;;
  63.     sun4*:SunOS:*:*)
  64.     echo sparc-sun-sunos${UNAME_RELEASE}
  65.     exit 0 ;;
  66.     sun3*:SunOS:*:*)
  67.     echo m68k-sun-sunos${UNAME_RELEASE}
  68.     exit 0 ;;
  69.     RISC*:ULTRIX:*:*)
  70.     echo mips-dec-ultrix${UNAME_RELEASE}
  71.     exit 0 ;;
  72.     VAX*:ULTRIX*:*:*)
  73.     echo vax-dec-ultrix${UNAME_RELEASE}
  74.     exit 0 ;;
  75.     mips:*:5*:RISCos)
  76.     echo mips-mips-riscos${UNAME_RELEASE}
  77.     exit 0 ;;
  78.     m88k:*:4*:R4*)
  79.     echo m88k-motorola-sysv4
  80.     exit 0 ;;
  81.     m88k:*:3*:R3*)
  82.     echo m88k-motorola-sysv3
  83.     exit 0 ;;
  84.     AViiON:dgux:*:*)
  85.      echo m88k-dg-dgux${UNAME_RELEASE}
  86.      exit 0 ;;
  87.     M88*:*:R3*:*)
  88.     # Delta 88k system running SVR3
  89.     echo m88k-motorola-sysv3
  90.     exit 0 ;;
  91.     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  92.     echo m88k-tektronix-sysv3
  93.     exit 0 ;;
  94.     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  95.     echo m68k-tektronix-bsd
  96.     exit 0 ;;
  97.     *:IRIX*:*:*)
  98.     echo mips-sgi-irix${UNAME_RELEASE}
  99.     exit 0 ;;
  100.     i[3456]86:AIX:*:*)
  101.     echo i386-ibm-aix
  102.     exit 0 ;;
  103.     *:AIX:2:3)
  104.     test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '=3240' \
  105.         && echo rs6000-ibm-aix3.2.4 && exit 0
  106.     test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '=3250' \
  107.         && echo rs6000-ibm-aix3.2.5 && exit 0
  108.     test -x /usr/bin/oslevel && test `/usr/bin/oslevel` = '<>3250' \
  109.         && echo rs6000-ibm-aix3.2.5 && exit 0
  110.     echo rs6000-ibm-aix3.2
  111.     exit 0 ;;
  112.     *:AIX:*:4)
  113.     echo rs6000-ibm-aix4
  114.     exit 0 ;;
  115.     *:AIX:*:*)
  116.     echo rs6000-ibm-aix
  117.     exit 0 ;;
  118.     *:BOSX:*:*)
  119.     echo rs6000-bull-bosx
  120.     exit 0 ;;
  121.     DPX/2?00:B.O.S.:*:*)
  122.     echo m68k-bull-sysv3
  123.     exit 0 ;;
  124.     9000/31?:HP-UX:*:*)
  125.     echo m68000-hp-hpux
  126.     exit 0 ;;
  127.     9000/[34]??:HP-UX:*:*)
  128.     echo m68k-hp-hpux
  129.     exit 0 ;;
  130.     9000/[34]??:4.3bsd:1.*:*)
  131.     echo m68k-hp-bsd
  132.     exit 0 ;;
  133.     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  134.     echo m68k-hp-bsd4.4
  135.     exit 0 ;;
  136.     9000/7??:HP-UX:*:* | 9000/8?7:HP-UX:*:* )
  137.     echo hppa1.1-hp-hpux
  138.     exit 0 ;;
  139.     9000/8??:HP-UX:*:*)
  140.     echo hppa1.0-hp-hpux
  141.     exit 0 ;;
  142.     3050*:HI-UX:*:*)
  143.     sed 's/^    //' << EOF >dummy.c
  144.     #include <unistd.h>
  145.     int
  146.     main ()
  147.     {
  148.       long cpu = sysconf (_SC_CPU_VERSION);
  149.       if (CPU_IS_HP_MC68K (cpu))
  150.         puts ("m68k-hitachi-hiuxwe2");
  151.       else if (CPU_IS_PA_RISC (cpu))
  152.         {
  153.           switch (cpu)
  154.         {
  155.           case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  156.           case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  157.           case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  158.           default: puts ("hppa-hitachi-hiuxwe2"); break;
  159.         }
  160.         }
  161.       else puts ("unknown-hitachi-hiuxwe2");
  162.       exit (0);
  163.     }
  164. EOF
  165.     ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
  166.     rm -f dummy.c dummy
  167.     echo unknown-hitachi-hiuxwe2
  168.     exit 0 ;;
  169.     9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
  170.     echo hppa1.1-hp-bsd
  171.     exit 0 ;;
  172.     9000/8??:4.3bsd:*:*)
  173.     echo hppa1.0-hp-bsd
  174.     exit 0 ;;
  175.     C1*:ConvexOS:*:* | convex:ConvexOS:C1:*)
  176.     echo c1-convex-bsd
  177.         exit 0 ;;
  178.     C2*:ConvexOS:*:* | convex:ConvexOS:C2:*)
  179.     echo c2-convex-bsd
  180.         exit 0 ;;
  181.     CRAY*X-MP:UNICOS:*:*)
  182.     echo xmp-cray-unicos
  183.         exit 0 ;;
  184.     CRAY*Y-MP:UNICOS:*:*)
  185.     echo ymp-cray-unicos
  186.         exit 0 ;;
  187.     CRAY-2:UNICOS:*:*)
  188.     echo cray2-cray-unicos
  189.         exit 0 ;;
  190.     hp3[0-9][05]:NetBSD:*:*)
  191.     echo m68k-hp-netbsd${UNAME_RELEASE}
  192.     exit 0 ;;
  193.     i[3456]86:FreeBSD:*:*)
  194.     echo ${UNAME_MACHINE}-unknown-freebsd
  195.     exit 0 ;;
  196.     i[3456]86:NetBSD:*:*)
  197.     echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE}
  198.     exit 0 ;;
  199.     alpha:Linux:*:*)
  200.     echo ${UNAME_MACHINE}-unknown-linux
  201.     exit 0 ;;
  202.     i[3456]86:Linux:*:*)
  203.     echo ${UNAME_MACHINE}-unknown-linux
  204.     exit 0 ;;
  205.     ppc:Linux:*:*)
  206.     echo ${UNAME_MACHINE}-unknown-linux
  207.     exit 0 ;;
  208.     i[3456]86:UNIX_SV:4.*:* | i[3456]86:SYSTEM_V:4.*:*)
  209.     if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  210.         UNAME_REL=`(/bin/uname -v)`
  211.         echo ${UNAME_MACHINE}-sco-unixware${UNAME_REL}
  212.     else
  213.         echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
  214.     fi
  215.     exit 0 ;;
  216.     i[3456]86:*:3.2:*)
  217.     if /bin/uname -X 2>/dev/null >/dev/null ; then
  218.         UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= .*v//')`
  219.         (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  220.         echo ${UNAME_MACHINE}-sco-opensv${UNAME_REL}
  221.     else
  222.         echo ${UNAME_MACHINE}-unknown-sysv32
  223.     fi
  224.     exit 0 ;;
  225.     mini*:CTIX:SYS*5:*)
  226.     # "miniframe"
  227.     echo m68010-convergent-sysv
  228.     exit 0 ;;
  229.     M680[234]0:*:R3V[567]*:*)
  230.     test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  231.     3[3456]??*:*:4.0:*)
  232.     uname -p 2>/dev/null | egrep 'Pentium|86' >/dev/null && echo x86-ncr-sysv4 && exit 0 ;;
  233.     m680[234]0:LynxOS:2.2*:*)
  234.     echo m68k-lynx-lynxos${UNAME_RELEASE}
  235.     exit 0 ;;
  236.     i[3456]86:LynxOS:2.2*:*)
  237.     echo x86-lynx-lynxos${UNAME_RELEASE}
  238.     exit 0 ;;
  239.     TSUNAMI:LynxOS:2.2*:*)
  240.     echo sparc-lynx-lynxos${UNAME_RELEASE}
  241.     exit 0 ;;
  242.     RM*:SINIX-N:5.4[23]:*|RM*:ReliantUNIX-N:5.4[23]:*)
  243.     echo mips-sni-reliantunix
  244.     exit 0 ;;
  245. esac
  246.  
  247. #echo '(No uname command or uname output not recognized.)' 1>&2
  248. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  249.  
  250. cat >dummy.c <<EOF
  251. main()
  252. {
  253. #if defined (sony)
  254. #if defined (MIPSEB)
  255. #if defined (__svr4)
  256.   printf ("mips-sony-sysv\n"); exit (0);
  257. #else
  258.   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
  259.      I don't know....  */
  260.   printf ("mips-sony-bsd\n"); exit (0);
  261. #endif
  262. #else
  263.   printf("m68k-sony-newsos\n"); exit(0);
  264. #endif
  265. #endif
  266.  
  267. #if defined (_nec_ews)
  268.   printf("mips-nec-uxv4.2\n"); exit(0);
  269. #endif
  270.  
  271. #if defined (__arm) && defined (__acorn) && defined (__unix)
  272.   printf("arm-acorn-riscix"); exit (0);
  273. #endif
  274.  
  275. #if defined(hp300) && !defined(hpux)
  276.   printf("m68k-hp-bsd\n"); exit(0);
  277. #endif
  278.  
  279. #if defined(NeXT)
  280. #if !defined(__ARCHITECTURE__)
  281. #define __ARCHITECTURE__ "m68k"
  282. #endif
  283.   int version;
  284.   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  285.   if (version==2)
  286.     {
  287.       printf("%s-next-ns2\n", __ARCHITECTURE__);
  288.       exit(0);
  289.     }
  290.   else
  291.     {
  292.       printf("%s-next-ns3\n", __ARCHITECTURE__);
  293.       exit(0);
  294.     }
  295. #endif
  296.  
  297. #if defined (MACH)
  298. #if defined (vax)
  299.   printf("vax-dec-mach\n"); exit(0);
  300. #else
  301. #if defined (sun3)
  302.   printf("mc68000-sun-mach\n"); exit(0);
  303. #else
  304. #if defined (sparc)
  305.   printf("sparc-sun-mach\n"); exit(0);
  306. #else
  307. #if defined (mips)
  308.   printf("mips-dec-mach\n"); exit(0);
  309. #else
  310. #if defined (ibmrt)
  311.   printf("romp-ibm-mach\n"); exit(0);
  312. #else
  313. #if defined (i386)
  314.   printf("i386-unknown-mach\n"); exit(0);
  315. #endif
  316. #endif
  317. #endif
  318. #endif
  319. #endif
  320. #endif
  321. #endif
  322.  
  323. #if defined (MULTIMAX) || defined (n16)
  324. #if defined (UMAXV)
  325.   printf("ns32k-encore-sysv\n"); exit(0);
  326. #else
  327. #if defined (CMU)
  328.   printf("ns32k-encore-mach\n"); exit(0);
  329. #else
  330.   printf("ns32k-encore-bsd\n"); exit(0);
  331. #endif
  332. #endif
  333. #endif
  334.  
  335. #if defined(__386BSD__) || (defined(__bsdi__) && defined(__i386__))
  336.   printf("i386-bsdi-bsd\n"); exit(0);
  337. #endif
  338.  
  339. #if defined(sequent)
  340. #if defined(i386)
  341.   printf("i386-sequent-dynix\n"); exit(0);
  342. #endif
  343. #if defined (ns32000)
  344.   printf("ns32k-sequent-dynix\n"); exit(0);
  345. #endif
  346. #endif
  347.  
  348. #if defined(_SEQUENT_)
  349.   printf("i386-sequent-ptx\n"); exit(0);
  350. #endif
  351.  
  352. #if defined(vax)
  353. #if !defined(ultrix)
  354.   printf("vax-dec-bsd\n"); exit(0);
  355. #else
  356.   printf("vax-dec-ultrix\n"); exit(0);
  357. #endif
  358. #endif
  359.  
  360.   exit (1);
  361. }
  362. EOF
  363.  
  364. ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
  365. rm -f dummy.c dummy
  366.  
  367. # Apollos put the system type in the environment.
  368.  
  369. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  370.  
  371. #echo '(Unable to guess system type)' 1>&2
  372.  
  373. exit 1
  374.