author | attila |
Tue, 15 Jan 2013 13:10:20 +0100 | |
changeset 16173 | c41d062f7d2a |
parent 15842 | a33cf9e2d7d8 |
child 15912 | bdd2262aaca1 |
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` |
|
39 |
||
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: |
|
49 |
# Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 |
|
50 |
COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` |
|
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 |
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 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
89 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
90 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
91 |
# Configure the development tool paths and potential sysroot. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
92 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
93 |
AC_LANG(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
94 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
95 |
# The option used to specify the target .o,.a or .so file. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
96 |
# When compiling, how to specify the to be created object file. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
97 |
CC_OUT_OPTION='-o$(SPACE)' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
98 |
# When linking, how to specify the to be created executable. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
99 |
EXE_OUT_OPTION='-o$(SPACE)' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
100 |
# When linking, how to specify the to be created dynamically linkable library. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
101 |
LD_OUT_OPTION='-o$(SPACE)' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
102 |
# When archiving, how to specify the to be create static archive for object files. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
103 |
AR_OUT_OPTION='rcs$(SPACE)' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
104 |
AC_SUBST(CC_OUT_OPTION) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
105 |
AC_SUBST(EXE_OUT_OPTION) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
106 |
AC_SUBST(LD_OUT_OPTION) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
107 |
AC_SUBST(AR_OUT_OPTION) |
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 |
14111 | 136 |
HELP_MSG_MISSING_DEPENDENCY([devkit]) |
137 |
AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) |
|
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]) |
|
145 |
||
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 |
[ |
|
177 |
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
|
178 |
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV |
|
15842
a33cf9e2d7d8
8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents:
15786
diff
changeset
|
179 |
TOOLCHAIN_SETUP_DXSDK |
14111 | 180 |
fi |
181 |
||
182 |
AC_SUBST(MSVCR_DLL) |
|
183 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
184 |
# If --build AND --host is set, then the configure script will find any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
185 |
# cross compilation tools in the PATH. Cross compilation tools |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
186 |
# follows the cross compilation standard where they are prefixed with ${host}. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
187 |
# For example the binary i686-sun-solaris2.10-gcc |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
188 |
# will cross compile for i686-sun-solaris2.10 |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
189 |
# If neither of build and host is not set, then build=host and the |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
190 |
# default compiler found in the path will be used. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
191 |
# Setting only --host, does not seem to be really supported. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
192 |
# Please set both --build and --host if you want to cross compile. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
193 |
|
13697 | 194 |
if test "x$COMPILE_TYPE" = "xcross"; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
195 |
# 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
|
196 |
# platform. We can't use the AC_PROG_CC macro, since it can only be used |
13697 | 197 |
# once. Also, we need to do this before adding a tools dir to the path, |
198 |
# otherwise we might pick up cross-compilers which don't use standard naming. |
|
199 |
# Otherwise, we'll set the BUILD_tools to the native tools, but that'll have |
|
200 |
# to wait until they are properly discovered. |
|
201 |
AC_PATH_PROGS(BUILD_CC, [cl cc gcc]) |
|
14111 | 202 |
BASIC_FIXUP_EXECUTABLE(BUILD_CC) |
13697 | 203 |
AC_PATH_PROGS(BUILD_CXX, [cl CC g++]) |
14111 | 204 |
BASIC_FIXUP_EXECUTABLE(BUILD_CXX) |
13697 | 205 |
AC_PATH_PROG(BUILD_LD, ld) |
14111 | 206 |
BASIC_FIXUP_EXECUTABLE(BUILD_LD) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
207 |
fi |
13697 | 208 |
AC_SUBST(BUILD_CC) |
209 |
AC_SUBST(BUILD_CXX) |
|
210 |
AC_SUBST(BUILD_LD) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
211 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
212 |
# If a devkit is found on the builddeps server, then prepend its path to the |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
213 |
# PATH variable. If there are cross compilers available in the devkit, these |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
214 |
# will be found by AC_PROG_CC et al. |
13697 | 215 |
DEVKIT= |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
216 |
BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
217 |
[# Found devkit |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
218 |
PATH="$DEVKIT/bin:$PATH" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
219 |
SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
220 |
if test "x$x_includes" = "xNONE"; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
221 |
x_includes="$SYS_ROOT/usr/include/X11" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
222 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
223 |
if test "x$x_libraries" = "xNONE"; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
224 |
x_libraries="$SYS_ROOT/usr/lib" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
225 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
226 |
], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
227 |
[]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
228 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
229 |
if test "x$SYS_ROOT" != "x/" ; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
230 |
CFLAGS="--sysroot=$SYS_ROOT $CFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
231 |
CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
232 |
OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
233 |
OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
234 |
CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
235 |
LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
236 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
237 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
238 |
# Store the CFLAGS etal passed to the configure script. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
239 |
ORG_CFLAGS="$CFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
240 |
ORG_CXXFLAGS="$CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
241 |
ORG_OBJCFLAGS="$OBJCFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
242 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
243 |
# autoconf magic only relies on PATH, so update it if tools dir is specified |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
244 |
OLD_PATH="$PATH" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
245 |
if test "x$TOOLS_DIR" != x; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
246 |
PATH=$TOOLS_DIR:$PATH |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
247 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
248 |
|
14111 | 249 |
|
250 |
### Locate C compiler (CC) |
|
251 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
252 |
# gcc is almost always present, but on Windows we |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
253 |
# prefer cl.exe and on Solaris we prefer CC. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
254 |
# Thus test for them in this order. |
14111 | 255 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
256 |
# Do not probe for cc on MacOSX. |
|
257 |
COMPILER_CHECK_LIST="cl gcc" |
|
258 |
else |
|
259 |
COMPILER_CHECK_LIST="cl cc gcc" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
260 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
261 |
|
14111 | 262 |
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) |
263 |
# Now that we have resolved CC ourself, let autoconf have it's go at it |
|
264 |
AC_PROG_CC([$CC]) |
|
265 |
||
266 |
### Locate C++ compiler (CXX) |
|
267 |
||
268 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
269 |
# Do not probe for CC on MacOSX. |
|
270 |
COMPILER_CHECK_LIST="cl g++" |
|
271 |
else |
|
272 |
COMPILER_CHECK_LIST="cl CC g++" |
|
273 |
fi |
|
274 |
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) |
|
275 |
# Now that we have resolved CXX ourself, let autoconf have it's go at it |
|
276 |
AC_PROG_CXX([$CXX]) |
|
277 |
||
278 |
### Locate other tools |
|
279 |
||
14112
1b447f5cb0d1
8001897: build-infra: misc adjustments to configure script
ihse
parents:
14111
diff
changeset
|
280 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
281 |
AC_PROG_OBJC |
14111 | 282 |
BASIC_FIXUP_EXECUTABLE(OBJC) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
283 |
else |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
284 |
OBJC= |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
285 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
286 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
287 |
# Restore the flags to the user specified values. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
288 |
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
289 |
CFLAGS="$ORG_CFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
290 |
CXXFLAGS="$ORG_CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
291 |
OBJCFLAGS="$ORG_OBJCFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
292 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
293 |
LD="$CC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
294 |
LDEXE="$CC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
295 |
LDCXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
296 |
LDEXECXX="$CXX" |
13697 | 297 |
AC_SUBST(LD) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
298 |
# LDEXE is the linker to use, when creating executables. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
299 |
AC_SUBST(LDEXE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
300 |
# Linking C++ libraries. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
301 |
AC_SUBST(LDCXX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
302 |
# Linking C++ executables. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
303 |
AC_SUBST(LDEXECXX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
304 |
|
14111 | 305 |
if test "x$OPENJDK_TARGET_OS" != xwindows; then |
13697 | 306 |
AC_CHECK_TOOL(AR, ar) |
14111 | 307 |
BASIC_FIXUP_EXECUTABLE(AR) |
13697 | 308 |
fi |
14111 | 309 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
310 |
ARFLAGS="-r" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
311 |
else |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
312 |
ARFLAGS="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
313 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
314 |
AC_SUBST(ARFLAGS) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
315 |
|
14111 | 316 |
# For hotspot, we need these in Windows mixed path; other platforms keep them the same |
317 |
HOTSPOT_CXX="$CXX" |
|
318 |
HOTSPOT_LD="$LD" |
|
319 |
AC_SUBST(HOTSPOT_CXX) |
|
320 |
AC_SUBST(HOTSPOT_LD) |
|
321 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
322 |
COMPILER_NAME=gcc |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
323 |
COMPILER_TYPE=CC |
14111 | 324 |
AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
325 |
# For now, assume that we are always compiling using cl.exe. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
326 |
CC_OUT_OPTION=-Fo |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
327 |
EXE_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
328 |
LD_OUT_OPTION=-out: |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
329 |
AR_OUT_OPTION=-out: |
13697 | 330 |
# 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
|
331 |
# program for something completely different. |
13697 | 332 |
AC_CHECK_PROG([WINLD], [link],[link],,, [$CYGWIN_LINK]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
333 |
# 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
|
334 |
# the full path to the link.exe program. |
14111 | 335 |
BASIC_FIXUP_EXECUTABLE(WINLD) |
13697 | 336 |
printf "Windows linker was found at $WINLD\n" |
337 |
AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) |
|
338 |
"$WINLD" --version > /dev/null |
|
339 |
if test $? -eq 0 ; then |
|
340 |
AC_MSG_RESULT([no]) |
|
341 |
AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.]) |
|
342 |
else |
|
343 |
AC_MSG_RESULT([yes]) |
|
344 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
345 |
LD="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
346 |
LDEXE="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
347 |
LDCXX="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
348 |
LDEXECXX="$WINLD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
349 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
350 |
AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) |
14111 | 351 |
BASIC_FIXUP_EXECUTABLE(MT) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
352 |
# The resource compiler |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
353 |
AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) |
14111 | 354 |
BASIC_FIXUP_EXECUTABLE(RC) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
355 |
|
14111 | 356 |
# For hotspot, we need these in Windows mixed path, |
357 |
# so rewrite them all. Need added .exe suffix. |
|
358 |
HOTSPOT_CXX="$CXX.exe" |
|
359 |
HOTSPOT_LD="$LD.exe" |
|
360 |
HOTSPOT_MT="$MT.exe" |
|
361 |
HOTSPOT_RC="$RC.exe" |
|
362 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) |
|
363 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) |
|
364 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) |
|
365 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) |
|
366 |
AC_SUBST(HOTSPOT_MT) |
|
367 |
AC_SUBST(HOTSPOT_RC) |
|
368 |
||
369 |
RC_FLAGS="-nologo -l 0x409 -r" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
370 |
AS_IF([test "x$VARIANT" = xOPT], [ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
371 |
RC_FLAGS="$RC_FLAGS -d NDEBUG" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
372 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
373 |
JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
374 |
AS_IF([test "x$JDK_UPDATE_VERSION" = x], [ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
375 |
JDK_UPDATE_VERSION_NOTNULL=0 |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
376 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
377 |
RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
378 |
RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
379 |
RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
380 |
RC_FLAGS="$RC_FLAGS -d \"JDK_VER=$JDK_MINOR_VERSION.$JDK_MICRO_VERSION.$JDK_UPDATE_VERSION_NOTNULL.$COOKED_BUILD_NUMBER\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
381 |
RC_FLAGS="$RC_FLAGS -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
382 |
RC_FLAGS="$RC_FLAGS -d \"JDK_NAME=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME $JDK_MINOR_VERSION $JDK_UPDATE_META_TAG\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
383 |
RC_FLAGS="$RC_FLAGS -d \"JDK_FVER=$JDK_MINOR_VERSION,$JDK_MICRO_VERSION,$JDK_UPDATE_VERSION_NOTNULL,$COOKED_BUILD_NUMBER\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
384 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
385 |
# lib.exe is used to create static libraries. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
386 |
AC_CHECK_PROG([WINAR], [lib],[lib],,,) |
14111 | 387 |
BASIC_FIXUP_EXECUTABLE(WINAR) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
388 |
AR="$WINAR" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
389 |
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
390 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
391 |
AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) |
14111 | 392 |
BASIC_FIXUP_EXECUTABLE(DUMPBIN) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
393 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
394 |
COMPILER_TYPE=CL |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
395 |
CCXXFLAGS="$CCXXFLAGS -nologo" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
396 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
397 |
AC_SUBST(RC_FLAGS) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
398 |
AC_SUBST(COMPILER_TYPE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
399 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
400 |
AC_PROG_CPP |
14111 | 401 |
BASIC_FIXUP_EXECUTABLE(CPP) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
402 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
403 |
AC_PROG_CXXCPP |
14111 | 404 |
BASIC_FIXUP_EXECUTABLE(CXXCPP) |
13697 | 405 |
|
406 |
if test "x$COMPILE_TYPE" != "xcross"; then |
|
407 |
# If we are not cross compiling, use the same compilers for |
|
408 |
# building the build platform executables. The cross-compilation |
|
409 |
# case needed to be done earlier, but this can only be done after |
|
410 |
# the native tools have been localized. |
|
411 |
BUILD_CC="$CC" |
|
412 |
BUILD_CXX="$CXX" |
|
413 |
BUILD_LD="$LD" |
|
414 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
415 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
416 |
# for solaris we really need solaris tools, and not gnu equivalent |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
417 |
# these seems to normally reside in /usr/ccs/bin so add that to path before |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
418 |
# starting to probe |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
419 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
420 |
# NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
421 |
# so that it can be overriden --with-tools-dir |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
422 |
if test "x$OPENJDK_BUILD_OS" = xsolaris; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
423 |
PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
424 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
425 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
426 |
# Find the right assembler. |
14111 | 427 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
428 |
AC_PATH_PROG(AS, as) |
14111 | 429 |
BASIC_FIXUP_EXECUTABLE(AS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
430 |
else |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
431 |
AS="$CC -c" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
432 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
433 |
AC_SUBST(AS) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
434 |
|
14111 | 435 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
13697 | 436 |
AC_PATH_PROGS(NM, [gnm nm]) |
14111 | 437 |
BASIC_FIXUP_EXECUTABLE(NM) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
438 |
AC_PATH_PROG(STRIP, strip) |
14111 | 439 |
BASIC_FIXUP_EXECUTABLE(STRIP) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
440 |
AC_PATH_PROG(MCS, mcs) |
14111 | 441 |
BASIC_FIXUP_EXECUTABLE(MCS) |
442 |
elif test "x$OPENJDK_TARGET_OS" != xwindows; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
443 |
AC_CHECK_TOOL(NM, nm) |
14111 | 444 |
BASIC_FIXUP_EXECUTABLE(NM) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
445 |
AC_CHECK_TOOL(STRIP, strip) |
14111 | 446 |
BASIC_FIXUP_EXECUTABLE(STRIP) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
447 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
448 |
|
14111 | 449 |
# objcopy is used for moving debug symbols to separate files when |
450 |
# full debug symbols are enabled. |
|
451 |
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
452 |
AC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy]) |
|
14464
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
453 |
# Only call fixup if objcopy was found. |
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
454 |
if test -n "$OBJCOPY"; then |
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
455 |
BASIC_FIXUP_EXECUTABLE(OBJCOPY) |
b82a851468d0
8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents:
14112
diff
changeset
|
456 |
fi |
14111 | 457 |
fi |
458 |
||
459 |
AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) |
|
460 |
if test "x$OBJDUMP" != x; then |
|
461 |
# Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. |
|
462 |
BASIC_FIXUP_EXECUTABLE(OBJDUMP) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
463 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
464 |
|
13697 | 465 |
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
466 |
AC_PATH_PROG(LIPO, lipo) |
|
14111 | 467 |
BASIC_FIXUP_EXECUTABLE(LIPO) |
13697 | 468 |
fi |
469 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
470 |
# Restore old path without tools dir |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
471 |
PATH="$OLD_PATH" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
472 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
473 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
474 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
475 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
476 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
477 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
478 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
479 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
480 |
# How to compile shared libraries. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
481 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
482 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
483 |
if test "x$GCC" = xyes; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
484 |
COMPILER_NAME=gcc |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
485 |
PICFLAG="-fPIC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
486 |
LIBRARY_PREFIX=lib |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
487 |
SHARED_LIBRARY='lib[$]1.so' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
488 |
STATIC_LIBRARY='lib[$]1.a' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
489 |
SHARED_LIBRARY_FLAGS="-shared" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
490 |
SHARED_LIBRARY_SUFFIX='.so' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
491 |
STATIC_LIBRARY_SUFFIX='.a' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
492 |
OBJ_SUFFIX='.o' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
493 |
EXE_SUFFIX='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
494 |
SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
495 |
SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
496 |
C_FLAG_REORDER='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
497 |
CXX_FLAG_REORDER='' |
13697 | 498 |
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' |
499 |
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
500 |
LD="$CC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
501 |
LDEXE="$CC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
502 |
LDCXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
503 |
LDEXECXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
504 |
POST_STRIP_CMD="$STRIP -g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
505 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
506 |
# Linking is different on MacOSX |
14111 | 507 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
508 |
# Might change in the future to clang. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
509 |
COMPILER_NAME=gcc |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
510 |
SHARED_LIBRARY='lib[$]1.dylib' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
511 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
512 |
SHARED_LIBRARY_SUFFIX='.dylib' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
513 |
EXE_SUFFIX='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
514 |
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
515 |
SET_SHARED_LIBRARY_MAPFILE='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
516 |
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' |
13697 | 517 |
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
518 |
POST_STRIP_CMD="$STRIP -S" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
519 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
520 |
else |
14111 | 521 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
522 |
# If it is not gcc, then assume it is the Oracle Solaris Studio Compiler |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
523 |
COMPILER_NAME=ossc |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
524 |
PICFLAG="-KPIC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
525 |
LIBRARY_PREFIX=lib |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
526 |
SHARED_LIBRARY='lib[$]1.so' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
527 |
STATIC_LIBRARY='lib[$]1.a' |
13697 | 528 |
SHARED_LIBRARY_FLAGS="-G" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
529 |
SHARED_LIBRARY_SUFFIX='.so' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
530 |
STATIC_LIBRARY_SUFFIX='.a' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
531 |
OBJ_SUFFIX='.o' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
532 |
EXE_SUFFIX='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
533 |
SET_SHARED_LIBRARY_NAME='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
534 |
SET_SHARED_LIBRARY_MAPFILE='-M[$]1' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
535 |
C_FLAG_REORDER='-xF' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
536 |
CXX_FLAG_REORDER='-xF' |
13697 | 537 |
SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1' |
538 |
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
539 |
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
540 |
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
541 |
CFLAGS_JDKLIB_EXTRA='-xstrconst' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
542 |
POST_STRIP_CMD="$STRIP -x" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
543 |
POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
544 |
fi |
14111 | 545 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
546 |
# If it is not gcc, then assume it is the MS Visual Studio compiler |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
547 |
COMPILER_NAME=cl |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
548 |
PICFLAG="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
549 |
LIBRARY_PREFIX= |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
550 |
SHARED_LIBRARY='[$]1.dll' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
551 |
STATIC_LIBRARY='[$]1.lib' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
552 |
SHARED_LIBRARY_FLAGS="-LD" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
553 |
SHARED_LIBRARY_SUFFIX='.dll' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
554 |
STATIC_LIBRARY_SUFFIX='.lib' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
555 |
OBJ_SUFFIX='.obj' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
556 |
EXE_SUFFIX='.exe' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
557 |
SET_SHARED_LIBRARY_NAME='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
558 |
SET_SHARED_LIBRARY_MAPFILE='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
559 |
SET_SHARED_LIBRARY_ORIGIN='' |
13697 | 560 |
SET_EXECUTABLE_ORIGIN='' |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
561 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
562 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
563 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
564 |
AC_SUBST(OBJ_SUFFIX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
565 |
AC_SUBST(SHARED_LIBRARY) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
566 |
AC_SUBST(STATIC_LIBRARY) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
567 |
AC_SUBST(LIBRARY_PREFIX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
568 |
AC_SUBST(SHARED_LIBRARY_SUFFIX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
569 |
AC_SUBST(STATIC_LIBRARY_SUFFIX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
570 |
AC_SUBST(EXE_SUFFIX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
571 |
AC_SUBST(SHARED_LIBRARY_FLAGS) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
572 |
AC_SUBST(SET_SHARED_LIBRARY_NAME) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
573 |
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
574 |
AC_SUBST(C_FLAG_REORDER) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
575 |
AC_SUBST(CXX_FLAG_REORDER) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
576 |
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) |
13697 | 577 |
AC_SUBST(SET_EXECUTABLE_ORIGIN) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
578 |
AC_SUBST(POST_STRIP_CMD) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
579 |
AC_SUBST(POST_MCS_CMD) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
580 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
581 |
# The (cross) compiler is now configured, we can now test capabilities |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
582 |
# of the target platform. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
583 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
584 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
585 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
586 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
587 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
588 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
589 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
590 |
# Setup the opt flags for different compilers |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
591 |
# and different operating systems. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
592 |
# |
13697 | 593 |
|
594 |
# |
|
595 |
# NOTE: check for -mstackrealign needs to be below potential addition of -m32 |
|
596 |
# |
|
597 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
598 |
# On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. |
|
599 |
# While waiting for a better solution, the current workaround is to use -mstackrealign. |
|
600 |
CFLAGS="$CFLAGS -mstackrealign" |
|
601 |
AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) |
|
602 |
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], |
|
603 |
[ |
|
604 |
AC_MSG_RESULT([yes]) |
|
605 |
], |
|
606 |
[ |
|
607 |
AC_MSG_RESULT([no]) |
|
608 |
AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) |
|
609 |
]) |
|
610 |
fi |
|
611 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
612 |
C_FLAG_DEPS="-MMD -MF" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
613 |
CXX_FLAG_DEPS="-MMD -MF" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
614 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
615 |
case $COMPILER_TYPE in |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
616 |
CC ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
617 |
D_FLAG="-g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
618 |
case $COMPILER_NAME in |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
619 |
gcc ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
620 |
case $OPENJDK_TARGET_OS in |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
621 |
macosx ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
622 |
# On MacOSX we optimize for size, something |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
623 |
# we should do for all platforms? |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
624 |
C_O_FLAG_HI="-Os" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
625 |
C_O_FLAG_NORM="-Os" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
626 |
C_O_FLAG_NONE="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
627 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
628 |
*) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
629 |
C_O_FLAG_HI="-O3" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
630 |
C_O_FLAG_NORM="-O2" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
631 |
C_O_FLAG_NONE="-O0" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
632 |
CFLAGS_DEBUG_SYMBOLS="-g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
633 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
634 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
635 |
CFLAGS_DEBUG_SYMBOLS="-g1" |
13697 | 636 |
CXXFLAGS_DEBUG_SYMBOLS="-g1" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
637 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
638 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
639 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
640 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
641 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
642 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
643 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
644 |
ossc ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
645 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
646 |
# Forte has different names for this with their C++ compiler... |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
647 |
# |
13697 | 648 |
C_FLAG_DEPS="-xMMD -xMF" |
649 |
CXX_FLAG_DEPS="-xMMD -xMF" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
650 |
|
13697 | 651 |
# Extra options used with HIGHEST |
652 |
# |
|
653 |
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be |
|
654 |
# done with care, there are some assumptions below that need to |
|
655 |
# be understood about the use of pointers, and IEEE behavior. |
|
656 |
# |
|
657 |
# Use non-standard floating point mode (not IEEE 754) |
|
658 |
CC_HIGHEST="$CC_HIGHEST -fns" |
|
659 |
# Do some simplification of floating point arithmetic (not IEEE 754) |
|
660 |
CC_HIGHEST="$CC_HIGHEST -fsimple" |
|
661 |
# Use single precision floating point with 'float' |
|
662 |
CC_HIGHEST="$CC_HIGHEST -fsingle" |
|
663 |
# Assume memory references via basic pointer types do not alias |
|
664 |
# (Source with excessing pointer casting and data access with mixed |
|
665 |
# pointer types are not recommended) |
|
666 |
CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" |
|
667 |
# Use intrinsic or inline versions for math/std functions |
|
668 |
# (If you expect perfect errno behavior, do not use this) |
|
669 |
CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" |
|
670 |
# Loop data dependency optimizations (need -xO3 or higher) |
|
671 |
CC_HIGHEST="$CC_HIGHEST -xdepend" |
|
672 |
# Pointer parameters to functions do not overlap |
|
673 |
# (Similar to -xalias_level=basic usage, but less obvious sometimes. |
|
674 |
# If you pass in multiple pointers to the same data, do not use this) |
|
675 |
CC_HIGHEST="$CC_HIGHEST -xrestrict" |
|
676 |
# Inline some library routines |
|
677 |
# (If you expect perfect errno behavior, do not use this) |
|
678 |
CC_HIGHEST="$CC_HIGHEST -xlibmil" |
|
679 |
# Use optimized math routines |
|
680 |
# (If you expect perfect errno behavior, do not use this) |
|
681 |
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now |
|
682 |
#CC_HIGHEST="$CC_HIGHEST -xlibmopt" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
683 |
|
14111 | 684 |
if test "x$OPENJDK_TARGET_CPU" = xsparc; then |
685 |
CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" |
|
686 |
CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" |
|
687 |
fi |
|
688 |
||
13697 | 689 |
case $OPENJDK_TARGET_CPU_ARCH in |
690 |
x86) |
|
691 |
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" |
|
692 |
C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" |
|
693 |
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" |
|
694 |
C_O_FLAG_NONE="-xregs=no%frameptr" |
|
695 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" |
|
696 |
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" |
|
697 |
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" |
|
698 |
CXX_O_FLAG_NONE="-xregs=no%frameptr" |
|
699 |
if test "x$OPENJDK_TARGET_CPU" = xx86; then |
|
700 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" |
|
701 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" |
|
702 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
703 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
704 |
sparc) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
705 |
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
706 |
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
707 |
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
708 |
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
709 |
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
710 |
C_O_FLAG_NONE="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
711 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
712 |
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
713 |
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
714 |
CXX_O_FLAG_NONE="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
715 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
716 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
717 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
718 |
CFLAGS_DEBUG_SYMBOLS="-g -xs" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
719 |
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
720 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
721 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
722 |
CL ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
723 |
D_FLAG= |
13697 | 724 |
C_O_FLAG_HIGHEST="-O2" |
725 |
C_O_FLAG_HI="-O1" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
726 |
C_O_FLAG_NORM="-O1" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
727 |
C_O_FLAG_NONE="-Od" |
13697 | 728 |
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
729 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
730 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
731 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
732 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
733 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
734 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
735 |
if test -z "$C_O_FLAG_HIGHEST"; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
736 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HI" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
737 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
738 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
739 |
if test -z "$CXX_O_FLAG_HIGHEST"; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
740 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
741 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
742 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
743 |
AC_SUBST(C_O_FLAG_HIGHEST) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
744 |
AC_SUBST(C_O_FLAG_HI) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
745 |
AC_SUBST(C_O_FLAG_NORM) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
746 |
AC_SUBST(C_O_FLAG_NONE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
747 |
AC_SUBST(CXX_O_FLAG_HIGHEST) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
748 |
AC_SUBST(CXX_O_FLAG_HI) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
749 |
AC_SUBST(CXX_O_FLAG_NORM) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
750 |
AC_SUBST(CXX_O_FLAG_NONE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
751 |
AC_SUBST(C_FLAG_DEPS) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
752 |
AC_SUBST(CXX_FLAG_DEPS) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
753 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
754 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
755 |
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
756 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
757 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
758 |
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then |
13697 | 759 |
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
760 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
761 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
762 |
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then |
13697 | 763 |
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
764 |
fi |
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 |
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then |
13697 | 767 |
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
768 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
769 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
770 |
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
771 |
[extra flags to be used when compiling jdk c-files])]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
772 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
773 |
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
774 |
[extra flags to be used when compiling jdk c++-files])]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
775 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
776 |
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
777 |
[extra flags to be used when linking jdk])]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
778 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
779 |
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
780 |
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
781 |
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
782 |
|
13697 | 783 |
# Hotspot needs these set in their legacy form |
784 |
LEGACY_EXTRA_CFLAGS=$with_extra_cflags |
|
785 |
LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags |
|
786 |
LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags |
|
787 |
||
788 |
AC_SUBST(LEGACY_EXTRA_CFLAGS) |
|
789 |
AC_SUBST(LEGACY_EXTRA_CXXFLAGS) |
|
790 |
AC_SUBST(LEGACY_EXTRA_LDFLAGS) |
|
791 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
792 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
793 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
794 |
# Now setup the CFLAGS and LDFLAGS for the JDK build. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
795 |
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
796 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
797 |
case $COMPILER_NAME in |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
798 |
gcc ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
799 |
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
800 |
-pipe \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
801 |
-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
802 |
case $OPENJDK_TARGET_CPU_ARCH in |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
803 |
arm ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
804 |
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
805 |
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
806 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
807 |
ppc ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
808 |
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
809 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
810 |
* ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
811 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
812 |
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
813 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
814 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
815 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
816 |
ossc ) |
13697 | 817 |
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" |
818 |
case $OPENJDK_TARGET_CPU_ARCH in |
|
819 |
x86 ) |
|
14111 | 820 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" |
13697 | 821 |
CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" |
822 |
;; |
|
823 |
esac |
|
824 |
||
825 |
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" |
|
826 |
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" |
|
827 |
||
828 |
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" |
|
829 |
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
830 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
831 |
cl ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
832 |
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
833 |
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
834 |
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
835 |
-DWIN32 -DIAL" |
13697 | 836 |
case $OPENJDK_TARGET_CPU in |
837 |
x86 ) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
838 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
839 |
;; |
13697 | 840 |
x86_64 ) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
841 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
842 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
843 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
844 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
845 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
846 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
847 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
848 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
849 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
850 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
851 |
# The package path is used only on macosx? |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
852 |
PACKAGE_PATH=/opt/local |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
853 |
AC_SUBST(PACKAGE_PATH) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
854 |
|
13697 | 855 |
if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then |
856 |
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the |
|
857 |
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
858 |
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). |
|
859 |
# Note: -Dmacro is the same as #define macro 1 |
|
860 |
# -Dmacro= is the same as #define macro |
|
861 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
|
862 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" |
|
863 |
else |
|
864 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" |
|
865 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
866 |
else |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
867 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
868 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
869 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
870 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
871 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
872 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
873 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
874 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
875 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
876 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
877 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
878 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
879 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE" |
15786 | 880 |
# Setting these parameters makes it an error to link to macosx APIs that are |
881 |
# newer than the given OS version and makes the linked binaries compatible even |
|
882 |
# if built on a newer version of the OS. |
|
883 |
# The expected format is X.Y.Z |
|
884 |
MACOSX_VERSION_MIN=10.7.0 |
|
885 |
AC_SUBST(MACOSX_VERSION_MIN) |
|
886 |
# The macro takes the version with no dots, ex: 1070 |
|
887 |
# Let the flags variables get resolved in make for easier override on make |
|
888 |
# command line. |
|
889 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
890 |
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
891 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
892 |
if test "x$OPENJDK_TARGET_OS" = xbsd; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
893 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
894 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
895 |
if test "x$DEBUG_LEVEL" = xrelease; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
896 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" |
13697 | 897 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
898 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" |
|
899 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
900 |
else |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
901 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
902 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
903 |
|
13697 | 904 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
905 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
906 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
907 |
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
908 |
-I${JDK_OUTPUTDIR}/include \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
909 |
-I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
910 |
-I${JDK_TOPDIR}/src/share/javavm/export \ |
13697 | 911 |
-I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \ |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
912 |
-I${JDK_TOPDIR}/src/share/native/common \ |
13697 | 913 |
-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
|
914 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
915 |
# The shared libraries are compiled using the picflag. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
916 |
CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
917 |
CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
918 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
919 |
# Executable flags |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
920 |
CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
921 |
CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
922 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
923 |
# Now this is odd. The JDK native libraries have to link against libjvm.so |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
924 |
# On 32-bit machines there is normally two distinct libjvm.so:s, client and server. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
925 |
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
926 |
# is identical for client and server? Yes. Which is picked at runtime (client or server)? |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
927 |
# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
928 |
# libraries will link to whatever is in memory. Yuck. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
929 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
930 |
# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. |
14111 | 931 |
if test "x$COMPILER_NAME" = xcl; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
932 |
LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" |
13697 | 933 |
if test "x$OPENJDK_TARGET_CPU" = xx86; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
934 |
LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
935 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
936 |
# TODO: make -debug optional "--disable-full-debug-symbols" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
937 |
LDFLAGS_JDK="$LDFLAGS_JDK -debug" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
938 |
LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
939 |
LDFLAGS_JDKLIB_SUFFIX="" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
940 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
941 |
LDFLAGS_STACK_SIZE=1048576 |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
942 |
else |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
943 |
LDFLAGS_STACK_SIZE=327680 |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
944 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
945 |
LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
946 |
else |
14111 | 947 |
if test "x$COMPILER_NAME" = xgcc; then |
948 |
# If this is a --hash-style=gnu system, use --hash-style=both, why? |
|
949 |
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` |
|
950 |
if test -n "$HAS_GNU_HASH"; then |
|
951 |
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " |
|
952 |
fi |
|
953 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
954 |
# And since we now know that the linker is gnu, then add -z defs, to forbid |
|
955 |
# undefined symbols in object files. |
|
956 |
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" |
|
957 |
if test "x$DEBUG_LEVEL" = "xrelease"; then |
|
958 |
# When building release libraries, tell the linker optimize them. |
|
959 |
# Should this be supplied to the OSS linker as well? |
|
960 |
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" |
|
961 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
962 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
963 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
964 |
LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ |
13697 | 965 |
-L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" |
966 |
||
14465 | 967 |
# 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
|
968 |
# Add server first if available. Linking aginst client does not always produce the same results. |
14810 | 969 |
# Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1. |
970 |
# Default to server for other variants. |
|
14467
a973c0a1bd5d
8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents:
14465
diff
changeset
|
971 |
if test "x$JVM_VARIANT_SERVER" = xtrue; then |
a973c0a1bd5d
8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents:
14465
diff
changeset
|
972 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" |
a973c0a1bd5d
8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents:
14465
diff
changeset
|
973 |
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then |
14465 | 974 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client" |
14810 | 975 |
elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then |
976 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal" |
|
14465 | 977 |
else |
978 |
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" |
|
979 |
fi |
|
980 |
||
13697 | 981 |
LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
982 |
if test "x$COMPILER_NAME" = xossc; then |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
983 |
LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
984 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
985 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
986 |
LDFLAGS_JDKEXE="${LDFLAGS_JDK}" |
13697 | 987 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
988 |
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
989 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
990 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
991 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
992 |
# Adjust flags according to debug level. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
993 |
case $DEBUG_LEVEL in |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
994 |
fastdebug ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
995 |
CFLAGS="$CFLAGS $D_FLAG" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
996 |
JAVAC_FLAGS="$JAVAC_FLAGS -g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
997 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
998 |
slowdebug ) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
999 |
CFLAGS="$CFLAGS $D_FLAG" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1000 |
C_O_FLAG_HI="$C_O_FLAG_NONE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1001 |
C_O_FLAG_NORM="$C_O_FLAG_NONE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1002 |
CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1003 |
CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1004 |
JAVAC_FLAGS="$JAVAC_FLAGS -g" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1005 |
;; |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1006 |
esac |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1007 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1008 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1009 |
AC_SUBST(CFLAGS_JDKLIB) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1010 |
AC_SUBST(CFLAGS_JDKEXE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1011 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1012 |
AC_SUBST(CXXFLAGS_JDKLIB) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1013 |
AC_SUBST(CXXFLAGS_JDKEXE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1014 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1015 |
AC_SUBST(LDFLAGS_JDKLIB) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1016 |
AC_SUBST(LDFLAGS_JDKEXE) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1017 |
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1018 |
AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) |
13697 | 1019 |
AC_SUBST(LDFLAGS_CXX_JDK) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1020 |
]) |