]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - config.guess
ncurses 6.3 - patch 20221119
[ncurses.git] / config.guess
index e81d3ae7c210ba487bc74ef7ef1af6024c6f0df8..a419d8643b62a4d2df58240785bc9b7b81c3ed52 100755 (executable)
@@ -1,14 +1,14 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2021 Free Software Foundation, Inc.
+#   Copyright 1992-2022 Free Software Foundation, Inc.
 
 # shellcheck disable=SC2006,SC2268 # see below for rationale
 
 
 # shellcheck disable=SC2006,SC2268 # see below for rationale
 
-timestamp='2021-06-03'
+timestamp='2022-08-01'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -60,7 +60,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2021 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -437,7 +437,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
        # This test works for both compilers.
        if test "$CC_FOR_BUILD" != no_compiler_found; then
            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
        # This test works for both compilers.
        if test "$CC_FOR_BUILD" != no_compiler_found; then
            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+               (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
                grep IS_64BIT_ARCH >/dev/null
            then
                SUN_ARCH=x86_64
                grep IS_64BIT_ARCH >/dev/null
            then
                SUN_ARCH=x86_64
@@ -929,6 +929,9 @@ EOF
     i*:PW*:*)
        GUESS=$UNAME_MACHINE-pc-pw32
        ;;
     i*:PW*:*)
        GUESS=$UNAME_MACHINE-pc-pw32
        ;;
+    *:SerenityOS:*:*)
+        GUESS=$UNAME_MACHINE-pc-serenity
+        ;;
     *:Interix*:*)
        case $UNAME_MACHINE in
            x86)
     *:Interix*:*)
        case $UNAME_MACHINE in
            x86)
@@ -1033,7 +1036,7 @@ EOF
     k1om:Linux:*:*)
        GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
        ;;
     k1om:Linux:*:*)
        GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
        ;;
-    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
        GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
        ;;
     m32r*:Linux:*:*)
        GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
        ;;
     m32r*:Linux:*:*)
@@ -1148,16 +1151,27 @@ EOF
        ;;
     x86_64:Linux:*:*)
        set_cc_for_build
        ;;
     x86_64:Linux:*:*)
        set_cc_for_build
+       CPU=$UNAME_MACHINE
        LIBCABI=$LIBC
        if test "$CC_FOR_BUILD" != no_compiler_found; then
        LIBCABI=$LIBC
        if test "$CC_FOR_BUILD" != no_compiler_found; then
-           if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
-               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-               grep IS_X32 >/dev/null
-           then
-               LIBCABI=${LIBC}x32
-           fi
+           ABI=64
+           sed 's/^        //' << EOF > "$dummy.c"
+           #ifdef __i386__
+           ABI=x86
+           #else
+           #ifdef __ILP32__
+           ABI=x32
+           #endif
+           #endif
+EOF
+           cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+           eval "$cc_set_abi"
+           case $ABI in
+               x86) CPU=i686 ;;
+               x32) LIBCABI=${LIBC}x32 ;;
+           esac
        fi
        fi
-       GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+       GUESS=$CPU-pc-linux-$LIBCABI
        ;;
     xtensa*:Linux:*:*)
        GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
        ;;
     xtensa*:Linux:*:*)
        GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
@@ -1364,8 +1378,11 @@ EOF
     BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
        GUESS=i586-pc-haiku
        ;;
     BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
        GUESS=i586-pc-haiku
        ;;
-    x86_64:Haiku:*:*)
-       GUESS=x86_64-unknown-haiku
+    ppc:Haiku:*:*)     # Haiku running on Apple PowerPC
+       GUESS=powerpc-apple-haiku
+       ;;
+    *:Haiku:*:*)       # Haiku modern gcc (not bound by BeOS compat)
+       GUESS=$UNAME_MACHINE-unknown-haiku
        ;;
     SX-4:SUPER-UX:*:*)
        GUESS=sx4-nec-superux$UNAME_RELEASE
        ;;
     SX-4:SUPER-UX:*:*)
        GUESS=sx4-nec-superux$UNAME_RELEASE
@@ -1522,6 +1539,9 @@ EOF
     i*86:rdos:*:*)
        GUESS=$UNAME_MACHINE-pc-rdos
        ;;
     i*86:rdos:*:*)
        GUESS=$UNAME_MACHINE-pc-rdos
        ;;
+    i*86:Fiwix:*:*)
+       GUESS=$UNAME_MACHINE-pc-fiwix
+       ;;
     *:AROS:*:*)
        GUESS=$UNAME_MACHINE-unknown-aros
        ;;
     *:AROS:*:*)
        GUESS=$UNAME_MACHINE-unknown-aros
        ;;