/[autoconf]/autoconf/config/config.guess
ViewVC logotype

Diff of /autoconf/config/config.guess

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by eggert, Wed Jun 5 20:55:06 2002 UTC revision 1.11 by akim, Thu Jul 18 12:06:37 2002 UTC
# Line 3  Line 3 
3  #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,  #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4  #   2000, 2001, 2002 Free Software Foundation, Inc.  #   2000, 2001, 2002 Free Software Foundation, Inc.
5    
6  timestamp='2002-05-29'  timestamp='2002-07-09'
7    
8  # This file is free software; you can redistribute it and/or modify it  # This file is free software; you can redistribute it and/or modify it
9  # under the terms of the GNU General Public License as published by  # under the terms of the GNU General Public License as published by
# Line 88  if test $# != 0; then Line 88  if test $# != 0; then
88    exit 1    exit 1
89  fi  fi
90    
91    trap 'exit 1' 1 2 15
92    
93  dummy=dummy-$$  # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
94  trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15  # compiler to aid in system detection is discouraged as it requires
95    # temporary files to be created and, as you can see below, it is a
96    # headache to deal with in a portable fashion.
97    
 # CC_FOR_BUILD -- compiler used by this script.  
98  # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still  # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
99  # use `HOST_CC' if defined, but it is deprecated.  # use `HOST_CC' if defined, but it is deprecated.
100    
101  set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in  # This shell variable is my proudest work .. or something. --bje
102   ,,)    echo "int dummy(){}" > $dummy.c ;  
103    set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
104    (old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
105       || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
106    dummy=$tmpdir/dummy ;
107    files="$dummy.c $dummy.o $dummy.rel $dummy" ;
108    trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
109    case $CC_FOR_BUILD,$HOST_CC,$CC in
110     ,,)    echo "int x;" > $dummy.c ;
111          for c in cc gcc c89 c99 ; do          for c in cc gcc c89 c99 ; do
112            ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;            if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then
           if test $? = 0 ; then  
