]> code.delx.au - gnu-emacs/blobdiff - config.guess
XEmacs compatibility hacks cleaned up.
[gnu-emacs] / config.guess
index 4d39b91228a11210972d0055fa68372fd0c87b4e..6cbbe8c938aa553c4f4ec97c884ed2f95f490540 100755 (executable)
@@ -423,6 +423,9 @@ EOF
     i*:CYGWIN*:*)
        echo i386-pc-cygwin32
        exit 0 ;;
+    i*:MINGW*:*)
+       echo i386-pc-mingw32
+       exit 0 ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin32
        exit 0 ;;
@@ -436,17 +439,21 @@ EOF
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us.
        ld_help_string=`ld --help 2>&1`
-       if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
-         echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
-       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
-         echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
-       elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations:sparclinux"; then
-         echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
-       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
-         echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
-       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
-         echo "powerpc-unknown-linux-gnu" ; exit 0
-       elif test "${UNAME_MACHINE}" = "alpha" ; then
+       ld_supported_emulations=`echo $ld_help_string \
+                        | sed -ne '/supported emulations:/!d
+                                   s/[         ][      ]*/ /g
+                                   s/.*supported emulations: *//
+                                   s/ .*//
+                                   p'`
+        case "$ld_supported_emulations" in
+         i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
+         i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
+         sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+         m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+         elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
+       esac
+
+       if test "${UNAME_MACHINE}" = "alpha" ; then
          echo alpha-unknown-linux-gnu ; exit 0
        elif test "${UNAME_MACHINE}" = "mips" ; then
          cat >dummy.c <<EOF
@@ -468,11 +475,14 @@ EOF
        else
          # Either a pre-BFD a.out linker (linux-gnuoldld)
          # or one that does not give us useful --help.
-         # Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
-         test ! -d /usr/lib/ldscripts/. \
-           && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+         # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+         # If ld does not provide *any* "supported emulations:"
+         # that means it is gnuoldld.
+         echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+         test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+
          case "${UNAME_MACHINE}" in
-         i.86)
+         i?86)
            VENDOR=pc;
            ;;
          *)
@@ -497,7 +507,7 @@ main(argc, argv)
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
 # endif
 #else
-  printf ("%s-pc-linux-gnuaout\n", argv[1]);
+  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
 #endif
   return 0;
 }
@@ -606,6 +616,9 @@ EOF
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
        exit 0 ;;
+    news*:NEWS-OS:*:6*)
+       echo mips-sony-newsos6
+       exit 0 ;;
     R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}