jdk-options.m4 revision 1225:35c9a2c8bc2d
174462Salfred#
274462Salfred# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3261046Smav# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4261046Smav#
5261046Smav# This code is free software; you can redistribute it and/or modify it
6261046Smav# under the terms of the GNU General Public License version 2 only, as
7261046Smav# published by the Free Software Foundation.  Oracle designates this
8261046Smav# particular file as subject to the "Classpath" exception as provided
9261046Smav# by Oracle in the LICENSE file that accompanied this code.
10261046Smav#
11261046Smav# This code is distributed in the hope that it will be useful, but WITHOUT
12261046Smav# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13261046Smav# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14261046Smav# version 2 for more details (a copy is included in the LICENSE file that
15261046Smav# accompanied this code).
16261046Smav#
1774462Salfred# You should have received a copy of the GNU General Public License version
18261046Smav# 2 along with this work; if not, write to the Free Software Foundation,
19261046Smav# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20261046Smav#
21261046Smav# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22261046Smav# or visit www.oracle.com if you need additional information or have any
23261046Smav# questions.
24261046Smav#
25261046Smav
26261046SmavAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
27261046Smav[
28261046Smav  ###############################################################################
2974462Salfred  #
3074462Salfred  # Check which variant of the JDK that we want to build.
3174462Salfred  # Currently we have:
3274462Salfred  #    normal:   standard edition
3374462Salfred  # but the custom make system may add other variants
3474462Salfred  #
3592990Sobrien  # Effectively the JDK variant gives a name to a specific set of
3692990Sobrien  # modules to compile into the JDK. In the future, these modules
3774462Salfred  # might even be Jigsaw modules.
3874462Salfred  #
3974462Salfred  AC_MSG_CHECKING([which variant of the JDK to build])
4074462Salfred  AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
4174462Salfred      [JDK variant to build (normal) @<:@normal@:>@])])
4274462Salfred
4375094Siedowse  if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
4474462Salfred    JDK_VARIANT="normal"
4574462Salfred  else
4674462Salfred    AC_MSG_ERROR([The available JDK variants are: normal])
4774462Salfred  fi
4874462Salfred
4974462Salfred  AC_SUBST(JDK_VARIANT)
5074462Salfred
5174462Salfred  AC_MSG_RESULT([$JDK_VARIANT])
5274462Salfred])
5374462Salfred
5474462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_JVM_INTERPRETER],
5576523Siedowse[
5674462Salfred###############################################################################
5774462Salfred#
5874462Salfred# Check which interpreter of the JVM we want to build.
5974462Salfred# Currently we have:
6074462Salfred#    template: Template interpreter (the default)
6174462Salfred#    cpp     : C++ interpreter
6274462SalfredAC_MSG_CHECKING([which interpreter of the JVM to build])
6374462SalfredAC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
6474462Salfred	[JVM interpreter to build (template, cpp) @<:@template@:>@])])
65156090Sdeischen
6674462Salfredif test "x$with_jvm_interpreter" = x; then
6774462Salfred     with_jvm_interpreter="template"
6874462Salfredfi
6974462Salfred
7074462SalfredJVM_INTERPRETER="$with_jvm_interpreter"
7174462Salfred
7274462Salfredif test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
7374462Salfred   AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
7474462Salfredfi
7574462Salfred
7674462SalfredAC_SUBST(JVM_INTERPRETER)
7774462Salfred
7874462SalfredAC_MSG_RESULT([$with_jvm_interpreter])
7974462Salfred])
8074462Salfred
8174462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
8274462Salfred[
8374462Salfred
8474462Salfred  ###############################################################################
8574462Salfred  #
8674462Salfred  # Check which variants of the JVM that we want to build.
8774462Salfred  # Currently we have:
8874462Salfred  #    server: normal interpreter and a tiered C1/C2 compiler
8974462Salfred  #    client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
9074462Salfred  #    minimal1: reduced form of client with optional VM services and features stripped out
9174462Salfred  #    kernel: kernel footprint JVM that passes the TCK without major performance problems,
9274462Salfred  #             ie normal interpreter and C1, only the serial GC, kernel jvmti etc
9374462Salfred  #    zero: no machine code interpreter, no compiler
9474462Salfred  #    zeroshark: zero interpreter and shark/llvm compiler backend
9574462Salfred#    core: interpreter only, no compiler (only works on some platforms)
9674462Salfred  AC_MSG_CHECKING([which variants of the JVM to build])
9774462Salfred  AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
9874462Salfred	[JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
9974462Salfred
10074462Salfred  if test "x$with_jvm_variants" = x; then
101107952Smbr    with_jvm_variants="server"
10274462Salfred  fi
10374462Salfred
10474462Salfred  JVM_VARIANTS=",$with_jvm_variants,"
10592905Sobrien  TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//'  -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
10674462Salfred
10792905Sobrien  if test "x$TEST_VARIANTS" != "x,"; then
10874462Salfred     AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core])
10974462Salfred  fi
11074462Salfred  AC_MSG_RESULT([$with_jvm_variants])
11174462Salfred
11274462Salfred  JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
11374462Salfred  JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
11474462Salfred  JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
11574462Salfred  JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
11674462Salfred  JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
11774462Salfred  JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
11874462Salfred  JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
11974462Salfred
12074462Salfred  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
12174462Salfred    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
12274462Salfred      AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
12374462Salfred    fi
12474462Salfred  fi
12574462Salfred  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
12674462Salfred    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
12774462Salfred      AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
12874462Salfred    fi
12974462Salfred  fi
13074462Salfred  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
13174462Salfred    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
13274462Salfred      AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
13374462Salfred    fi
13474462Salfred  fi
13574462Salfred
13674462Salfred  # Replace the commas with AND for use in the build directory name.
13774462Salfred  ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
13874462Salfred  COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
13974462Salfred  if test "x$COUNT_VARIANTS" != "x,1"; then
14074462Salfred    BUILDING_MULTIPLE_JVM_VARIANTS=yes
14174462Salfred  else
14275314Siedowse    BUILDING_MULTIPLE_JVM_VARIANTS=no
14374462Salfred  fi
14475314Siedowse
14574462Salfred  AC_SUBST(JVM_VARIANTS)
14674462Salfred  AC_SUBST(JVM_VARIANT_SERVER)
14775314Siedowse  AC_SUBST(JVM_VARIANT_CLIENT)
14874462Salfred  AC_SUBST(JVM_VARIANT_MINIMAL1)
14974462Salfred  AC_SUBST(JVM_VARIANT_KERNEL)
15075314Siedowse  AC_SUBST(JVM_VARIANT_ZERO)
15174462Salfred  AC_SUBST(JVM_VARIANT_ZEROSHARK)
15274462Salfred  AC_SUBST(JVM_VARIANT_CORE)
15375314Siedowse
15474462Salfred  INCLUDE_SA=true
15574462Salfred  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
15674462Salfred    INCLUDE_SA=false
15775314Siedowse  fi
15874462Salfred  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
15974462Salfred    INCLUDE_SA=false
16074462Salfred  fi
16174462Salfred  if test "x$OPENJDK_TARGET_OS" = xaix ; then
16274462Salfred    INCLUDE_SA=false
16374462Salfred  fi
16474462Salfred  AC_SUBST(INCLUDE_SA)
16574462Salfred
16674462Salfred  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
16774462Salfred    MACOSX_UNIVERSAL="true"
16874462Salfred  fi
16974462Salfred
17074462Salfred  AC_SUBST(MACOSX_UNIVERSAL)
17174462Salfred])
17274462Salfred
17374462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
17474462Salfred[
17574462Salfred  ###############################################################################
17674462Salfred  #
17774462Salfred  # Set the debug level
17874462Salfred  #    release: no debug information, all optimizations, no asserts.
17974462Salfred  #    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
18074462Salfred  #    fastdebug: debug information (-g), all optimizations, all asserts
18174462Salfred  #    slowdebug: debug information (-g), no optimizations, all asserts
18274462Salfred  #
18374462Salfred  DEBUG_LEVEL="release"
18474462Salfred  AC_MSG_CHECKING([which debug level to use])
18574462Salfred  AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
18674462Salfred      [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
18774462Salfred      [
18874462Salfred        ENABLE_DEBUG="${enableval}"
18974462Salfred        DEBUG_LEVEL="fastdebug"
19074462Salfred      ], [ENABLE_DEBUG="no"])
19174462Salfred
19274462Salfred  AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
19374462Salfred      [set the debug level (release, fastdebug, slowdebug, optimized (HotSpot build only)) @<:@release@:>@])],
19474462Salfred      [
19574462Salfred        DEBUG_LEVEL="${withval}"
19674462Salfred        if test "x$ENABLE_DEBUG" = xyes; then
19774462Salfred          AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
19874462Salfred        fi
19974462Salfred      ])
20074462Salfred  AC_MSG_RESULT([$DEBUG_LEVEL])
20174462Salfred
20274462Salfred  if test "x$DEBUG_LEVEL" != xrelease && \
20374462Salfred      test "x$DEBUG_LEVEL" != xoptimized && \
20474462Salfred      test "x$DEBUG_LEVEL" != xfastdebug && \
20574462Salfred      test "x$DEBUG_LEVEL" != xslowdebug; then
20674462Salfred    AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
20774462Salfred  fi
20874462Salfred
209121652Smbr
21074462Salfred  ###############################################################################
21174462Salfred  #
21274462Salfred  # Setup legacy vars/targets and new vars to deal with different debug levels.
21374462Salfred  #
21474462Salfred
21574462Salfred  case $DEBUG_LEVEL in
21674462Salfred    release )
21774462Salfred      VARIANT="OPT"
21874462Salfred      FASTDEBUG="false"
21974462Salfred      DEBUG_CLASSFILES="false"
22074462Salfred      BUILD_VARIANT_RELEASE=""
22174462Salfred      HOTSPOT_DEBUG_LEVEL="product"
22274462Salfred      HOTSPOT_EXPORT="product"
223204950Sjhb      ;;
224204950Sjhb    fastdebug )
225204950Sjhb      VARIANT="DBG"
226204950Sjhb      FASTDEBUG="true"
227204950Sjhb      DEBUG_CLASSFILES="true"
228204950Sjhb      BUILD_VARIANT_RELEASE="-fastdebug"
229204950Sjhb      HOTSPOT_DEBUG_LEVEL="fastdebug"
230204950Sjhb      HOTSPOT_EXPORT="fastdebug"
231204950Sjhb      ;;
232204950Sjhb    slowdebug )
233204950Sjhb      VARIANT="DBG"
234204950Sjhb      FASTDEBUG="false"
23574462Salfred      DEBUG_CLASSFILES="true"
23674462Salfred      BUILD_VARIANT_RELEASE="-debug"
23774462Salfred      HOTSPOT_DEBUG_LEVEL="debug"
23874462Salfred      HOTSPOT_EXPORT="debug"
23974462Salfred      ;;
24074462Salfred    optimized )
24174462Salfred      VARIANT="OPT"
24274462Salfred      FASTDEBUG="false"
24374462Salfred      DEBUG_CLASSFILES="false"
24474462Salfred      BUILD_VARIANT_RELEASE="-optimized"
24574462Salfred      HOTSPOT_DEBUG_LEVEL="optimized"
24674462Salfred      HOTSPOT_EXPORT="optimized"
24774462Salfred      ;;
24874462Salfred  esac
24974462Salfred
25074462Salfred  # The debug level 'optimized' is a little special because it is currently only
25174462Salfred  # applicable to the HotSpot build where it means to build a completely
25274462Salfred  # optimized version of the VM without any debugging code (like for the
25374462Salfred  # 'release' debug level which is called 'product' in the HotSpot build) but
25474462Salfred  # with the exception that it can contain additional code which is otherwise
255204950Sjhb  # protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
256204950Sjhb  # test new and/or experimental features which are not intended for customer
257204950Sjhb  # shipment. Because these new features need to be tested and benchmarked in
25874462Salfred  # real world scenarios, we want to build the containing JDK at the 'release'
25974462Salfred  # debug level.
26074462Salfred  if test "x$DEBUG_LEVEL" = xoptimized; then
26174462Salfred    DEBUG_LEVEL="release"
26274462Salfred  fi
26374462Salfred
26474462Salfred  #####
26574462Salfred  # Generate the legacy makefile targets for hotspot.
26674462Salfred  # The hotspot api for selecting the build artifacts, really, needs to be improved.
26774462Salfred  # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
26874462Salfred  # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
26974462Salfred  # But until then ...
27074462Salfred  HOTSPOT_TARGET=""
271241142Spfg
272241142Spfg  if test "x$JVM_VARIANT_SERVER" = xtrue; then
27374462Salfred    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
27474462Salfred  fi
27574462Salfred
27674462Salfred  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
27774462Salfred    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
27874462Salfred  fi
27974462Salfred
280241142Spfg  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
281241142Spfg    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
28274462Salfred  fi
28374462Salfred
28474462Salfred  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
28574462Salfred    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
28674462Salfred  fi
28774462Salfred
28874462Salfred  if test "x$JVM_VARIANT_ZERO" = xtrue; then
28974462Salfred    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
29074462Salfred  fi
29174462Salfred
29274462Salfred  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
29374462Salfred    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
29474462Salfred  fi
29574462Salfred
29674462Salfred  if test "x$JVM_VARIANT_CORE" = xtrue; then
29774462Salfred    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
29874462Salfred  fi
29974462Salfred
300121652Smbr  HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
30174462Salfred
30274462Salfred  # On Macosx universal binaries are produced, but they only contain
30374462Salfred  # 64 bit intel. This invalidates control of which jvms are built
30474462Salfred  # from configure, but only server is valid anyway. Fix this
30574462Salfred  # when hotspot makefiles are rewritten.
30674462Salfred  if test "x$MACOSX_UNIVERSAL" = xtrue; then
30774462Salfred    HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
30874462Salfred  fi
30974462Salfred
31074462Salfred  #####
31174462Salfred
31274462Salfred  AC_SUBST(DEBUG_LEVEL)
31374462Salfred  AC_SUBST(VARIANT)
31474462Salfred  AC_SUBST(FASTDEBUG)
31574462Salfred  AC_SUBST(DEBUG_CLASSFILES)
31674462Salfred  AC_SUBST(BUILD_VARIANT_RELEASE)
31774462Salfred])
31874462Salfred
31974462Salfred
32074462Salfred###############################################################################
32174462Salfred#
32274462Salfred# Should we build only OpenJDK even if closed sources are present?
32374462Salfred#
32474462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
325172259Smatteo[
326172259Smatteo  AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
32774462Salfred      [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
32874462Salfred
32974462Salfred  AC_MSG_CHECKING([for presence of closed sources])
33074462Salfred  if test -d "$SRC_ROOT/jdk/src/closed"; then
33174462Salfred    CLOSED_SOURCE_PRESENT=yes
33274462Salfred  else
33374462Salfred    CLOSED_SOURCE_PRESENT=no
33474462Salfred  fi
33574462Salfred  AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
336172259Smatteo
33774462Salfred  AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)])
33874462Salfred  SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only"
33974462Salfred  AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE])
34074462Salfred
341172259Smatteo  if test "x$CLOSED_SOURCE_PRESENT" = xno; then
34274462Salfred    OPENJDK=true
34374462Salfred    if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
34474462Salfred      AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
345172259Smatteo    fi
346172259Smatteo  else
347172259Smatteo    if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
348172259Smatteo      OPENJDK=true
34974462Salfred    else
35074462Salfred      OPENJDK=false
35174462Salfred    fi
35274462Salfred  fi
35374462Salfred
35474462Salfred  if test "x$OPENJDK" = "xtrue"; then
35574462Salfred    SET_OPENJDK="OPENJDK=true"
35674462Salfred  fi
35774462Salfred
35874462Salfred  AC_SUBST(SET_OPENJDK)
35974462Salfred
36074462Salfred  # custom-make-dir is deprecated. Please use your custom-hook.m4 to override
36174462Salfred  # the IncludeCustomExtension macro.
36274462Salfred  BASIC_DEPRECATED_ARG_WITH(custom-make-dir)
36374462Salfred])
36474462Salfred
36574462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
36674462Salfred[
36774462Salfred
36874462Salfred  ###############################################################################
36974462Salfred  #
37074462Salfred  # Should we build a JDK/JVM with headful support (ie a graphical ui)?
37174462Salfred  # We always build headless support.
37274462Salfred  #
37374462Salfred  AC_MSG_CHECKING([headful support])
37474462Salfred  AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
37574462Salfred      [disable building headful support (graphical UI support) @<:@enabled@:>@])],
37674462Salfred      [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
37774462Salfred
37874462Salfred  SUPPORT_HEADLESS=yes
37974462Salfred  BUILD_HEADLESS="BUILD_HEADLESS:=true"
38074462Salfred
38174462Salfred  if test "x$SUPPORT_HEADFUL" = xyes; then
38274462Salfred    # We are building both headful and headless.
38374462Salfred    headful_msg="include support for both headful and headless"
38474462Salfred  fi
38574462Salfred
38674462Salfred  if test "x$SUPPORT_HEADFUL" = xno; then
38774462Salfred    # Thus we are building headless only.
38874462Salfred    BUILD_HEADLESS="BUILD_HEADLESS:=true"
38974462Salfred    headful_msg="headless only"
39074462Salfred  fi
39174462Salfred
39274462Salfred  AC_MSG_RESULT([$headful_msg])
39374462Salfred
39474462Salfred  AC_SUBST(SUPPORT_HEADLESS)
39574462Salfred  AC_SUBST(SUPPORT_HEADFUL)
39674462Salfred  AC_SUBST(BUILD_HEADLESS)
39774462Salfred
39874462Salfred  # Control wether Hotspot runs Queens test after build.
39974462Salfred  AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
40074462Salfred      [run the Queens test after Hotspot build @<:@disabled@:>@])],,
40174462Salfred      [enable_hotspot_test_in_build=no])
40274462Salfred  if test "x$enable_hotspot_test_in_build" = "xyes"; then
40374462Salfred    TEST_IN_BUILD=true
40474462Salfred  else
40574462Salfred    TEST_IN_BUILD=false
40674462Salfred  fi
40774462Salfred  AC_SUBST(TEST_IN_BUILD)
40874462Salfred
40974462Salfred  ###############################################################################
41074462Salfred  #
41174462Salfred  # Choose cacerts source file
41274462Salfred  #
41374462Salfred  AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
41474462Salfred      [specify alternative cacerts file])])
41574462Salfred  if test "x$with_cacerts_file" != x; then
41674462Salfred    CACERTS_FILE=$with_cacerts_file
41774462Salfred  fi
41874462Salfred  AC_SUBST(CACERTS_FILE)
41974462Salfred
42074462Salfred  ###############################################################################
42174462Salfred  #
42274462Salfred  # Enable or disable unlimited crypto
42374462Salfred  #
42474462Salfred  AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
42574462Salfred      [Enable unlimited crypto policy @<:@disabled@:>@])],,
42674462Salfred      [enable_unlimited_crypto=no])
42774462Salfred  if test "x$enable_unlimited_crypto" = "xyes"; then
42874462Salfred    UNLIMITED_CRYPTO=true
42974462Salfred  else
43074462Salfred    UNLIMITED_CRYPTO=false
43174462Salfred  fi
43274462Salfred  AC_SUBST(UNLIMITED_CRYPTO)
43374462Salfred
43474462Salfred  ###############################################################################
43574462Salfred  #
43674462Salfred  # Enable or disable the elliptic curve crypto implementation
43774462Salfred  #
43874462Salfred  AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
43974462Salfred  [
44074462Salfred    AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
44174462Salfred
44274462Salfred    if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
44374462Salfred      ENABLE_INTREE_EC=yes
44474462Salfred      AC_MSG_RESULT([yes])
44574462Salfred    else
44674462Salfred      ENABLE_INTREE_EC=no
44774462Salfred      AC_MSG_RESULT([no])
44874462Salfred    fi
44974462Salfred
45074462Salfred    AC_SUBST(ENABLE_INTREE_EC)
45174462Salfred  ])
45274462Salfred
45374462Salfred  ###############################################################################
45474462Salfred  #
45574462Salfred  # --enable-rmiconnector-iiop
45674462Salfred  #
45774462Salfred  AC_ARG_ENABLE(rmiconnector-iiop, [AS_HELP_STRING([--enable-rmiconnector-iiop],
45874462Salfred      [enable the JMX RMIConnector iiop transport  @<:@disabled@:>@])])
45974462Salfred  if test "x$enable_rmiconnector_iiop" = "xyes"; then
46074462Salfred    RMICONNECTOR_IIOP=true
46174462Salfred  else
46274462Salfred    RMICONNECTOR_IIOP=false
46374462Salfred  fi
46474462Salfred  AC_SUBST(RMICONNECTOR_IIOP)
46574462Salfred
46674462Salfred  ###############################################################################
46774462Salfred  #
46874462Salfred  # Compress jars
46974462Salfred  #
47074462Salfred  COMPRESS_JARS=false
47174462Salfred
47274462Salfred  AC_SUBST(COMPRESS_JARS)
47374462Salfred])
47474462Salfred
47574462Salfred###############################################################################
47674462Salfred#
47774462Salfred# Setup version numbers
47874462Salfred#
47974462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
48074462Salfred[
48174462Salfred  # Source the version numbers
48274462Salfred  . $AUTOCONF_DIR/version-numbers
48374462Salfred
48474462Salfred  # Get the settings from parameters
48574462Salfred  AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone],
48674462Salfred      [Set milestone value for build @<:@internal@:>@])])
48774462Salfred  if test "x$with_milestone" = xyes; then
48874462Salfred    AC_MSG_ERROR([Milestone must have a value])
48974462Salfred  elif test "x$with_milestone" != x; then
49074462Salfred    MILESTONE="$with_milestone"
49174462Salfred  fi
49274462Salfred  if test "x$MILESTONE" = x; then
49374462Salfred    MILESTONE=internal
49474462Salfred  fi
49574462Salfred
49674462Salfred  AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
49774462Salfred      [Set update version value for build @<:@b00@:>@])])
49874462Salfred  if test "x$with_update_version" = xyes; then
49974462Salfred    AC_MSG_ERROR([Update version must have a value])
50074462Salfred  elif test "x$with_update_version" != x; then
50174462Salfred    JDK_UPDATE_VERSION="$with_update_version"
50274462Salfred    # On macosx 10.7, it's not possible to set --with-update-version=0X due
50374462Salfred    # to a bug in expr (which reduces it to just X). To work around this, we
50474462Salfred    # always add a 0 to one digit update versions.
50574462Salfred    if test "${#JDK_UPDATE_VERSION}" = "1"; then
50674462Salfred      JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
50774462Salfred    fi
50874462Salfred  fi
50974462Salfred
51074462Salfred  AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],
51174462Salfred      [Add a custom string to the version string if build number is not set.@<:@username_builddateb00@:>@])])
51274462Salfred  if test "x$with_user_release_suffix" = xyes; then
51374462Salfred    AC_MSG_ERROR([Release suffix must have a value])
51474462Salfred  elif test "x$with_user_release_suffix" != x; then
51574462Salfred    USER_RELEASE_SUFFIX="$with_user_release_suffix"
51674462Salfred  fi
51774462Salfred
51874462Salfred  AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number],
51974462Salfred      [Set build number value for build @<:@b00@:>@])])
52074462Salfred  if test "x$with_build_number" = xyes; then
52174462Salfred    AC_MSG_ERROR([Build number must have a value])
52274462Salfred  elif test "x$with_build_number" != x; then
52374462Salfred    JDK_BUILD_NUMBER="$with_build_number"
52474462Salfred  fi
52574462Salfred  # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set
52674462Salfred  if test "x$JDK_BUILD_NUMBER" = x; then
52774462Salfred    JDK_BUILD_NUMBER=b00
52874462Salfred    if test "x$USER_RELEASE_SUFFIX" = x; then
52974462Salfred      BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
53074462Salfred      # Avoid [:alnum:] since it depends on the locale.
531107952Smbr      CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
532107952Smbr      USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
533107952Smbr    fi
53474462Salfred  fi
53574462Salfred
53674462Salfred  # Now set the JDK version, milestone, build number etc.
53774462Salfred  AC_SUBST(USER_RELEASE_SUFFIX)
53874462Salfred  AC_SUBST(JDK_MAJOR_VERSION)
53974462Salfred  AC_SUBST(JDK_MINOR_VERSION)
54074462Salfred  AC_SUBST(JDK_MICRO_VERSION)
54174462Salfred  AC_SUBST(JDK_UPDATE_VERSION)
54274462Salfred  AC_SUBST(JDK_BUILD_NUMBER)
54374462Salfred  AC_SUBST(MILESTONE)
54474462Salfred  AC_SUBST(LAUNCHER_NAME)
54574462Salfred  AC_SUBST(PRODUCT_NAME)
54674462Salfred  AC_SUBST(PRODUCT_SUFFIX)
54774462Salfred  AC_SUBST(JDK_RC_PLATFORM_NAME)
54874462Salfred  AC_SUBST(COMPANY_NAME)
54974462Salfred  AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
55074462Salfred  AC_SUBST(MACOSX_BUNDLE_ID_BASE)
55174462Salfred
55274462Salfred  AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
55374462Salfred      [Set copyright year value for build @<:@current year@:>@])])
55474462Salfred  if test "x$with_copyright_year" = xyes; then
55574462Salfred    AC_MSG_ERROR([Copyright year must have a value])
55674462Salfred  elif test "x$with_copyright_year" != x; then
55774462Salfred    COPYRIGHT_YEAR="$with_copyright_year"
55874462Salfred  else
55974462Salfred    COPYRIGHT_YEAR=`date +'%Y'`
56074462Salfred  fi
56174462Salfred  AC_SUBST(COPYRIGHT_YEAR)
562109384Smbr
56374462Salfred  if test "x$JDK_UPDATE_VERSION" != x; then
564109384Smbr    JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
565109384Smbr  else
566107952Smbr    JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
56774462Salfred  fi
56874462Salfred  AC_SUBST(JDK_VERSION)
569109384Smbr
570107952Smbr  COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
571107952Smbr  AC_SUBST(COOKED_BUILD_NUMBER)
572107952Smbr])
573107952Smbr
574107952SmbrAC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
575107952Smbr[
576109384Smbr  HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
577109384Smbr  AC_SUBST(HOTSPOT_MAKE_ARGS)
57874462Salfred
57974462Salfred  # The name of the Service Agent jar.
580107952Smbr  SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
581109384Smbr  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
582109384Smbr    SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
58374462Salfred  fi
58474462Salfred  AC_SUBST(SALIB_NAME)
58574462Salfred])
58674462Salfred
58774462SalfredAC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
58874462Salfred[
58974462Salfred  #
59074462Salfred  # ENABLE_DEBUG_SYMBOLS
59174462Salfred  # This must be done after the toolchain is setup, since we're looking at objcopy.
59274462Salfred  #
59374462Salfred  AC_ARG_ENABLE([debug-symbols],
59474462Salfred      [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
59574462Salfred
59674462Salfred  AC_MSG_CHECKING([if we should generate debug symbols])
59774462Salfred
59874462Salfred  if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
59974462Salfred    # explicit enabling of enable-debug-symbols and can't find objcopy
60074462Salfred    #   this is an error
60174462Salfred    AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
60274462Salfred  fi
60374462Salfred
60474462Salfred  if test "x$enable_debug_symbols" = "xyes"; then
60574462Salfred    ENABLE_DEBUG_SYMBOLS=true
60674462Salfred  elif test "x$enable_debug_symbols" = "xno"; then
60774462Salfred    ENABLE_DEBUG_SYMBOLS=false
60874462Salfred  else
60974462Salfred    # Default is on if objcopy is found
61074462Salfred    if test "x$OBJCOPY" != x; then
61174462Salfred      ENABLE_DEBUG_SYMBOLS=true
61274462Salfred    # MacOS X and Windows don't use objcopy but default is on for those OSes
61374462Salfred    elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
61474462Salfred      ENABLE_DEBUG_SYMBOLS=true
61574462Salfred    else
61674462Salfred      ENABLE_DEBUG_SYMBOLS=false
61774462Salfred    fi
61874462Salfred  fi
61974462Salfred
62074462Salfred  AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
62174462Salfred
62274462Salfred  #
62374462Salfred  # ZIP_DEBUGINFO_FILES
62474462Salfred  #
62574462Salfred  AC_MSG_CHECKING([if we should zip debug-info files])
62674462Salfred  AC_ARG_ENABLE([zip-debug-info],
62774462Salfred      [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
62874462Salfred      [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
62974462Salfred  AC_MSG_RESULT([${enable_zip_debug_info}])
63074462Salfred
63174462Salfred  if test "x${enable_zip_debug_info}" = "xno"; then
63274462Salfred    ZIP_DEBUGINFO_FILES=false
63374462Salfred  else
63474462Salfred    ZIP_DEBUGINFO_FILES=true
63574462Salfred  fi
63674462Salfred
63774462Salfred  AC_SUBST(ENABLE_DEBUG_SYMBOLS)
63874462Salfred  AC_SUBST(ZIP_DEBUGINFO_FILES)
63974462Salfred])
64074462Salfred