113               CC_FOR_BUILD="$c"; break ;               CC_FOR_BUILD="$c"; break ;
114            fi ;            fi ;
115          done ;          done ;
116          rm -f $dummy.c $dummy.o $dummy.rel ;          rm -f $files ;
117          if test x"$CC_FOR_BUILD" = x ; then          if test x"$CC_FOR_BUILD" = x ; then
118            CC_FOR_BUILD=no_compiler_found ;            CC_FOR_BUILD=no_compiler_found ;
119          fi          fi
120          ;;          ;;
121   ,,*)   CC_FOR_BUILD=$CC ;;   ,,*)   CC_FOR_BUILD=$CC ;;
122   ,*,*)  CC_FOR_BUILD=$HOST_CC ;;   ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
123  esac'  esac ;
124    unset files'
125    
126  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
127  # (ghazi@noc.rutgers.edu 1994-08-24)  # (ghazi@noc.rutgers.edu 1994-08-24)
# Line 249  EOF Line 259  EOF
259          eval $set_cc_for_build          eval $set_cc_for_build
260          $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null          $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
261          if test "$?" = 0 ; then          if test "$?" = 0 ; then
262                  case `./$dummy` in                  case `$dummy` in
263                          0-0)                          0-0)
264                                  UNAME_MACHINE="alpha"                                  UNAME_MACHINE="alpha"
265                                  ;;                                  ;;
# Line 273  EOF Line 283  EOF
283                                  ;;                                  ;;
284                  esac                  esac
285          fi          fi
286          rm -f $dummy.s $dummy          rm -f $dummy.s $dummy && rmdir $tmpdir
287          echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`          echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
288          exit 0 ;;          exit 0 ;;
289      Alpha\ *:Windows_NT*:*)      Alpha\ *:Windows_NT*:*)
# Line 314  EOF Line 324  EOF
324      NILE*:*:*:dcosx)      NILE*:*:*:dcosx)
325          echo pyramid-pyramid-svr4          echo pyramid-pyramid-svr4
326          exit 0 ;;          exit 0 ;;
327        DRS?6000:UNIX_SV:4.2*:7*)
328            case `/usr/bin/uname -p` in
329                sparc) echo sparc-icl-nx7 && exit 0 ;;
330            esac ;;
331      sun4H:SunOS:5.*:*)      sun4H:SunOS:5.*:*)
332          echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`          echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333          exit 0 ;;          exit 0 ;;
# Line 421  EOF Line 435  EOF
435          }          }
436  EOF  EOF
437          $CC_FOR_BUILD $dummy.c -o $dummy \          $CC_FOR_BUILD $dummy.c -o $dummy \
438            && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \            && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
439            && rm -f $dummy.c $dummy && exit 0            && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
440          rm -f $dummy.c $dummy          rm -f $dummy.c $dummy && rmdir $tmpdir
441          echo mips-mips-riscos${UNAME_RELEASE}          echo mips-mips-riscos${UNAME_RELEASE}
442          exit 0 ;;          exit 0 ;;
443      Motorola:PowerMAX_OS:*:*)      Motorola:PowerMAX_OS:*:*)
# Line 504  EOF Line 518  EOF
518                          exit(0);                          exit(0);
519                          }                          }
520  EOF  EOF
521                  $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0                  $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
522                  rm -f $dummy.c $dummy                  rm -f $dummy.c $dummy && rmdir $tmpdir
523                  echo rs6000-ibm-aix3.2.5                  echo rs6000-ibm-aix3.2.5
524          elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then          elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
525                  echo rs6000-ibm-aix3.2.4                  echo rs6000-ibm-aix3.2.4
# Line 603  EOF Line 617  EOF
617                    exit (0);                    exit (0);
618                }                }
619  EOF  EOF
620                      (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`                      (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
621                      if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi                      if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
622                      rm -f $dummy.c $dummy                      rm -f $dummy.c $dummy && rmdir $tmpdir
623                  fi ;;                  fi ;;
624          esac          esac
625          echo ${HP_ARCH}-hp-hpux${HPUX_REV}          echo ${HP_ARCH}-hp-hpux${HPUX_REV}
# Line 641  EOF Line 655  EOF
655            exit (0);            exit (0);
656          }          }
657  EOF  EOF
658          $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0          $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
659          rm -f $dummy.c $dummy          rm -f $dummy.c $dummy && rmdir $tmpdir
660          echo unknown-hitachi-hiuxwe2          echo unknown-hitachi-hiuxwe2
661          exit 0 ;;          exit 0 ;;
662      9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )      9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
# Line 725  EOF Line 739  EOF
739          echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}          echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
740          exit 0 ;;          exit 0 ;;
741      *:FreeBSD:*:*)      *:FreeBSD:*:*)
742          echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`          # Determine whether the default compiler uses glibc.
743            eval $set_cc_for_build
744            sed 's/^        //' << EOF >$dummy.c
745            #include <features.h>
746            #if __GLIBC__ >= 2
747            LIBC=gnu
748            #else
749            LIBC=
750            #endif
751    EOF
752            eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
753            rm -f $dummy.c && rmdir $tmpdir
754            echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
755          exit 0 ;;          exit 0 ;;
756      i*:CYGWIN*:*)      i*:CYGWIN*:*)
757          echo ${UNAME_MACHINE}-pc-cygwin          echo ${UNAME_MACHINE}-pc-cygwin
# Line 786  EOF Line 812  EOF
812          #endif          #endif
813  EOF  EOF
814          eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`          eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
815          rm -f $dummy.c          rm -f $dummy.c && rmdir $tmpdir
816          test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0          test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
817          ;;          ;;
818      ppc:Linux:*:*)      ppc:Linux:*:*)
# Line 882  EOF Line 908  EOF
908          #endif          #endif
909  EOF  EOF
910          eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`          eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
911          rm -f $dummy.c          rm -f $dummy.c && rmdir $tmpdir
912          test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0          test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
913          test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0          test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
914          ;;          ;;
# Line 1245  main () Line 1271  main ()
1271  }  }
1272  EOF  EOF
1273    
1274  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
1275  rm -f $dummy.c $dummy  rm -f $dummy.c $dummy && rmdir $tmpdir
1276    
1277  # Apollos put the system type in the environment.  # Apollos put the system type in the environment.
1278    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26