1 #
2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
49 ])
50
51 ###############################################################################
52 # Set the debug level
53 # release: no debug information, all optimizations, no asserts.
54 # optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
55 # fastdebug: debug information (-g), all optimizations, all asserts
56 # slowdebug: debug information (-g), no optimizations, all asserts
57 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
58 [
59 DEBUG_LEVEL="release"
60 AC_MSG_CHECKING([which debug level to use])
61 AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
62 [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
63 [
64 ENABLE_DEBUG="${enableval}"
65 DEBUG_LEVEL="fastdebug"
66 ], [ENABLE_DEBUG="no"])
67
68 AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
69 [set the debug level (release, fastdebug, slowdebug, optimized (HotSpot build only)) @<:@release@:>@])],
70 [
71 DEBUG_LEVEL="${withval}"
72 if test "x$ENABLE_DEBUG" = xyes; then
73 AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
74 fi
75 ])
76 AC_MSG_RESULT([$DEBUG_LEVEL])
77
78 if test "x$DEBUG_LEVEL" != xrelease && \
79 test "x$DEBUG_LEVEL" != xoptimized && \
80 test "x$DEBUG_LEVEL" != xfastdebug && \
81 test "x$DEBUG_LEVEL" != xslowdebug; then
82 AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
83 fi
84 ])
85
86 ###############################################################################
87 #
88 # Should we build only OpenJDK even if closed sources are present?
89 #
90 AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
91 [
92 AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
93 [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
94
95 AC_MSG_CHECKING([for presence of closed sources])
96 if test -d "$SRC_ROOT/jdk/src/closed"; then
97 CLOSED_SOURCE_PRESENT=yes
98 else
99 CLOSED_SOURCE_PRESENT=no
100 fi
101 AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
102
159
160 # Choose cacerts source file
161 AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
162 [specify alternative cacerts file])])
163 if test "x$with_cacerts_file" != x; then
164 CACERTS_FILE=$with_cacerts_file
165 fi
166 AC_SUBST(CACERTS_FILE)
167
168 # Enable or disable unlimited crypto
169 AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
170 [Enable unlimited crypto policy @<:@disabled@:>@])],,
171 [enable_unlimited_crypto=no])
172 if test "x$enable_unlimited_crypto" = "xyes"; then
173 UNLIMITED_CRYPTO=true
174 else
175 UNLIMITED_CRYPTO=false
176 fi
177 AC_SUBST(UNLIMITED_CRYPTO)
178
179 # Compress jars
180 COMPRESS_JARS=false
181
182 AC_SUBST(COMPRESS_JARS)
183
184 # Setup default copyright year. Mostly overridden when building close to a new year.
185 AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
186 [Set copyright year value for build @<:@current year@:>@])])
187 if test "x$with_copyright_year" = xyes; then
188 AC_MSG_ERROR([Copyright year must have a value])
189 elif test "x$with_copyright_year" != x; then
190 COPYRIGHT_YEAR="$with_copyright_year"
191 else
192 COPYRIGHT_YEAR=`date +'%Y'`
193 fi
194 AC_SUBST(COPYRIGHT_YEAR)
195 ])
196
197 ###############################################################################
198 #
205 if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
206 ENABLE_INTREE_EC=yes
207 AC_MSG_RESULT([yes])
208 else
209 ENABLE_INTREE_EC=no
210 AC_MSG_RESULT([no])
211 fi
212
213 AC_SUBST(ENABLE_INTREE_EC)
214 ])
215
216 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
217 [
218 #
219 # NATIVE_DEBUG_SYMBOLS
220 # This must be done after the toolchain is setup, since we're looking at objcopy.
221 #
222 AC_MSG_CHECKING([what type of native debug symbols to use])
223 AC_ARG_WITH([native-debug-symbols],
224 [AS_HELP_STRING([--with-native-debug-symbols],
225 [set the native debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
226 [
227 if test "x$OPENJDK_TARGET_OS" = xaix; then
228 if test "x$withval" = xexternal || test "x$withval" = xzipped; then
229 AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
230 fi
231 fi
232 ],
233 [
234 if test "x$OPENJDK_TARGET_OS" = xaix; then
235 # AIX doesn't support 'zipped' so use 'internal' as default
236 with_native_debug_symbols="internal"
237 else
238 with_native_debug_symbols="zipped"
239 fi
240 ])
241 NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
242 AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
243
244 if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
245
246 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
247 if test "x$OBJCOPY" = x; then
248 # enabling of enable-debug-symbols and can't find objcopy
249 # this is an error
250 AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
251 fi
252 fi
253
254 COMPILE_WITH_DEBUG_SYMBOLS=true
255 COPY_DEBUG_SYMBOLS=true
256 ZIP_EXTERNAL_DEBUG_SYMBOLS=true
257
258 # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
259 DEBUG_BINARIES=false
|
1 #
2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
49 ])
50
51 ###############################################################################
52 # Set the debug level
53 # release: no debug information, all optimizations, no asserts.
54 # optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
55 # fastdebug: debug information (-g), all optimizations, all asserts
56 # slowdebug: debug information (-g), no optimizations, all asserts
57 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
58 [
59 DEBUG_LEVEL="release"
60 AC_MSG_CHECKING([which debug level to use])
61 AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
62 [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
63 [
64 ENABLE_DEBUG="${enableval}"
65 DEBUG_LEVEL="fastdebug"
66 ], [ENABLE_DEBUG="no"])
67
68 AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
69 [set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])],
70 [
71 DEBUG_LEVEL="${withval}"
72 if test "x$ENABLE_DEBUG" = xyes; then
73 AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
74 fi
75 ])
76 AC_MSG_RESULT([$DEBUG_LEVEL])
77
78 if test "x$DEBUG_LEVEL" != xrelease && \
79 test "x$DEBUG_LEVEL" != xoptimized && \
80 test "x$DEBUG_LEVEL" != xfastdebug && \
81 test "x$DEBUG_LEVEL" != xslowdebug; then
82 AC_MSG_ERROR([Allowed debug levels are: release, fastdebug, slowdebug and optimized])
83 fi
84 ])
85
86 ###############################################################################
87 #
88 # Should we build only OpenJDK even if closed sources are present?
89 #
90 AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
91 [
92 AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
93 [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
94
95 AC_MSG_CHECKING([for presence of closed sources])
96 if test -d "$SRC_ROOT/jdk/src/closed"; then
97 CLOSED_SOURCE_PRESENT=yes
98 else
99 CLOSED_SOURCE_PRESENT=no
100 fi
101 AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
102
159
160 # Choose cacerts source file
161 AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
162 [specify alternative cacerts file])])
163 if test "x$with_cacerts_file" != x; then
164 CACERTS_FILE=$with_cacerts_file
165 fi
166 AC_SUBST(CACERTS_FILE)
167
168 # Enable or disable unlimited crypto
169 AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
170 [Enable unlimited crypto policy @<:@disabled@:>@])],,
171 [enable_unlimited_crypto=no])
172 if test "x$enable_unlimited_crypto" = "xyes"; then
173 UNLIMITED_CRYPTO=true
174 else
175 UNLIMITED_CRYPTO=false
176 fi
177 AC_SUBST(UNLIMITED_CRYPTO)
178
179 # Should we build the serviceability agent (SA)?
180 INCLUDE_SA=true
181 if test "x$JVM_VARIANT_ZERO" = xtrue ; then
182 INCLUDE_SA=false
183 fi
184 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
185 INCLUDE_SA=false
186 fi
187 if test "x$OPENJDK_TARGET_OS" = xaix ; then
188 INCLUDE_SA=false
189 fi
190 if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
191 INCLUDE_SA=false
192 fi
193 AC_SUBST(INCLUDE_SA)
194
195 # Compress jars
196 COMPRESS_JARS=false
197
198 AC_SUBST(COMPRESS_JARS)
199
200 # Setup default copyright year. Mostly overridden when building close to a new year.
201 AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
202 [Set copyright year value for build @<:@current year@:>@])])
203 if test "x$with_copyright_year" = xyes; then
204 AC_MSG_ERROR([Copyright year must have a value])
205 elif test "x$with_copyright_year" != x; then
206 COPYRIGHT_YEAR="$with_copyright_year"
207 else
208 COPYRIGHT_YEAR=`date +'%Y'`
209 fi
210 AC_SUBST(COPYRIGHT_YEAR)
211 ])
212
213 ###############################################################################
214 #
221 if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
222 ENABLE_INTREE_EC=yes
223 AC_MSG_RESULT([yes])
224 else
225 ENABLE_INTREE_EC=no
226 AC_MSG_RESULT([no])
227 fi
228
229 AC_SUBST(ENABLE_INTREE_EC)
230 ])
231
232 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
233 [
234 #
235 # NATIVE_DEBUG_SYMBOLS
236 # This must be done after the toolchain is setup, since we're looking at objcopy.
237 #
238 AC_MSG_CHECKING([what type of native debug symbols to use])
239 AC_ARG_WITH([native-debug-symbols],
240 [AS_HELP_STRING([--with-native-debug-symbols],
241 [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
242 [
243 if test "x$OPENJDK_TARGET_OS" = xaix; then
244 if test "x$withval" = xexternal || test "x$withval" = xzipped; then
245 AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
246 fi
247 fi
248 ],
249 [
250 if test "x$OPENJDK_TARGET_OS" = xaix; then
251 # AIX doesn't support 'zipped' so use 'internal' as default
252 with_native_debug_symbols="internal"
253 else
254 if test "x$STATIC_BUILD" = xtrue; then
255 with_native_debug_symbols="none"
256 else
257 with_native_debug_symbols="zipped"
258 fi
259 fi
260 ])
261 NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
262 AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
263
264 if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
265
266 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
267 if test "x$OBJCOPY" = x; then
268 # enabling of enable-debug-symbols and can't find objcopy
269 # this is an error
270 AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
271 fi
272 fi
273
274 COMPILE_WITH_DEBUG_SYMBOLS=true
275 COPY_DEBUG_SYMBOLS=true
276 ZIP_EXTERNAL_DEBUG_SYMBOLS=true
277
278 # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
279 DEBUG_BINARIES=false
|