jdk

Форк
0
/
flags-other.m4 
154 строки · 5.0 Кб
1
#
2
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
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
################################################################################
27
#
28
# Setup flags for other tools than C/C++ compiler
29
#
30

31
AC_DEFUN([FLAGS_SETUP_ARFLAGS],
32
[
33
  # FIXME: figure out if we should select AR flags depending on OS or toolchain.
34
  if test "x$OPENJDK_TARGET_OS" = xaix; then
35
    ARFLAGS="-X64"
36
  else
37
    ARFLAGS=""
38
  fi
39

40
  AC_SUBST(ARFLAGS)
41
])
42

43
AC_DEFUN([FLAGS_SETUP_LIBFLAGS],
44
[
45
  # LIB is used to create static libraries on Windows
46
  if test "x$OPENJDK_TARGET_OS" = xwindows; then
47
    LIBFLAGS="-nodefaultlib:msvcrt"
48
  else
49
    LIBFLAGS=""
50
  fi
51

52
  AC_SUBST(LIBFLAGS)
53
])
54

55
AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
56
[
57
  ## Setup strip.
58
  if test "x$STRIP" != x; then
59
    AC_MSG_CHECKING([how to run strip])
60

61
    # Easy cheat: Check strip variant by passing --version as an argument.
62
    # Different types of strip have varying command line syntaxes for querying their
63
    # version string, and all noisily fail if the provided version option is not
64
    # recognised.
65
    #
66
    # The actual version string or failure to execute strip are hidden by redirection
67
    # to config.log with 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
68

69
    if $STRIP "--version" 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
70
      # strip that comes from the GNU family uses --version
71
      # This variant of strip is usually found accompanying gcc and clang
72
      STRIPFLAGS="--strip-debug"
73
    elif $STRIP "-V" 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
74
      # IBM strip that works with AIX binaries only supports -V
75
      STRIPFLAGS="-X32_64"
76
    else
77
      # The only strip variant left is MacOS/Xcode strip, which does not have any
78
      # way whatsoever to be identified (lacking even basic help or version options),
79
      # so we leave it as the last fallback when all other tests have failed.
80
      STRIPFLAGS="-S"
81
    fi
82
    AC_MSG_RESULT($STRIPFLAGS)
83
  fi
84

85
  AC_SUBST(STRIPFLAGS)
86
])
87

88
AC_DEFUN([FLAGS_SETUP_RCFLAGS],
89
[
90
  # On Windows, we need to set RC flags.
91
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
92
    RCFLAGS="-nologo"
93
    if test "x$DEBUG_LEVEL" = xrelease; then
94
      RCFLAGS="$RCFLAGS -DNDEBUG"
95
    fi
96
  fi
97
  AC_SUBST(RCFLAGS)
98
])
99

100
AC_DEFUN([FLAGS_SETUP_NMFLAGS],
101
[
102
  # On AIX, we need to set NM flag -X64 for processing 64bit object files
103
  if test "x$OPENJDK_TARGET_OS" = xaix; then
104
    NMFLAGS="-X64"
105
  fi
106

107
  AC_SUBST(NMFLAGS)
108
])
109

110
################################################################################
111
# platform independent
112
AC_DEFUN([FLAGS_SETUP_ASFLAGS],
113
[
114
  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
115
    # Force preprocessor to run, just to make sure
116
    BASIC_ASFLAGS="-x assembler-with-cpp"
117
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
118
    BASIC_ASFLAGS="-nologo -c"
119
  fi
120
  AC_SUBST(BASIC_ASFLAGS)
121

122
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
123
    JVM_BASIC_ASFLAGS="-mno-omit-leaf-frame-pointer -mstack-alignment=16"
124

125
    # Fix linker warning.
126
    # Code taken from make/autoconf/flags-cflags.m4 and adapted.
127
    JVM_BASIC_ASFLAGS="$JVM_BASIC_ASFLAGS \
128
        -DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \
129
        -mmacosx-version-min=$MACOSX_VERSION_MIN"
130

131
    if test -n "$MACOSX_VERSION_MAX"; then
132
        JVM_BASIC_ASFLAGS="$JVM_BASIC_ASFLAGS $OS_CFLAGS \
133
            -DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS"
134
    fi
135
  fi
136
])
137

138
################################################################################
139
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
140
#      conditionals against.
141
# $2 - Optional prefix for each variable defined.
142
AC_DEFUN([FLAGS_SETUP_ASFLAGS_CPU_DEP],
143
[
144
  # Misuse EXTRA_CFLAGS to mimic old behavior
145
  $2JVM_ASFLAGS="$JVM_BASIC_ASFLAGS ${$2EXTRA_CFLAGS}"
146

147
  if test "x$1" = "xTARGET" && \
148
      test "x$TOOLCHAIN_TYPE" = xgcc && \
149
      test "x$OPENJDK_TARGET_CPU" = xarm; then
150
    $2JVM_ASFLAGS="${$2JVM_ASFLAGS} $ARM_ARCH_TYPE_ASFLAGS $ARM_FLOAT_TYPE_ASFLAGS"
151
  fi
152

153
  AC_SUBST($2JVM_ASFLAGS)
154
])
155

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

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

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

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