author | lana |
Thu, 05 Dec 2013 10:32:36 -0800 | |
changeset 21904 | 5a52f685faf0 |
parent 21055 | d52217bb8e80 |
child 22035 | 897e2da883cd |
child 22467 | b16a5ae55d50 |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
2 |
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
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 |
|
14111 | 26 |
# $1 = compiler to test (CC or CXX) |
27 |
# $2 = human readable name of compiler (C or C++) |
|
28 |
AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
29 |
[ |
14111 | 30 |
COMPILER=[$]$1 |
31 |
COMPILER_NAME=$2 |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
32 |
|
14111 | 33 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
34 |
# Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work |
|
35 |
COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` |
|
36 |
$ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null |
|
37 |
if test $? -ne 0; then |
|
38 |
GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` |
|
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
39 |
|
14111 | 40 |
AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.]) |
41 |
AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"]) |
|
42 |
AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.]) |
|
13697 | 43 |
else |
14111 | 44 |
COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/p"` |
45 |
COMPILER_VENDOR="Sun Studio" |
|
46 |
fi |
|
47 |
elif test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
48 |
# First line typically looks something like: |
|
20362
5f8289bfda3e
8023611: Win32 and win64: Remove all the WARNINGS in JDK 8 builds for Windows 2008 and MSVS 2010 SP1
tbell
parents:
19763
diff
changeset
|
49 |
# Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 |
18423
5f706ddb73ed
8019229: Build Configuration Fail in Windows Platform
erikj
parents:
18421
diff
changeset
|
50 |
COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` |
14111 | 51 |
COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"` |
52 |
COMPILER_VENDOR="Microsoft CL.EXE" |
|
53 |
COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` |
|
54 |
if test "x$OPENJDK_TARGET_CPU" = "xx86"; then |
|
55 |
if test "x$COMPILER_CPU_TEST" != "x80x86"; then |
|
56 |
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".]) |
|
57 |
fi |
|
58 |
elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then |
|
59 |
if test "x$COMPILER_CPU_TEST" != "xx64"; then |
|
60 |
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".]) |
|
61 |
fi |
|
62 |
fi |
|
63 |
else |
|
64 |
COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` |
|
65 |
# Check that this is likely to be GCC. |
|
66 |
$COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null |
|
67 |
if test $? -ne 0; then |
|
68 |
AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler.]) |
|
69 |
AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"]) |
|
70 |
AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.]) |
|
13697 | 71 |
fi |
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
72 |
|
14111 | 73 |
# First line typically looks something like: |
74 |
# gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 |
|
75 |
COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/p"` |
|
76 |
COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) @<:@1-9@:>@@<:@0-9.@:>@*/\1/p"` |
|
77 |
fi |
|
78 |
# This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) |
|
79 |
$1_VERSION="$COMPILER_VERSION" |
|
80 |
# This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) |
|
81 |
$1_VENDOR="$COMPILER_VENDOR" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
82 |
|
14111 | 83 |
AC_MSG_NOTICE([Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
84 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
85 |
|
14111 | 86 |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
87 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
88 |
[ |
20363 | 89 |
############################################################################### |
90 |
# |
|
91 |
# Configure the development tool paths and potential sysroot. |
|
92 |
# |
|
93 |
AC_LANG(C++) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
94 |
|
20363 | 95 |
# The option used to specify the target .o,.a or .so file. |
96 |
# When compiling, how to specify the to be created object file. |
|
97 |
CC_OUT_OPTION='-o$(SPACE)' |
|
98 |
# When linking, how to specify the to be created executable. |
|
99 |
EXE_OUT_OPTION='-o$(SPACE)' |
|
100 |
# When linking, how to specify the to be created dynamically linkable library. |
|
101 |
LD_OUT_OPTION='-o$(SPACE)' |
|
102 |
# When archiving, how to specify the to be create static archive for object files. |
|
103 |
AR_OUT_OPTION='rcs$(SPACE)' |
|
104 |
AC_SUBST(CC_OUT_OPTION) |
|
105 |
AC_SUBST(EXE_OUT_OPTION) |
|
106 |
AC_SUBST(LD_OUT_OPTION) |
|
107 |
AC_SUBST(AR_OUT_OPTION) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
108 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
109 |
|
14111 | 110 |
# $1 = compiler to test (CC or CXX) |
111 |
# $2 = human readable name of compiler (C or C++) |
|
112 |
# $3 = list of compiler names to search for |
|
113 |
AC_DEFUN([TOOLCHAIN_FIND_COMPILER], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
114 |
[ |
14111 | 115 |
COMPILER_NAME=$2 |
116 |
||
14614
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
117 |
$1= |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
118 |
# If TOOLS_DIR is set, check for all compiler names in there first |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
119 |
# before checking the rest of the PATH. |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
120 |
if test -n "$TOOLS_DIR"; then |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
121 |
PATH_save="$PATH" |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
122 |
PATH="$TOOLS_DIR" |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
123 |
AC_PATH_PROGS(TOOLS_DIR_$1, $3) |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
124 |
$1=$TOOLS_DIR_$1 |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
125 |
PATH="$PATH_save" |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
126 |
fi |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
127 |
|
14111 | 128 |
# AC_PATH_PROGS can't be run multiple times with the same variable, |
129 |
# so create a new name for this run. |
|
14614
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
130 |
if test "x[$]$1" = x; then |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
131 |
AC_PATH_PROGS(POTENTIAL_$1, $3) |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
132 |
$1=$POTENTIAL_$1 |
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
133 |
fi |
14111 | 134 |
|
14614
3bb0a6b81bb9
8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents:
14467
diff
changeset
|
135 |
if test "x[$]$1" = x; then |
20363 | 136 |
HELP_MSG_MISSING_DEPENDENCY([devkit]) |
137 |
AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) |
|
14111 | 138 |
fi |
139 |
BASIC_FIXUP_EXECUTABLE($1) |
|
140 |
AC_MSG_CHECKING([resolved symbolic links for $1]) |
|
141 |
TEST_COMPILER="[$]$1" |
|
142 |
BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) |
|
143 |
AC_MSG_RESULT([$TEST_COMPILER]) |
|
144 |
AC_MSG_CHECKING([if $1 is disguised ccache]) |
|
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
145 |
|
14111 | 146 |
COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` |
147 |
if test "x$COMPILER_BASENAME" = "xccache"; then |
|
148 |
AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) |
|
149 |
# We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. |
|
150 |
# We want to control ccache invocation ourselves, so ignore this cc and try |
|
151 |
# searching again. |
|
152 |
||
153 |
# Remove the path to the fake ccache cc from the PATH |
|
154 |
RETRY_COMPILER_SAVED_PATH="$PATH" |
|
155 |
COMPILER_DIRNAME=`$DIRNAME [$]$1` |
|
156 |
PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" |
|
157 |
||
158 |
# Try again looking for our compiler |
|
159 |
AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) |
|
160 |
BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) |
|
161 |
PATH="$RETRY_COMPILER_SAVED_PATH" |
|
162 |
||
163 |
AC_MSG_CHECKING([for resolved symbolic links for $1]) |
|
164 |
BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) |
|
165 |
AC_MSG_RESULT([$PROPER_COMPILER_$1]) |
|
166 |
$1="$PROPER_COMPILER_$1" |
|
167 |
else |
|
168 |
AC_MSG_RESULT([no, keeping $1]) |
|
169 |
$1="$TEST_COMPILER" |
|
170 |
fi |
|
171 |
TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) |
|
172 |
]) |
|
173 |
||
174 |
||
175 |
AC_DEFUN([TOOLCHAIN_SETUP_PATHS], |
|
176 |
[ |
|
20363 | 177 |
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
178 |
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV |
|
20643 | 179 |
TOOLCHAIN_SETUP_MSVCR_DLL |
20363 | 180 |
BASIC_DEPRECATED_ARG_WITH([dxsdk]) |
181 |
BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) |
|
182 |
BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) |
|
183 |
fi |
|
14111 | 184 |
|
20363 | 185 |
AC_SUBST(MSVCR_DLL) |
14111 | 186 |
|
20363 | 187 |
# If --build AND --host is set, then the configure script will find any |
188 |
# cross compilation tools in the PATH. Cross compilation tools |
|
189 |
# follows the cross compilation standard where they are prefixed with ${host}. |
|
190 |
# For example the binary i686-sun-solaris2.10-gcc |
|
191 |
# will cross compile for i686-sun-solaris2.10 |
|
192 |
# If neither of build and host is not set, then build=host and the |
|
193 |
# default compiler found in the path will be used. |
|
194 |
# Setting only --host, does not seem to be really supported. |
|
195 |
# Please set both --build and --host if you want to cross compile. |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
196 |
|
20363 | 197 |
if test "x$COMPILE_TYPE" = "xcross"; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
198 |
# Now we to find a C/C++ compiler that can build executables for the build |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
199 |
# platform. We can't use the AC_PROG_CC macro, since it can only be used |
13697 | 200 |
# once. Also, we need to do this before adding a tools dir to the path, |
201 |
# otherwise we might pick up cross-compilers which don't use standard naming. |
|
202 |
# Otherwise, we'll set the BUILD_tools to the native tools, but that'll have |
|
203 |
# to wait until they are properly discovered. |
|
204 |
AC_PATH_PROGS(BUILD_CC, [cl cc gcc]) |
|
14111 | 205 |
BASIC_FIXUP_EXECUTABLE(BUILD_CC) |
13697 | 206 |
AC_PATH_PROGS(BUILD_CXX, [cl CC g++]) |
14111 | 207 |
BASIC_FIXUP_EXECUTABLE(BUILD_CXX) |
13697 | 208 |
AC_PATH_PROG(BUILD_LD, ld) |
14111 | 209 |
BASIC_FIXUP_EXECUTABLE(BUILD_LD) |
20363 | 210 |
fi |
211 |
AC_SUBST(BUILD_CC) |
|
212 |
AC_SUBST(BUILD_CXX) |
|
213 |
AC_SUBST(BUILD_LD) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
214 |
|
20363 | 215 |
# If a devkit is found on the builddeps server, then prepend its path to the |
216 |
# PATH variable. If there are cross compilers available in the devkit, these |
|
217 |
# will be found by AC_PROG_CC et al. |
|
218 |
DEVKIT= |
|
219 |
BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, |
|
220 |
[ |
|
221 |
# Found devkit |
|
222 |
PATH="$DEVKIT/bin:$PATH" |
|
223 |
SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" |
|
224 |
if test "x$x_includes" = "xNONE"; then |
|
225 |
x_includes="$SYS_ROOT/usr/include/X11" |
|
226 |
fi |
|
227 |
if test "x$x_libraries" = "xNONE"; then |
|
228 |
x_libraries="$SYS_ROOT/usr/lib" |
|
229 |
fi |
|
230 |
], |
|
231 |
[]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
232 |
|
20363 | 233 |
# Store the CFLAGS etal passed to the configure script. |
234 |
ORG_CFLAGS="$CFLAGS" |
|
235 |
ORG_CXXFLAGS="$CXXFLAGS" |
|
236 |
ORG_OBJCFLAGS="$OBJCFLAGS" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
237 |
|
20363 | 238 |
# autoconf magic only relies on PATH, so update it if tools dir is specified |
239 |
OLD_PATH="$PATH" |
|
240 |
if test "x$TOOLS_DIR" != x; then |
|
241 |
PATH=$TOOLS_DIR:$PATH |
|
242 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
243 |
|
14111 | 244 |
|
20363 | 245 |
### Locate C compiler (CC) |
14111 | 246 |
|
20363 | 247 |
# On windows, only cl.exe is supported. |
248 |
# On Solaris, cc is preferred to gcc. |
|
249 |
# Elsewhere, gcc is preferred to cc. |
|
15906
3c42874d7148
8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents:
15581
diff
changeset
|
250 |
|
20363 | 251 |
if test "x$CC" != x; then |
252 |
COMPILER_CHECK_LIST="$CC" |
|
253 |
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
|
254 |
COMPILER_CHECK_LIST="cl" |
|
255 |
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
|
256 |
COMPILER_CHECK_LIST="cc gcc" |
|
257 |
else |
|
258 |
COMPILER_CHECK_LIST="gcc cc" |
|
259 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
260 |
|
20363 | 261 |
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) |
262 |
# Now that we have resolved CC ourself, let autoconf have its go at it |
|
263 |
AC_PROG_CC([$CC]) |
|
14111 | 264 |
|
20363 | 265 |
### Locate C++ compiler (CXX) |
14111 | 266 |
|
20363 | 267 |
if test "x$CXX" != x; then |
268 |
COMPILER_CHECK_LIST="$CXX" |
|
269 |
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
|
270 |
COMPILER_CHECK_LIST="cl" |
|
271 |
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then |
|
272 |
COMPILER_CHECK_LIST="CC g++" |
|
273 |
else |
|
274 |
COMPILER_CHECK_LIST="g++ CC" |
|
275 |
fi |
|
15906
3c42874d7148
8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents:
15581
diff
changeset
|
276 |
|
20363 | 277 |
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) |
278 |
# Now that we have resolved CXX ourself, let autoconf have its go at it |
|
279 |
AC_PROG_CXX([$CXX]) |
|
14111 | 280 |
|
20363 | 281 |
### Locate other tools |
14111 | 282 |
|
20363 | 283 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
284 |
AC_PROG_OBJC |
14111 | 285 |
BASIC_FIXUP_EXECUTABLE(OBJC) |
20363 | 286 |
else |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
287 |
OBJC= |
20363 | 288 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
289 |
|
20363 | 290 |
# Restore the flags to the user specified values. |
291 |
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" |
|
292 |
CFLAGS="$ORG_CFLAGS" |
|
293 |
CXXFLAGS="$ORG_CXXFLAGS" |
|
294 |
OBJCFLAGS="$ORG_OBJCFLAGS" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
295 |
|
20363 | 296 |
LD="$CC" |
297 |
LDEXE="$CC" |
|
298 |
LDCXX="$CXX" |
|
299 |
LDEXECXX="$CXX" |
|
300 |
AC_SUBST(LD) |
|
301 |
# LDEXE is the linker to use, when creating executables. |
|
302 |
AC_SUBST(LDEXE) |
|
303 |
# Linking C++ libraries. |
|
304 |
AC_SUBST(LDCXX) |
|
305 |
# Linking C++ executables. |
|
306 |
AC_SUBST(LDEXECXX) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
307 |
|
20363 | 308 |
if test "x$OPENJDK_TARGET_OS" != xwindows; then |
13697 | 309 |
AC_CHECK_TOOL(AR, ar) |
14111 | 310 |
BASIC_FIXUP_EXECUTABLE(AR) |
20363 | 311 |
fi |
312 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
313 |
ARFLAGS="-r" |
20363 | 314 |
else |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
315 |
ARFLAGS="" |
20363 | 316 |
fi |
317 |
AC_SUBST(ARFLAGS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
318 |
|
20363 | 319 |
# For hotspot, we need these in Windows mixed path; other platforms keep them the same |
320 |
HOTSPOT_CXX="$CXX" |
|
321 |
HOTSPOT_LD="$LD" |
|
322 |
AC_SUBST(HOTSPOT_CXX) |
|
323 |
AC_SUBST(HOTSPOT_LD) |
|
14111 | 324 |
|
20363 | 325 |
COMPILER_NAME=gcc |
326 |
COMPILER_TYPE=CC |
|
327 |
AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ |
|
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
328 |
# For now, assume that we are always compiling using cl.exe. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
329 |
CC_OUT_OPTION=-Fo |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
330 |
EXE_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
331 |
LD_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
332 |
AR_OUT_OPTION=-out: |
13697 | 333 |
# On Windows, reject /usr/bin/link (as determined in CYGWIN_LINK), which is a cygwin |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
334 |
# program for something completely different. |
13697 | 335 |
AC_CHECK_PROG([WINLD], [link],[link],,, [$CYGWIN_LINK]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
336 |
# Since we must ignore the first found link, WINLD will contain |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
337 |
# the full path to the link.exe program. |
14111 | 338 |
BASIC_FIXUP_EXECUTABLE(WINLD) |
13697 | 339 |
printf "Windows linker was found at $WINLD\n" |
340 |
AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) |
|
341 |
"$WINLD" --version > /dev/null |
|
342 |
if test $? -eq 0 ; then |
|
343 |
AC_MSG_RESULT([no]) |
|
344 |
AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.]) |
|
345 |
else |
|
346 |
AC_MSG_RESULT([yes]) |
|
347 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
348 |
LD="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
349 |
LDEXE="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
350 |
LDCXX="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
351 |
LDEXECXX="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
352 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
353 |
AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) |
14111 | 354 |
BASIC_FIXUP_EXECUTABLE(MT) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
355 |
# The resource compiler |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
356 |
AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) |
14111 | 357 |
BASIC_FIXUP_EXECUTABLE(RC) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
358 |
|
14111 | 359 |
# For hotspot, we need these in Windows mixed path, |
360 |
# so rewrite them all. Need added .exe suffix. |
|
361 |
HOTSPOT_CXX="$CXX.exe" |
|
362 |
HOTSPOT_LD="$LD.exe" |
|
363 |
HOTSPOT_MT="$MT.exe" |
|
364 |
HOTSPOT_RC="$RC.exe" |
|
365 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) |
|
366 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) |
|
367 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) |
|
368 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) |
|
369 |
AC_SUBST(HOTSPOT_MT) |
|
370 |
AC_SUBST(HOTSPOT_RC) |
|
371 |
||
372 |
RC_FLAGS="-nologo -l 0x409 -r" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
373 |
AS_IF([test "x$VARIANT" = xOPT], [ |
20363 | 374 |
RC_FLAGS="$RC_FLAGS -d NDEBUG" |
375 |
]) |
|
18426
bf9e616c1476
8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents:
18423
diff
changeset
|
376 |
|
20363 | 377 |
# The version variables used to create RC_FLAGS may be overridden |
378 |
# in a custom configure script, or possibly the command line. |
|
379 |
# Let those variables be expanded at make time in spec.gmk. |
|
380 |
# The \$ are escaped to the shell, and the $(...) variables |
|
381 |
# are evaluated by make. |
|
382 |
RC_FLAGS="$RC_FLAGS \ |
|
383 |
-d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ |
|
384 |
-d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ |
|
385 |
-d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ |
|
386 |
-d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ |
|
387 |
-d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ |
|
388 |
-d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ |
|
389 |
-d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
390 |
|
20363 | 391 |
# lib.exe is used to create static libraries. |
392 |
AC_CHECK_PROG([WINAR], [lib],[lib],,,) |
|
393 |
BASIC_FIXUP_EXECUTABLE(WINAR) |
|
394 |
AR="$WINAR" |
|
395 |
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
396 |
|
20363 | 397 |
AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) |
398 |
BASIC_FIXUP_EXECUTABLE(DUMPBIN) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
399 |
|
20363 | 400 |
COMPILER_TYPE=CL |
401 |
CCXXFLAGS="$CCXXFLAGS -nologo" |
|
402 |
]) |
|
403 |
AC_SUBST(RC_FLAGS) |
|
404 |
AC_SUBST(COMPILER_TYPE) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
405 |
|
20363 | 406 |
AC_PROG_CPP |
407 |
BASIC_FIXUP_EXECUTABLE(CPP) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
408 |
|
20363 | 409 |
AC_PROG_CXXCPP |
410 |
BASIC_FIXUP_EXECUTABLE(CXXCPP) |
|
13697 | 411 |
|
20363 | 412 |
if test "x$COMPILE_TYPE" != "xcross"; then |
13697 | 413 |
# If we are not cross compiling, use the same compilers for |
414 |
# building the build platform executables. The cross-compilation |
|
415 |
# case needed to be done earlier, but this can only be done after |
|
416 |
# the native tools have been localized. |
|
417 |
BUILD_CC="$CC" |
|
418 |
BUILD_CXX="$CXX" |
|
419 |
BUILD_LD="$LD" |
|
20363 | 420 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
421 |
|
20363 | 422 |
# for solaris we really need solaris tools, and not gnu equivalent |
423 |
# these seems to normally reside in /usr/ccs/bin so add that to path before |
|
424 |
# starting to probe |
|
425 |
# |
|
426 |
# NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH |
|
427 |
# so that it can be overriden --with-tools-dir |
|
428 |
if test "x$OPENJDK_BUILD_OS" = xsolaris; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
429 |
PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}" |
20363 | 430 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
431 |
|
20363 | 432 |
# Find the right assembler. |
433 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
434 |
AC_PATH_PROG(AS, as) |
14111 | 435 |
BASIC_FIXUP_EXECUTABLE(AS) |
20363 | 436 |
else |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
437 |
AS="$CC -c" |
20363 | 438 |
fi |
439 |
AC_SUBST(AS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
440 |
|
20363 | 441 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
16582
61f0b8f48036
8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents:
15912
diff
changeset
|
442 |
AC_PATH_PROG(NM, nm) |
14111 | 443 |
BASIC_FIXUP_EXECUTABLE(NM) |
16582
61f0b8f48036
8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents:
15912
diff
changeset
|
444 |
AC_PATH_PROG(GNM, gnm) |
61f0b8f48036
8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents:
15912
diff
changeset
|
445 |
BASIC_FIXUP_EXECUTABLE(GNM) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
446 |
AC_PATH_PROG(STRIP, strip) |
14111 | 447 |
BASIC_FIXUP_EXECUTABLE(STRIP) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
448 |
AC_PATH_PROG(MCS, mcs) |
14111 | 449 |
BASIC_FIXUP_EXECUTABLE(MCS) |
20363 | 450 |
elif test "x$OPENJDK_TARGET_OS" != xwindows; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
451 |
AC_CHECK_TOOL(NM, nm) |
14111 | 452 |
BASIC_FIXUP_EXECUTABLE(NM) |
16582
61f0b8f48036
8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents:
15912
diff
changeset
|
453 |
GNM="$NM" |
61f0b8f48036
8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents:
15912
diff
changeset
|
454 |
AC_SUBST(GNM) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
455 |
AC_CHECK_TOOL(STRIP, strip) |
14111 | 456 |
BASIC_FIXUP_EXECUTABLE(STRIP) |
20363 | 457 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
458 |
|
20363 | 459 |
# objcopy is used for moving debug symbols to separate files when |
460 |
# full debug symbols are enabled. |
|
461 |
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
14111 | 462 |
AC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy]) |
14464
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
463 |
# Only call fixup if objcopy was found. |
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
464 |
if test -n "$OBJCOPY"; then |
20363 | 465 |
BASIC_FIXUP_EXECUTABLE(OBJCOPY) |
14464
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
466 |
fi |
20363 | 467 |
fi |
14111 | 468 |
|
20363 | 469 |
AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) |
470 |
if test "x$OBJDUMP" != x; then |
|
471 |
# Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. |
|
472 |
BASIC_FIXUP_EXECUTABLE(OBJDUMP) |
|
473 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
474 |
|
20363 | 475 |
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
476 |
AC_PATH_PROG(LIPO, lipo) |
|
477 |
BASIC_FIXUP_EXECUTABLE(LIPO) |
|
478 |
fi |
|
13697 | 479 |
|
20363 | 480 |
TOOLCHAIN_SETUP_JTREG |
17593
de6741d8a142
8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents:
16988
diff
changeset
|
481 |
|
20363 | 482 |
# Restore old path without tools dir |
483 |
PATH="$OLD_PATH" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
484 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
485 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
486 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
487 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
488 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
489 |
|
20363 | 490 |
############################################################################### |
491 |
# |
|
492 |
# How to compile shared libraries. |
|
493 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
494 |
|
20363 | 495 |
if test "x$GCC" = xyes; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
496 |
COMPILER_NAME=gcc |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
497 |
PICFLAG="-fPIC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
498 |
LIBRARY_PREFIX=lib |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
499 |
SHARED_LIBRARY='lib[$]1.so' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
500 |
STATIC_LIBRARY='lib[$]1.a' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
501 |
SHARED_LIBRARY_FLAGS="-shared" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
502 |
SHARED_LIBRARY_SUFFIX='.so' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
503 |
STATIC_LIBRARY_SUFFIX='.a' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
504 |
OBJ_SUFFIX='.o' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
505 |
EXE_SUFFIX='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
506 |
SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
507 |
SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
508 |
C_FLAG_REORDER='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
509 |
CXX_FLAG_REORDER='' |
13697 | 510 |
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' |
511 |
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
512 |
LD="$CC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
513 |
LDEXE="$CC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
514 |
LDCXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
515 |
LDEXECXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
516 |
POST_STRIP_CMD="$STRIP -g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
517 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
518 |
# Linking is different on MacOSX |
14111 | 519 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
20363 | 520 |
# Might change in the future to clang. |
521 |
COMPILER_NAME=gcc |
|
522 |
SHARED_LIBRARY='lib[$]1.dylib' |
|
523 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" |
|
524 |
SHARED_LIBRARY_SUFFIX='.dylib' |
|
525 |
EXE_SUFFIX='' |
|
526 |
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' |
|
527 |
SET_SHARED_LIBRARY_MAPFILE='' |
|
528 |
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' |
|
529 |
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" |
|
530 |
POST_STRIP_CMD="$STRIP -S" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
531 |
fi |
20363 | 532 |
else |
14111 | 533 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
20363 | 534 |
# If it is not gcc, then assume it is the Oracle Solaris Studio Compiler |
535 |
COMPILER_NAME=ossc |
|
536 |
PICFLAG="-KPIC" |
|
537 |
LIBRARY_PREFIX=lib |
|
538 |
SHARED_LIBRARY='lib[$]1.so' |
|
539 |
STATIC_LIBRARY='lib[$]1.a' |
|
540 |
SHARED_LIBRARY_FLAGS="-G" |
|
541 |
SHARED_LIBRARY_SUFFIX='.so' |
|
542 |
STATIC_LIBRARY_SUFFIX='.a' |
|
543 |
OBJ_SUFFIX='.o' |
|
544 |
EXE_SUFFIX='' |
|
545 |
SET_SHARED_LIBRARY_NAME='' |
|
546 |
SET_SHARED_LIBRARY_MAPFILE='-M[$]1' |
|
547 |
C_FLAG_REORDER='-xF' |
|
548 |
CXX_FLAG_REORDER='-xF' |
|
549 |
SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1' |
|
550 |
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" |
|
551 |
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" |
|
552 |
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" |
|
553 |
CFLAGS_JDKLIB_EXTRA='-xstrconst' |
|
554 |
POST_STRIP_CMD="$STRIP -x" |
|
555 |
POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
556 |
fi |
14111 | 557 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
20363 | 558 |
# If it is not gcc, then assume it is the MS Visual Studio compiler |
559 |
COMPILER_NAME=cl |
|
560 |
PICFLAG="" |
|
561 |
LIBRARY_PREFIX= |
|
562 |
SHARED_LIBRARY='[$]1.dll' |
|
563 |
STATIC_LIBRARY='[$]1.lib' |
|
564 |
SHARED_LIBRARY_FLAGS="-LD" |
|
565 |
SHARED_LIBRARY_SUFFIX='.dll' |
|
566 |
STATIC_LIBRARY_SUFFIX='.lib' |
|
567 |
OBJ_SUFFIX='.obj' |
|
568 |
EXE_SUFFIX='.exe' |
|
569 |
SET_SHARED_LIBRARY_NAME='' |
|
570 |
SET_SHARED_LIBRARY_MAPFILE='' |
|
571 |
SET_SHARED_LIBRARY_ORIGIN='' |
|
572 |
SET_EXECUTABLE_ORIGIN='' |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
573 |
fi |
20363 | 574 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
575 |
|
20363 | 576 |
AC_SUBST(COMPILER_NAME) |
577 |
AC_SUBST(OBJ_SUFFIX) |
|
578 |
AC_SUBST(SHARED_LIBRARY) |
|
579 |
AC_SUBST(STATIC_LIBRARY) |
|
580 |
AC_SUBST(LIBRARY_PREFIX) |
|
581 |
AC_SUBST(SHARED_LIBRARY_SUFFIX) |
|
582 |
AC_SUBST(STATIC_LIBRARY_SUFFIX) |
|
583 |
AC_SUBST(EXE_SUFFIX) |
|
584 |
AC_SUBST(SHARED_LIBRARY_FLAGS) |
|
585 |
AC_SUBST(SET_SHARED_LIBRARY_NAME) |
|
586 |
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) |
|
587 |
AC_SUBST(C_FLAG_REORDER) |
|
588 |
AC_SUBST(CXX_FLAG_REORDER) |
|
589 |
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) |
|
590 |
AC_SUBST(SET_EXECUTABLE_ORIGIN) |
|
591 |
AC_SUBST(POST_STRIP_CMD) |
|
592 |
AC_SUBST(POST_MCS_CMD) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
593 |
|
20363 | 594 |
# The (cross) compiler is now configured, we can now test capabilities |
595 |
# of the target platform. |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
596 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
597 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
598 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
599 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
600 |
|
20363 | 601 |
############################################################################### |
602 |
# |
|
603 |
# Setup the opt flags for different compilers |
|
604 |
# and different operating systems. |
|
605 |
# |
|
13697 | 606 |
|
20363 | 607 |
# |
608 |
# NOTE: check for -mstackrealign needs to be below potential addition of -m32 |
|
609 |
# |
|
610 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
13697 | 611 |
# On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. |
612 |
# While waiting for a better solution, the current workaround is to use -mstackrealign. |
|
613 |
CFLAGS="$CFLAGS -mstackrealign" |
|
614 |
AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) |
|
615 |
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], |
|
20363 | 616 |
[ |
617 |
AC_MSG_RESULT([yes]) |
|
618 |
], |
|
619 |
[ |
|
620 |
AC_MSG_RESULT([no]) |
|
621 |
AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) |
|
622 |
] |
|
623 |
) |
|
624 |
fi |
|
13697 | 625 |
|
20363 | 626 |
C_FLAG_DEPS="-MMD -MF" |
627 |
CXX_FLAG_DEPS="-MMD -MF" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
628 |
|
20363 | 629 |
case $COMPILER_TYPE in |
630 |
CC ) |
|
631 |
case $COMPILER_NAME in |
|
632 |
gcc ) |
|
633 |
case $OPENJDK_TARGET_OS in |
|
634 |
macosx ) |
|
635 |
# On MacOSX we optimize for size, something |
|
636 |
# we should do for all platforms? |
|
637 |
C_O_FLAG_HI="-Os" |
|
638 |
C_O_FLAG_NORM="-Os" |
|
639 |
C_O_FLAG_NONE="" |
|
640 |
;; |
|
641 |
*) |
|
642 |
C_O_FLAG_HI="-O3" |
|
643 |
C_O_FLAG_NORM="-O2" |
|
644 |
C_O_FLAG_NONE="-O0" |
|
645 |
;; |
|
646 |
esac |
|
647 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
|
648 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
|
649 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
|
650 |
CFLAGS_DEBUG_SYMBOLS="-g" |
|
651 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
|
652 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then |
|
18020
eade0d9836bf
8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents:
17664
diff
changeset
|
653 |
CFLAGS_DEBUG_SYMBOLS="-g1" |
eade0d9836bf
8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents:
17664
diff
changeset
|
654 |
CXXFLAGS_DEBUG_SYMBOLS="-g1" |
20363 | 655 |
fi |
656 |
;; |
|
657 |
ossc ) |
|
658 |
# |
|
659 |
# Forte has different names for this with their C++ compiler... |
|
660 |
# |
|
661 |
C_FLAG_DEPS="-xMMD -xMF" |
|
662 |
CXX_FLAG_DEPS="-xMMD -xMF" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
663 |
|
20363 | 664 |
# Extra options used with HIGHEST |
665 |
# |
|
666 |
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be |
|
667 |
# done with care, there are some assumptions below that need to |
|
668 |
# be understood about the use of pointers, and IEEE behavior. |
|
669 |
# |
|
670 |
# Use non-standard floating point mode (not IEEE 754) |
|
671 |
CC_HIGHEST="$CC_HIGHEST -fns" |
|
672 |
# Do some simplification of floating point arithmetic (not IEEE 754) |
|
673 |
CC_HIGHEST="$CC_HIGHEST -fsimple" |
|
674 |
# Use single precision floating point with 'float' |
|
675 |
CC_HIGHEST="$CC_HIGHEST -fsingle" |
|
676 |
# Assume memory references via basic pointer types do not alias |
|
677 |
# (Source with excessing pointer casting and data access with mixed |
|
678 |
# pointer types are not recommended) |
|
679 |
CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" |
|
680 |
# Use intrinsic or inline versions for math/std functions |
|
681 |
# (If you expect perfect errno behavior, do not use this) |
|
682 |
CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" |
|
683 |
# Loop data dependency optimizations (need -xO3 or higher) |
|
684 |
CC_HIGHEST="$CC_HIGHEST -xdepend" |
|
685 |
# Pointer parameters to functions do not overlap |
|
686 |
# (Similar to -xalias_level=basic usage, but less obvious sometimes. |
|
687 |
# If you pass in multiple pointers to the same data, do not use this) |
|
688 |
CC_HIGHEST="$CC_HIGHEST -xrestrict" |
|
689 |
# Inline some library routines |
|
690 |
# (If you expect perfect errno behavior, do not use this) |
|
691 |
CC_HIGHEST="$CC_HIGHEST -xlibmil" |
|
692 |
# Use optimized math routines |
|
693 |
# (If you expect perfect errno behavior, do not use this) |
|
694 |
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now |
|
695 |
#CC_HIGHEST="$CC_HIGHEST -xlibmopt" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
696 |
|
20363 | 697 |
if test "x$OPENJDK_TARGET_CPU" = xsparc; then |
698 |
CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" |
|
699 |
CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" |
|
700 |
fi |
|
14111 | 701 |
|
20363 | 702 |
case $OPENJDK_TARGET_CPU_ARCH in |
703 |
x86) |
|
704 |
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" |
|
705 |
C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" |
|
706 |
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" |
|
707 |
C_O_FLAG_NONE="-xregs=no%frameptr" |
|
708 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" |
|
709 |
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" |
|
710 |
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" |
|
711 |
CXX_O_FLAG_NONE="-xregs=no%frameptr" |
|
712 |
if test "x$OPENJDK_TARGET_CPU" = xx86; then |
|
713 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" |
|
714 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" |
|
715 |
fi |
|
716 |
;; |
|
717 |
sparc) |
|
718 |
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" |
|
719 |
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" |
|
720 |
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" |
|
721 |
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
|
722 |
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
|
723 |
C_O_FLAG_NONE="" |
|
724 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" |
|
725 |
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
|
726 |
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
|
727 |
CXX_O_FLAG_NONE="" |
|
728 |
;; |
|
729 |
esac |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
730 |
|
20363 | 731 |
CFLAGS_DEBUG_SYMBOLS="-g -xs" |
732 |
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
|
733 |
esac |
|
734 |
;; |
|
735 |
CL ) |
|
736 |
C_O_FLAG_HIGHEST="-O2" |
|
737 |
C_O_FLAG_HI="-O1" |
|
738 |
C_O_FLAG_NORM="-O1" |
|
739 |
C_O_FLAG_NONE="-Od" |
|
740 |
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" |
|
741 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
|
742 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
|
743 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
|
744 |
;; |
|
745 |
esac |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
746 |
|
20363 | 747 |
if test -z "$C_O_FLAG_HIGHEST"; then |
748 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HI" |
|
749 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
750 |
|
20363 | 751 |
if test -z "$CXX_O_FLAG_HIGHEST"; then |
752 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" |
|
753 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
754 |
|
20363 | 755 |
AC_SUBST(C_O_FLAG_HIGHEST) |
756 |
AC_SUBST(C_O_FLAG_HI) |
|
757 |
AC_SUBST(C_O_FLAG_NORM) |
|
758 |
AC_SUBST(C_O_FLAG_NONE) |
|
759 |
AC_SUBST(CXX_O_FLAG_HIGHEST) |
|
760 |
AC_SUBST(CXX_O_FLAG_HI) |
|
761 |
AC_SUBST(CXX_O_FLAG_NORM) |
|
762 |
AC_SUBST(CXX_O_FLAG_NONE) |
|
763 |
AC_SUBST(C_FLAG_DEPS) |
|
764 |
AC_SUBST(CXX_FLAG_DEPS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
765 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
766 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
767 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
768 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
769 |
|
20363 | 770 |
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then |
771 |
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) |
|
772 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
773 |
|
20363 | 774 |
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then |
775 |
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) |
|
776 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
777 |
|
20363 | 778 |
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then |
779 |
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) |
|
780 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
781 |
|
20363 | 782 |
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], |
783 |
[extra flags to be used when compiling jdk c-files])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
784 |
|
20363 | 785 |
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], |
786 |
[extra flags to be used when compiling jdk c++-files])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
787 |
|
20363 | 788 |
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], |
789 |
[extra flags to be used when linking jdk])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
790 |
|
20363 | 791 |
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" |
792 |
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" |
|
793 |
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
794 |
|
20363 | 795 |
# Hotspot needs these set in their legacy form |
796 |
LEGACY_EXTRA_CFLAGS=$with_extra_cflags |
|
797 |
LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags |
|
798 |
LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags |
|
13697 | 799 |
|
20363 | 800 |
AC_SUBST(LEGACY_EXTRA_CFLAGS) |
801 |
AC_SUBST(LEGACY_EXTRA_CXXFLAGS) |
|
802 |
AC_SUBST(LEGACY_EXTRA_LDFLAGS) |
|
13697 | 803 |
|
20363 | 804 |
############################################################################### |
805 |
# |
|
806 |
# Now setup the CFLAGS and LDFLAGS for the JDK build. |
|
807 |
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. |
|
808 |
# |
|
809 |
case $COMPILER_NAME in |
|
810 |
gcc ) |
|
811 |
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ |
|
812 |
-pipe \ |
|
813 |
-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
|
814 |
case $OPENJDK_TARGET_CPU_ARCH in |
|
815 |
arm ) |
|
816 |
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing |
|
817 |
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
818 |
;; |
20363 | 819 |
ppc ) |
820 |
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing |
|
821 |
;; |
|
822 |
* ) |
|
823 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" |
|
824 |
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
825 |
;; |
20363 | 826 |
esac |
827 |
;; |
|
828 |
ossc ) |
|
829 |
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" |
|
830 |
case $OPENJDK_TARGET_CPU_ARCH in |
|
831 |
x86 ) |
|
832 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" |
|
833 |
CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
834 |
;; |
20363 | 835 |
esac |
836 |
||
837 |
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" |
|
838 |
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
839 |
|
20363 | 840 |
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" |
841 |
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" |
|
842 |
;; |
|
843 |
cl ) |
|
844 |
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ |
|
845 |
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ |
|
846 |
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ |
|
847 |
-DWIN32 -DIAL" |
|
848 |
case $OPENJDK_TARGET_CPU in |
|
849 |
x86 ) |
|
850 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" |
|
851 |
;; |
|
852 |
x86_64 ) |
|
853 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" |
|
854 |
;; |
|
855 |
esac |
|
856 |
;; |
|
857 |
esac |
|
858 |
||
859 |
############################################################################### |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
860 |
|
20363 | 861 |
# Adjust flags according to debug level. |
862 |
case $DEBUG_LEVEL in |
|
863 |
fastdebug ) |
|
864 |
CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" |
|
865 |
CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" |
|
866 |
C_O_FLAG_HI="$C_O_FLAG_NORM" |
|
867 |
C_O_FLAG_NORM="$C_O_FLAG_NORM" |
|
868 |
CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" |
|
869 |
CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM" |
|
870 |
JAVAC_FLAGS="$JAVAC_FLAGS -g" |
|
871 |
;; |
|
872 |
slowdebug ) |
|
873 |
CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" |
|
874 |
CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" |
|
875 |
C_O_FLAG_HI="$C_O_FLAG_NONE" |
|
876 |
C_O_FLAG_NORM="$C_O_FLAG_NONE" |
|
877 |
CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" |
|
878 |
CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" |
|
879 |
JAVAC_FLAGS="$JAVAC_FLAGS -g" |
|
880 |
;; |
|
881 |
esac |
|
18020
eade0d9836bf
8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents:
17664
diff
changeset
|
882 |
|
20363 | 883 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
884 |
|
20363 | 885 |
# The package path is used only on macosx? |
886 |
PACKAGE_PATH=/opt/local |
|
887 |
AC_SUBST(PACKAGE_PATH) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
888 |
|
20363 | 889 |
if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then |
13697 | 890 |
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the |
891 |
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
892 |
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). |
|
893 |
# Note: -Dmacro is the same as #define macro 1 |
|
20363 | 894 |
# -Dmacro= is the same as #define macro |
13697 | 895 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
20363 | 896 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" |
13697 | 897 |
else |
20363 | 898 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" |
13697 | 899 |
fi |
20363 | 900 |
else |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
901 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" |
20363 | 902 |
fi |
903 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
904 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" |
20363 | 905 |
fi |
906 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
907 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS" |
20363 | 908 |
fi |
909 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
910 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS" |
20363 | 911 |
fi |
912 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
19311
741980fe0b33
8021820: Number of opened files used in select() is limited to 1024 [macosx]
aefimov
parents:
18426
diff
changeset
|
913 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" |
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
914 |
# Setting these parameters makes it an error to link to macosx APIs that are |
15786 | 915 |
# newer than the given OS version and makes the linked binaries compatible even |
916 |
# if built on a newer version of the OS. |
|
917 |
# The expected format is X.Y.Z |
|
918 |
MACOSX_VERSION_MIN=10.7.0 |
|
919 |
AC_SUBST(MACOSX_VERSION_MIN) |
|
920 |
# The macro takes the version with no dots, ex: 1070 |
|
921 |
# Let the flags variables get resolved in make for easier override on make |
|
922 |
# command line. |
|
923 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
924 |
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
20363 | 925 |
fi |
926 |
if test "x$OPENJDK_TARGET_OS" = xbsd; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
927 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" |
20363 | 928 |
fi |
929 |
if test "x$DEBUG_LEVEL" = xrelease; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
930 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" |
20363 | 931 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
932 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" |
|
933 |
fi |
|
934 |
else |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
935 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" |
20363 | 936 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
937 |
|
20363 | 938 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" |
939 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
940 |
|
20363 | 941 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ |
942 |
-I${JDK_OUTPUTDIR}/include \ |
|
943 |
-I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ |
|
944 |
-I${JDK_TOPDIR}/src/share/javavm/export \ |
|
21055
d52217bb8e80
8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
20643
diff
changeset
|
945 |
-I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \ |
20363 | 946 |
-I${JDK_TOPDIR}/src/share/native/common \ |
947 |
-I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
948 |
|
20363 | 949 |
# The shared libraries are compiled using the picflag. |
950 |
CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" |
|
951 |
CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
952 |
|
20363 | 953 |
# Executable flags |
954 |
CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" |
|
955 |
CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
956 |
|
20363 | 957 |
# Now this is odd. The JDK native libraries have to link against libjvm.so |
958 |
# On 32-bit machines there is normally two distinct libjvm.so:s, client and server. |
|
959 |
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library |
|
960 |
# is identical for client and server? Yes. Which is picked at runtime (client or server)? |
|
961 |
# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following |
|
962 |
# libraries will link to whatever is in memory. Yuck. |
|
963 |
# |
|
964 |
# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. |
|
965 |
if test "x$COMPILER_NAME" = xcl; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
966 |
LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" |
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
967 |
if test "x$OPENJDK_TARGET_CPU" = xx86; then |
20363 | 968 |
LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
969 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
970 |
# TODO: make -debug optional "--disable-full-debug-symbols" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
971 |
LDFLAGS_JDK="$LDFLAGS_JDK -debug" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
972 |
LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
973 |
LDFLAGS_JDKLIB_SUFFIX="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
974 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then |
20363 | 975 |
LDFLAGS_STACK_SIZE=1048576 |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
976 |
else |
20363 | 977 |
LDFLAGS_STACK_SIZE=327680 |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
978 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
979 |
LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" |
20363 | 980 |
else |
14111 | 981 |
if test "x$COMPILER_NAME" = xgcc; then |
20363 | 982 |
# If this is a --hash-style=gnu system, use --hash-style=both, why? |
983 |
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` |
|
984 |
if test -n "$HAS_GNU_HASH"; then |
|
985 |
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " |
|
986 |
fi |
|
987 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
988 |
# And since we now know that the linker is gnu, then add -z defs, to forbid |
|
989 |
# undefined symbols in object files. |
|
990 |
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" |
|
991 |
if test "x$DEBUG_LEVEL" = "xrelease"; then |
|
992 |
# When building release libraries, tell the linker optimize them. |
|
993 |
# Should this be supplied to the OSS linker as well? |
|
994 |
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" |
|
14111 | 995 |
fi |
20363 | 996 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
997 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
998 |
LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ |
20363 | 999 |
-L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" |
13697 | 1000 |
|
14465 | 1001 |
# On some platforms (mac) the linker warns about non existing -L dirs. |
14467
a973c0a1bd5d
8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents:
14465
diff
changeset
|
1002 |
# Add server first if available. Linking aginst client does not always produce the same results. |
14810 | 1003 |
# Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1. |
1004 |
# Default to server for other variants. |
|
14467
a973c0a1bd5d
8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents:
14465
diff
changeset
|
1005 |
if test "x$JVM_VARIANT_SERVER" = xtrue; then |
20363 | 1006 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" |
14467
a973c0a1bd5d
8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents:
14465
diff
changeset
|
1007 |
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then |
20363 | 1008 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client" |
14810 | 1009 |
elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then |
20363 | 1010 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal" |
14465 | 1011 |
else |
20363 | 1012 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" |
14465 | 1013 |
fi |
1014 |
||
13697 | 1015 |
LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1016 |
if test "x$COMPILER_NAME" = xossc; then |
20363 | 1017 |
LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1018 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1019 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1020 |
LDFLAGS_JDKEXE="${LDFLAGS_JDK}" |
13697 | 1021 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
20363 | 1022 |
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1023 |
fi |
20363 | 1024 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1025 |
|
20363 | 1026 |
AC_SUBST(CFLAGS_JDKLIB) |
1027 |
AC_SUBST(CFLAGS_JDKEXE) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1028 |
|
20363 | 1029 |
AC_SUBST(CXXFLAGS_JDKLIB) |
1030 |
AC_SUBST(CXXFLAGS_JDKEXE) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1031 |
|
20363 | 1032 |
AC_SUBST(LDFLAGS_JDKLIB) |
1033 |
AC_SUBST(LDFLAGS_JDKEXE) |
|
1034 |
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) |
|
1035 |
AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) |
|
1036 |
AC_SUBST(LDFLAGS_CXX_JDK) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1037 |
]) |
16987 | 1038 |
|
1039 |
||
1040 |
# TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], |
|
1041 |
# [RUN-IF-FALSE]) |
|
1042 |
# ------------------------------------------------------------ |
|
1043 |
# Check that the c and c++ compilers support an argument |
|
1044 |
AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS], |
|
1045 |
[ |
|
1046 |
AC_MSG_CHECKING([if compiler supports "$1"]) |
|
1047 |
supports=yes |
|
1048 |
||
1049 |
saved_cflags="$CFLAGS" |
|
1050 |
CFLAGS="$CFLAGS $1" |
|
1051 |
AC_LANG_PUSH([C]) |
|
20363 | 1052 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
1053 |
[supports=no]) |
|
16987 | 1054 |
AC_LANG_POP([C]) |
1055 |
CFLAGS="$saved_cflags" |
|
1056 |
||
1057 |
saved_cxxflags="$CXXFLAGS" |
|
1058 |
CXXFLAGS="$CXXFLAG $1" |
|
1059 |
AC_LANG_PUSH([C++]) |
|
20363 | 1060 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], |
1061 |
[supports=no]) |
|
16987 | 1062 |
AC_LANG_POP([C++]) |
1063 |
CXXFLAGS="$saved_cxxflags" |
|
1064 |
||
1065 |
AC_MSG_RESULT([$supports]) |
|
1066 |
if test "x$supports" = "xyes" ; then |
|
1067 |
m4_ifval([$2], [$2], [:]) |
|
1068 |
else |
|
1069 |
m4_ifval([$3], [$3], [:]) |
|
1070 |
fi |
|
1071 |
]) |
|
1072 |
||
1073 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC], |
|
1074 |
[ |
|
1075 |
# Some Zero and Shark settings. |
|
1076 |
# ZERO_ARCHFLAG tells the compiler which mode to build for |
|
1077 |
case "${OPENJDK_TARGET_CPU}" in |
|
1078 |
s390) |
|
1079 |
ZERO_ARCHFLAG="-m31" |
|
1080 |
;; |
|
1081 |
*) |
|
1082 |
ZERO_ARCHFLAG="-m${OPENJDK_TARGET_CPU_BITS}" |
|
1083 |
esac |
|
1084 |
TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""]) |
|
1085 |
AC_SUBST(ZERO_ARCHFLAG) |
|
1086 |
||
1087 |
# Check that the compiler supports -mX flags |
|
1088 |
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does |
|
1089 |
TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([-m${OPENJDK_TARGET_CPU_BITS}], |
|
20363 | 1090 |
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], |
1091 |
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) |
|
16987 | 1092 |
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) |
1093 |
]) |
|
17593
de6741d8a142
8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents:
16988
diff
changeset
|
1094 |
|
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1095 |
# Setup the JTREG paths |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1096 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1097 |
[ |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1098 |
AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], |
20363 | 1099 |
[Regression Test Harness @<:@probed@:>@])], |
1100 |
[], |
|
1101 |
[with_jtreg=no]) |
|
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1102 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1103 |
if test "x$with_jtreg" = xno; then |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1104 |
# jtreg disabled |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1105 |
AC_MSG_CHECKING([for jtreg]) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1106 |
AC_MSG_RESULT(no) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1107 |
else |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1108 |
if test "x$with_jtreg" != xyes; then |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1109 |
# with path specified. |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1110 |
JT_HOME="$with_jtreg" |
17593
de6741d8a142
8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents:
16988
diff
changeset
|
1111 |
fi |
17664
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1112 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1113 |
if test "x$JT_HOME" != x; then |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1114 |
AC_MSG_CHECKING([for jtreg]) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1115 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1116 |
# use JT_HOME enviroment var. |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1117 |
BASIC_FIXUP_PATH([JT_HOME]) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1118 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1119 |
# jtreg win32 script works for everybody |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1120 |
JTREGEXE="$JT_HOME/win32/bin/jtreg" |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1121 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1122 |
if test ! -f "$JTREGEXE"; then |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1123 |
AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE]) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1124 |
fi |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1125 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1126 |
AC_MSG_RESULT($JTREGEXE) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1127 |
else |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1128 |
# try to find jtreg on path |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1129 |
BASIC_REQUIRE_PROG(JTREGEXE, jtreg) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1130 |
JT_HOME="`$DIRNAME $JTREGEXE`" |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1131 |
fi |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1132 |
fi |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1133 |
|
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1134 |
AC_SUBST(JT_HOME) |
2cb42641740b
8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents:
17593
diff
changeset
|
1135 |
AC_SUBST(JTREGEXE) |
17593
de6741d8a142
8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents:
16988
diff
changeset
|
1136 |
]) |