author | herrick |
Thu, 28 Mar 2019 13:49:38 -0400 | |
branch | JDK-8200758-branch |
changeset 57292 | 7a683c461b80 |
parent 53643 | 1126811a5124 |
child 55748 | c6923eaecd7b |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
48767
0c6ce8fdb50a
8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()
gadams
parents:
48751
diff
changeset
|
2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
4 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
10 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
16 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
20 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
23 |
# questions. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
24 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
25 |
|
49120 | 26 |
m4_include([flags-cflags.m4]) |
27 |
m4_include([flags-ldflags.m4]) |
|
28 |
m4_include([flags-other.m4]) |
|
29 |
||
42538 | 30 |
################################################################################ |
31 |
# |
|
32 |
# Setup ABI profile (for arm) |
|
33 |
# |
|
34 |
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE], |
|
35 |
[ |
|
36 |
AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile], |
|
52351 | 37 |
[specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,aarch64) @<:@toolchain dependent@:>@ ])]) |
42538 | 38 |
|
39 |
if test "x$with_abi_profile" != x; then |
|
40 |
if test "x$OPENJDK_TARGET_CPU" != xarm && \ |
|
41 |
test "x$OPENJDK_TARGET_CPU" != xaarch64; then |
|
42 |
AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64]) |
|
43 |
fi |
|
44 |
||
45 |
OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile |
|
46 |
AC_MSG_CHECKING([for ABI profle]) |
|
47 |
AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE]) |
|
48 |
||
52736
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
49 |
# --- Arm-sflt CFLAGS and ASFLAGS --- |
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
50 |
# Armv5te is required for assembler, because pld insn used in arm32 hotspot is only in v5E and above. |
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
51 |
# However, there is also a GCC bug which generates unaligned strd/ldrd instructions on armv5te: |
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
52 |
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82445, and it was fixed only quite recently. |
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
53 |
# The resulting compromise is to enable v5TE for assembler and let GCC generate code for v5T. |
42538 | 54 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then |
55 |
ARM_FLOAT_TYPE=vfp-sflt |
|
56 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
52735 | 57 |
ARM_ARCH_TYPE_ASFLAGS='-march=armv7-a -mthumb' |
42538 | 58 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then |
59 |
ARM_FLOAT_TYPE=vfp-hflt |
|
60 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
52735 | 61 |
ARM_ARCH_TYPE_ASFLAGS='-march=armv7-a -mthumb' |
42538 | 62 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then |
63 |
ARM_FLOAT_TYPE=sflt |
|
64 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
52736
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
65 |
ARM_ARCH_TYPE_ASFLAGS='-march=armv5te' |
42538 | 66 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then |
67 |
ARM_FLOAT_TYPE=vfp-sflt |
|
68 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
52736
99c48295ec8e
8214465: Upgrade arm-sflt minimum architecture to ARMv5TE for assembler
dholmes
parents:
52735
diff
changeset
|
69 |
ARM_ARCH_TYPE_ASFLAGS='-march=armv5te' |
42538 | 70 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then |
71 |
ARM_FLOAT_TYPE=vfp-hflt |
|
72 |
ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' |
|
52735 | 73 |
ARM_ARCH_TYPE_ASFLAGS='-march=armv6' |
42538 | 74 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then |
75 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
76 |
ARM_FLOAT_TYPE= |
|
77 |
ARM_ARCH_TYPE_FLAGS= |
|
52735 | 78 |
ARM_ARCH_TYPE_ASFLAGS= |
42538 | 79 |
else |
80 |
AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"]) |
|
81 |
fi |
|
82 |
||
83 |
if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then |
|
84 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' |
|
52735 | 85 |
ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=softfp -mfpu=vfp" |
42538 | 86 |
elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then |
87 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' |
|
52735 | 88 |
ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=hard -mfpu=vfp" |
42538 | 89 |
elif test "x$ARM_FLOAT_TYPE" = xsflt; then |
90 |
ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' |
|
52735 | 91 |
ARM_FLOAT_TYPE_ASFLAGS="-mfloat-abi=soft -mfpu=vfp" |
42538 | 92 |
fi |
93 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) |
|
94 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) |
|
52735 | 95 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags for assembler]) |
96 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_ASFLAGS]) |
|
42538 | 97 |
|
98 |
AC_MSG_CHECKING([for arch type flags]) |
|
99 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) |
|
52735 | 100 |
AC_MSG_CHECKING([for arch type flags for assembler]) |
101 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_ASFLAGS]) |
|
42538 | 102 |
|
103 |
# Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the |
|
104 |
# autoconf target triplet. |
|
105 |
[ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] |
|
106 |
# Sanity check that it is a known ABI. |
|
107 |
if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ |
|
108 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ |
|
109 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then |
|
110 |
AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) |
|
111 |
fi |
|
112 |
AC_MSG_CHECKING([for ABI property name]) |
|
113 |
AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) |
|
114 |
AC_SUBST(JDK_ARCH_ABI_PROP_NAME) |
|
115 |
fi |
|
116 |
||
117 |
# When building with an abi profile, the name of that profile is appended on the |
|
118 |
# bundle platform, which is used in bundle names. |
|
119 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then |
|
120 |
OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" |
|
121 |
fi |
|
122 |
]) |
|
123 |
||
49120 | 124 |
AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION], |
125 |
[ |
|
126 |
# Additional macosx handling |
|
127 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
128 |
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built |
|
129 |
# binaries should be compatible with, even if compiled on a newer version |
|
130 |
# of the OS. It currently has a hard coded value. Setting this also limits |
|
131 |
# exposure to API changes in header files. Bumping this is likely to |
|
132 |
# require code changes to build. |
|
49523 | 133 |
MACOSX_VERSION_MIN=10.9.0 |
49120 | 134 |
MACOSX_VERSION_MIN_NODOTS=${MACOSX_VERSION_MIN//\./} |
135 |
||
136 |
AC_SUBST(MACOSX_VERSION_MIN) |
|
137 |
||
138 |
# Setting --with-macosx-version-max=<version> makes it an error to build or |
|
139 |
# link to macosx APIs that are newer than the given OS version. The expected |
|
140 |
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. |
|
141 |
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max], |
|
142 |
[error on use of newer functionality. @<:@macosx@:>@])], |
|
143 |
[ |
|
144 |
if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then |
|
145 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
146 |
elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then |
|
147 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
148 |
elif test "x$with_macosx_version_max" = "xno"; then |
|
149 |
# Use build system default |
|
150 |
MACOSX_VERSION_MAX= |
|
151 |
else |
|
152 |
AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn]) |
|
153 |
fi |
|
154 |
], |
|
155 |
[MACOSX_VERSION_MAX=] |
|
156 |
) |
|
157 |
MACOSX_VERSION_MAX_NODOTS=${MACOSX_VERSION_MAX//\./} |
|
158 |
||
159 |
AC_SUBST(MACOSX_VERSION_MAX) |
|
160 |
fi |
|
161 |
]) |
|
162 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
163 |
# Reset the global CFLAGS/LDFLAGS variables and initialize them with the |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
164 |
# corresponding configure arguments instead |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
165 |
AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
166 |
[ |
49120 | 167 |
if test "x$CFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
168 |
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
169 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
170 |
|
49120 | 171 |
if test "x$CXXFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
172 |
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
173 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
174 |
|
49120 | 175 |
if test "x$LDFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
176 |
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
177 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
178 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
179 |
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
180 |
[extra flags to be used when compiling jdk c-files])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
181 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
182 |
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
183 |
[extra flags to be used when compiling jdk c++-files])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
184 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
185 |
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
186 |
[extra flags to be used when linking jdk])]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
187 |
|
49120 | 188 |
USER_CFLAGS="$with_extra_cflags" |
189 |
USER_CXXFLAGS="$with_extra_cxxflags" |
|
190 |
USER_LDFLAGS="$with_extra_ldflags" |
|
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
191 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
192 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
193 |
# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
194 |
# that configure can use them while detecting compilers. |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
195 |
# TOOLCHAIN_TYPE is available here. |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
196 |
# Param 1 - Optional prefix to all variables. (e.g BUILD_) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
197 |
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
198 |
[ |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
199 |
if test "x[$]$1SYSROOT" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
200 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
201 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
202 |
# Solaris Studio does not have a concept of sysroot. Instead we must |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
203 |
# make sure the default include and lib dirs are appended to each |
35450
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
204 |
# compile and link command line. Must also add -I-xbuiltin to enable |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
205 |
# inlining of system functions and intrinsics. |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
206 |
$1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include" |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
207 |
$1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ |
41040
7b919a4497ff
8165161: Solaris: /usr/ccs /opt/sfw and /opt/csw are dead, references should be expunged
alanbur
parents:
39940
diff
changeset
|
208 |
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR" |
48909
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
209 |
# If the devkit contains the ld linker, make sure we use it. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
210 |
AC_PATH_PROG(SOLARIS_LD, ld, , $DEVKIT_TOOLCHAIN_PATH:$DEVKIT_EXTRA_PATH) |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
211 |
# Make sure this ld is runnable. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
212 |
if test -f "$SOLARIS_LD"; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
213 |
if "$SOLARIS_LD" -V > /dev/null 2> /dev/null; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
214 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -Yl,$(dirname $SOLARIS_LD)" |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
215 |
else |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
216 |
AC_MSG_WARN([Could not run $SOLARIS_LD found in devkit, reverting to system ld]) |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
217 |
fi |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
218 |
fi |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
219 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
220 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
221 |
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
222 |
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
223 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
224 |
$1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
225 |
$1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
226 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
227 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
228 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
229 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
230 |
# We also need -iframework<path>/System/Library/Frameworks |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
231 |
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
232 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
233 |
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
234 |
# set this here so it doesn't have to be peppered throughout the forest |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
235 |
$1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
236 |
$1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
237 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
238 |
|
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
239 |
AC_SUBST($1SYSROOT_CFLAGS) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
240 |
AC_SUBST($1SYSROOT_LDFLAGS) |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
241 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
242 |
|
49120 | 243 |
AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN], |
244 |
[ |
|
245 |
# We should always include user supplied flags |
|
246 |
FLAGS_SETUP_USER_SUPPLIED_FLAGS |
|
247 |
# The sysroot flags are needed for configure to be able to run the compilers |
|
248 |
FLAGS_SETUP_SYSROOT_FLAGS |
|
249 |
||
49846
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
250 |
# For solstudio and xlc, the word size flag is required for correct behavior. |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
251 |
# For clang/gcc, the flag is only strictly required for reduced builds, but |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
252 |
# set it always where possible (x86, sparc and ppc). |
49120 | 253 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
254 |
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}" |
|
49846
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
255 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
256 |
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
257 |
elif test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
51641
9ce4a0d718c7
8165440: Add Zero support for x86_64-linux-gnux32 target
glaubitz
parents:
49846
diff
changeset
|
258 |
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86 && |
9ce4a0d718c7
8165440: Add Zero support for x86_64-linux-gnux32 target
glaubitz
parents:
49846
diff
changeset
|
259 |
test "x$OPENJDK_TARGET_CPU" != xx32 || |
49846
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
260 |
test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc || |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
261 |
test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then |
49132 | 262 |
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" |
263 |
fi |
|
49120 | 264 |
fi |
265 |
||
266 |
# FIXME: global flags are not used yet... |
|
267 |
# The "global" flags will *always* be set. Without them, it is not possible to |
|
268 |
# get a working compilation. |
|
269 |
GLOBAL_CFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CFLAGS" |
|
270 |
GLOBAL_CXXFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CXXFLAGS" |
|
271 |
GLOBAL_LDFLAGS="$MACHINE_FLAG $SYSROOT_LDFLAGS $USER_LDFLAGS" |
|
272 |
# FIXME: Don't really know how to do with this, but this was the old behavior |
|
273 |
GLOBAL_CPPFLAGS="$SYSROOT_CFLAGS" |
|
274 |
AC_SUBST(GLOBAL_CFLAGS) |
|
275 |
AC_SUBST(GLOBAL_CXXFLAGS) |
|
276 |
AC_SUBST(GLOBAL_LDFLAGS) |
|
277 |
AC_SUBST(GLOBAL_CPPFLAGS) |
|
278 |
||
279 |
# FIXME: For compatilibity, export this as EXTRA_CFLAGS for now. |
|
280 |
EXTRA_CFLAGS="$MACHINE_FLAG $USER_CFLAGS" |
|
281 |
EXTRA_CXXFLAGS="$MACHINE_FLAG $USER_CXXFLAGS" |
|
282 |
EXTRA_LDFLAGS="$MACHINE_FLAG $USER_LDFLAGS" |
|
283 |
||
284 |
AC_SUBST(EXTRA_CFLAGS) |
|
285 |
AC_SUBST(EXTRA_CXXFLAGS) |
|
286 |
AC_SUBST(EXTRA_LDFLAGS) |
|
287 |
||
288 |
# For autoconf testing to work, the global flags must also be stored in the |
|
289 |
# "unnamed" CFLAGS etc. |
|
290 |
CFLAGS="$GLOBAL_CFLAGS" |
|
291 |
CXXFLAGS="$GLOBAL_CXXFLAGS" |
|
292 |
LDFLAGS="$GLOBAL_LDFLAGS" |
|
293 |
CPPFLAGS="$GLOBAL_CPPFLAGS" |
|
294 |
]) |
|
295 |
||
296 |
AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
297 |
[ |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
298 |
# COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
299 |
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler |
36051 | 300 |
# COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder |
301 |
# commands produced by the link step (currently AIX only) |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
302 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
303 |
COMPILER_TARGET_BITS_FLAG="-q" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
304 |
COMPILER_COMMAND_FILE_FLAG="-f" |
36051 | 305 |
COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" |
22458
6a74da13c52f
8022411: Allow overriding of CXX and CC with absolute path
ihse
parents:
22179
diff
changeset
|
306 |
else |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
307 |
COMPILER_TARGET_BITS_FLAG="-m" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
308 |
COMPILER_COMMAND_FILE_FLAG="@" |
36051 | 309 |
COMPILER_BINDCMD_FILE_FLAG="" |
34864
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
310 |
|
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
311 |
# The solstudio linker does not support @-files. |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
312 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
313 |
COMPILER_COMMAND_FILE_FLAG= |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
314 |
fi |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
315 |
|
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
316 |
# Check if @file is supported by gcc |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
317 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
318 |
AC_MSG_CHECKING([if @file is supported by gcc]) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
319 |
# Extra emtpy "" to prevent ECHO from interpreting '--version' as argument |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
320 |
$ECHO "" "--version" > command.file |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
321 |
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
322 |
AC_MSG_RESULT(yes) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
323 |
COMPILER_COMMAND_FILE_FLAG="@" |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
324 |
else |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
325 |
AC_MSG_RESULT(no) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
326 |
COMPILER_COMMAND_FILE_FLAG= |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
327 |
fi |
38843
2b141e8e916f
8158535: Configure script uses basic tools directly in many places
erikj
parents:
37864
diff
changeset
|
328 |
$RM command.file |
34864
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
329 |
fi |
20363 | 330 |
fi |
49120 | 331 |
|
22467 | 332 |
AC_SUBST(COMPILER_TARGET_BITS_FLAG) |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
333 |
AC_SUBST(COMPILER_COMMAND_FILE_FLAG) |
36051 | 334 |
AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) |
22466 | 335 |
|
49120 | 336 |
# Check that the compiler supports -mX (or -qX on AIX) flags |
337 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
|
338 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], |
|
339 |
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
|
340 |
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
|
341 |
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
342 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
343 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
344 |
CC_OUT_OPTION=-Fo |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
345 |
LD_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
346 |
AR_OUT_OPTION=-out: |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
347 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
348 |
# The option used to specify the target .o,.a or .so file. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
349 |
# When compiling, how to specify the to be created object file. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
350 |
CC_OUT_OPTION='-o$(SPACE)' |
49534 | 351 |
# When linking, how to specify the output |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
352 |
LD_OUT_OPTION='-o$(SPACE)' |
51783 | 353 |
# When archiving, how to specify the destination static archive. |
354 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
355 |
AR_OUT_OPTION='-r -cs$(SPACE)' |
|
356 |
else |
|
357 |
AR_OUT_OPTION='-rcs$(SPACE)' |
|
358 |
fi |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
359 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
360 |
AC_SUBST(CC_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
361 |
AC_SUBST(LD_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
362 |
AC_SUBST(AR_OUT_OPTION) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
363 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
364 |
# Generate make dependency files |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
365 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
366 |
C_FLAG_DEPS="-MMD -MF" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
367 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
368 |
C_FLAG_DEPS="-MMD -MF" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
369 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
370 |
C_FLAG_DEPS="-xMMD -xMF" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
371 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
372 |
C_FLAG_DEPS="-qmakedep=gcc -MF" |
20363 | 373 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
374 |
CXX_FLAG_DEPS="$C_FLAG_DEPS" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
375 |
AC_SUBST(C_FLAG_DEPS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
376 |
AC_SUBST(CXX_FLAG_DEPS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
377 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
378 |
|
49120 | 379 |
AC_DEFUN_ONCE([FLAGS_POST_TOOLCHAIN], |
37402 | 380 |
[ |
49120 | 381 |
FLAGS_SETUP_TOOLCHAIN_CONTROL |
46224
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
382 |
|
49120 | 383 |
if test "x$BUILD_SYSROOT" != x; then |
384 |
FLAGS_SETUP_SYSROOT_FLAGS([BUILD_]) |
|
385 |
else |
|
49204
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
386 |
if test "x$COMPILE_TYPE" != "xcross"; then |
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
387 |
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS" |
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
388 |
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS" |
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
389 |
fi |
49120 | 390 |
fi |
391 |
AC_SUBST(BUILD_SYSROOT_CFLAGS) |
|
392 |
AC_SUBST(BUILD_SYSROOT_LDFLAGS) |
|
37402 | 393 |
|
394 |
]) |
|
395 |
||
49120 | 396 |
AC_DEFUN([FLAGS_SETUP_FLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
397 |
[ |
49120 | 398 |
FLAGS_SETUP_MACOSX_VERSION |
399 |
FLAGS_SETUP_ABI_PROFILE |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
400 |
|
49120 | 401 |
FLAGS_SETUP_SHARED_LIBS |
402 |
FLAGS_SETUP_DEBUG_SYMBOLS |
|
403 |
FLAGS_SETUP_WARNINGS |
|
404 |
FLAGS_SETUP_QUALITY_CHECKS |
|
405 |
FLAGS_SETUP_OPTIMIZATION |
|
37402 | 406 |
|
49120 | 407 |
FLAGS_SETUP_CFLAGS |
408 |
FLAGS_SETUP_LDFLAGS |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
409 |
|
49120 | 410 |
FLAGS_SETUP_ARFLAGS |
411 |
FLAGS_SETUP_STRIPFLAGS |
|
412 |
FLAGS_SETUP_RCFLAGS |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
413 |
|
49120 | 414 |
FLAGS_SETUP_ASFLAGS |
415 |
FLAGS_SETUP_ASFLAGS_CPU_DEP([TARGET]) |
|
416 |
FLAGS_SETUP_ASFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
417 |
]) |
16987 | 418 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
419 |
# FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
420 |
# IF_FALSE: [RUN-IF-FALSE]) |
16987 | 421 |
# ------------------------------------------------------------ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
422 |
# Check that the C compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
423 |
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
424 |
[*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@], |
16987 | 425 |
[ |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
426 |
AC_MSG_CHECKING([if ARG_PREFIX[CC] supports "ARG_ARGUMENT"]) |
16987 | 427 |
supports=yes |
428 |
||
429 |
saved_cflags="$CFLAGS" |
|
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
430 |
saved_cc="$CC" |
34923 | 431 |
CFLAGS="$CFLAGS ARG_ARGUMENT" |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
432 |
CC="$ARG_PREFIX[CC]" |
16987 | 433 |
AC_LANG_PUSH([C]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
434 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 435 |
[supports=no]) |
16987 | 436 |
AC_LANG_POP([C]) |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
437 |
CC="$saved_cc" |
16987 | 438 |
CFLAGS="$saved_cflags" |
439 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
440 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
441 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
442 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
443 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
444 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
445 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
446 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
447 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
448 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
449 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
450 |
# FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
451 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
452 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
453 |
# Check that the C++ compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
454 |
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
455 |
[*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@], |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
456 |
[ |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
457 |
AC_MSG_CHECKING([if ARG_PREFIX[CXX] supports "ARG_ARGUMENT"]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
458 |
supports=yes |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
459 |
|
16987 | 460 |
saved_cxxflags="$CXXFLAGS" |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
461 |
saved_cxx="$CXX" |
34923 | 462 |
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
463 |
CXX="$ARG_PREFIX[CXX]" |
16987 | 464 |
AC_LANG_PUSH([C++]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
465 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 466 |
[supports=no]) |
16987 | 467 |
AC_LANG_POP([C++]) |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
468 |
CXX="$saved_cxx" |
16987 | 469 |
CXXFLAGS="$saved_cxxflags" |
470 |
||
471 |
AC_MSG_RESULT([$supports]) |
|
472 |
if test "x$supports" = "xyes" ; then |
|
34923 | 473 |
: |
474 |
ARG_IF_TRUE |
|
16987 | 475 |
else |
34923 | 476 |
: |
477 |
ARG_IF_FALSE |
|
16987 | 478 |
fi |
479 |
]) |
|
480 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
481 |
# FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
482 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
483 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
484 |
# Check that the C and C++ compilers support an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
485 |
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
486 |
[*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@], |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
487 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
488 |
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
489 |
IF_TRUE: [C_COMP_SUPPORTS="yes"], |
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
490 |
IF_FALSE: [C_COMP_SUPPORTS="no"], |
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
491 |
PREFIX: [ARG_PREFIX]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
492 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
493 |
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], |
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
494 |
IF_FALSE: [CXX_COMP_SUPPORTS="no"], |
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
495 |
PREFIX: [ARG_PREFIX]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
496 |
|
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
497 |
AC_MSG_CHECKING([if both ARG_PREFIX[CC] and ARG_PREFIX[CXX] support "ARG_ARGUMENT"]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
498 |
supports=no |
53643
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
499 |
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then |
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
500 |
supports=yes; |
1126811a5124
8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
erikj
parents:
52736
diff
changeset
|
501 |
fi |
42141 | 502 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
503 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
504 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
505 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
506 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
507 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
508 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
509 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
510 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
511 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
512 |
|
34923 | 513 |
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
514 |
# IF_FALSE: [RUN-IF-FALSE]) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
515 |
# ------------------------------------------------------------ |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
516 |
# Check that the linker support an argument |
34923 | 517 |
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS], |
518 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
519 |
[ |
34923 | 520 |
AC_MSG_CHECKING([if linker supports "ARG_ARGUMENT"]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
521 |
supports=yes |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
522 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
523 |
saved_ldflags="$LDFLAGS" |
34923 | 524 |
LDFLAGS="$LDFLAGS ARG_ARGUMENT" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
525 |
AC_LANG_PUSH([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
526 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
527 |
[], [supports=no]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
528 |
AC_LANG_POP([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
529 |
LDFLAGS="$saved_ldflags" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
530 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
531 |
AC_MSG_RESULT([$supports]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
532 |
if test "x$supports" = "xyes" ; then |
34923 | 533 |
: |
534 |
ARG_IF_TRUE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
535 |
else |
34923 | 536 |
: |
537 |
ARG_IF_FALSE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
538 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
539 |
]) |