jdk

Форк
0
/
config.guess 
102 строки · 3.5 Кб
1
#!/bin/sh
2
#
3
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
4
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6
#
7
# This code is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License version 2 only, as
9
# published by the Free Software Foundation.
10
#
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
16
#
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
#
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
23
# questions.
24
#
25

26
# This is a wrapper for the config.guess from autoconf. The latter does not
27
# properly detect 64 bit systems on all platforms. Instead of patching the
28
# autoconf system (which might easily get lost in a future update), we wrap it
29
# and fix the broken property, if needed.
30

31
DIR=`dirname $0`
32
OUT=`. $DIR/autoconf-config.guess 2> /dev/null`
33

34
# Handle some cases that autoconf-config.guess is not capable of
35
if [ "x$OUT" = x ]; then
36
  if [ `uname -s` = Linux ]; then
37
    # Test and fix little endian MIPS.
38
    if [ `uname -m` = mipsel ]; then
39
      OUT=mipsel-unknown-linux-gnu
40
    fi
41
  # Test and fix cygwin machine arch .x86_64
42
  elif [[ `uname -s` = CYGWIN* ]]; then
43
    if [ `uname -m` = ".x86_64" ]; then
44
      OUT=x86_64-unknown-cygwin
45
    fi
46
  fi
47

48
  if [ "x$OUT" = x ]; then
49
    # Run autoconf-config.guess again to get the error message.
50
    . $DIR/autoconf-config.guess > /dev/null
51
  else
52
    printf "guessed by custom config.guess... " >&2
53
  fi
54
fi
55

56
# Test and fix cygwin on x86_64
57
echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null
58
if test $? != 0; then
59
  echo $OUT | grep 86-pc-mingw > /dev/null 2> /dev/null
60
fi
61
if test $? = 0; then
62
  case `echo $PROCESSOR_IDENTIFIER | cut -f1 -d' '` in
63
    intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64)
64
      REAL_CPU=x86_64
65
      OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
66
      ;;
67
  esac
68
fi
69

70
# Test and fix wsl
71
echo $OUT | grep '\(unknown\|pc\)-linux-gnu' > /dev/null 2> /dev/null
72
if test $? = 0; then
73
  uname -r | grep -i microsoft > /dev/null 2> /dev/null
74
  if test $? = 0; then
75
    OUT=`echo $OUT | sed -e 's/\(unknown\|pc\)-linux-gnu/pc-wsl/'`
76
  fi
77
fi
78

79
# Test and fix architecture string on AIX
80
# On AIX 'config.guess' returns 'powerpc' as architecture but 'powerpc' is
81
# implicitly handled as 32-bit architecture in 'platform.m4' so we check
82
# for the kernel mode rewrite it to 'powerpc64' if we'Re running in 64-bit mode.
83
# The check could also be done with `/usr/sbin/prtconf | grep "Kernel Type" | grep "64-bit"`
84
echo $OUT | grep powerpc-ibm-aix > /dev/null 2> /dev/null
85
if test $? = 0; then
86
  if [ -x /bin/getconf ] ; then
87
    KERNEL_BITMODE=`getconf KERNEL_BITMODE`
88
    if  [ "$KERNEL_BITMODE" = "32" ]; then
89
      KERNEL_BITMODE=""
90
    fi
91
  fi
92
  OUT=powerpc$KERNEL_BITMODE`echo $OUT | sed -e 's/[^-]*//'`
93
fi
94

95
# Test and fix cpu on Macosx when C preprocessor is not on the path
96
echo $OUT | grep i386-apple-darwin > /dev/null 2> /dev/null
97
if test $? = 0; then
98
  REAL_CPU=`uname -m`
99
  OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
100
fi
101

102
echo $OUT
103

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.