common/autoconf/jdk-options.m4

Thu, 04 Apr 2019 17:59:06 +0800

author
aoqi
date
Thu, 04 Apr 2019 17:59:06 +0800
changeset 2384
b45bf475c2ca
parent 2325
a5b23c21a665
parent 2316
64a3eeabf6e5
child 2408
2e38e8d106de
permissions
-rw-r--r--

Merge

aoqi@0 1 #
kevinw@2206 2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation. Oracle designates this
aoqi@0 8 # particular file as subject to the "Classpath" exception as provided
aoqi@0 9 # by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 #
aoqi@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 # accompanied this code).
aoqi@0 16 #
aoqi@0 17 # You should have received a copy of the GNU General Public License version
aoqi@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 #
aoqi@0 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 # or visit www.oracle.com if you need additional information or have any
aoqi@0 23 # questions.
aoqi@0 24 #
aoqi@0 25
aoqi@0 26 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
aoqi@0 27 [
aoqi@0 28 ###############################################################################
aoqi@0 29 #
aoqi@0 30 # Check which variant of the JDK that we want to build.
aoqi@0 31 # Currently we have:
aoqi@0 32 # normal: standard edition
aoqi@0 33 # but the custom make system may add other variants
aoqi@0 34 #
aoqi@0 35 # Effectively the JDK variant gives a name to a specific set of
aoqi@0 36 # modules to compile into the JDK. In the future, these modules
aoqi@0 37 # might even be Jigsaw modules.
aoqi@0 38 #
aoqi@0 39 AC_MSG_CHECKING([which variant of the JDK to build])
aoqi@0 40 AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
aoqi@0 41 [JDK variant to build (normal) @<:@normal@:>@])])
aoqi@0 42
aoqi@0 43 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
aoqi@0 44 JDK_VARIANT="normal"
aoqi@0 45 else
aoqi@0 46 AC_MSG_ERROR([The available JDK variants are: normal])
aoqi@0 47 fi
aoqi@0 48
aoqi@0 49 AC_SUBST(JDK_VARIANT)
aoqi@0 50
aoqi@0 51 AC_MSG_RESULT([$JDK_VARIANT])
aoqi@0 52 ])
aoqi@0 53
aoqi@0 54 AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_INTERPRETER],
aoqi@0 55 [
aoqi@0 56 ###############################################################################
aoqi@0 57 #
aoqi@0 58 # Check which interpreter of the JVM we want to build.
aoqi@0 59 # Currently we have:
aoqi@0 60 # template: Template interpreter (the default)
aoqi@0 61 # cpp : C++ interpreter
aoqi@0 62 AC_MSG_CHECKING([which interpreter of the JVM to build])
aoqi@0 63 AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
aoqi@0 64 [JVM interpreter to build (template, cpp) @<:@template@:>@])])
aoqi@0 65
aoqi@0 66 if test "x$with_jvm_interpreter" = x; then
aoqi@0 67 with_jvm_interpreter="template"
aoqi@0 68 fi
aoqi@0 69
aoqi@0 70 JVM_INTERPRETER="$with_jvm_interpreter"
aoqi@0 71
aoqi@0 72 if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
aoqi@0 73 AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
aoqi@0 74 fi
aoqi@0 75
aoqi@0 76 AC_SUBST(JVM_INTERPRETER)
aoqi@0 77
aoqi@0 78 AC_MSG_RESULT([$with_jvm_interpreter])
aoqi@0 79 ])
aoqi@0 80
aoqi@0 81 AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
aoqi@0 82 [
aoqi@0 83
aoqi@0 84 ###############################################################################
aoqi@0 85 #
aoqi@0 86 # Check which variants of the JVM that we want to build.
aoqi@0 87 # Currently we have:
aoqi@0 88 # server: normal interpreter and a tiered C1/C2 compiler
aoqi@0 89 # client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
aoqi@0 90 # minimal1: reduced form of client with optional VM services and features stripped out
aoqi@0 91 # kernel: kernel footprint JVM that passes the TCK without major performance problems,
aoqi@0 92 # ie normal interpreter and C1, only the serial GC, kernel jvmti etc
aoqi@0 93 # zero: no machine code interpreter, no compiler
aoqi@0 94 # zeroshark: zero interpreter and shark/llvm compiler backend
aoqi@0 95 # core: interpreter only, no compiler (only works on some platforms)
aoqi@0 96 AC_MSG_CHECKING([which variants of the JVM to build])
aoqi@0 97 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
aoqi@0 98 [JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
aoqi@0 99
aoqi@0 100 if test "x$with_jvm_variants" = x; then
aoqi@0 101 with_jvm_variants="server"
aoqi@0 102 fi
aoqi@0 103
aoqi@0 104 JVM_VARIANTS=",$with_jvm_variants,"
aoqi@0 105 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,//'`
aoqi@0 106
aoqi@0 107 if test "x$TEST_VARIANTS" != "x,"; then
aoqi@0 108 AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core])
aoqi@0 109 fi
aoqi@0 110 AC_MSG_RESULT([$with_jvm_variants])
aoqi@0 111
aoqi@0 112 JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
aoqi@0 113 JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
aoqi@0 114 JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
aoqi@0 115 JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
aoqi@0 116 JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
aoqi@0 117 JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
aoqi@0 118 JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
aoqi@0 119
aoqi@0 120 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
aoqi@0 121 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
aoqi@0 122 AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
aoqi@0 123 fi
aoqi@0 124 fi
aoqi@0 125 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
aoqi@0 126 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
aoqi@0 127 AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
aoqi@0 128 fi
aoqi@0 129 fi
aoqi@0 130 if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
aoqi@0 131 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
aoqi@0 132 AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
aoqi@0 133 fi
aoqi@0 134 fi
aoqi@0 135
aoqi@0 136 # Replace the commas with AND for use in the build directory name.
mikael@1138 137 ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
aoqi@0 138 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/'`
aoqi@0 139 if test "x$COUNT_VARIANTS" != "x,1"; then
aoqi@0 140 BUILDING_MULTIPLE_JVM_VARIANTS=yes
aoqi@0 141 else
aoqi@0 142 BUILDING_MULTIPLE_JVM_VARIANTS=no
aoqi@0 143 fi
aoqi@0 144
aoqi@0 145 AC_SUBST(JVM_VARIANTS)
aoqi@0 146 AC_SUBST(JVM_VARIANT_SERVER)
aoqi@0 147 AC_SUBST(JVM_VARIANT_CLIENT)
aoqi@0 148 AC_SUBST(JVM_VARIANT_MINIMAL1)
aoqi@0 149 AC_SUBST(JVM_VARIANT_KERNEL)
aoqi@0 150 AC_SUBST(JVM_VARIANT_ZERO)
aoqi@0 151 AC_SUBST(JVM_VARIANT_ZEROSHARK)
aoqi@0 152 AC_SUBST(JVM_VARIANT_CORE)
aoqi@0 153
aoqi@0 154 INCLUDE_SA=true
aoqi@0 155 if test "x$JVM_VARIANT_ZERO" = xtrue ; then
aoqi@0 156 INCLUDE_SA=false
aoqi@0 157 fi
aoqi@0 158 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
aoqi@0 159 INCLUDE_SA=false
aoqi@0 160 fi
sgehwolf@2325 161 if test "x$VAR_CPU" = xppc64 -o "x$VAR_CPU" = xppc64le ; then
aoqi@0 162 INCLUDE_SA=false
aoqi@0 163 fi
aph@1321 164 if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
aph@1321 165 INCLUDE_SA=false
aph@1321 166 fi
aoqi@0 167 AC_SUBST(INCLUDE_SA)
aoqi@0 168
aoqi@0 169 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
ddehaven@1304 170 MACOSX_UNIVERSAL="false"
aoqi@0 171 fi
aoqi@0 172
aoqi@0 173 AC_SUBST(MACOSX_UNIVERSAL)
aoqi@0 174 ])
aoqi@0 175
aoqi@0 176 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
aoqi@0 177 [
aoqi@0 178 ###############################################################################
aoqi@0 179 #
aoqi@0 180 # Set the debug level
aoqi@0 181 # release: no debug information, all optimizations, no asserts.
aoqi@0 182 # fastdebug: debug information (-g), all optimizations, all asserts
aoqi@0 183 # slowdebug: debug information (-g), no optimizations, all asserts
aoqi@0 184 #
aoqi@0 185 DEBUG_LEVEL="release"
aoqi@0 186 AC_MSG_CHECKING([which debug level to use])
aoqi@0 187 AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
aoqi@0 188 [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
aoqi@0 189 [
aoqi@0 190 ENABLE_DEBUG="${enableval}"
aoqi@0 191 DEBUG_LEVEL="fastdebug"
aoqi@0 192 ], [ENABLE_DEBUG="no"])
aoqi@0 193
aoqi@0 194 AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
aoqi@0 195 [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
aoqi@0 196 [
aoqi@0 197 DEBUG_LEVEL="${withval}"
aoqi@0 198 if test "x$ENABLE_DEBUG" = xyes; then
aoqi@0 199 AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
aoqi@0 200 fi
aoqi@0 201 ])
aoqi@0 202 AC_MSG_RESULT([$DEBUG_LEVEL])
aoqi@0 203
aoqi@0 204 if test "x$DEBUG_LEVEL" != xrelease && \
aoqi@0 205 test "x$DEBUG_LEVEL" != xfastdebug && \
aoqi@0 206 test "x$DEBUG_LEVEL" != xslowdebug; then
aoqi@0 207 AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
aoqi@0 208 fi
aoqi@0 209
aoqi@0 210
aoqi@0 211 ###############################################################################
aoqi@0 212 #
aoqi@0 213 # Setup legacy vars/targets and new vars to deal with different debug levels.
aoqi@0 214 #
aoqi@0 215
aoqi@0 216 case $DEBUG_LEVEL in
aoqi@0 217 release )
aoqi@0 218 VARIANT="OPT"
aoqi@0 219 FASTDEBUG="false"
aoqi@0 220 DEBUG_CLASSFILES="false"
aoqi@0 221 BUILD_VARIANT_RELEASE=""
aoqi@0 222 HOTSPOT_DEBUG_LEVEL="product"
aoqi@0 223 HOTSPOT_EXPORT="product"
aoqi@0 224 ;;
aoqi@0 225 fastdebug )
aoqi@0 226 VARIANT="DBG"
aoqi@0 227 FASTDEBUG="true"
aoqi@0 228 DEBUG_CLASSFILES="true"
aoqi@0 229 BUILD_VARIANT_RELEASE="-fastdebug"
aoqi@0 230 HOTSPOT_DEBUG_LEVEL="fastdebug"
aoqi@0 231 HOTSPOT_EXPORT="fastdebug"
aoqi@0 232 ;;
aoqi@0 233 slowdebug )
aoqi@0 234 VARIANT="DBG"
aoqi@0 235 FASTDEBUG="false"
aoqi@0 236 DEBUG_CLASSFILES="true"
aoqi@0 237 BUILD_VARIANT_RELEASE="-debug"
aoqi@0 238 HOTSPOT_DEBUG_LEVEL="jvmg"
aoqi@0 239 HOTSPOT_EXPORT="debug"
aoqi@0 240 ;;
aoqi@0 241 esac
aoqi@0 242
aoqi@0 243 #####
aoqi@0 244 # Generate the legacy makefile targets for hotspot.
aoqi@0 245 # The hotspot api for selecting the build artifacts, really, needs to be improved.
aoqi@0 246 # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
aoqi@0 247 # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
aoqi@0 248 # But until then ...
aoqi@0 249 HOTSPOT_TARGET=""
aoqi@0 250
aoqi@0 251 if test "x$JVM_VARIANT_SERVER" = xtrue; then
aoqi@0 252 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
aoqi@0 253 fi
aoqi@0 254
aoqi@0 255 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
aoqi@0 256 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
aoqi@0 257 fi
aoqi@0 258
aoqi@0 259 if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
aoqi@0 260 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
aoqi@0 261 fi
aoqi@0 262
aoqi@0 263 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
aoqi@0 264 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
aoqi@0 265 fi
aoqi@0 266
aoqi@0 267 if test "x$JVM_VARIANT_ZERO" = xtrue; then
aoqi@0 268 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
aoqi@0 269 fi
aoqi@0 270
aoqi@0 271 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
aoqi@0 272 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
aoqi@0 273 fi
aoqi@0 274
aoqi@0 275 if test "x$JVM_VARIANT_CORE" = xtrue; then
aoqi@0 276 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
aoqi@0 277 fi
aoqi@0 278
aoqi@0 279 HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
aoqi@0 280
aoqi@0 281 # On Macosx universal binaries are produced, but they only contain
aoqi@0 282 # 64 bit intel. This invalidates control of which jvms are built
aoqi@0 283 # from configure, but only server is valid anyway. Fix this
aoqi@0 284 # when hotspot makefiles are rewritten.
aoqi@0 285 if test "x$MACOSX_UNIVERSAL" = xtrue; then
aoqi@0 286 HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
aoqi@0 287 fi
aoqi@0 288
aoqi@0 289 #####
aoqi@0 290
aoqi@0 291 AC_SUBST(DEBUG_LEVEL)
aoqi@0 292 AC_SUBST(VARIANT)
aoqi@0 293 AC_SUBST(FASTDEBUG)
aoqi@0 294 AC_SUBST(DEBUG_CLASSFILES)
aoqi@0 295 AC_SUBST(BUILD_VARIANT_RELEASE)
aoqi@0 296 ])
aoqi@0 297
aoqi@0 298
aoqi@0 299 ###############################################################################
aoqi@0 300 #
aoqi@0 301 # Should we build only OpenJDK even if closed sources are present?
aoqi@0 302 #
aoqi@0 303 AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
aoqi@0 304 [
aoqi@0 305 AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
aoqi@0 306 [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
aoqi@0 307
aoqi@0 308 AC_MSG_CHECKING([for presence of closed sources])
aoqi@0 309 if test -d "$SRC_ROOT/jdk/src/closed"; then
aoqi@0 310 CLOSED_SOURCE_PRESENT=yes
aoqi@0 311 else
aoqi@0 312 CLOSED_SOURCE_PRESENT=no
aoqi@0 313 fi
aoqi@0 314 AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
aoqi@0 315
aoqi@0 316 AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)])
aoqi@0 317 SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only"
aoqi@0 318 AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE])
aoqi@0 319
aoqi@0 320 if test "x$CLOSED_SOURCE_PRESENT" = xno; then
aoqi@0 321 OPENJDK=true
aoqi@0 322 if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
aoqi@0 323 AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
aoqi@0 324 fi
aoqi@0 325 else
aoqi@0 326 if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
aoqi@0 327 OPENJDK=true
aoqi@0 328 else
aoqi@0 329 OPENJDK=false
aoqi@0 330 fi
aoqi@0 331 fi
aoqi@0 332
aoqi@0 333 if test "x$OPENJDK" = "xtrue"; then
aoqi@0 334 SET_OPENJDK="OPENJDK=true"
aoqi@0 335 fi
aoqi@0 336
aoqi@0 337 AC_SUBST(SET_OPENJDK)
aoqi@0 338 ])
aoqi@0 339
aoqi@0 340 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
aoqi@0 341 [
aoqi@0 342
aoqi@0 343 ###############################################################################
aoqi@0 344 #
aoqi@0 345 # Should we build a JDK/JVM with headful support (ie a graphical ui)?
aoqi@0 346 # We always build headless support.
aoqi@0 347 #
aoqi@0 348 AC_MSG_CHECKING([headful support])
aoqi@0 349 AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
aoqi@0 350 [disable building headful support (graphical UI support) @<:@enabled@:>@])],
aoqi@0 351 [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
aoqi@0 352
aoqi@0 353 SUPPORT_HEADLESS=yes
aoqi@0 354 BUILD_HEADLESS="BUILD_HEADLESS:=true"
aoqi@0 355
aoqi@0 356 if test "x$SUPPORT_HEADFUL" = xyes; then
aoqi@0 357 # We are building both headful and headless.
aoqi@0 358 headful_msg="include support for both headful and headless"
aoqi@0 359 fi
aoqi@0 360
aoqi@0 361 if test "x$SUPPORT_HEADFUL" = xno; then
aoqi@0 362 # Thus we are building headless only.
aoqi@0 363 BUILD_HEADLESS="BUILD_HEADLESS:=true"
aoqi@0 364 headful_msg="headless only"
aoqi@0 365 fi
aoqi@0 366
aoqi@0 367 AC_MSG_RESULT([$headful_msg])
aoqi@0 368
aoqi@0 369 AC_SUBST(SUPPORT_HEADLESS)
aoqi@0 370 AC_SUBST(SUPPORT_HEADFUL)
aoqi@0 371 AC_SUBST(BUILD_HEADLESS)
aoqi@0 372
aoqi@0 373 # Control wether Hotspot runs Queens test after build.
aoqi@0 374 AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
aoqi@0 375 [run the Queens test after Hotspot build @<:@disabled@:>@])],,
aoqi@0 376 [enable_hotspot_test_in_build=no])
aoqi@0 377 if test "x$enable_hotspot_test_in_build" = "xyes"; then
aoqi@0 378 TEST_IN_BUILD=true
aoqi@0 379 else
aoqi@0 380 TEST_IN_BUILD=false
aoqi@0 381 fi
aoqi@0 382 AC_SUBST(TEST_IN_BUILD)
aoqi@0 383
aoqi@0 384 ###############################################################################
aoqi@0 385 #
aoqi@0 386 # Choose cacerts source file
aoqi@0 387 #
aoqi@0 388 AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
aoqi@0 389 [specify alternative cacerts file])])
aoqi@0 390 if test "x$with_cacerts_file" != x; then
aoqi@0 391 CACERTS_FILE=$with_cacerts_file
aoqi@0 392 else
aoqi@0 393 CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
aoqi@0 394 fi
aoqi@0 395 AC_SUBST(CACERTS_FILE)
aoqi@0 396
aoqi@0 397 ###############################################################################
aoqi@0 398 #
aoqi@0 399 # Enable or disable unlimited crypto
aoqi@0 400 #
aoqi@0 401 AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
aoqi@0 402 [Enable unlimited crypto policy @<:@disabled@:>@])],,
aoqi@0 403 [enable_unlimited_crypto=no])
aoqi@0 404 if test "x$enable_unlimited_crypto" = "xyes"; then
aoqi@0 405 UNLIMITED_CRYPTO=true
aoqi@0 406 else
aoqi@0 407 UNLIMITED_CRYPTO=false
aoqi@0 408 fi
aoqi@0 409 AC_SUBST(UNLIMITED_CRYPTO)
aoqi@0 410
aoqi@0 411 ###############################################################################
aoqi@0 412 #
aoqi@0 413 # Enable or disable the elliptic curve crypto implementation
aoqi@0 414 #
aoqi@0 415 AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
aoqi@0 416 [
aoqi@0 417 AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
aoqi@0 418
aoqi@0 419 if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
aoqi@0 420 ENABLE_INTREE_EC=yes
aoqi@0 421 AC_MSG_RESULT([yes])
aoqi@0 422 else
aoqi@0 423 ENABLE_INTREE_EC=no
aoqi@0 424 AC_MSG_RESULT([no])
aoqi@0 425 fi
aoqi@0 426
aoqi@0 427 AC_SUBST(ENABLE_INTREE_EC)
aoqi@0 428 ])
aoqi@0 429
aoqi@0 430 ###############################################################################
aoqi@0 431 #
aoqi@0 432 # Compress jars
aoqi@0 433 #
aoqi@0 434 COMPRESS_JARS=false
aoqi@0 435
aoqi@0 436 AC_SUBST(COMPRESS_JARS)
aoqi@0 437 ])
aoqi@0 438
aoqi@0 439 ###############################################################################
aoqi@0 440 #
aoqi@0 441 # Setup version numbers
aoqi@0 442 #
aoqi@0 443 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
aoqi@0 444 [
aoqi@0 445 # Source the version numbers
aoqi@0 446 . $AUTOCONF_DIR/version-numbers
aoqi@0 447
aoqi@0 448 # Get the settings from parameters
aoqi@0 449 AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone],
aoqi@0 450 [Set milestone value for build @<:@internal@:>@])])
aoqi@0 451 if test "x$with_milestone" = xyes; then
aoqi@0 452 AC_MSG_ERROR([Milestone must have a value])
aoqi@0 453 elif test "x$with_milestone" != x; then
aoqi@0 454 MILESTONE="$with_milestone"
aoqi@0 455 fi
aoqi@0 456 if test "x$MILESTONE" = x; then
aoqi@0 457 MILESTONE=internal
aoqi@0 458 fi
aoqi@0 459
aoqi@0 460 AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
aoqi@0 461 [Set update version value for build @<:@b00@:>@])])
aoqi@0 462 if test "x$with_update_version" = xyes; then
aoqi@0 463 AC_MSG_ERROR([Update version must have a value])
aoqi@0 464 elif test "x$with_update_version" != x; then
aoqi@0 465 JDK_UPDATE_VERSION="$with_update_version"
aoqi@0 466 # On macosx 10.7, it's not possible to set --with-update-version=0X due
aoqi@0 467 # to a bug in expr (which reduces it to just X). To work around this, we
aoqi@0 468 # always add a 0 to one digit update versions.
aoqi@0 469 if test "${#JDK_UPDATE_VERSION}" = "1"; then
aoqi@0 470 JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
aoqi@0 471 fi
aoqi@0 472 fi
aoqi@0 473
aoqi@0 474 AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],
aoqi@0 475 [Add a custom string to the version string if build number isn't set.@<:@username_builddateb00@:>@])])
aoqi@0 476 if test "x$with_user_release_suffix" = xyes; then
aoqi@0 477 AC_MSG_ERROR([Release suffix must have a value])
aoqi@0 478 elif test "x$with_user_release_suffix" != x; then
aoqi@0 479 USER_RELEASE_SUFFIX="$with_user_release_suffix"
aoqi@0 480 fi
aoqi@0 481
aoqi@0 482 AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number],
aoqi@0 483 [Set build number value for build @<:@b00@:>@])])
aoqi@0 484 if test "x$with_build_number" = xyes; then
aoqi@0 485 AC_MSG_ERROR([Build number must have a value])
aoqi@0 486 elif test "x$with_build_number" != x; then
aoqi@0 487 JDK_BUILD_NUMBER="$with_build_number"
aoqi@0 488 fi
aoqi@0 489 # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set
aoqi@0 490 if test "x$JDK_BUILD_NUMBER" = x; then
aoqi@0 491 JDK_BUILD_NUMBER=b00
aoqi@0 492 if test "x$USER_RELEASE_SUFFIX" = x; then
aoqi@0 493 BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
aoqi@0 494 # Avoid [:alnum:] since it depends on the locale.
aoqi@0 495 CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
aoqi@0 496 USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
aoqi@0 497 fi
aoqi@0 498 fi
aoqi@0 499
aoqi@0 500 # Now set the JDK version, milestone, build number etc.
aoqi@0 501 AC_SUBST(USER_RELEASE_SUFFIX)
aoqi@0 502 AC_SUBST(JDK_MAJOR_VERSION)
aoqi@0 503 AC_SUBST(JDK_MINOR_VERSION)
aoqi@0 504 AC_SUBST(JDK_MICRO_VERSION)
aoqi@0 505 AC_SUBST(JDK_UPDATE_VERSION)
aoqi@0 506 AC_SUBST(JDK_BUILD_NUMBER)
aoqi@0 507 AC_SUBST(MILESTONE)
aoqi@0 508 AC_SUBST(LAUNCHER_NAME)
aoqi@0 509 AC_SUBST(PRODUCT_NAME)
aoqi@0 510 AC_SUBST(PRODUCT_SUFFIX)
aoqi@0 511 AC_SUBST(JDK_RC_PLATFORM_NAME)
aoqi@0 512 AC_SUBST(COMPANY_NAME)
aoqi@0 513 AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
aoqi@0 514 AC_SUBST(MACOSX_BUNDLE_ID_BASE)
aoqi@0 515
erikj@1202 516 AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
erikj@1202 517 [Set copyright year value for build @<:@current year@:>@])])
erikj@1202 518 if test "x$with_copyright_year" = xyes; then
erikj@1202 519 AC_MSG_ERROR([Copyright year must have a value])
erikj@1202 520 elif test "x$with_copyright_year" != x; then
erikj@1202 521 COPYRIGHT_YEAR="$with_copyright_year"
erikj@1202 522 else
erikj@1202 523 COPYRIGHT_YEAR=`date +'%Y'`
erikj@1202 524 fi
aoqi@0 525 AC_SUBST(COPYRIGHT_YEAR)
aoqi@0 526
aoqi@0 527 if test "x$JDK_UPDATE_VERSION" != x; then
aoqi@0 528 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
aoqi@0 529 else
aoqi@0 530 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
aoqi@0 531 fi
aoqi@0 532 AC_SUBST(JDK_VERSION)
aoqi@0 533
erikj@1404 534 # The cooked update version used to encode trailing letters in the update
erikj@1404 535 # version into a trailing number. That is no longer needed, but need to
erikj@1404 536 # keep the format in 8u for compatibility.
erikj@1404 537 COOKED_JDK_UPDATE_VERSION="${JDK_UPDATE_VERSION}0"
erikj@1404 538 AC_SUBST(COOKED_JDK_UPDATE_VERSION)
erikj@1404 539
aoqi@0 540 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
aoqi@0 541 AC_SUBST(COOKED_BUILD_NUMBER)
aoqi@0 542 ])
aoqi@0 543
aoqi@0 544 AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
aoqi@0 545 [
aoqi@0 546 HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
aoqi@0 547 AC_SUBST(HOTSPOT_MAKE_ARGS)
aoqi@0 548
aoqi@0 549 # The name of the Service Agent jar.
aoqi@0 550 SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
aoqi@0 551 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
aoqi@0 552 SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
aoqi@0 553 fi
aoqi@0 554 AC_SUBST(SALIB_NAME)
aoqi@0 555 ])
aoqi@0 556
aoqi@0 557 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
aoqi@0 558 [
sgehwolf@2236 559 # Backwards compatibility. --with-native-debug-symbols is preferred post JDK-8207234,
sgehwolf@2236 560 # but if somebody does not specify it via configure, we still want to preserve old
sgehwolf@2236 561 # behaviour of --disable-debug-symbols
aoqi@0 562 #
aoqi@0 563 # ENABLE_DEBUG_SYMBOLS
aoqi@0 564 # This must be done after the toolchain is setup, since we're looking at objcopy.
aoqi@0 565 #
aoqi@0 566 AC_ARG_ENABLE([debug-symbols],
aoqi@0 567 [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
aoqi@0 568
aoqi@0 569 AC_MSG_CHECKING([if we should generate debug symbols])
aoqi@0 570
aoqi@0 571 if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
aoqi@0 572 # explicit enabling of enable-debug-symbols and can't find objcopy
aoqi@0 573 # this is an error
aoqi@0 574 AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
aoqi@0 575 fi
aoqi@0 576
aoqi@0 577 if test "x$enable_debug_symbols" = "xyes"; then
aoqi@0 578 ENABLE_DEBUG_SYMBOLS=true
aoqi@0 579 elif test "x$enable_debug_symbols" = "xno"; then
aoqi@0 580 ENABLE_DEBUG_SYMBOLS=false
aoqi@0 581 else
aoqi@0 582 # Default is on if objcopy is found
aoqi@0 583 if test "x$OBJCOPY" != x; then
aoqi@0 584 ENABLE_DEBUG_SYMBOLS=true
aoqi@0 585 # MacOS X and Windows don't use objcopy but default is on for those OSes
aoqi@0 586 elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
aoqi@0 587 ENABLE_DEBUG_SYMBOLS=true
aoqi@0 588 else
aoqi@0 589 ENABLE_DEBUG_SYMBOLS=false
aoqi@0 590 fi
aoqi@0 591 fi
aoqi@0 592
aoqi@0 593 AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
aoqi@0 594
sgehwolf@2236 595 # Backwards compatibility. --with-native-debug-symbols is preferred post JDK-8207234,
sgehwolf@2236 596 # but if somebody does not specify it via configure, we still want to preserve old
sgehwolf@2236 597 # behaviour of --disable-zip-debug-info.
aoqi@0 598 #
aoqi@0 599 # ZIP_DEBUGINFO_FILES
aoqi@0 600 #
aoqi@0 601 AC_MSG_CHECKING([if we should zip debug-info files])
aoqi@0 602 AC_ARG_ENABLE([zip-debug-info],
aoqi@0 603 [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
aoqi@0 604 [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
aoqi@0 605 AC_MSG_RESULT([${enable_zip_debug_info}])
aoqi@0 606
aoqi@0 607 if test "x${enable_zip_debug_info}" = "xno"; then
aoqi@0 608 ZIP_DEBUGINFO_FILES=false
sgehwolf@2236 609 elif test "x${enable_zip_debug_info}" = "xyes"; then
aoqi@0 610 ZIP_DEBUGINFO_FILES=true
aoqi@0 611 fi
aoqi@0 612
sgehwolf@2236 613 #
sgehwolf@2236 614 # NATIVE_DEBUG_SYMBOLS
sgehwolf@2236 615 # This must be done after the toolchain is setup, since we're looking at objcopy.
sgehwolf@2236 616 # In addition, this must be done after ENABLE_DEBUG_SYMBOLS and ZIP_DEBUGINFO_FILES
sgehwolf@2236 617 # checking in order to preserve backwards compatibility post JDK-8207234.
sgehwolf@2236 618 #
sgehwolf@2236 619 AC_MSG_CHECKING([what type of native debug symbols to use (this will override previous settings)])
sgehwolf@2236 620 AC_ARG_WITH([native-debug-symbols],
sgehwolf@2236 621 [AS_HELP_STRING([--with-native-debug-symbols],
sgehwolf@2236 622 [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
sgehwolf@2236 623 [
sgehwolf@2236 624 if test "x$OPENJDK_TARGET_OS" = xaix; then
sgehwolf@2236 625 if test "x$with_native_debug_symbols" = xexternal || test "x$with_native_debug_symbols" = xzipped; then
sgehwolf@2236 626 AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
sgehwolf@2236 627 fi
sgehwolf@2236 628 fi
sgehwolf@2236 629 ],
sgehwolf@2236 630 [
sgehwolf@2236 631 # Default to unset for backwards compatibility
sgehwolf@2236 632 with_native_debug_symbols=""
sgehwolf@2236 633 ])
sgehwolf@2236 634 NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
sgehwolf@2236 635 if test "x$NATIVE_DEBUG_SYMBOLS" = x; then
sgehwolf@2236 636 AC_MSG_RESULT([not specified])
sgehwolf@2236 637 else
sgehwolf@2236 638 AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
sgehwolf@2236 639 fi
sgehwolf@2236 640 # Default is empty
sgehwolf@2236 641 DEBUG_BINARIES=
sgehwolf@2236 642 # Default is min_strip. Possible values are min_strip, all_strip, no_strip
sgehwolf@2236 643 STRIP_POLICY=min_strip
sgehwolf@2236 644
sgehwolf@2236 645 if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
sgehwolf@2236 646
sgehwolf@2236 647 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
sgehwolf@2236 648 if test "x$OBJCOPY" = x; then
sgehwolf@2236 649 # enabling of enable-debug-symbols and can't find objcopy
sgehwolf@2236 650 # this is an error
sgehwolf@2236 651 AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
sgehwolf@2236 652 fi
sgehwolf@2236 653 fi
sgehwolf@2236 654
sgehwolf@2236 655 ENABLE_DEBUG_SYMBOLS=true
sgehwolf@2236 656 STRIP_POLICY=min_strip
sgehwolf@2236 657 ZIP_DEBUGINFO_FILES=true
sgehwolf@2236 658 elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
sgehwolf@2236 659 ENABLE_DEBUG_SYMBOLS=false
sgehwolf@2236 660 STRIP_POLICY=min_strip
sgehwolf@2236 661 ZIP_DEBUGINFO_FILES=false
sgehwolf@2236 662 elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
sgehwolf@2236 663 ENABLE_DEBUG_SYMBOLS=true
sgehwolf@2236 664 STRIP_POLICY=no_strip
sgehwolf@2236 665 ZIP_DEBUGINFO_FILES=false
sgehwolf@2236 666 POST_STRIP_CMD=
sgehwolf@2236 667 DEBUG_BINARIES=true
sgehwolf@2236 668 elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
sgehwolf@2236 669
sgehwolf@2236 670 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
sgehwolf@2236 671 if test "x$OBJCOPY" = x; then
sgehwolf@2236 672 # enabling of enable-debug-symbols and can't find objcopy
sgehwolf@2236 673 # this is an error
sgehwolf@2236 674 AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
sgehwolf@2236 675 fi
sgehwolf@2236 676 fi
sgehwolf@2236 677
sgehwolf@2236 678 ENABLE_DEBUG_SYMBOLS=true
sgehwolf@2236 679 STRIP_POLICY=min_strip
sgehwolf@2236 680 ZIP_DEBUGINFO_FILES=false
sgehwolf@2236 681 elif test "x$NATIVE_DEBUG_SYMBOLS" != x; then
sgehwolf@2236 682 AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
sgehwolf@2236 683 else
sgehwolf@2236 684 AC_MSG_NOTICE([--with-native-debug-symbols not specified. Using values from --disable-debug-symbols and --disable-zip-debug-info])
sgehwolf@2236 685 fi
sgehwolf@2236 686
aoqi@0 687 AC_SUBST(ENABLE_DEBUG_SYMBOLS)
sgehwolf@2236 688 AC_SUBST(STRIP_POLICY)
sgehwolf@2236 689 AC_SUBST(POST_STRIP_CMD)
sgehwolf@2236 690 AC_SUBST(DEBUG_BINARIES)
aoqi@0 691 AC_SUBST(ZIP_DEBUGINFO_FILES)
aoqi@0 692 ])
aoqi@0 693
aoqi@0 694 # Support for customization of the build process. Some build files
aoqi@0 695 # will include counterparts from this location, if they exist. This allows
aoqi@0 696 # for a degree of customization of the build targets and the rules/recipes
aoqi@0 697 # to create them
aoqi@0 698 AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir],
aoqi@0 699 [use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir])
aoqi@0 700 AC_SUBST(CUSTOM_MAKE_DIR)

mercurial