author | eosterlund |
Fri, 08 Jun 2018 11:30:10 +0200 | |
changeset 50470 | f3aac763a315 |
parent 49846 | a24f067a02dc |
child 51641 | 9ce4a0d718c7 |
child 56721 | 01b558efd286 |
child 56726 | 3a9b7a1f9197 |
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], |
|
37 |
[specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])]) |
|
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 |
||
49 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then |
|
50 |
ARM_FLOAT_TYPE=vfp-sflt |
|
51 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
52 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then |
|
53 |
ARM_FLOAT_TYPE=vfp-hflt |
|
54 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
55 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then |
|
56 |
ARM_FLOAT_TYPE=sflt |
|
57 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
58 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then |
|
59 |
ARM_FLOAT_TYPE=vfp-sflt |
|
60 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
61 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then |
|
62 |
ARM_FLOAT_TYPE=vfp-hflt |
|
63 |
ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' |
|
64 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then |
|
65 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
66 |
ARM_FLOAT_TYPE= |
|
67 |
ARM_ARCH_TYPE_FLAGS= |
|
68 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then |
|
69 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
70 |
ARM_FLOAT_TYPE= |
|
71 |
ARM_ARCH_TYPE_FLAGS= |
|
72 |
else |
|
73 |
AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"]) |
|
74 |
fi |
|
75 |
||
76 |
if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then |
|
77 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt' |
|
78 |
elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then |
|
79 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' |
|
80 |
elif test "x$ARM_FLOAT_TYPE" = xsflt; then |
|
81 |
ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' |
|
82 |
fi |
|
83 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) |
|
84 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) |
|
85 |
||
86 |
AC_MSG_CHECKING([for arch type flags]) |
|
87 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) |
|
88 |
||
89 |
# Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the |
|
90 |
# autoconf target triplet. |
|
91 |
[ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] |
|
92 |
# Sanity check that it is a known ABI. |
|
93 |
if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ |
|
94 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ |
|
95 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then |
|
96 |
AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) |
|
97 |
fi |
|
98 |
AC_MSG_CHECKING([for ABI property name]) |
|
99 |
AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) |
|
100 |
AC_SUBST(JDK_ARCH_ABI_PROP_NAME) |
|
101 |
fi |
|
102 |
||
103 |
# When building with an abi profile, the name of that profile is appended on the |
|
104 |
# bundle platform, which is used in bundle names. |
|
105 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then |
|
106 |
OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" |
|
107 |
fi |
|
108 |
]) |
|
109 |
||
49120 | 110 |
AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION], |
111 |
[ |
|
112 |
# Additional macosx handling |
|
113 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
114 |
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built |
|
115 |
# binaries should be compatible with, even if compiled on a newer version |
|
116 |
# of the OS. It currently has a hard coded value. Setting this also limits |
|
117 |
# exposure to API changes in header files. Bumping this is likely to |
|
118 |
# require code changes to build. |
|
49523 | 119 |
MACOSX_VERSION_MIN=10.9.0 |
49120 | 120 |
MACOSX_VERSION_MIN_NODOTS=${MACOSX_VERSION_MIN//\./} |
121 |
||
122 |
AC_SUBST(MACOSX_VERSION_MIN) |
|
123 |
||
124 |
# Setting --with-macosx-version-max=<version> makes it an error to build or |
|
125 |
# link to macosx APIs that are newer than the given OS version. The expected |
|
126 |
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. |
|
127 |
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max], |
|
128 |
[error on use of newer functionality. @<:@macosx@:>@])], |
|
129 |
[ |
|
130 |
if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then |
|
131 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
132 |
elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then |
|
133 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
|
134 |
elif test "x$with_macosx_version_max" = "xno"; then |
|
135 |
# Use build system default |
|
136 |
MACOSX_VERSION_MAX= |
|
137 |
else |
|
138 |
AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn]) |
|
139 |
fi |
|
140 |
], |
|
141 |
[MACOSX_VERSION_MAX=] |
|
142 |
) |
|
143 |
MACOSX_VERSION_MAX_NODOTS=${MACOSX_VERSION_MAX//\./} |
|
144 |
||
145 |
AC_SUBST(MACOSX_VERSION_MAX) |
|
146 |
fi |
|
147 |
]) |
|
148 |
||
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
149 |
# 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
|
150 |
# corresponding configure arguments instead |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
151 |
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
|
152 |
[ |
49120 | 153 |
if test "x$CFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
154 |
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
|
155 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
156 |
|
49120 | 157 |
if test "x$CXXFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
158 |
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
|
159 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
160 |
|
49120 | 161 |
if test "x$LDFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
162 |
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
|
163 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
164 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
165 |
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
|
166 |
[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
|
167 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
168 |
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
|
169 |
[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
|
170 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
171 |
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
|
172 |
[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
|
173 |
|
49120 | 174 |
USER_CFLAGS="$with_extra_cflags" |
175 |
USER_CXXFLAGS="$with_extra_cxxflags" |
|
176 |
USER_LDFLAGS="$with_extra_ldflags" |
|
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
177 |
]) |
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 |
# 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
|
180 |
# 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
|
181 |
# TOOLCHAIN_TYPE is available here. |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
182 |
# 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
|
183 |
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
184 |
[ |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
185 |
if test "x[$]$1SYSROOT" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
186 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
187 |
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
|
188 |
# 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
|
189 |
# 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
|
190 |
# 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
|
191 |
# inlining of system functions and intrinsics. |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
192 |
$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
|
193 |
$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
|
194 |
-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
|
195 |
# 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
|
196 |
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
|
197 |
# Make sure this ld is runnable. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
198 |
if test -f "$SOLARIS_LD"; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
199 |
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
|
200 |
$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
|
201 |
else |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
202 |
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
|
203 |
fi |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
204 |
fi |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
205 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
206 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
207 |
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
208 |
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
209 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
210 |
$1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
211 |
$1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
212 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
213 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
214 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
215 |
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
|
216 |
# 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
|
217 |
$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
|
218 |
$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
|
219 |
# 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
|
220 |
# 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
|
221 |
$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
|
222 |
$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
|
223 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
224 |
|
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
225 |
AC_SUBST($1SYSROOT_CFLAGS) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
226 |
AC_SUBST($1SYSROOT_LDFLAGS) |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
227 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
228 |
|
49120 | 229 |
AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN], |
230 |
[ |
|
231 |
# We should always include user supplied flags |
|
232 |
FLAGS_SETUP_USER_SUPPLIED_FLAGS |
|
233 |
# The sysroot flags are needed for configure to be able to run the compilers |
|
234 |
FLAGS_SETUP_SYSROOT_FLAGS |
|
235 |
||
49846
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
236 |
# 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
|
237 |
# 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
|
238 |
# set it always where possible (x86, sparc and ppc). |
49120 | 239 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
240 |
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}" |
|
49846
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
241 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
242 |
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
243 |
elif test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
244 |
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86 || |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
245 |
test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc || |
a24f067a02dc
8201536: configure fails compiler check due to bad -m32 flag
ihse
parents:
49534
diff
changeset
|
246 |
test "x$OPENJDK_TARGET_CPU_ARCH" = xppc; then |
49132 | 247 |
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" |
248 |
fi |
|
49120 | 249 |
fi |
250 |
||
251 |
# FIXME: global flags are not used yet... |
|
252 |
# The "global" flags will *always* be set. Without them, it is not possible to |
|
253 |
# get a working compilation. |
|
254 |
GLOBAL_CFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CFLAGS" |
|
255 |
GLOBAL_CXXFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CXXFLAGS" |
|
256 |
GLOBAL_LDFLAGS="$MACHINE_FLAG $SYSROOT_LDFLAGS $USER_LDFLAGS" |
|
257 |
# FIXME: Don't really know how to do with this, but this was the old behavior |
|
258 |
GLOBAL_CPPFLAGS="$SYSROOT_CFLAGS" |
|
259 |
AC_SUBST(GLOBAL_CFLAGS) |
|
260 |
AC_SUBST(GLOBAL_CXXFLAGS) |
|
261 |
AC_SUBST(GLOBAL_LDFLAGS) |
|
262 |
AC_SUBST(GLOBAL_CPPFLAGS) |
|
263 |
||
264 |
# FIXME: For compatilibity, export this as EXTRA_CFLAGS for now. |
|
265 |
EXTRA_CFLAGS="$MACHINE_FLAG $USER_CFLAGS" |
|
266 |
EXTRA_CXXFLAGS="$MACHINE_FLAG $USER_CXXFLAGS" |
|
267 |
EXTRA_LDFLAGS="$MACHINE_FLAG $USER_LDFLAGS" |
|
268 |
||
269 |
AC_SUBST(EXTRA_CFLAGS) |
|
270 |
AC_SUBST(EXTRA_CXXFLAGS) |
|
271 |
AC_SUBST(EXTRA_LDFLAGS) |
|
272 |
||
273 |
# For autoconf testing to work, the global flags must also be stored in the |
|
274 |
# "unnamed" CFLAGS etc. |
|
275 |
CFLAGS="$GLOBAL_CFLAGS" |
|
276 |
CXXFLAGS="$GLOBAL_CXXFLAGS" |
|
277 |
LDFLAGS="$GLOBAL_LDFLAGS" |
|
278 |
CPPFLAGS="$GLOBAL_CPPFLAGS" |
|
279 |
]) |
|
280 |
||
281 |
AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
282 |
[ |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
283 |
# 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
|
284 |
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler |
36051 | 285 |
# COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder |
286 |
# 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
|
287 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
288 |
COMPILER_TARGET_BITS_FLAG="-q" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
289 |
COMPILER_COMMAND_FILE_FLAG="-f" |
36051 | 290 |
COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" |
22458
6a74da13c52f
8022411: Allow overriding of CXX and CC with absolute path
ihse
parents:
22179
diff
changeset
|
291 |
else |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
292 |
COMPILER_TARGET_BITS_FLAG="-m" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
293 |
COMPILER_COMMAND_FILE_FLAG="@" |
36051 | 294 |
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
|
295 |
|
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
296 |
# 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
|
297 |
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
|
298 |
COMPILER_COMMAND_FILE_FLAG= |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
299 |
fi |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
300 |
|
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
301 |
# 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
|
302 |
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
|
303 |
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
|
304 |
# 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
|
305 |
$ECHO "" "--version" > command.file |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
306 |
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
|
307 |
AC_MSG_RESULT(yes) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
308 |
COMPILER_COMMAND_FILE_FLAG="@" |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
309 |
else |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
310 |
AC_MSG_RESULT(no) |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
311 |
COMPILER_COMMAND_FILE_FLAG= |
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
312 |
fi |
38843
2b141e8e916f
8158535: Configure script uses basic tools directly in many places
erikj
parents:
37864
diff
changeset
|
313 |
$RM command.file |
34864
47326b00e368
8146638: Only use compiler option files if they are really supported by the toolchain
simonis
parents:
34596
diff
changeset
|
314 |
fi |
20363 | 315 |
fi |
49120 | 316 |
|
22467 | 317 |
AC_SUBST(COMPILER_TARGET_BITS_FLAG) |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
318 |
AC_SUBST(COMPILER_COMMAND_FILE_FLAG) |
36051 | 319 |
AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) |
22466 | 320 |
|
49120 | 321 |
# Check that the compiler supports -mX (or -qX on AIX) flags |
322 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
|
323 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], |
|
324 |
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
|
325 |
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
|
326 |
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
327 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
328 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
329 |
CC_OUT_OPTION=-Fo |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
330 |
LD_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
331 |
AR_OUT_OPTION=-out: |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
332 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
333 |
# 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
|
334 |
# 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
|
335 |
CC_OUT_OPTION='-o$(SPACE)' |
49534 | 336 |
# When linking, how to specify the output |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
337 |
LD_OUT_OPTION='-o$(SPACE)' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
338 |
# When archiving, how to specify the to be create static archive for object files. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
339 |
AR_OUT_OPTION='rcs$(SPACE)' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
340 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
341 |
AC_SUBST(CC_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
342 |
AC_SUBST(LD_OUT_OPTION) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
343 |
AC_SUBST(AR_OUT_OPTION) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
344 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
345 |
# Generate make dependency files |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
346 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
347 |
C_FLAG_DEPS="-MMD -MF" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
348 |
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
|
349 |
C_FLAG_DEPS="-MMD -MF" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
350 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
351 |
C_FLAG_DEPS="-xMMD -xMF" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
352 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
353 |
C_FLAG_DEPS="-qmakedep=gcc -MF" |
20363 | 354 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
355 |
CXX_FLAG_DEPS="$C_FLAG_DEPS" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
356 |
AC_SUBST(C_FLAG_DEPS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
357 |
AC_SUBST(CXX_FLAG_DEPS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
358 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
359 |
|
49120 | 360 |
AC_DEFUN_ONCE([FLAGS_POST_TOOLCHAIN], |
37402 | 361 |
[ |
49120 | 362 |
FLAGS_SETUP_TOOLCHAIN_CONTROL |
46224
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
363 |
|
49120 | 364 |
if test "x$BUILD_SYSROOT" != x; then |
365 |
FLAGS_SETUP_SYSROOT_FLAGS([BUILD_]) |
|
366 |
else |
|
49204
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
367 |
if test "x$COMPILE_TYPE" != "xcross"; then |
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
368 |
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS" |
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
369 |
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS" |
564802b01ded
8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents:
49194
diff
changeset
|
370 |
fi |
49120 | 371 |
fi |
372 |
AC_SUBST(BUILD_SYSROOT_CFLAGS) |
|
373 |
AC_SUBST(BUILD_SYSROOT_LDFLAGS) |
|
37402 | 374 |
|
375 |
]) |
|
376 |
||
49120 | 377 |
AC_DEFUN([FLAGS_SETUP_FLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
378 |
[ |
49120 | 379 |
FLAGS_SETUP_MACOSX_VERSION |
380 |
FLAGS_SETUP_ABI_PROFILE |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
381 |
|
49120 | 382 |
FLAGS_SETUP_SHARED_LIBS |
383 |
FLAGS_SETUP_DEBUG_SYMBOLS |
|
384 |
FLAGS_SETUP_WARNINGS |
|
385 |
FLAGS_SETUP_QUALITY_CHECKS |
|
386 |
FLAGS_SETUP_OPTIMIZATION |
|
37402 | 387 |
|
49120 | 388 |
FLAGS_SETUP_CFLAGS |
389 |
FLAGS_SETUP_LDFLAGS |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
390 |
|
49120 | 391 |
FLAGS_SETUP_ARFLAGS |
392 |
FLAGS_SETUP_STRIPFLAGS |
|
393 |
FLAGS_SETUP_RCFLAGS |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
394 |
|
49120 | 395 |
FLAGS_SETUP_ASFLAGS |
396 |
FLAGS_SETUP_ASFLAGS_CPU_DEP([TARGET]) |
|
397 |
FLAGS_SETUP_ASFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
398 |
]) |
16987 | 399 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
400 |
# 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
|
401 |
# IF_FALSE: [RUN-IF-FALSE]) |
16987 | 402 |
# ------------------------------------------------------------ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
403 |
# Check that the C compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
404 |
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], |
34923 | 405 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
16987 | 406 |
[ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
407 |
AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"]) |
16987 | 408 |
supports=yes |
409 |
||
410 |
saved_cflags="$CFLAGS" |
|
34923 | 411 |
CFLAGS="$CFLAGS ARG_ARGUMENT" |
16987 | 412 |
AC_LANG_PUSH([C]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
413 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 414 |
[supports=no]) |
16987 | 415 |
AC_LANG_POP([C]) |
416 |
CFLAGS="$saved_cflags" |
|
417 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
418 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
419 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
420 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
421 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
422 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
423 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
424 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
425 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
426 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
427 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
428 |
# 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
|
429 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
430 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
431 |
# Check that the C++ compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
432 |
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
433 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
434 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
435 |
AC_MSG_CHECKING([if the C++ compiler supports "ARG_ARGUMENT"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
436 |
supports=yes |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
437 |
|
16987 | 438 |
saved_cxxflags="$CXXFLAGS" |
34923 | 439 |
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" |
16987 | 440 |
AC_LANG_PUSH([C++]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
441 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 442 |
[supports=no]) |
16987 | 443 |
AC_LANG_POP([C++]) |
444 |
CXXFLAGS="$saved_cxxflags" |
|
445 |
||
446 |
AC_MSG_RESULT([$supports]) |
|
447 |
if test "x$supports" = "xyes" ; then |
|
34923 | 448 |
: |
449 |
ARG_IF_TRUE |
|
16987 | 450 |
else |
34923 | 451 |
: |
452 |
ARG_IF_FALSE |
|
16987 | 453 |
fi |
454 |
]) |
|
455 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
456 |
# 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
|
457 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
458 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
459 |
# 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
|
460 |
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
461 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
462 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
463 |
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
464 |
IF_TRUE: [C_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
465 |
IF_FALSE: [C_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
466 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
467 |
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
468 |
IF_FALSE: [CXX_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
469 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
470 |
AC_MSG_CHECKING([if both compilers support "ARG_ARGUMENT"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
471 |
supports=no |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
472 |
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi |
42141 | 473 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
474 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
475 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
476 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
477 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
478 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
479 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
480 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
481 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
482 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
483 |
|
34923 | 484 |
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
485 |
# IF_FALSE: [RUN-IF-FALSE]) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
486 |
# ------------------------------------------------------------ |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
487 |
# Check that the linker support an argument |
34923 | 488 |
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS], |
489 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
490 |
[ |
34923 | 491 |
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
|
492 |
supports=yes |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
493 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
494 |
saved_ldflags="$LDFLAGS" |
34923 | 495 |
LDFLAGS="$LDFLAGS ARG_ARGUMENT" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
496 |
AC_LANG_PUSH([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
497 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
498 |
[], [supports=no]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
499 |
AC_LANG_POP([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
500 |
LDFLAGS="$saved_ldflags" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
501 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
502 |
AC_MSG_RESULT([$supports]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
503 |
if test "x$supports" = "xyes" ; then |
34923 | 504 |
: |
505 |
ARG_IF_TRUE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
506 |
else |
34923 | 507 |
: |
508 |
ARG_IF_FALSE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
509 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
510 |
]) |