author | ihse |
Mon, 26 Feb 2018 14:23:19 +0100 | |
branch | ihse-cflags-rewrite-branch |
changeset 56177 | 2fbe3b84ee3d |
parent 56176 | b3e3a12dcb33 |
child 56178 | 7e63ac6274dd |
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 |
|
56154 | 26 |
m4_include([flags-cflags.m4]) |
56150 | 27 |
m4_include([flags-ldflags.m4]) |
56154 | 28 |
m4_include([flags-other.m4]) |
56150 | 29 |
|
56170 | 30 |
# Sort the flags in a given variable, and remove superfluous whitespace. |
31 |
# |
|
32 |
# $1 = name of variable to sort |
|
33 |
AC_DEFUN([FLAGS_SORT_FLAGS], [ |
|
34 |
$1=`$ECHO ${$1} | $TR ' ' '\n' | $SORT | $TR '\n' ' '` |
|
35 |
]) |
|
36 |
||
42538 | 37 |
################################################################################ |
38 |
# |
|
39 |
# Setup ABI profile (for arm) |
|
40 |
# |
|
41 |
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE], |
|
42 |
[ |
|
43 |
AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile], |
|
44 |
[specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])]) |
|
45 |
||
46 |
if test "x$with_abi_profile" != x; then |
|
47 |
if test "x$OPENJDK_TARGET_CPU" != xarm && \ |
|
48 |
test "x$OPENJDK_TARGET_CPU" != xaarch64; then |
|
49 |
AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64]) |
|
50 |
fi |
|
51 |
||
52 |
OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile |
|
53 |
AC_MSG_CHECKING([for ABI profle]) |
|
54 |
AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE]) |
|
55 |
||
56 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then |
|
57 |
ARM_FLOAT_TYPE=vfp-sflt |
|
58 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
59 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then |
|
60 |
ARM_FLOAT_TYPE=vfp-hflt |
|
61 |
ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb' |
|
62 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then |
|
63 |
ARM_FLOAT_TYPE=sflt |
|
64 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
65 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then |
|
66 |
ARM_FLOAT_TYPE=vfp-sflt |
|
67 |
ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm' |
|
68 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then |
|
69 |
ARM_FLOAT_TYPE=vfp-hflt |
|
70 |
ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm' |
|
71 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then |
|
72 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
73 |
ARM_FLOAT_TYPE= |
|
74 |
ARM_ARCH_TYPE_FLAGS= |
|
75 |
elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then |
|
76 |
# No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME |
|
77 |
ARM_FLOAT_TYPE= |
|
78 |
ARM_ARCH_TYPE_FLAGS= |
|
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' |
|
85 |
elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then |
|
86 |
ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt' |
|
87 |
elif test "x$ARM_FLOAT_TYPE" = xsflt; then |
|
88 |
ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp' |
|
89 |
fi |
|
90 |
AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags]) |
|
91 |
AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS]) |
|
92 |
||
93 |
AC_MSG_CHECKING([for arch type flags]) |
|
94 |
AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS]) |
|
95 |
||
96 |
# Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the |
|
97 |
# autoconf target triplet. |
|
98 |
[ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ] |
|
99 |
# Sanity check that it is a known ABI. |
|
100 |
if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \ |
|
101 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi && \ |
|
102 |
test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then |
|
103 |
AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"]) |
|
104 |
fi |
|
105 |
AC_MSG_CHECKING([for ABI property name]) |
|
106 |
AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME]) |
|
107 |
AC_SUBST(JDK_ARCH_ABI_PROP_NAME) |
|
108 |
fi |
|
109 |
||
110 |
# When building with an abi profile, the name of that profile is appended on the |
|
111 |
# bundle platform, which is used in bundle names. |
|
112 |
if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then |
|
113 |
OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE" |
|
114 |
fi |
|
115 |
]) |
|
116 |
||
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
117 |
AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
118 |
[ |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
119 |
# Additional macosx handling |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
120 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
121 |
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
122 |
# binaries should be compatible with, even if compiled on a newer version |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
123 |
# of the OS. It currently has a hard coded value. Setting this also limits |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
124 |
# exposure to API changes in header files. Bumping this is likely to |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
125 |
# require code changes to build. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
126 |
MACOSX_VERSION_MIN=10.7.0 |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
127 |
MACOSX_VERSION_MIN_NODOTS=1070 |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
128 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
129 |
AC_SUBST(MACOSX_VERSION_MIN) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
130 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
131 |
# Setting --with-macosx-version-max=<version> makes it an error to build or |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
132 |
# link to macosx APIs that are newer than the given OS version. The expected |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
133 |
# format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
134 |
AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
135 |
[error on use of newer functionality. @<:@macosx@:>@])], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
136 |
[ |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
137 |
if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
138 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
139 |
elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
140 |
MACOSX_VERSION_MAX=$with_macosx_version_max |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
141 |
elif test "x$with_macosx_version_max" = "xno"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
142 |
# Use build system default |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
143 |
MACOSX_VERSION_MAX= |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
144 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
145 |
AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
146 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
147 |
], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
148 |
[MACOSX_VERSION_MAX=] |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
149 |
) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
150 |
MACOSX_VERSION_MAX_NODOTS=`$ECHO $MACOSX_VERSION_MAX | $TR -d .` |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
151 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
152 |
AC_SUBST(MACOSX_VERSION_MAX) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
153 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
154 |
]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
155 |
|
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
156 |
# 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
|
157 |
# corresponding configure arguments instead |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
158 |
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
|
159 |
[ |
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
160 |
if test "x$CFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
161 |
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
|
162 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
163 |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
164 |
if test "x$CXXFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
165 |
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
|
166 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
167 |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
168 |
if test "x$LDFLAGS" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
169 |
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
|
170 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
171 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
172 |
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
|
173 |
[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
|
174 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
175 |
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
|
176 |
[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
|
177 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
178 |
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
|
179 |
[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
|
180 |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
181 |
USER_CFLAGS="$with_extra_cflags" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
182 |
USER_CXXFLAGS="$with_extra_cxxflags" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
183 |
USER_LDFLAGS="$with_extra_ldflags" |
32810
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 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
186 |
# 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
|
187 |
# 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
|
188 |
# TOOLCHAIN_TYPE is available here. |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
189 |
# 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
|
190 |
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
191 |
[ |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
192 |
if test "x[$]$1SYSROOT" != "x"; then |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
193 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
194 |
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
|
195 |
# 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
|
196 |
# 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
|
197 |
# 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
|
198 |
# inlining of system functions and intrinsics. |
0124e2c9ef64
8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents:
35444
diff
changeset
|
199 |
$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
|
200 |
$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
|
201 |
-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
|
202 |
# 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
|
203 |
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
|
204 |
# Make sure this ld is runnable. |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
205 |
if test -f "$SOLARIS_LD"; then |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
206 |
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
|
207 |
$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
|
208 |
else |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
209 |
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
|
210 |
fi |
54b423e1c4cf
8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents:
48854
diff
changeset
|
211 |
fi |
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 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
214 |
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
215 |
$1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT" |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
216 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
217 |
$1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT" |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
218 |
$1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT" |
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 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
221 |
|
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
222 |
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
|
223 |
# 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
|
224 |
$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
|
225 |
$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
|
226 |
# 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
|
227 |
# 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
|
228 |
$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
|
229 |
$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
|
230 |
fi |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
231 |
|
33395
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
232 |
AC_SUBST($1SYSROOT_CFLAGS) |
5907d5b1287c
8140593: Add configure parameter for devkit for the build compiler
erikj
parents:
33394
diff
changeset
|
233 |
AC_SUBST($1SYSROOT_LDFLAGS) |
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
234 |
]) |
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
235 |
|
56177 | 236 |
AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN], |
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
237 |
[ |
56177 | 238 |
# We should always include user supplied flags |
239 |
FLAGS_SETUP_USER_SUPPLIED_FLAGS |
|
240 |
# The sysroot flags are needed for configure to be able to run the compilers |
|
241 |
FLAGS_SETUP_SYSROOT_FLAGS |
|
242 |
||
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
243 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
244 |
MACHINE_FLAG="-q${OPENJDK_TARGET_CPU_BITS}" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
245 |
elif test "x$TOOLCHAIN_TYPE" != xmicrosoft; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
246 |
MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
247 |
fi |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
248 |
|
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
249 |
# FIXME: global flags are not used yet... |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
250 |
# The "global" flags will *always* be set. Without them, it is not possible to |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
251 |
# get a working compilation. |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
252 |
GLOBAL_CFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
253 |
GLOBAL_CXXFLAGS="$MACHINE_FLAG $SYSROOT_CFLAGS $USER_CXXFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
254 |
GLOBAL_LDFLAGS="$MACHINE_FLAG $SYSROOT_LDFLAGS $USER_LDFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
255 |
# FIXME: Don't really know how to do with this, but this was the old behavior |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
256 |
GLOBAL_CPPFLAGS="$SYSROOT_CFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
257 |
AC_SUBST(GLOBAL_CFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
258 |
AC_SUBST(GLOBAL_CXXFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
259 |
AC_SUBST(GLOBAL_LDFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
260 |
AC_SUBST(GLOBAL_CPPFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
261 |
|
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
262 |
# FIXME: For compatilibity, export this as EXTRA_CFLAGS for now. |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
263 |
EXTRA_CFLAGS="$MACHINE_FLAG $USER_CFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
264 |
EXTRA_CXXFLAGS="$MACHINE_FLAG $USER_CXXFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
265 |
EXTRA_LDFLAGS="$MACHINE_FLAG $USER_LDFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
266 |
|
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
267 |
AC_SUBST(EXTRA_CFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
268 |
AC_SUBST(EXTRA_CXXFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
269 |
AC_SUBST(EXTRA_LDFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
270 |
|
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
271 |
# For autoconf testing to work, the global flags must also be stored in the |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
272 |
# "unnamed" CFLAGS etc. |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
273 |
CFLAGS="$GLOBAL_CFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
274 |
CXXFLAGS="$GLOBAL_CXXFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
275 |
LDFLAGS="$GLOBAL_LDFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
276 |
CPPFLAGS="$GLOBAL_CPPFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
277 |
]) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
278 |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
279 |
AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
280 |
[ |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
281 |
# COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
282 |
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
283 |
# COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
284 |
# commands produced by the link step (currently AIX only) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
285 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
286 |
COMPILER_TARGET_BITS_FLAG="-q" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
287 |
COMPILER_COMMAND_FILE_FLAG="-f" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
288 |
COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
289 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
290 |
COMPILER_TARGET_BITS_FLAG="-m" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
291 |
COMPILER_COMMAND_FILE_FLAG="@" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
292 |
COMPILER_BINDCMD_FILE_FLAG="" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
293 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
294 |
# The solstudio linker does not support @-files. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
295 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
296 |
COMPILER_COMMAND_FILE_FLAG= |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
297 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
298 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
299 |
# Check if @file is supported by gcc |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
300 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
301 |
AC_MSG_CHECKING([if @file is supported by gcc]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
302 |
# Extra emtpy "" to prevent ECHO from interpreting '--version' as argument |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
303 |
$ECHO "" "--version" > command.file |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
304 |
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
305 |
AC_MSG_RESULT(yes) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
306 |
COMPILER_COMMAND_FILE_FLAG="@" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
307 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
308 |
AC_MSG_RESULT(no) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
309 |
COMPILER_COMMAND_FILE_FLAG= |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
310 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
311 |
$RM command.file |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
312 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
313 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
314 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
315 |
AC_SUBST(COMPILER_TARGET_BITS_FLAG) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
316 |
AC_SUBST(COMPILER_COMMAND_FILE_FLAG) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
317 |
AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
318 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
319 |
# Check that the compiler supports -mX (or -qX on AIX) flags |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
320 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
321 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
322 |
IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
323 |
IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
324 |
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
325 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
326 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
327 |
CC_OUT_OPTION=-Fo |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
328 |
EXE_OUT_OPTION=-out: |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
329 |
LD_OUT_OPTION=-out: |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
330 |
AR_OUT_OPTION=-out: |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
331 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
332 |
# The option used to specify the target .o,.a or .so file. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
333 |
# When compiling, how to specify the to be created object file. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
334 |
CC_OUT_OPTION='-o$(SPACE)' |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
335 |
# When linking, how to specify the to be created executable. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
336 |
EXE_OUT_OPTION='-o$(SPACE)' |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
337 |
# When linking, how to specify the to be created dynamically linkable library. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
338 |
LD_OUT_OPTION='-o$(SPACE)' |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
339 |
# When archiving, how to specify the to be create static archive for object files. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
340 |
AR_OUT_OPTION='rcs$(SPACE)' |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
341 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
342 |
AC_SUBST(CC_OUT_OPTION) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
343 |
AC_SUBST(EXE_OUT_OPTION) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
344 |
AC_SUBST(LD_OUT_OPTION) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
345 |
AC_SUBST(AR_OUT_OPTION) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
346 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
347 |
# Generate make dependency files |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
348 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
349 |
C_FLAG_DEPS="-MMD -MF" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
350 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
351 |
C_FLAG_DEPS="-MMD -MF" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
352 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
353 |
C_FLAG_DEPS="-xMMD -xMF" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
354 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
355 |
C_FLAG_DEPS="-qmakedep=gcc -MF" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
356 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
357 |
CXX_FLAG_DEPS="$C_FLAG_DEPS" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
358 |
AC_SUBST(C_FLAG_DEPS) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
359 |
AC_SUBST(CXX_FLAG_DEPS) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
360 |
]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
361 |
|
56177 | 362 |
AC_DEFUN_ONCE([FLAGS_POST_TOOLCHAIN], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
363 |
[ |
56124 | 364 |
FLAGS_SETUP_TOOLCHAIN_CONTROL |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
365 |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
366 |
if test "x$BUILD_SYSROOT" != x; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
367 |
FLAGS_SETUP_SYSROOT_FLAGS([BUILD_]) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
368 |
else |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
369 |
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
370 |
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
371 |
fi |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
372 |
AC_SUBST(BUILD_SYSROOT_CFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
373 |
AC_SUBST(BUILD_SYSROOT_LDFLAGS) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
374 |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
375 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
376 |
|
56177 | 377 |
AC_DEFUN([FLAGS_SETUP_FLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
378 |
[ |
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
379 |
FLAGS_SETUP_MACOSX_VERSION |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
380 |
FLAGS_SETUP_ABI_PROFILE |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
381 |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
382 |
FLAGS_SETUP_SHARED_LIBS |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
383 |
FLAGS_SETUP_DEBUG_SYMBOLS |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
384 |
FLAGS_SETUP_QUALITY_CHECKS |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
385 |
FLAGS_SETUP_OPTIMIZATION |
56177 | 386 |
|
387 |
FLAGS_SETUP_CFLAGS |
|
388 |
FLAGS_SETUP_LDFLAGS |
|
389 |
||
390 |
FLAGS_SETUP_ARFLAGS |
|
391 |
FLAGS_SETUP_STRIPFLAGS |
|
392 |
FLAGS_SETUP_RCFLAGS |
|
393 |
||
394 |
FLAGS_SETUP_ASFLAGS |
|
395 |
FLAGS_SETUP_ASFLAGS_CPU_DEP([TARGET]) |
|
396 |
FLAGS_SETUP_ASFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
397 |
]) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
398 |
|
56177 | 399 |
AC_DEFUN([FLAGS_SETUP_CFLAGS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
400 |
[ |
56177 | 401 |
# FIXME: How to handle this? |
402 |
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
403 |
# silence copyright notice and other headers. |
|
404 |
COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" |
|
37402 | 405 |
|
406 |
if test "x$DEBUG_LEVEL" != xrelease; then |
|
407 |
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
|
408 |
JVM_CFLAGS="$JVM_CFLAGS -homeparams" |
|
409 |
fi |
|
410 |
fi |
|
411 |
fi |
|
46224
b1ce24ef8897
8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents:
44398
diff
changeset
|
412 |
|
56149 | 413 |
### CFLAGS |
414 |
||
56177 | 415 |
FLAGS_SETUP_CFLAGS_HELPER |
56153 | 416 |
|
56155 | 417 |
FLAGS_OS=$OPENJDK_TARGET_OS |
418 |
FLAGS_OS_TYPE=$OPENJDK_TARGET_OS_TYPE |
|
419 |
FLAGS_CPU=$OPENJDK_TARGET_CPU |
|
420 |
FLAGS_CPU_ARCH=$OPENJDK_TARGET_CPU_ARCH |
|
421 |
FLAGS_CPU_BITS=$OPENJDK_TARGET_CPU_BITS |
|
422 |
FLAGS_CPU_ENDIAN=$OPENJDK_TARGET_CPU_ENDIAN |
|
423 |
FLAGS_CPU_LEGACY=$OPENJDK_TARGET_CPU_LEGACY |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
424 |
FLAGS_CPU_LEGACY_LIB=$OPENJDK_TARGET_CPU_LEGACY_LIB |
56124 | 425 |
|
56177 | 426 |
FLAGS_SETUP_CFLAGS_CPU_DEP([TARGET]) |
56124 | 427 |
|
56155 | 428 |
FLAGS_OS=$OPENJDK_BUILD_OS |
429 |
FLAGS_OS_TYPE=$OPENJDK_BUILD_OS_TYPE |
|
430 |
FLAGS_CPU=$OPENJDK_BUILD_CPU |
|
431 |
FLAGS_CPU_ARCH=$OPENJDK_BUILD_CPU_ARCH |
|
432 |
FLAGS_CPU_BITS=$OPENJDK_BUILD_CPU_BITS |
|
433 |
FLAGS_CPU_ENDIAN=$OPENJDK_BUILD_CPU_ENDIAN |
|
434 |
FLAGS_CPU_LEGACY=$OPENJDK_BUILD_CPU_LEGACY |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
435 |
FLAGS_CPU_LEGACY_LIB=$OPENJDK_BUILD_CPU_LEGACY_LIB |
56124 | 436 |
|
56177 | 437 |
FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) |
37402 | 438 |
|
439 |
# Tests are only ever compiled for TARGET |
|
56153 | 440 |
CFLAGS_TESTLIB="$CFLAGS_JDKLIB" |
441 |
CXXFLAGS_TESTLIB="$CXXFLAGS_JDKLIB" |
|
442 |
CFLAGS_TESTEXE="$CFLAGS_JDKEXE" |
|
443 |
CXXFLAGS_TESTEXE="$CXXFLAGS_JDKEXE" |
|
37402 | 444 |
|
445 |
AC_SUBST(CFLAGS_TESTLIB) |
|
446 |
AC_SUBST(CFLAGS_TESTEXE) |
|
447 |
AC_SUBST(CXXFLAGS_TESTLIB) |
|
448 |
AC_SUBST(CXXFLAGS_TESTEXE) |
|
449 |
]) |
|
450 |
||
451 |
################################################################################ |
|
56153 | 452 |
# platform independent |
56177 | 453 |
AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
454 |
[ |
56145 | 455 |
#### OS DEFINES, these should be independent on toolchain |
56155 | 456 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
56153 | 457 |
CFLAGS_OS_DEF_JVM="-DLINUX" |
458 |
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
|
56155 | 459 |
elif test "x$OPENJDK_TARGET_OS" = xsolaris; then |
56153 | 460 |
CFLAGS_OS_DEF_JVM="-DSOLARIS" |
461 |
CFLAGS_OS_DEF_JDK="-D__solaris__" |
|
56155 | 462 |
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then |
56153 | 463 |
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE" |
464 |
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" |
|
56155 | 465 |
elif test "x$OPENJDK_TARGET_OS" = xaix; then |
56153 | 466 |
CFLAGS_OS_DEF_JVM="-DAIX" |
56155 | 467 |
elif test "x$OPENJDK_TARGET_OS" = xbsd; then |
56153 | 468 |
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE" |
56155 | 469 |
elif test "x$OPENJDK_TARGET_OS" = xwindows; then |
56153 | 470 |
CFLAGS_OS_DEF_JVM="-D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_" |
56145 | 471 |
fi |
472 |
||
473 |
# Setup target OS define. Use OS target name but in upper case. |
|
56155 | 474 |
OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` |
475 |
CFLAGS_OS_DEF_JDK="$CFLAGS_OS_DEF_JDK -D$OPENJDK_TARGET_OS_UPPERCASE" |
|
56148 | 476 |
|
477 |
#### GLOBAL DEFINES |
|
478 |
# Set some common defines. These works for all compilers, but assume |
|
479 |
# -D is universally accepted. |
|
480 |
||
481 |
# Always enable optional macros for VM. |
|
56153 | 482 |
ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" |
56148 | 483 |
|
484 |
# Setup some hard coded includes |
|
56153 | 485 |
ALWAYS_CFLAGS_JDK=" \ |
56148 | 486 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \ |
487 |
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \ |
|
488 |
-I${TOPDIR}/src/java.base/share/native/libjava \ |
|
56155 | 489 |
-I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \ |
56148 | 490 |
-I${TOPDIR}/src/hotspot/share/include \ |
56153 | 491 |
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include" |
56148 | 492 |
|
493 |
############################################################################### |
|
494 |
||
495 |
# Adjust flags according to debug level. |
|
496 |
# Setup debug/release defines |
|
497 |
if test "x$DEBUG_LEVEL" = xrelease; then |
|
56153 | 498 |
DEBUG_CFLAGS_JDK="-DNDEBUG" |
56155 | 499 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
56153 | 500 |
DEBUG_CFLAGS_JDK="$DEBUG_CFLAGS_JDK -DTRIMMED" |
56148 | 501 |
fi |
502 |
else |
|
56153 | 503 |
DEBUG_CFLAGS_JDK="-DDEBUG" |
56148 | 504 |
|
505 |
if test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
506 |
# We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows. |
|
507 |
# Hotspot now overflows its 64K TOC (currently only for debug), |
|
508 |
# so for debug we build with '-qpic=large -bbigtoc'. |
|
56153 | 509 |
DEBUG_CFLAGS_JVM="-qpic=large" |
56148 | 510 |
fi |
511 |
fi |
|
512 |
||
56153 | 513 |
if test "x$DEBUG_LEVEL" != xrelease; then |
514 |
DEBUG_SYMBOLS_CFLAGS_JDK="$CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS" |
|
515 |
fi |
|
56148 | 516 |
|
56145 | 517 |
#### TOOLCHAIN DEFINES |
518 |
||
519 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
56153 | 520 |
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE -D_REENTRANT" |
56145 | 521 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
56153 | 522 |
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE" |
56145 | 523 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
56153 | 524 |
ALWAYS_DEFINES_JVM="-DSPARC_WORKS -D_Crun_inline_placement" |
525 |
ALWAYS_DEFINES_JDK="-DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" |
|
526 |
ALWAYS_DEFINES_JDK_CXXONLY="-DCC_NOEX" |
|
56145 | 527 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
56153 | 528 |
ALWAYS_DEFINES_JVM="-D_REENTRANT" |
529 |
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" |
|
56145 | 530 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
56153 | 531 |
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \ |
532 |
-D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL" |
|
56145 | 533 |
fi |
56144 | 534 |
|
56148 | 535 |
############################################################################### |
536 |
# |
|
537 |
# |
|
538 |
# CFLAGS BASIC |
|
539 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
|
540 |
# COMMON to gcc and clang |
|
56153 | 541 |
TOOLCHAIN_CFLAGS_JVM="-pipe -fno-rtti -fno-exceptions \ |
56148 | 542 |
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" |
543 |
fi |
|
544 |
||
545 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
56153 | 546 |
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new" |
547 |
TOOLCHAIN_CFLAGS_JDK="-pipe" |
|
548 |
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX (but since this gives *worse* performance, use no-strict-aliasing everywhere!) |
|
549 |
||
56155 | 550 |
CXXSTD_CXXFLAG="-std=gnu++98" |
56153 | 551 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG -Werror], |
552 |
IF_FALSE: [CXXSTD_CXXFLAG=""]) |
|
553 |
TOOLCHAIN_CFLAGS_JDK_CXXONLY="$CXXSTD_CXXFLAG" |
|
554 |
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $CXXSTD_CXXFLAG" |
|
555 |
ADLC_CXXFLAG="$CXXSTD_CXXFLAG" |
|
556 |
||
56148 | 557 |
|
558 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
559 |
# Restrict the debug information created by Clang to avoid |
|
560 |
# too big object files and speed the build up a little bit |
|
561 |
# (see http://llvm.org/bugs/show_bug.cgi?id=7554) |
|
56153 | 562 |
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info" |
56148 | 563 |
|
56155 | 564 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
56153 | 565 |
TOOLCHAIN_CFLAGS_JDK="-pipe" |
566 |
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX |
|
56148 | 567 |
fi |
568 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
56174 | 569 |
TOOLCHAIN_CFLAGS_JDK="-mt" |
56153 | 570 |
TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -v -W0,-noglobal" # C only |
571 |
TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only |
|
56158
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
572 |
TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \ |
56148 | 573 |
-library=stlport4 -mt -features=no%except" |
574 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
56153 | 575 |
TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt" # add on both CFLAGS |
576 |
TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \ |
|
56148 | 577 |
-qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ |
578 |
-qlanglvl=noredefmac -qnortti -qnoeh -qignerrno" |
|
579 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
56153 | 580 |
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP" |
581 |
TOOLCHAIN_CFLAGS_JDK="-MD -Zc:wchar_t-" |
|
56148 | 582 |
fi |
583 |
||
584 |
# CFLAGS WARNINGS STUFF |
|
56153 | 585 |
# Set JVM_CFLAGS warning handling |
56148 | 586 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
587 |
# COMMON to gcc and clang |
|
56153 | 588 |
WARNING_CFLAGS_JVM="-Wpointer-arith -Wsign-compare -Wunused-function" |
56148 | 589 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then |
590 |
# Non-zero builds have stricter warnings |
|
56153 | 591 |
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wundef -Wformat=2" |
56148 | 592 |
fi |
593 |
||
594 |
fi |
|
595 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
56153 | 596 |
WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2" |
597 |
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual" |
|
56148 | 598 |
|
599 |
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then |
|
600 |
# Non-zero builds have stricter warnings |
|
56153 | 601 |
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wreturn-type" |
56148 | 602 |
fi |
603 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
56153 | 604 |
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated" |
56155 | 605 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
56153 | 606 |
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-sometimes-uninitialized" |
607 |
WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2" |
|
56148 | 608 |
fi |
609 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
56153 | 610 |
WARNING_CFLAGS_JDK_CONLY="-errshort=tags" |
611 |
WARNING_CFLAGS_JDK_CXXONLY="+w" |
|
612 |
WARNING_CFLAGS_JDK="-errtags=yes -errfmt" |
|
56148 | 613 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
56153 | 614 |
WARNING_CFLAGS="-W3" |
615 |
WARNING_CFLAGS_JDK="-wd4800" |
|
616 |
fi |
|
617 |
||
618 |
# Set some additional per-OS defines. |
|
619 |
||
620 |
# Additional macosx handling |
|
56155 | 621 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
56171 | 622 |
OS_CFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \ |
623 |
-mmacosx-version-min=$MACOSX_VERSION_MIN" |
|
56153 | 624 |
|
625 |
if test -n "$MACOSX_VERSION_MAX"; then |
|
626 |
OS_CFLAGS="$OS_CFLAGS \ |
|
56171 | 627 |
-DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS" |
56153 | 628 |
fi |
629 |
fi |
|
630 |
||
631 |
# Where does this really belong?? |
|
56158
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
632 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
633 |
PICFLAG="-fPIC" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
634 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
635 |
PICFLAG="-KPIC" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
636 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
637 |
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
638 |
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
639 |
# will have to patch this single instruction with a call to some out-of-order code which |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
640 |
# does the load from the TOC. This is of course slow. But in that case we also would have |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
641 |
# to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'. |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
642 |
# With 'qpic=large' the compiler will by default generate a two-instruction sequence which |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
643 |
# can be patched directly by the linker and does not require a jump to out-of-order code. |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
644 |
# Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc' |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
645 |
# instead. This creates a distinct TOC for every compilation unit (and thus requires two |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
646 |
# loads for accessing a global variable). But there are rumors that this may be seen as a |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
647 |
# 'performance feature' because of improved code locality of the symbols used in a |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
648 |
# compilation unit. |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
649 |
PICFLAG="-qpic" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
650 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
651 |
PICFLAG="" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
652 |
fi |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
653 |
|
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
654 |
JVM_PICFLAG="$PICFLAG" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
655 |
JDK_PICFLAG="$PICFLAG" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
656 |
|
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
657 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
658 |
# Linking is different on MacOSX |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
659 |
JDK_PICFLAG='' |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
660 |
if test "x$STATIC_BUILD" = xtrue; then |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
661 |
JVM_PICFLAG="" |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
662 |
fi |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
663 |
fi |
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
664 |
|
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
665 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
56153 | 666 |
OS_CFLAGS_JVM="$OS_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16" |
667 |
fi |
|
56177 | 668 |
|
669 |
# Optional POSIX functionality needed by the JVM |
|
670 |
# |
|
671 |
# Check if clock_gettime is available and in which library. This indicates |
|
672 |
# availability of CLOCK_MONOTONIC for hotspot. But we don't need to link, so |
|
673 |
# don't let it update LIBS. |
|
674 |
save_LIBS="$LIBS" |
|
675 |
AC_SEARCH_LIBS(clock_gettime, rt, [HAS_CLOCK_GETTIME=true], []) |
|
676 |
if test "x$LIBS" = "x-lrt "; then |
|
677 |
CLOCK_GETTIME_IN_LIBRT=true |
|
678 |
fi |
|
679 |
LIBS="$save_LIBS" |
|
56153 | 680 |
|
681 |
if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then |
|
682 |
OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DSUPPORTS_CLOCK_MONOTONIC" |
|
683 |
if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then |
|
684 |
OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DNEEDS_LIBRT" |
|
685 |
fi |
|
686 |
fi |
|
687 |
||
688 |
# EXPORT |
|
689 |
AC_SUBST(ADLC_CXXFLAG) |
|
690 |
]) |
|
691 |
||
692 |
################################################################################ |
|
693 |
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check |
|
694 |
# conditionals against. |
|
695 |
# $2 - Optional prefix for each variable defined. |
|
56177 | 696 |
AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], |
56153 | 697 |
[ |
698 |
#### CPU DEFINES, these should be independent on toolchain |
|
699 |
||
700 |
# Setup target CPU |
|
701 |
# Setup endianness |
|
702 |
# The macros _LITTLE/BIG_ENDIAN needs to be defined with = to avoid |
|
703 |
# sunstudio warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
704 |
if test "x$FLAGS_CPU_ENDIAN" = xlittle; then |
|
705 |
$1_DEFINES_CPU_JVM="-DVM_LITTLE_ENDIAN" |
|
706 |
$1_DEFINES_CPU_JDK="-D_LITTLE_ENDIAN=" |
|
707 |
else |
|
708 |
$1_DEFINES_CPU_JDK="-D_BIG_ENDIAN=" |
|
709 |
fi |
|
710 |
||
711 |
# setup CPU bit size |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
712 |
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \ |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
713 |
-D$FLAGS_CPU_LEGACY" |
56153 | 714 |
|
715 |
if test "x$FLAGS_CPU_BITS" = x64; then |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
716 |
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
717 |
# unpack200.exe. |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
718 |
if test "x$FLAGS_OS" = xlinux || test "x$FLAGS_OS" = xmacosx; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
719 |
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
720 |
fi |
56153 | 721 |
if test "x$FLAGS_OS" != xsolaris && test "x$FLAGS_OS" != xaix; then |
722 |
# Solaris does not have _LP64=1 in the old build. |
|
723 |
# xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. |
|
724 |
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1" |
|
725 |
fi |
|
726 |
fi |
|
727 |
||
728 |
# toolchain dependend, per-cpu |
|
729 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
730 |
if test "x$FLAGS_CPU_ARCH" = xx86; then |
|
731 |
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB" |
|
732 |
fi |
|
733 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
734 |
if test "x$FLAGS_CPU" = xx86_64; then |
|
735 |
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_AMD64_ -Damd64" |
|
736 |
else |
|
737 |
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_X86_ -Dx86" |
|
738 |
fi |
|
56148 | 739 |
fi |
740 |
||
741 |
# CFLAGS PER CPU |
|
56154 | 742 |
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then |
56148 | 743 |
# COMMON to gcc and clang |
744 |
if test "x$FLAGS_CPU" = xx86; then |
|
745 |
# Force compatibility with i586 on 32 bit intel platforms. |
|
56153 | 746 |
$1_CFLAGS_CPU="-march=i586" |
56148 | 747 |
fi |
748 |
fi |
|
749 |
||
750 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
56153 | 751 |
if test "x$FLAGS_CPU" = xarm; then |
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
752 |
# -Wno-psabi to get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
753 |
$1_CFLAGS_CPU="-fsigned-char -Wno-psabi $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
754 |
$1_CFLAGS_CPU_JVM="-DARM" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
755 |
elif test "x$FLAGS_CPU" = xaarch64; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
756 |
if test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
757 |
$1_CFLAGS_CPU_JVM="-fsigned-char -DARM" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
758 |
fi |
56153 | 759 |
elif test "x$FLAGS_CPU_ARCH" = xppc; then |
760 |
$1_CFLAGS_CPU_JVM="-minsert-sched-nops=regroup_exact -mno-multiple -mno-string" |
|
56148 | 761 |
if test "x$FLAGS_CPU" = xppc64; then |
56153 | 762 |
# -mminimal-toc fixes `relocation truncated to fit' error for gcc 4.1. |
56148 | 763 |
# Use ppc64 instructions, but schedule for power5 |
56153 | 764 |
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc -mcpu=powerpc64 -mtune=power5" |
56148 | 765 |
elif test "x$FLAGS_CPU" = xppc64le; then |
766 |
# Little endian machine uses ELFv2 ABI. |
|
767 |
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. |
|
56153 | 768 |
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" |
56148 | 769 |
fi |
770 |
elif test "x$FLAGS_CPU" = xs390x; then |
|
56153 | 771 |
$1_CFLAGS_CPU="-mbackchain -march=z10" |
56148 | 772 |
fi |
773 |
||
774 |
if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then |
|
775 |
# for all archs except arm and ppc, prevent gcc to omit frame pointer |
|
56153 | 776 |
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer" |
56148 | 777 |
fi |
778 |
||
779 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
780 |
if test "x$FLAGS_OS" = xlinux; then |
|
781 |
# ppc test not really needed for clang |
|
782 |
if test "x$FLAGS_CPU_ARCH" != xarm && test "x$FLAGS_CPU_ARCH" != xppc; then |
|
783 |
# for all archs except arm and ppc, prevent gcc to omit frame pointer |
|
56153 | 784 |
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer" |
56148 | 785 |
fi |
786 |
fi |
|
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
787 |
|
56148 | 788 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
56162 | 789 |
if test "x$FLAGS_CPU" = xx86_64; then |
790 |
# NOTE: -xregs=no%frameptr is supposed to be default on x64 |
|
791 |
$1_CFLAGS_CPU_JDK="-xregs=no%frameptr" |
|
792 |
elif test "x$FLAGS_CPU" = xsparcv9; then |
|
56153 | 793 |
$1_CFLAGS_CPU_JVM="-xarch=sparc" |
56175
6301cc5b17cc
Fix too many EXTRA_CXXFLAGS, and -xregs=no%appl on binaries in solstudio.
ihse
parents:
56174
diff
changeset
|
794 |
$1_CFLAGS_CPU_JDK_LIBONLY="-xregs=no%appl" |
56148 | 795 |
fi |
56153 | 796 |
|
56148 | 797 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
798 |
if test "x$FLAGS_CPU" = xppc64; then |
|
56153 | 799 |
$1_CFLAGS_CPU_JVM="-qarch=ppc64" |
56148 | 800 |
fi |
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
801 |
|
56148 | 802 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
803 |
if test "x$FLAGS_CPU" = xx86; then |
|
56153 | 804 |
$1_CFLAGS_CPU_JVM="-arch:IA32" |
56148 | 805 |
fi |
806 |
fi |
|
807 |
||
56153 | 808 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
809 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($1)) |
|
56155 | 810 |
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}" |
56148 | 811 |
|
56153 | 812 |
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2, |
813 |
IF_AT_LEAST: [ |
|
814 |
# These flags either do not work or give spurious warnings prior to gcc 4.8. |
|
815 |
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized" |
|
816 |
] |
|
817 |
) |
|
56148 | 818 |
fi |
819 |
||
56153 | 820 |
# EXPORT to API |
821 |
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM $TOOLCHAIN_CFLAGS_JVM \ |
|
822 |
$OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \ |
|
56158
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56155
diff
changeset
|
823 |
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG" |
56148 | 824 |
|
56153 | 825 |
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \ |
826 |
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \ |
|
56175
6301cc5b17cc
Fix too many EXTRA_CXXFLAGS, and -xregs=no%appl on binaries in solstudio.
ihse
parents:
56174
diff
changeset
|
827 |
$WARNING_CFLAGS $WARNING_CFLAGS_JDK" |
56148 | 828 |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
829 |
# Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
830 |
# (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
831 |
# change in the future.) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
832 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
833 |
CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY $WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}" |
56153 | 834 |
CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY $TOOLCHAIN_CFLAGS_JDK_CXXONLY \ |
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
835 |
$WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}" |
56148 | 836 |
|
56155 | 837 |
$1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}" |
838 |
$1_CFLAGS_JDK="${$1_DEFINES_CPU_JDK} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JDK} ${$1_TOOLCHAIN_CFLAGS}" |
|
56148 | 839 |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
840 |
$2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}" |
56148 | 841 |
|
56153 | 842 |
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}" |
843 |
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}" |
|
56175
6301cc5b17cc
Fix too many EXTRA_CXXFLAGS, and -xregs=no%appl on binaries in solstudio.
ihse
parents:
56174
diff
changeset
|
844 |
$2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}" |
6301cc5b17cc
Fix too many EXTRA_CXXFLAGS, and -xregs=no%appl on binaries in solstudio.
ihse
parents:
56174
diff
changeset
|
845 |
$2CXXFLAGS_JDKLIB="${$2CXXFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}" |
56148 | 846 |
|
56153 | 847 |
AC_SUBST($2JVM_CFLAGS) |
56149 | 848 |
AC_SUBST($2CFLAGS_JDKLIB) |
849 |
AC_SUBST($2CFLAGS_JDKEXE) |
|
850 |
AC_SUBST($2CXXFLAGS_JDKLIB) |
|
851 |
AC_SUBST($2CXXFLAGS_JDKEXE) |
|
852 |
]) |
|
853 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
854 |
# 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
|
855 |
# IF_FALSE: [RUN-IF-FALSE]) |
16987 | 856 |
# ------------------------------------------------------------ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
857 |
# Check that the C compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
858 |
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS], |
34923 | 859 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
16987 | 860 |
[ |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
861 |
AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"]) |
16987 | 862 |
supports=yes |
863 |
||
864 |
saved_cflags="$CFLAGS" |
|
34923 | 865 |
CFLAGS="$CFLAGS ARG_ARGUMENT" |
16987 | 866 |
AC_LANG_PUSH([C]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
867 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 868 |
[supports=no]) |
16987 | 869 |
AC_LANG_POP([C]) |
870 |
CFLAGS="$saved_cflags" |
|
871 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
872 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
873 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
874 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
875 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
876 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
877 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
878 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
879 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
880 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
881 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
882 |
# 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
|
883 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
884 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
885 |
# Check that the C++ compiler supports an argument |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
886 |
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
887 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
888 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
889 |
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
|
890 |
supports=yes |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
891 |
|
16987 | 892 |
saved_cxxflags="$CXXFLAGS" |
34923 | 893 |
CXXFLAGS="$CXXFLAG ARG_ARGUMENT" |
16987 | 894 |
AC_LANG_PUSH([C++]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
895 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
20363 | 896 |
[supports=no]) |
16987 | 897 |
AC_LANG_POP([C++]) |
898 |
CXXFLAGS="$saved_cxxflags" |
|
899 |
||
900 |
AC_MSG_RESULT([$supports]) |
|
901 |
if test "x$supports" = "xyes" ; then |
|
34923 | 902 |
: |
903 |
ARG_IF_TRUE |
|
16987 | 904 |
else |
34923 | 905 |
: |
906 |
ARG_IF_FALSE |
|
16987 | 907 |
fi |
908 |
]) |
|
909 |
||
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
910 |
# 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
|
911 |
# IF_FALSE: [RUN-IF-FALSE]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
912 |
# ------------------------------------------------------------ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
913 |
# 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
|
914 |
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
915 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
916 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
917 |
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
918 |
IF_TRUE: [C_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
919 |
IF_FALSE: [C_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
920 |
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
921 |
IF_TRUE: [CXX_COMP_SUPPORTS="yes"], |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
922 |
IF_FALSE: [CXX_COMP_SUPPORTS="no"]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
923 |
|
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
924 |
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
|
925 |
supports=no |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
926 |
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi |
42141 | 927 |
|
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
928 |
AC_MSG_RESULT([$supports]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
929 |
if test "x$supports" = "xyes" ; then |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
930 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
931 |
ARG_IF_TRUE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
932 |
else |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
933 |
: |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
934 |
ARG_IF_FALSE |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
935 |
fi |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
936 |
]) |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
937 |
|
34923 | 938 |
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE], |
939 |
# IF_FALSE: [RUN-IF-FALSE]) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
940 |
# ------------------------------------------------------------ |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
941 |
# Check that the linker support an argument |
34923 | 942 |
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS], |
943 |
[*ARGUMENT IF_TRUE IF_FALSE], [$@], |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
944 |
[ |
34923 | 945 |
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
|
946 |
supports=yes |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
947 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
948 |
saved_ldflags="$LDFLAGS" |
34923 | 949 |
LDFLAGS="$LDFLAGS ARG_ARGUMENT" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
950 |
AC_LANG_PUSH([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
951 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
952 |
[], [supports=no]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
953 |
AC_LANG_POP([C]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
954 |
LDFLAGS="$saved_ldflags" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
955 |
|
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
956 |
AC_MSG_RESULT([$supports]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
957 |
if test "x$supports" = "xyes" ; then |
34923 | 958 |
: |
959 |
ARG_IF_TRUE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
960 |
else |
34923 | 961 |
: |
962 |
ARG_IF_FALSE |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
963 |
fi |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
964 |
]) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
965 |
|
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
966 |
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
967 |
# Arguments: |
56153 | 968 |
# $1 - Prefix for each variable defined. |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
969 |
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS], |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
970 |
[ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
971 |
# These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
972 |
# runs afoul of the more aggressive versions of these optimisations. |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
973 |
# Notably, value range propagation now assumes that the this pointer of C++ |
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
974 |
# member functions is non-null. |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
975 |
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks" |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
976 |
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
977 |
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror], |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
978 |
dnl IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""]) |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
979 |
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" |
39936
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
980 |
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
981 |
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror], |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
982 |
dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""]) |
552923792fd8
8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents:
39194
diff
changeset
|
983 |
AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}]) |
56153 | 984 |
$1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" |
36535
141db8da8c18
8151841: Build needs additional flags to compile with GCC 6
andrew
parents:
36531
diff
changeset
|
985 |
]) |
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
986 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
987 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
988 |
# Documentation on common flags used for solstudio in HIGHEST. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
989 |
# |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
990 |
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
991 |
# done with care, there are some assumptions below that need to |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
992 |
# be understood about the use of pointers, and IEEE behavior. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
993 |
# |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
994 |
# -fns: Use non-standard floating point mode (not IEEE 754) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
995 |
# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
996 |
# -fsingle: Use single precision floating point with 'float' |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
997 |
# -xalias_level=basic: Assume memory references via basic pointer types do not alias |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
998 |
# (Source with excessing pointer casting and data access with mixed |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
999 |
# pointer types are not recommended) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1000 |
# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1001 |
# (If you expect perfect errno behavior, do not use this) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1002 |
# -xdepend: Loop data dependency optimizations (need -xO3 or higher) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1003 |
# -xrestrict: Pointer parameters to functions do not overlap |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1004 |
# (Similar to -xalias_level=basic usage, but less obvious sometimes. |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1005 |
# If you pass in multiple pointers to the same data, do not use this) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1006 |
# -xlibmil: Inline some library routines |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1007 |
# (If you expect perfect errno behavior, do not use this) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1008 |
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1009 |
# (If you expect perfect errno behavior, do not use this) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56175
diff
changeset
|
1010 |
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now |