author | ihse |
Mon, 26 Feb 2018 14:10:16 +0100 | |
branch | ihse-cflags-rewrite-branch |
changeset 56176 | b3e3a12dcb33 |
parent 56168 | cb0b10e44247 |
child 56177 | 2fbe3b84ee3d |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
48767
0c6ce8fdb50a
8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()
gadams
parents:
48751
diff
changeset
|
2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
4 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
10 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
16 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
20 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
23 |
# questions. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
24 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
25 |
|
42538 | 26 |
################################################################################ |
27 |
# |
|
56124 | 28 |
# Setup flags for C/C++ compiler |
42538 | 29 |
# |
30 |
||
56124 | 31 |
############################################################################### |
32 |
# |
|
33 |
# How to compile shared libraries. |
|
34 |
# |
|
35 |
AC_DEFUN([FLAGS_SETUP_SHARED_LIBS], |
|
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
36 |
[ |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
37 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
38 |
C_FLAG_REORDER='' |
56168 | 39 |
|
40 |
# Default works for linux, might work on other platforms as well. |
|
41 |
SHARED_LIBRARY_FLAGS='-shared' |
|
42 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1' |
|
43 |
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" |
|
44 |
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1' |
|
45 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1' |
|
46 |
||
47 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
48 |
C_FLAG_REORDER='' |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
49 |
|
14111 | 50 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
51 |
# Linking is different on MacOSX |
56158
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56146
diff
changeset
|
52 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0" |
44398
406532d25529
8177634: Fix for 8175307 may cause linker errors on OS X 10.9
ihse
parents:
44074
diff
changeset
|
53 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
54 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
55 |
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' |
35747 | 56 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' |
37402 | 57 |
|
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
58 |
else |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
59 |
# Default works for linux, might work on other platforms as well. |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
60 |
SHARED_LIBRARY_FLAGS='-shared' |
41875 | 61 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
62 |
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1' |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
63 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1' |
42538 | 64 |
|
65 |
# arm specific settings |
|
66 |
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then |
|
67 |
# '-Wl,-z,origin' isn't used on arm. |
|
68 |
SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1' |
|
69 |
else |
|
70 |
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" |
|
71 |
fi |
|
56168 | 72 |
fi |
42538 | 73 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
74 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
75 |
C_FLAG_REORDER='-xF' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
76 |
SHARED_LIBRARY_FLAGS="-G" |
41875 | 77 |
SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN[$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
78 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
79 |
SET_SHARED_LIBRARY_NAME='-h [$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
80 |
SET_SHARED_LIBRARY_MAPFILE='-M[$]1' |
56168 | 81 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
82 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
83 |
C_FLAG_REORDER='' |
36051 | 84 |
SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
85 |
SET_EXECUTABLE_ORIGIN="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
86 |
SET_SHARED_LIBRARY_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
87 |
SET_SHARED_LIBRARY_NAME='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
88 |
SET_SHARED_LIBRARY_MAPFILE='' |
56168 | 89 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
90 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
91 |
C_FLAG_REORDER='' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
92 |
SHARED_LIBRARY_FLAGS="-dll" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
93 |
SET_EXECUTABLE_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
94 |
SET_SHARED_LIBRARY_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
95 |
SET_SHARED_LIBRARY_NAME='' |
35747 | 96 |
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1' |
20363 | 97 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
98 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
99 |
AC_SUBST(C_FLAG_REORDER) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
100 |
AC_SUBST(SET_EXECUTABLE_ORIGIN) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
101 |
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) |
20363 | 102 |
AC_SUBST(SET_SHARED_LIBRARY_NAME) |
103 |
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
104 |
AC_SUBST(SHARED_LIBRARY_FLAGS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
105 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
106 |
|
56124 | 107 |
AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
108 |
[ |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
109 |
# Debug symbols |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
110 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
111 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
112 |
CFLAGS_DEBUG_SYMBOLS="-g1" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
113 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
114 |
CFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
115 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
116 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
117 |
CFLAGS_DEBUG_SYMBOLS="-g" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
118 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
119 |
CFLAGS_DEBUG_SYMBOLS="-g -xs" |
35032 | 120 |
# -g0 enables debug symbols without disabling inlining. |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
121 |
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
122 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
123 |
CFLAGS_DEBUG_SYMBOLS="-g" |
36531
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
124 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
125 |
CFLAGS_DEBUG_SYMBOLS="-Zi" |
56162 | 126 |
fi |
127 |
||
128 |
if test "x$CXXFLAGS_DEBUG_SYMBOLS" = x; then |
|
129 |
# If we did not specify special flags for C++, use C version |
|
130 |
CXXFLAGS_DEBUG_SYMBOLS="$CFLAGS_DEBUG_SYMBOLS" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
131 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
132 |
AC_SUBST(CFLAGS_DEBUG_SYMBOLS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
133 |
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) |
56161
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
134 |
|
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
135 |
# FIXME: This was never used in the old build. What to do with it? |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
136 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
137 |
# "-Og" suppported for GCC 4.8 and later |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
138 |
CFLAG_OPTIMIZE_DEBUG_FLAG="-Og" |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
139 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CFLAG_OPTIMIZE_DEBUG_FLAG], |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
140 |
IF_TRUE: [HAS_CFLAG_OPTIMIZE_DEBUG=true], |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
141 |
IF_FALSE: [HAS_CFLAG_OPTIMIZE_DEBUG=false]) |
a7585ecb9fc2
Trying to sort out EXTRA_CFLAGS. Moving all flag handling to flags.m4.
ihse
parents:
56158
diff
changeset
|
142 |
fi |
56124 | 143 |
]) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
144 |
|
56124 | 145 |
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS], |
146 |
[ |
|
56176
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
147 |
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
148 |
[do not consider native warnings to be an error @<:@enabled@:>@])]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
149 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
150 |
AC_MSG_CHECKING([if native warnings are errors]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
151 |
if test "x$enable_warnings_as_errors" = "xyes"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
152 |
AC_MSG_RESULT([yes (explicitly set)]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
153 |
WARNINGS_AS_ERRORS=true |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
154 |
elif test "x$enable_warnings_as_errors" = "xno"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
155 |
AC_MSG_RESULT([no]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
156 |
WARNINGS_AS_ERRORS=false |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
157 |
elif test "x$enable_warnings_as_errors" = "x"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
158 |
AC_MSG_RESULT([yes (default)]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
159 |
WARNINGS_AS_ERRORS=true |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
160 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
161 |
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument]) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
162 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
163 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
164 |
AC_SUBST(WARNINGS_AS_ERRORS) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
165 |
|
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
166 |
case "${TOOLCHAIN_TYPE}" in |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
167 |
microsoft) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
168 |
DISABLE_WARNING_PREFIX="-wd" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
169 |
CFLAGS_WARNINGS_ARE_ERRORS="-WX" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
170 |
;; |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
171 |
solstudio) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
172 |
DISABLE_WARNING_PREFIX="-erroff=" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
173 |
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
174 |
;; |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
175 |
gcc) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
176 |
# Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
177 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
178 |
IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
179 |
IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false] |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
180 |
) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
181 |
if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
182 |
DISABLE_WARNING_PREFIX="-Wno-" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
183 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
184 |
DISABLE_WARNING_PREFIX= |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
185 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
186 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
187 |
# Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
188 |
# CFLAGS since any target specific flags will likely not work with the |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
189 |
# build compiler |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
190 |
CC_OLD="$CC" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
191 |
CXX_OLD="$CXX" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
192 |
CC="$BUILD_CC" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
193 |
CXX="$BUILD_CXX" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
194 |
CFLAGS_OLD="$CFLAGS" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
195 |
CFLAGS="" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
196 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
197 |
IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true], |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
198 |
IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false] |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
199 |
) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
200 |
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
201 |
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
202 |
else |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
203 |
BUILD_CC_DISABLE_WARNING_PREFIX= |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
204 |
fi |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
205 |
CC="$CC_OLD" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
206 |
CXX="$CXX_OLD" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
207 |
CFLAGS="$CFLAGS_OLD" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
208 |
;; |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
209 |
clang) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
210 |
DISABLE_WARNING_PREFIX="-Wno-" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
211 |
CFLAGS_WARNINGS_ARE_ERRORS="-Werror" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
212 |
;; |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
213 |
xlc) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
214 |
DISABLE_WARNING_PREFIX="-qsuppress=" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
215 |
CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
216 |
;; |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
217 |
esac |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
218 |
AC_SUBST(DISABLE_WARNING_PREFIX) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
219 |
AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
220 |
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) |
b3e3a12dcb33
Lots of structural rearrangements. Also fix for adding EXTRA_FLAGS to BUILD
ihse
parents:
56168
diff
changeset
|
221 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
222 |
# bounds, memory and behavior checking options |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
223 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
224 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
225 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
226 |
# no adjustment |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
227 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
228 |
fastdebug ) |
26123
44827e1a7a7b
8047952: Remove FORTIFY_SOURCE from fastdebug and slowdebug builds
mduigou
parents:
25459
diff
changeset
|
229 |
# no adjustment |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
230 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
231 |
slowdebug ) |
37402 | 232 |
# FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it |
35747 | 233 |
# get's added conditionally on whether we produce debug symbols or not. |
234 |
# This is most likely not really correct. |
|
235 |
||
30856
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
236 |
# Add runtime stack smashing and undefined behavior checks. |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
237 |
# Not all versions of gcc support -fstack-protector |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
238 |
STACK_PROTECTOR_CFLAG="-fstack-protector-all" |
56168 | 239 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], |
240 |
IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) |
|
30856
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
241 |
|
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
242 |
CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
243 |
CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
244 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
245 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
246 |
fi |
56124 | 247 |
]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
248 |
|
56124 | 249 |
AC_DEFUN([FLAGS_SETUP_OPTIMIZATION], |
250 |
[ |
|
37402 | 251 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
252 |
# Optimization levels |
56162 | 253 |
# Most toolchains share opt flags between CC and CXX; |
254 |
# setup for C and duplicate afterwards. |
|
255 |
||
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
256 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
56162 | 257 |
CC_HIGHEST="-fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
258 |
|
56162 | 259 |
C_O_FLAG_HIGHEST_JVM="-xO4" |
260 |
C_O_FLAG_DEBUG_JVM="" |
|
261 |
C_O_FLAG_SIZE="" |
|
262 |
C_O_FLAG_DEBUG="" |
|
263 |
C_O_FLAG_NONE="" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
264 |
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then |
56162 | 265 |
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST" |
266 |
C_O_FLAG_HI="-xO4 -Wu,-O4~yz" |
|
267 |
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
268 |
elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
56168 | 269 |
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 \ |
270 |
-xprefetch=auto,explicit -xchip=ultra $CC_HIGHEST" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
271 |
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
272 |
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
56162 | 273 |
fi |
274 |
elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
|
275 |
C_O_FLAG_HIGHEST_JVM="-O3" |
|
276 |
C_O_FLAG_HIGHEST="-O3" |
|
277 |
C_O_FLAG_HI="-O3" |
|
278 |
C_O_FLAG_NORM="-O2" |
|
279 |
C_O_FLAG_SIZE="-Os" |
|
280 |
C_O_FLAG_DEBUG="-O0" |
|
281 |
C_O_FLAG_DEBUG_JVM="-O0" |
|
282 |
C_O_FLAG_NONE="-O0" |
|
283 |
elif test "x$TOOLCHAIN_TYPE" = xclang; then |
|
284 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
285 |
# On MacOSX we optimize for size, something |
|
286 |
# we should do for all platforms? |
|
287 |
C_O_FLAG_HIGHEST_JVM="-Os" |
|
288 |
C_O_FLAG_HIGHEST="-Os" |
|
289 |
C_O_FLAG_HI="-Os" |
|
290 |
C_O_FLAG_NORM="-Os" |
|
37402 | 291 |
C_O_FLAG_DEBUG_JVM="" |
56162 | 292 |
else |
293 |
C_O_FLAG_HIGHEST_JVM="-O3" |
|
294 |
C_O_FLAG_HIGHEST="-O3" |
|
295 |
C_O_FLAG_HI="-O3" |
|
296 |
C_O_FLAG_NORM="-O2" |
|
297 |
C_O_FLAG_DEBUG_JVM="-O0" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
298 |
fi |
56162 | 299 |
C_O_FLAG_SIZE="-Os" |
300 |
C_O_FLAG_DEBUG="-O0" |
|
301 |
C_O_FLAG_NONE="-O0" |
|
302 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
|
303 |
C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue" |
|
304 |
C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue" |
|
305 |
C_O_FLAG_HI="-O3 -qinline -qinlglue" |
|
306 |
C_O_FLAG_NORM="-O2" |
|
307 |
C_O_FLAG_DEBUG="-qnoopt" |
|
308 |
# FIXME: Value below not verified. |
|
309 |
C_O_FLAG_DEBUG_JVM="" |
|
310 |
C_O_FLAG_NONE="-qnoopt" |
|
311 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
|
312 |
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-" |
|
313 |
C_O_FLAG_HIGHEST="-O2" |
|
314 |
C_O_FLAG_HI="-O1" |
|
315 |
C_O_FLAG_NORM="-O1" |
|
316 |
C_O_FLAG_DEBUG="-Od" |
|
317 |
C_O_FLAG_DEBUG_JVM="" |
|
318 |
C_O_FLAG_NONE="-Od" |
|
319 |
C_O_FLAG_SIZE="-Os" |
|
320 |
fi |
|
321 |
||
322 |
# Now copy to C++ flags |
|
323 |
CXX_O_FLAG_HIGHEST_JVM="$C_O_FLAG_HIGHEST_JVM" |
|
324 |
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" |
|
325 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
|
326 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
|
327 |
CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG" |
|
328 |
CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM" |
|
329 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
|
330 |
CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE" |
|
331 |
||
332 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
|
333 |
# In solstudio, also add this to C (but not C++) flags... |
|
334 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xalias_level=basic" |
|
20363 | 335 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
336 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
337 |
# Adjust optimization flags according to debug level. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
338 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
339 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
340 |
# no adjustment |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
341 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
342 |
fastdebug ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
343 |
# Not quite so much optimization |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
344 |
C_O_FLAG_HI="$C_O_FLAG_NORM" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
345 |
CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
346 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
347 |
slowdebug ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
348 |
# Disable optimization |
37402 | 349 |
C_O_FLAG_HIGHEST_JVM="$C_O_FLAG_DEBUG_JVM" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
350 |
C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
351 |
C_O_FLAG_HI="$C_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
352 |
C_O_FLAG_NORM="$C_O_FLAG_DEBUG" |
37402 | 353 |
C_O_FLAG_SIZE="$C_O_FLAG_DEBUG" |
354 |
CXX_O_FLAG_HIGHEST_JVM="$CXX_O_FLAG_DEBUG_JVM" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
355 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
356 |
CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
357 |
CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG" |
37402 | 358 |
CXX_O_FLAG_SIZE="$CXX_O_FLAG_DEBUG" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
359 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
360 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
361 |
|
37402 | 362 |
AC_SUBST(C_O_FLAG_HIGHEST_JVM) |
20363 | 363 |
AC_SUBST(C_O_FLAG_HIGHEST) |
364 |
AC_SUBST(C_O_FLAG_HI) |
|
365 |
AC_SUBST(C_O_FLAG_NORM) |
|
366 |
AC_SUBST(C_O_FLAG_NONE) |
|
37402 | 367 |
AC_SUBST(C_O_FLAG_SIZE) |
368 |
AC_SUBST(CXX_O_FLAG_HIGHEST_JVM) |
|
20363 | 369 |
AC_SUBST(CXX_O_FLAG_HIGHEST) |
370 |
AC_SUBST(CXX_O_FLAG_HI) |
|
371 |
AC_SUBST(CXX_O_FLAG_NORM) |
|
372 |
AC_SUBST(CXX_O_FLAG_NONE) |
|
37402 | 373 |
AC_SUBST(CXX_O_FLAG_SIZE) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
374 |
]) |