common/autoconf/jdk-options.m4

changeset 0
75a576e87639
child 1133
50aaf272884f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/common/autoconf/jdk-options.m4	Wed Apr 27 01:39:08 2016 +0800
     1.3 @@ -0,0 +1,602 @@
     1.4 +#
     1.5 +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.  Oracle designates this
    1.11 +# particular file as subject to the "Classpath" exception as provided
    1.12 +# by Oracle in the LICENSE file that accompanied this code.
    1.13 +#
    1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 +# version 2 for more details (a copy is included in the LICENSE file that
    1.18 +# accompanied this code).
    1.19 +#
    1.20 +# You should have received a copy of the GNU General Public License version
    1.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 +#
    1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 +# or visit www.oracle.com if you need additional information or have any
    1.26 +# questions.
    1.27 +#
    1.28 +
    1.29 +AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
    1.30 +[
    1.31 +  ###############################################################################
    1.32 +  #
    1.33 +  # Check which variant of the JDK that we want to build.
    1.34 +  # Currently we have:
    1.35 +  #    normal:   standard edition
    1.36 +  # but the custom make system may add other variants
    1.37 +  #
    1.38 +  # Effectively the JDK variant gives a name to a specific set of
    1.39 +  # modules to compile into the JDK. In the future, these modules
    1.40 +  # might even be Jigsaw modules.
    1.41 +  #
    1.42 +  AC_MSG_CHECKING([which variant of the JDK to build])
    1.43 +  AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
    1.44 +      [JDK variant to build (normal) @<:@normal@:>@])])
    1.45 +
    1.46 +  if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
    1.47 +    JDK_VARIANT="normal"
    1.48 +  else
    1.49 +    AC_MSG_ERROR([The available JDK variants are: normal])
    1.50 +  fi
    1.51 +
    1.52 +  AC_SUBST(JDK_VARIANT)
    1.53 +
    1.54 +  AC_MSG_RESULT([$JDK_VARIANT])
    1.55 +])
    1.56 +
    1.57 +AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_INTERPRETER],
    1.58 +[
    1.59 +###############################################################################
    1.60 +#
    1.61 +# Check which interpreter of the JVM we want to build.
    1.62 +# Currently we have:
    1.63 +#    template: Template interpreter (the default)
    1.64 +#    cpp     : C++ interpreter
    1.65 +AC_MSG_CHECKING([which interpreter of the JVM to build])
    1.66 +AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
    1.67 +	[JVM interpreter to build (template, cpp) @<:@template@:>@])])
    1.68 +
    1.69 +if test "x$with_jvm_interpreter" = x; then
    1.70 +     with_jvm_interpreter="template"
    1.71 +fi
    1.72 +
    1.73 +JVM_INTERPRETER="$with_jvm_interpreter"
    1.74 +
    1.75 +if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
    1.76 +   AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
    1.77 +fi
    1.78 +
    1.79 +AC_SUBST(JVM_INTERPRETER)
    1.80 +
    1.81 +AC_MSG_RESULT([$with_jvm_interpreter])
    1.82 +])
    1.83 +
    1.84 +AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
    1.85 +[
    1.86 +
    1.87 +  ###############################################################################
    1.88 +  #
    1.89 +  # Check which variants of the JVM that we want to build.
    1.90 +  # Currently we have:
    1.91 +  #    server: normal interpreter and a tiered C1/C2 compiler
    1.92 +  #    client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
    1.93 +  #    minimal1: reduced form of client with optional VM services and features stripped out
    1.94 +  #    kernel: kernel footprint JVM that passes the TCK without major performance problems,
    1.95 +  #             ie normal interpreter and C1, only the serial GC, kernel jvmti etc
    1.96 +  #    zero: no machine code interpreter, no compiler
    1.97 +  #    zeroshark: zero interpreter and shark/llvm compiler backend
    1.98 +#    core: interpreter only, no compiler (only works on some platforms)
    1.99 +  AC_MSG_CHECKING([which variants of the JVM to build])
   1.100 +  AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
   1.101 +	[JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
   1.102 +
   1.103 +  if test "x$with_jvm_variants" = x; then
   1.104 +    with_jvm_variants="server"
   1.105 +  fi
   1.106 +
   1.107 +  JVM_VARIANTS=",$with_jvm_variants,"
   1.108 +  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,//'`
   1.109 +
   1.110 +  if test "x$TEST_VARIANTS" != "x,"; then
   1.111 +     AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core])
   1.112 +  fi
   1.113 +  AC_MSG_RESULT([$with_jvm_variants])
   1.114 +
   1.115 +  JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
   1.116 +  JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
   1.117 +  JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
   1.118 +  JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
   1.119 +  JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
   1.120 +  JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
   1.121 +  JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
   1.122 +
   1.123 +  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
   1.124 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.125 +      AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
   1.126 +    fi
   1.127 +  fi
   1.128 +  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
   1.129 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.130 +      AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
   1.131 +    fi
   1.132 +  fi
   1.133 +  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
   1.134 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.135 +      AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
   1.136 +    fi
   1.137 +  fi
   1.138 +
   1.139 +  # Replace the commas with AND for use in the build directory name.
   1.140 +  ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
   1.141 +  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/'`
   1.142 +  if test "x$COUNT_VARIANTS" != "x,1"; then
   1.143 +    BUILDING_MULTIPLE_JVM_VARIANTS=yes
   1.144 +  else
   1.145 +    BUILDING_MULTIPLE_JVM_VARIANTS=no
   1.146 +  fi
   1.147 +
   1.148 +  AC_SUBST(JVM_VARIANTS)
   1.149 +  AC_SUBST(JVM_VARIANT_SERVER)
   1.150 +  AC_SUBST(JVM_VARIANT_CLIENT)
   1.151 +  AC_SUBST(JVM_VARIANT_MINIMAL1)
   1.152 +  AC_SUBST(JVM_VARIANT_KERNEL)
   1.153 +  AC_SUBST(JVM_VARIANT_ZERO)
   1.154 +  AC_SUBST(JVM_VARIANT_ZEROSHARK)
   1.155 +  AC_SUBST(JVM_VARIANT_CORE)
   1.156 +
   1.157 +  INCLUDE_SA=true
   1.158 +  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
   1.159 +    INCLUDE_SA=false
   1.160 +  fi
   1.161 +  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
   1.162 +    INCLUDE_SA=false
   1.163 +  fi
   1.164 +  if test "x$VAR_CPU" = xppc64 ; then
   1.165 +    INCLUDE_SA=false
   1.166 +  fi
   1.167 +  AC_SUBST(INCLUDE_SA)
   1.168 +
   1.169 +  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
   1.170 +    MACOSX_UNIVERSAL="true"
   1.171 +  fi
   1.172 +
   1.173 +  AC_SUBST(MACOSX_UNIVERSAL)
   1.174 +])
   1.175 +
   1.176 +AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
   1.177 +[
   1.178 +  ###############################################################################
   1.179 +  #
   1.180 +  # Set the debug level
   1.181 +  #    release: no debug information, all optimizations, no asserts.
   1.182 +  #    fastdebug: debug information (-g), all optimizations, all asserts
   1.183 +  #    slowdebug: debug information (-g), no optimizations, all asserts
   1.184 +  #
   1.185 +  DEBUG_LEVEL="release"
   1.186 +  AC_MSG_CHECKING([which debug level to use])
   1.187 +  AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
   1.188 +      [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
   1.189 +      [
   1.190 +        ENABLE_DEBUG="${enableval}"
   1.191 +        DEBUG_LEVEL="fastdebug"
   1.192 +      ], [ENABLE_DEBUG="no"])
   1.193 +
   1.194 +  AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
   1.195 +      [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
   1.196 +      [
   1.197 +        DEBUG_LEVEL="${withval}"
   1.198 +        if test "x$ENABLE_DEBUG" = xyes; then
   1.199 +          AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
   1.200 +        fi
   1.201 +      ])
   1.202 +  AC_MSG_RESULT([$DEBUG_LEVEL])
   1.203 +
   1.204 +  if test "x$DEBUG_LEVEL" != xrelease && \
   1.205 +      test "x$DEBUG_LEVEL" != xfastdebug && \
   1.206 +      test "x$DEBUG_LEVEL" != xslowdebug; then
   1.207 +    AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
   1.208 +  fi
   1.209 +
   1.210 +
   1.211 +  ###############################################################################
   1.212 +  #
   1.213 +  # Setup legacy vars/targets and new vars to deal with different debug levels.
   1.214 +  #
   1.215 +
   1.216 +  case $DEBUG_LEVEL in
   1.217 +    release )
   1.218 +      VARIANT="OPT"
   1.219 +      FASTDEBUG="false"
   1.220 +      DEBUG_CLASSFILES="false"
   1.221 +      BUILD_VARIANT_RELEASE=""
   1.222 +      HOTSPOT_DEBUG_LEVEL="product"
   1.223 +      HOTSPOT_EXPORT="product"
   1.224 +      ;;
   1.225 +    fastdebug )
   1.226 +      VARIANT="DBG"
   1.227 +      FASTDEBUG="true"
   1.228 +      DEBUG_CLASSFILES="true"
   1.229 +      BUILD_VARIANT_RELEASE="-fastdebug"
   1.230 +      HOTSPOT_DEBUG_LEVEL="fastdebug"
   1.231 +      HOTSPOT_EXPORT="fastdebug"
   1.232 +      ;;
   1.233 +    slowdebug )
   1.234 +      VARIANT="DBG"
   1.235 +      FASTDEBUG="false"
   1.236 +      DEBUG_CLASSFILES="true"
   1.237 +      BUILD_VARIANT_RELEASE="-debug"
   1.238 +      HOTSPOT_DEBUG_LEVEL="jvmg"
   1.239 +      HOTSPOT_EXPORT="debug"
   1.240 +      ;;
   1.241 +  esac
   1.242 +
   1.243 +  #####
   1.244 +  # Generate the legacy makefile targets for hotspot.
   1.245 +  # The hotspot api for selecting the build artifacts, really, needs to be improved.
   1.246 +  # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
   1.247 +  # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
   1.248 +  # But until then ...
   1.249 +  HOTSPOT_TARGET=""
   1.250 +
   1.251 +  if test "x$JVM_VARIANT_SERVER" = xtrue; then
   1.252 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
   1.253 +  fi
   1.254 +
   1.255 +  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
   1.256 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
   1.257 +  fi
   1.258 +
   1.259 +  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
   1.260 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
   1.261 +  fi
   1.262 +
   1.263 +  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
   1.264 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
   1.265 +  fi
   1.266 +
   1.267 +  if test "x$JVM_VARIANT_ZERO" = xtrue; then
   1.268 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
   1.269 +  fi
   1.270 +
   1.271 +  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
   1.272 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
   1.273 +  fi
   1.274 +
   1.275 +  if test "x$JVM_VARIANT_CORE" = xtrue; then
   1.276 +    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
   1.277 +  fi
   1.278 +
   1.279 +  HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
   1.280 +
   1.281 +  # On Macosx universal binaries are produced, but they only contain
   1.282 +  # 64 bit intel. This invalidates control of which jvms are built
   1.283 +  # from configure, but only server is valid anyway. Fix this
   1.284 +  # when hotspot makefiles are rewritten.
   1.285 +  if test "x$MACOSX_UNIVERSAL" = xtrue; then
   1.286 +    HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
   1.287 +  fi
   1.288 +
   1.289 +  #####
   1.290 +
   1.291 +  AC_SUBST(DEBUG_LEVEL)
   1.292 +  AC_SUBST(VARIANT)
   1.293 +  AC_SUBST(FASTDEBUG)
   1.294 +  AC_SUBST(DEBUG_CLASSFILES)
   1.295 +  AC_SUBST(BUILD_VARIANT_RELEASE)
   1.296 +])
   1.297 +
   1.298 +
   1.299 +###############################################################################
   1.300 +#
   1.301 +# Should we build only OpenJDK even if closed sources are present?
   1.302 +#
   1.303 +AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
   1.304 +[
   1.305 +  AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
   1.306 +      [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
   1.307 +
   1.308 +  AC_MSG_CHECKING([for presence of closed sources])
   1.309 +  if test -d "$SRC_ROOT/jdk/src/closed"; then
   1.310 +    CLOSED_SOURCE_PRESENT=yes
   1.311 +  else
   1.312 +    CLOSED_SOURCE_PRESENT=no
   1.313 +  fi
   1.314 +  AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
   1.315 +
   1.316 +  AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)])
   1.317 +  SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only"
   1.318 +  AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE])
   1.319 +
   1.320 +  if test "x$CLOSED_SOURCE_PRESENT" = xno; then
   1.321 +    OPENJDK=true
   1.322 +    if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
   1.323 +      AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
   1.324 +    fi
   1.325 +  else
   1.326 +    if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
   1.327 +      OPENJDK=true
   1.328 +    else
   1.329 +      OPENJDK=false
   1.330 +    fi
   1.331 +  fi
   1.332 +
   1.333 +  if test "x$OPENJDK" = "xtrue"; then
   1.334 +    SET_OPENJDK="OPENJDK=true"
   1.335 +  fi
   1.336 +
   1.337 +  AC_SUBST(SET_OPENJDK)
   1.338 +])
   1.339 +
   1.340 +AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
   1.341 +[
   1.342 +
   1.343 +  ###############################################################################
   1.344 +  #
   1.345 +  # Should we build a JDK/JVM with headful support (ie a graphical ui)?
   1.346 +  # We always build headless support.
   1.347 +  #
   1.348 +  AC_MSG_CHECKING([headful support])
   1.349 +  AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
   1.350 +      [disable building headful support (graphical UI support) @<:@enabled@:>@])],
   1.351 +      [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
   1.352 +
   1.353 +  SUPPORT_HEADLESS=yes
   1.354 +  BUILD_HEADLESS="BUILD_HEADLESS:=true"
   1.355 +
   1.356 +  if test "x$SUPPORT_HEADFUL" = xyes; then
   1.357 +    # We are building both headful and headless.
   1.358 +    headful_msg="include support for both headful and headless"
   1.359 +  fi
   1.360 +
   1.361 +  if test "x$SUPPORT_HEADFUL" = xno; then
   1.362 +    # Thus we are building headless only.
   1.363 +    BUILD_HEADLESS="BUILD_HEADLESS:=true"
   1.364 +    headful_msg="headless only"
   1.365 +  fi
   1.366 +
   1.367 +  AC_MSG_RESULT([$headful_msg])
   1.368 +
   1.369 +  AC_SUBST(SUPPORT_HEADLESS)
   1.370 +  AC_SUBST(SUPPORT_HEADFUL)
   1.371 +  AC_SUBST(BUILD_HEADLESS)
   1.372 +
   1.373 +  # Control wether Hotspot runs Queens test after build.
   1.374 +  AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
   1.375 +      [run the Queens test after Hotspot build @<:@disabled@:>@])],,
   1.376 +      [enable_hotspot_test_in_build=no])
   1.377 +  if test "x$enable_hotspot_test_in_build" = "xyes"; then
   1.378 +    TEST_IN_BUILD=true
   1.379 +  else
   1.380 +    TEST_IN_BUILD=false
   1.381 +  fi
   1.382 +  AC_SUBST(TEST_IN_BUILD)
   1.383 +
   1.384 +  ###############################################################################
   1.385 +  #
   1.386 +  # Choose cacerts source file
   1.387 +  #
   1.388 +  AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
   1.389 +      [specify alternative cacerts file])])
   1.390 +  if test "x$with_cacerts_file" != x; then
   1.391 +    CACERTS_FILE=$with_cacerts_file
   1.392 +  else
   1.393 +    CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
   1.394 +  fi
   1.395 +  AC_SUBST(CACERTS_FILE)
   1.396 +
   1.397 +  ###############################################################################
   1.398 +  #
   1.399 +  # Enable or disable unlimited crypto
   1.400 +  #
   1.401 +  AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
   1.402 +      [Enable unlimited crypto policy @<:@disabled@:>@])],,
   1.403 +      [enable_unlimited_crypto=no])
   1.404 +  if test "x$enable_unlimited_crypto" = "xyes"; then
   1.405 +    UNLIMITED_CRYPTO=true
   1.406 +  else
   1.407 +    UNLIMITED_CRYPTO=false
   1.408 +  fi
   1.409 +  AC_SUBST(UNLIMITED_CRYPTO)
   1.410 +
   1.411 +  ###############################################################################
   1.412 +  #
   1.413 +  # Enable or disable the elliptic curve crypto implementation
   1.414 +  #
   1.415 +  AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
   1.416 +  [
   1.417 +    AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
   1.418 +
   1.419 +    if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
   1.420 +      ENABLE_INTREE_EC=yes
   1.421 +      AC_MSG_RESULT([yes])
   1.422 +    else
   1.423 +      ENABLE_INTREE_EC=no
   1.424 +      AC_MSG_RESULT([no])
   1.425 +    fi
   1.426 +
   1.427 +    AC_SUBST(ENABLE_INTREE_EC)
   1.428 +  ])
   1.429 +
   1.430 +  ###############################################################################
   1.431 +  #
   1.432 +  # Compress jars
   1.433 +  #
   1.434 +  COMPRESS_JARS=false
   1.435 +
   1.436 +  AC_SUBST(COMPRESS_JARS)
   1.437 +])
   1.438 +
   1.439 +###############################################################################
   1.440 +#
   1.441 +# Setup version numbers
   1.442 +#
   1.443 +AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
   1.444 +[
   1.445 +  # Source the version numbers
   1.446 +  . $AUTOCONF_DIR/version-numbers
   1.447 +
   1.448 +  # Get the settings from parameters
   1.449 +  AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone],
   1.450 +      [Set milestone value for build @<:@internal@:>@])])
   1.451 +  if test "x$with_milestone" = xyes; then
   1.452 +    AC_MSG_ERROR([Milestone must have a value])
   1.453 +  elif test "x$with_milestone" != x; then
   1.454 +    MILESTONE="$with_milestone"
   1.455 +  fi
   1.456 +  if test "x$MILESTONE" = x; then
   1.457 +    MILESTONE=internal
   1.458 +  fi
   1.459 +
   1.460 +  AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
   1.461 +      [Set update version value for build @<:@b00@:>@])])
   1.462 +  if test "x$with_update_version" = xyes; then
   1.463 +    AC_MSG_ERROR([Update version must have a value])
   1.464 +  elif test "x$with_update_version" != x; then
   1.465 +    JDK_UPDATE_VERSION="$with_update_version"
   1.466 +    # On macosx 10.7, it's not possible to set --with-update-version=0X due
   1.467 +    # to a bug in expr (which reduces it to just X). To work around this, we
   1.468 +    # always add a 0 to one digit update versions.
   1.469 +    if test "${#JDK_UPDATE_VERSION}" = "1"; then
   1.470 +      JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
   1.471 +    fi
   1.472 +  fi
   1.473 +
   1.474 +  AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],
   1.475 +      [Add a custom string to the version string if build number isn't set.@<:@username_builddateb00@:>@])])
   1.476 +  if test "x$with_user_release_suffix" = xyes; then
   1.477 +    AC_MSG_ERROR([Release suffix must have a value])
   1.478 +  elif test "x$with_user_release_suffix" != x; then
   1.479 +    USER_RELEASE_SUFFIX="$with_user_release_suffix"
   1.480 +  fi
   1.481 +
   1.482 +  AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number],
   1.483 +      [Set build number value for build @<:@b00@:>@])])
   1.484 +  if test "x$with_build_number" = xyes; then
   1.485 +    AC_MSG_ERROR([Build number must have a value])
   1.486 +  elif test "x$with_build_number" != x; then
   1.487 +    JDK_BUILD_NUMBER="$with_build_number"
   1.488 +  fi
   1.489 +  # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set
   1.490 +  if test "x$JDK_BUILD_NUMBER" = x; then
   1.491 +    JDK_BUILD_NUMBER=b00
   1.492 +    if test "x$USER_RELEASE_SUFFIX" = x; then
   1.493 +      BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
   1.494 +      # Avoid [:alnum:] since it depends on the locale.
   1.495 +      CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
   1.496 +      USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.497 +    fi
   1.498 +  fi
   1.499 +
   1.500 +  # Now set the JDK version, milestone, build number etc.
   1.501 +  AC_SUBST(USER_RELEASE_SUFFIX)
   1.502 +  AC_SUBST(JDK_MAJOR_VERSION)
   1.503 +  AC_SUBST(JDK_MINOR_VERSION)
   1.504 +  AC_SUBST(JDK_MICRO_VERSION)
   1.505 +  AC_SUBST(JDK_UPDATE_VERSION)
   1.506 +  AC_SUBST(JDK_BUILD_NUMBER)
   1.507 +  AC_SUBST(MILESTONE)
   1.508 +  AC_SUBST(LAUNCHER_NAME)
   1.509 +  AC_SUBST(PRODUCT_NAME)
   1.510 +  AC_SUBST(PRODUCT_SUFFIX)
   1.511 +  AC_SUBST(JDK_RC_PLATFORM_NAME)
   1.512 +  AC_SUBST(COMPANY_NAME)
   1.513 +  AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
   1.514 +  AC_SUBST(MACOSX_BUNDLE_ID_BASE)
   1.515 +
   1.516 +  COPYRIGHT_YEAR=`date +'%Y'`
   1.517 +  AC_SUBST(COPYRIGHT_YEAR)
   1.518 +
   1.519 +  if test "x$JDK_UPDATE_VERSION" != x; then
   1.520 +    JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
   1.521 +  else
   1.522 +    JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
   1.523 +  fi
   1.524 +  AC_SUBST(JDK_VERSION)
   1.525 +
   1.526 +  COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
   1.527 +  AC_SUBST(COOKED_BUILD_NUMBER)
   1.528 +])
   1.529 +
   1.530 +AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
   1.531 +[
   1.532 +  HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
   1.533 +  AC_SUBST(HOTSPOT_MAKE_ARGS)
   1.534 +
   1.535 +  # The name of the Service Agent jar.
   1.536 +  SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
   1.537 +  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.538 +    SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
   1.539 +  fi
   1.540 +  AC_SUBST(SALIB_NAME)
   1.541 +])
   1.542 +
   1.543 +AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
   1.544 +[
   1.545 +  #
   1.546 +  # ENABLE_DEBUG_SYMBOLS
   1.547 +  # This must be done after the toolchain is setup, since we're looking at objcopy.
   1.548 +  #
   1.549 +  AC_ARG_ENABLE([debug-symbols],
   1.550 +      [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
   1.551 +
   1.552 +  AC_MSG_CHECKING([if we should generate debug symbols])
   1.553 +
   1.554 +  if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
   1.555 +    # explicit enabling of enable-debug-symbols and can't find objcopy
   1.556 +    #   this is an error
   1.557 +    AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
   1.558 +  fi
   1.559 +
   1.560 +  if test "x$enable_debug_symbols" = "xyes"; then
   1.561 +    ENABLE_DEBUG_SYMBOLS=true
   1.562 +  elif test "x$enable_debug_symbols" = "xno"; then
   1.563 +    ENABLE_DEBUG_SYMBOLS=false
   1.564 +  else
   1.565 +    # Default is on if objcopy is found
   1.566 +    if test "x$OBJCOPY" != x; then
   1.567 +      ENABLE_DEBUG_SYMBOLS=true
   1.568 +    # MacOS X and Windows don't use objcopy but default is on for those OSes
   1.569 +    elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
   1.570 +      ENABLE_DEBUG_SYMBOLS=true
   1.571 +    else
   1.572 +      ENABLE_DEBUG_SYMBOLS=false
   1.573 +    fi
   1.574 +  fi
   1.575 +
   1.576 +  AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
   1.577 +
   1.578 +  #
   1.579 +  # ZIP_DEBUGINFO_FILES
   1.580 +  #
   1.581 +  AC_MSG_CHECKING([if we should zip debug-info files])
   1.582 +  AC_ARG_ENABLE([zip-debug-info],
   1.583 +      [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
   1.584 +      [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
   1.585 +  AC_MSG_RESULT([${enable_zip_debug_info}])
   1.586 +
   1.587 +  if test "x${enable_zip_debug_info}" = "xno"; then
   1.588 +    ZIP_DEBUGINFO_FILES=false
   1.589 +  else
   1.590 +    ZIP_DEBUGINFO_FILES=true
   1.591 +  fi
   1.592 +
   1.593 +  AC_SUBST(ENABLE_DEBUG_SYMBOLS)
   1.594 +  AC_SUBST(ZIP_DEBUGINFO_FILES)
   1.595 +  AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
   1.596 +  AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
   1.597 +])
   1.598 +
   1.599 +# Support for customization of the build process. Some build files
   1.600 +# will include counterparts from this location, if they exist. This allows
   1.601 +# for a degree of customization of the build targets and the rules/recipes
   1.602 +# to create them
   1.603 +AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir],
   1.604 +[use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir])
   1.605 +AC_SUBST(CUSTOM_MAKE_DIR)

mercurial