Mon, 31 Dec 2012 14:52:11 -0500
8005583: Install build(gnumake all) failed preventing RE from doing JDK8 combo builds
Reviewed-by: paulk, billyh
1 #
2 # Copyright (c) 2011, 2012, 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
23 # questions.
24 #
26 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
27 [
28 ###############################################################################
29 #
30 # Check which variant of the JDK that we want to build.
31 # Currently we have:
32 # normal: standard edition
33 # but the custom make system may add other variants
34 #
35 # Effectively the JDK variant gives a name to a specific set of
36 # modules to compile into the JDK. In the future, these modules
37 # might even be Jigsaw modules.
38 #
39 AC_MSG_CHECKING([which variant of the JDK to build])
40 AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
41 [JDK variant to build (normal) @<:@normal@:>@])])
43 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
44 JDK_VARIANT="normal"
45 else
46 AC_MSG_ERROR([The available JDK variants are: normal])
47 fi
49 AC_SUBST(JDK_VARIANT)
51 AC_MSG_RESULT([$JDK_VARIANT])
52 ])
54 AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
55 [
57 ###############################################################################
58 #
59 # Check which variants of the JVM that we want to build.
60 # Currently we have:
61 # server: normal interpreter and a tiered C1/C2 compiler
62 # client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
63 # kernel: kernel footprint JVM that passes the TCK without major performance problems,
64 # ie normal interpreter and C1, only the serial GC, kernel jvmti etc
65 # zero: no machine code interpreter, no compiler
66 # zeroshark: zero interpreter and shark/llvm compiler backend
67 AC_MSG_CHECKING([which variants of the JVM to build])
68 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
69 [JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
71 if test "x$with_jvm_variants" = x; then
72 with_jvm_variants="server"
73 fi
75 JVM_VARIANTS=",$with_jvm_variants,"
76 TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
78 if test "x$TEST_VARIANTS" != "x,"; then
79 AC_MSG_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark])
80 fi
81 AC_MSG_RESULT([$with_jvm_variants])
83 JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
84 JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
85 JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
86 JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
87 JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
89 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
90 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
91 AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
92 fi
93 fi
94 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
95 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
96 AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
97 fi
98 fi
100 # Replace the commas with AND for use in the build directory name.
101 ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
102 COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
103 if test "x$COUNT_VARIANTS" != "x,1"; then
104 BUILDING_MULTIPLE_JVM_VARIANTS=yes
105 else
106 BUILDING_MULTIPLE_JVM_VARIANTS=no
107 fi
109 AC_SUBST(JVM_VARIANTS)
110 AC_SUBST(JVM_VARIANT_SERVER)
111 AC_SUBST(JVM_VARIANT_CLIENT)
112 AC_SUBST(JVM_VARIANT_KERNEL)
113 AC_SUBST(JVM_VARIANT_ZERO)
114 AC_SUBST(JVM_VARIANT_ZEROSHARK)
116 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
117 MACOSX_UNIVERSAL="true"
118 fi
120 AC_SUBST(MACOSX_UNIVERSAL)
122 ])
124 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
125 [
126 ###############################################################################
127 #
128 # Set the debug level
129 # release: no debug information, all optimizations, no asserts.
130 # fastdebug: debug information (-g), all optimizations, all asserts
131 # slowdebug: debug information (-g), no optimizations, all asserts
132 #
133 DEBUG_LEVEL="release"
134 AC_MSG_CHECKING([which debug level to use])
135 AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
136 [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
137 [
138 ENABLE_DEBUG="${enableval}"
139 DEBUG_LEVEL="fastdebug"
140 ], [ENABLE_DEBUG="no"])
142 AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
143 [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
144 [
145 DEBUG_LEVEL="${withval}"
146 if test "x$ENABLE_DEBUG" = xyes; then
147 AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
148 fi
149 ])
150 AC_MSG_RESULT([$DEBUG_LEVEL])
152 if test "x$DEBUG_LEVEL" != xrelease && \
153 test "x$DEBUG_LEVEL" != xfastdebug && \
154 test "x$DEBUG_LEVEL" != xslowdebug; then
155 AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
156 fi
159 ###############################################################################
160 #
161 # Setup legacy vars/targets and new vars to deal with different debug levels.
162 #
164 case $DEBUG_LEVEL in
165 release )
166 VARIANT="OPT"
167 FASTDEBUG="false"
168 DEBUG_CLASSFILES="false"
169 BUILD_VARIANT_RELEASE=""
170 HOTSPOT_DEBUG_LEVEL="product"
171 HOTSPOT_EXPORT="product"
172 ;;
173 fastdebug )
174 VARIANT="DBG"
175 FASTDEBUG="true"
176 DEBUG_CLASSFILES="true"
177 BUILD_VARIANT_RELEASE="-fastdebug"
178 HOTSPOT_DEBUG_LEVEL="fastdebug"
179 HOTSPOT_EXPORT="fastdebug"
180 ;;
181 slowdebug )
182 VARIANT="DBG"
183 FASTDEBUG="false"
184 DEBUG_CLASSFILES="true"
185 BUILD_VARIANT_RELEASE="-debug"
186 HOTSPOT_DEBUG_LEVEL="jvmg"
187 HOTSPOT_EXPORT="debug"
188 ;;
189 esac
191 #####
192 # Generate the legacy makefile targets for hotspot.
193 # The hotspot api for selecting the build artifacts, really, needs to be improved.
194 #
195 HOTSPOT_TARGET=""
197 if test "x$JVM_VARIANT_SERVER" = xtrue; then
198 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
199 fi
201 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
202 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
203 fi
205 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
206 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
207 fi
209 if test "x$JVM_VARIANT_ZERO" = xtrue; then
210 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
211 fi
213 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
214 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
215 fi
217 HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
219 # On Macosx universal binaries are produced, but they only contain
220 # 64 bit intel. This invalidates control of which jvms are built
221 # from configure, but only server is valid anyway. Fix this
222 # when hotspot makefiles are rewritten.
223 if test "x$MACOSX_UNIVERSAL" = xtrue; then
224 HOTSPOT_TARGET=universal_product
225 fi
227 #####
229 AC_SUBST(DEBUG_LEVEL)
230 AC_SUBST(VARIANT)
231 AC_SUBST(FASTDEBUG)
232 AC_SUBST(DEBUG_CLASSFILES)
233 AC_SUBST(BUILD_VARIANT_RELEASE)
234 ])
236 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
237 [
239 ###############################################################################
240 #
241 # Should we build only OpenJDK even if closed sources are present?
242 #
243 AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
244 [supress building closed source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
246 AC_MSG_CHECKING([for presence of closed sources])
247 if test -d "$SRC_ROOT/jdk/src/closed"; then
248 CLOSED_SOURCE_PRESENT=yes
249 else
250 CLOSED_SOURCE_PRESENT=no
251 fi
252 AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
254 AC_MSG_CHECKING([if closed source is supressed (openjdk-only)])
255 SUPRESS_CLOSED_SOURCE="$enable_openjdk_only"
256 AC_MSG_RESULT([$SUPRESS_CLOSED_SOURCE])
258 if test "x$CLOSED_SOURCE_PRESENT" = xno; then
259 OPENJDK=true
260 if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then
261 AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
262 fi
263 else
264 if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then
265 OPENJDK=true
266 else
267 OPENJDK=false
268 fi
269 fi
271 if test "x$OPENJDK" = "xtrue"; then
272 SET_OPENJDK="OPENJDK=true"
273 fi
275 AC_SUBST(SET_OPENJDK)
277 ###############################################################################
278 #
279 # Should we build a JDK/JVM with headful support (ie a graphical ui)?
280 # We always build headless support.
281 #
282 AC_MSG_CHECKING([headful support])
283 AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
284 [disable building headful support (graphical UI support) @<:@enabled@:>@])],
285 [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
287 SUPPORT_HEADLESS=yes
288 BUILD_HEADLESS="BUILD_HEADLESS:=true"
290 if test "x$SUPPORT_HEADFUL" = xyes; then
291 # We are building both headful and headless.
292 headful_msg="inlude support for both headful and headless"
293 fi
295 if test "x$SUPPORT_HEADFUL" = xno; then
296 # Thus we are building headless only.
297 BUILD_HEADLESS="BUILD_HEADLESS:=true"
298 headful_msg="headless only"
299 fi
301 AC_MSG_RESULT([$headful_msg])
303 AC_SUBST(SUPPORT_HEADLESS)
304 AC_SUBST(SUPPORT_HEADFUL)
305 AC_SUBST(BUILD_HEADLESS)
307 # Control wether Hotspot runs Queens test after build.
308 AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
309 [run the Queens test after Hotspot build @<:@disabled@:>@])],,
310 [enable_hotspot_test_in_build=no])
311 if test "x$enable_hotspot_test_in_build" = "xyes"; then
312 TEST_IN_BUILD=true
313 else
314 TEST_IN_BUILD=false
315 fi
316 AC_SUBST(TEST_IN_BUILD)
318 ###############################################################################
319 #
320 # Choose cacerts source file
321 #
322 AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
323 [specify alternative cacerts file])])
324 if test "x$with_cacerts_file" != x; then
325 CACERTS_FILE=$with_cacerts_file
326 else
327 if test "x$OPENJDK" = "xtrue"; then
328 CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
329 else
330 CACERTS_FILE=${SRC_ROOT}/jdk/src/closed/share/lib/security/cacerts.internal
331 fi
332 fi
333 AC_SUBST(CACERTS_FILE)
335 ###############################################################################
336 #
337 # Enable or disable unlimited crypto
338 #
339 AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
340 [Enable unlimited crypto policy @<:@disabled@:>@])],,
341 [enable_unlimited_crypto=no])
342 if test "x$enable_unlimited_crypto" = "xyes"; then
343 UNLIMITED_CRYPTO=true
344 else
345 UNLIMITED_CRYPTO=false
346 fi
347 AC_SUBST(UNLIMITED_CRYPTO)
349 ###############################################################################
350 #
351 # Compress jars
352 #
353 COMPRESS_JARS=false
355 AC_SUBST(COMPRESS_JARS)
356 ])
358 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
359 [
360 # Source the version numbers
361 . $AUTOCONF_DIR/version.numbers
362 if test "x$OPENJDK" = "xfalse"; then
363 . $AUTOCONF_DIR/closed.version.numbers
364 fi
365 # Now set the JDK version, milestone, build number etc.
366 AC_SUBST(JDK_MAJOR_VERSION)
367 AC_SUBST(JDK_MINOR_VERSION)
368 AC_SUBST(JDK_MICRO_VERSION)
369 AC_SUBST(JDK_UPDATE_VERSION)
370 AC_SUBST(JDK_BUILD_NUMBER)
371 AC_SUBST(MILESTONE)
372 AC_SUBST(LAUNCHER_NAME)
373 AC_SUBST(PRODUCT_NAME)
374 AC_SUBST(PRODUCT_SUFFIX)
375 AC_SUBST(JDK_RC_PLATFORM_NAME)
376 AC_SUBST(COMPANY_NAME)
377 AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
378 AC_SUBST(MACOSX_BUNDLE_ID_BASE)
380 COPYRIGHT_YEAR=`date +'%Y'`
381 AC_SUBST(COPYRIGHT_YEAR)
383 RUNTIME_NAME="$PRODUCT_NAME $PRODUCT_SUFFIX"
384 AC_SUBST(RUNTIME_NAME)
386 if test "x$JDK_UPDATE_VERSION" != x; then
387 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
388 else
389 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
390 fi
391 AC_SUBST(JDK_VERSION)
393 if test "x$MILESTONE" != x; then
394 RELEASE="${JDK_VERSION}-${MILESTONE}${BUILD_VARIANT_RELEASE}"
395 else
396 RELEASE="${JDK_VERSION}${BUILD_VARIANT_RELEASE}"
397 fi
398 AC_SUBST(RELEASE)
400 if test "x$JDK_BUILD_NUMBER" != x; then
401 FULL_VERSION="${RELEASE}-${JDK_BUILD_NUMBER}"
402 else
403 JDK_BUILD_NUMBER=b00
404 BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
405 # Avoid [:alnum:] since it depends on the locale.
406 CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
407 USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
408 FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}"
409 fi
410 AC_SUBST(FULL_VERSION)
411 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
412 AC_SUBST(COOKED_BUILD_NUMBER)
413 ])
415 AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
416 [
417 HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
418 AC_SUBST(HOTSPOT_MAKE_ARGS)
420 # The name of the Service Agent jar.
421 SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
422 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
423 SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
424 fi
425 AC_SUBST(SALIB_NAME)
427 ])
429 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
430 [
431 #
432 # ENABLE_DEBUG_SYMBOLS
433 # This must be done after the toolchain is setup, since we're looking at objcopy.
434 #
435 AC_ARG_ENABLE([debug-symbols],
436 [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
438 AC_MSG_CHECKING([if we should generate debug symbols])
440 if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
441 # explicit enabling of enable-debug-symbols and can't find objcopy
442 # this is an error
443 AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
444 fi
446 if test "x$enable_debug_symbols" = "xyes"; then
447 ENABLE_DEBUG_SYMBOLS=true
448 elif test "x$enable_debug_symbols" = "xno"; then
449 ENABLE_DEBUG_SYMBOLS=false
450 else
451 # default on macosx is false
452 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
453 ENABLE_DEBUG_SYMBOLS=false
454 # Default is on if objcopy is found, otherwise off
455 elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then
456 ENABLE_DEBUG_SYMBOLS=true
457 else
458 ENABLE_DEBUG_SYMBOLS=false
459 fi
460 fi
462 AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
464 #
465 # ZIP_DEBUGINFO_FILES
466 #
467 AC_ARG_ENABLE([zip-debug-info],
468 [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])])
470 AC_MSG_CHECKING([if we should zip debug-info files])
471 AC_MSG_RESULT([${enable_zip_debug_info}])
473 if test "x${enable_zip_debug_info}" = "xno"; then
474 ZIP_DEBUGINFO_FILES=false
475 else
476 ZIP_DEBUGINFO_FILES=true
477 fi
479 AC_SUBST(ENABLE_DEBUG_SYMBOLS)
480 AC_SUBST(ZIP_DEBUGINFO_FILES)
481 AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
482 AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
483 ])
485 # Support for customization of the build process. Some build files
486 # will include counterparts from this location, if they exist. This allows
487 # for a degree of customization of the build targets and the rules/recipes
488 # to create them
489 AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir],
490 [use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir])
491 AC_SUBST(CUSTOM_MAKE_DIR)