common/autoconf/jdk-options.m4

Thu, 31 Aug 2017 15:40:18 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:40:18 +0800
changeset 1133
50aaf272884f
parent 1028
feeb67be5886
parent 0
75a576e87639
child 1288
7801df19942d
permissions
-rw-r--r--

merge

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 2011, 2013, 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.
aoqi@0 137 ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
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
aoqi@0 161 if test "x$VAR_CPU" = xppc64 ; then
aoqi@0 162 INCLUDE_SA=false
aoqi@0 163 fi
aoqi@0 164 AC_SUBST(INCLUDE_SA)
aoqi@0 165
aoqi@0 166 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
aoqi@0 167 MACOSX_UNIVERSAL="true"
aoqi@0 168 fi
aoqi@0 169
aoqi@0 170 AC_SUBST(MACOSX_UNIVERSAL)
aoqi@0 171 ])
aoqi@0 172
aoqi@0 173 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
aoqi@0 174 [
aoqi@0 175 ###############################################################################
aoqi@0 176 #
aoqi@0 177 # Set the debug level
aoqi@0 178 # release: no debug information, all optimizations, no asserts.
aoqi@0 179 # fastdebug: debug information (-g), all optimizations, all asserts
aoqi@0 180 # slowdebug: debug information (-g), no optimizations, all asserts
aoqi@0 181 #
aoqi@0 182 DEBUG_LEVEL="release"
aoqi@0 183 AC_MSG_CHECKING([which debug level to use])
aoqi@0 184 AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
aoqi@0 185 [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
aoqi@0 186 [
aoqi@0 187 ENABLE_DEBUG="${enableval}"
aoqi@0 188 DEBUG_LEVEL="fastdebug"
aoqi@0 189 ], [ENABLE_DEBUG="no"])
aoqi@0 190
aoqi@0 191 AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
aoqi@0 192 [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
aoqi@0 193 [
aoqi@0 194 DEBUG_LEVEL="${withval}"
aoqi@0 195 if test "x$ENABLE_DEBUG" = xyes; then
aoqi@0 196 AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
aoqi@0 197 fi
aoqi@0 198 ])
aoqi@0 199 AC_MSG_RESULT([$DEBUG_LEVEL])
aoqi@0 200
aoqi@0 201 if test "x$DEBUG_LEVEL" != xrelease && \
aoqi@0 202 test "x$DEBUG_LEVEL" != xfastdebug && \
aoqi@0 203 test "x$DEBUG_LEVEL" != xslowdebug; then
aoqi@0 204 AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
aoqi@0 205 fi
aoqi@0 206
aoqi@0 207
aoqi@0 208 ###############################################################################
aoqi@0 209 #
aoqi@0 210 # Setup legacy vars/targets and new vars to deal with different debug levels.
aoqi@0 211 #
aoqi@0 212
aoqi@0 213 case $DEBUG_LEVEL in
aoqi@0 214 release )
aoqi@0 215 VARIANT="OPT"
aoqi@0 216 FASTDEBUG="false"
aoqi@0 217 DEBUG_CLASSFILES="false"
aoqi@0 218 BUILD_VARIANT_RELEASE=""
aoqi@0 219 HOTSPOT_DEBUG_LEVEL="product"
aoqi@0 220 HOTSPOT_EXPORT="product"
aoqi@0 221 ;;
aoqi@0 222 fastdebug )
aoqi@0 223 VARIANT="DBG"
aoqi@0 224 FASTDEBUG="true"
aoqi@0 225 DEBUG_CLASSFILES="true"
aoqi@0 226 BUILD_VARIANT_RELEASE="-fastdebug"
aoqi@0 227 HOTSPOT_DEBUG_LEVEL="fastdebug"
aoqi@0 228 HOTSPOT_EXPORT="fastdebug"
aoqi@0 229 ;;
aoqi@0 230 slowdebug )
aoqi@0 231 VARIANT="DBG"
aoqi@0 232 FASTDEBUG="false"
aoqi@0 233 DEBUG_CLASSFILES="true"
aoqi@0 234 BUILD_VARIANT_RELEASE="-debug"
aoqi@0 235 HOTSPOT_DEBUG_LEVEL="jvmg"
aoqi@0 236 HOTSPOT_EXPORT="debug"
aoqi@0 237 ;;
aoqi@0 238 esac
aoqi@0 239
aoqi@0 240 #####
aoqi@0 241 # Generate the legacy makefile targets for hotspot.
aoqi@0 242 # The hotspot api for selecting the build artifacts, really, needs to be improved.
aoqi@0 243 # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
aoqi@0 244 # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
aoqi@0 245 # But until then ...
aoqi@0 246 HOTSPOT_TARGET=""
aoqi@0 247
aoqi@0 248 if test "x$JVM_VARIANT_SERVER" = xtrue; then
aoqi@0 249 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
aoqi@0 250 fi
aoqi@0 251
aoqi@0 252 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
aoqi@0 253 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
aoqi@0 254 fi
aoqi@0 255
aoqi@0 256 if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
aoqi@0 257 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
aoqi@0 258 fi
aoqi@0 259
aoqi@0 260 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
aoqi@0 261 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
aoqi@0 262 fi
aoqi@0 263
aoqi@0 264 if test "x$JVM_VARIANT_ZERO" = xtrue; then
aoqi@0 265 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
aoqi@0 266 fi
aoqi@0 267
aoqi@0 268 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
aoqi@0 269 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
aoqi@0 270 fi
aoqi@0 271
aoqi@0 272 if test "x$JVM_VARIANT_CORE" = xtrue; then
aoqi@0 273 HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
aoqi@0 274 fi
aoqi@0 275
aoqi@0 276 HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
aoqi@0 277
aoqi@0 278 # On Macosx universal binaries are produced, but they only contain
aoqi@0 279 # 64 bit intel. This invalidates control of which jvms are built
aoqi@0 280 # from configure, but only server is valid anyway. Fix this
aoqi@0 281 # when hotspot makefiles are rewritten.
aoqi@0 282 if test "x$MACOSX_UNIVERSAL" = xtrue; then
aoqi@0 283 HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
aoqi@0 284 fi
aoqi@0 285
aoqi@0 286 #####
aoqi@0 287
aoqi@0 288 AC_SUBST(DEBUG_LEVEL)
aoqi@0 289 AC_SUBST(VARIANT)
aoqi@0 290 AC_SUBST(FASTDEBUG)
aoqi@0 291 AC_SUBST(DEBUG_CLASSFILES)
aoqi@0 292 AC_SUBST(BUILD_VARIANT_RELEASE)
aoqi@0 293 ])
aoqi@0 294
aoqi@0 295
aoqi@0 296 ###############################################################################
aoqi@0 297 #
aoqi@0 298 # Should we build only OpenJDK even if closed sources are present?
aoqi@0 299 #
aoqi@0 300 AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
aoqi@0 301 [
aoqi@0 302 AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
aoqi@0 303 [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
aoqi@0 304
aoqi@0 305 AC_MSG_CHECKING([for presence of closed sources])
aoqi@0 306 if test -d "$SRC_ROOT/jdk/src/closed"; then
aoqi@0 307 CLOSED_SOURCE_PRESENT=yes
aoqi@0 308 else
aoqi@0 309 CLOSED_SOURCE_PRESENT=no
aoqi@0 310 fi
aoqi@0 311 AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
aoqi@0 312
aoqi@0 313 AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)])
aoqi@0 314 SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only"
aoqi@0 315 AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE])
aoqi@0 316
aoqi@0 317 if test "x$CLOSED_SOURCE_PRESENT" = xno; then
aoqi@0 318 OPENJDK=true
aoqi@0 319 if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
aoqi@0 320 AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
aoqi@0 321 fi
aoqi@0 322 else
aoqi@0 323 if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
aoqi@0 324 OPENJDK=true
aoqi@0 325 else
aoqi@0 326 OPENJDK=false
aoqi@0 327 fi
aoqi@0 328 fi
aoqi@0 329
aoqi@0 330 if test "x$OPENJDK" = "xtrue"; then
aoqi@0 331 SET_OPENJDK="OPENJDK=true"
aoqi@0 332 fi
aoqi@0 333
aoqi@0 334 AC_SUBST(SET_OPENJDK)
aoqi@0 335 ])
aoqi@0 336
aoqi@0 337 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
aoqi@0 338 [
aoqi@0 339
aoqi@0 340 ###############################################################################
aoqi@0 341 #
aoqi@0 342 # Should we build a JDK/JVM with headful support (ie a graphical ui)?
aoqi@0 343 # We always build headless support.
aoqi@0 344 #
aoqi@0 345 AC_MSG_CHECKING([headful support])
aoqi@0 346 AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
aoqi@0 347 [disable building headful support (graphical UI support) @<:@enabled@:>@])],
aoqi@0 348 [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
aoqi@0 349
aoqi@0 350 SUPPORT_HEADLESS=yes
aoqi@0 351 BUILD_HEADLESS="BUILD_HEADLESS:=true"
aoqi@0 352
aoqi@0 353 if test "x$SUPPORT_HEADFUL" = xyes; then
aoqi@0 354 # We are building both headful and headless.
aoqi@0 355 headful_msg="include support for both headful and headless"
aoqi@0 356 fi
aoqi@0 357
aoqi@0 358 if test "x$SUPPORT_HEADFUL" = xno; then
aoqi@0 359 # Thus we are building headless only.
aoqi@0 360 BUILD_HEADLESS="BUILD_HEADLESS:=true"
aoqi@0 361 headful_msg="headless only"
aoqi@0 362 fi
aoqi@0 363
aoqi@0 364 AC_MSG_RESULT([$headful_msg])
aoqi@0 365
aoqi@0 366 AC_SUBST(SUPPORT_HEADLESS)
aoqi@0 367 AC_SUBST(SUPPORT_HEADFUL)
aoqi@0 368 AC_SUBST(BUILD_HEADLESS)
aoqi@0 369
aoqi@0 370 # Control wether Hotspot runs Queens test after build.
aoqi@0 371 AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
aoqi@0 372 [run the Queens test after Hotspot build @<:@disabled@:>@])],,
aoqi@0 373 [enable_hotspot_test_in_build=no])
aoqi@0 374 if test "x$enable_hotspot_test_in_build" = "xyes"; then
aoqi@0 375 TEST_IN_BUILD=true
aoqi@0 376 else
aoqi@0 377 TEST_IN_BUILD=false
aoqi@0 378 fi
aoqi@0 379 AC_SUBST(TEST_IN_BUILD)
aoqi@0 380
aoqi@0 381 ###############################################################################
aoqi@0 382 #
aoqi@0 383 # Choose cacerts source file
aoqi@0 384 #
aoqi@0 385 AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
aoqi@0 386 [specify alternative cacerts file])])
aoqi@0 387 if test "x$with_cacerts_file" != x; then
aoqi@0 388 CACERTS_FILE=$with_cacerts_file
aoqi@0 389 else
aoqi@0 390 CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
aoqi@0 391 fi
aoqi@0 392 AC_SUBST(CACERTS_FILE)
aoqi@0 393
aoqi@0 394 ###############################################################################
aoqi@0 395 #
aoqi@0 396 # Enable or disable unlimited crypto
aoqi@0 397 #
aoqi@0 398 AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
aoqi@0 399 [Enable unlimited crypto policy @<:@disabled@:>@])],,
aoqi@0 400 [enable_unlimited_crypto=no])
aoqi@0 401 if test "x$enable_unlimited_crypto" = "xyes"; then
aoqi@0 402 UNLIMITED_CRYPTO=true
aoqi@0 403 else
aoqi@0 404 UNLIMITED_CRYPTO=false
aoqi@0 405 fi
aoqi@0 406 AC_SUBST(UNLIMITED_CRYPTO)
aoqi@0 407
aoqi@0 408 ###############################################################################
aoqi@0 409 #
aoqi@0 410 # Enable or disable the elliptic curve crypto implementation
aoqi@0 411 #
aoqi@0 412 AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
aoqi@0 413 [
aoqi@0 414 AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
aoqi@0 415
aoqi@0 416 if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
aoqi@0 417 ENABLE_INTREE_EC=yes
aoqi@0 418 AC_MSG_RESULT([yes])
aoqi@0 419 else
aoqi@0 420 ENABLE_INTREE_EC=no
aoqi@0 421 AC_MSG_RESULT([no])
aoqi@0 422 fi
aoqi@0 423
aoqi@0 424 AC_SUBST(ENABLE_INTREE_EC)
aoqi@0 425 ])
aoqi@0 426
aoqi@0 427 ###############################################################################
aoqi@0 428 #
aoqi@0 429 # Compress jars
aoqi@0 430 #
aoqi@0 431 COMPRESS_JARS=false
aoqi@0 432
aoqi@0 433 AC_SUBST(COMPRESS_JARS)
aoqi@0 434 ])
aoqi@0 435
aoqi@0 436 ###############################################################################
aoqi@0 437 #
aoqi@0 438 # Setup version numbers
aoqi@0 439 #
aoqi@0 440 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
aoqi@0 441 [
aoqi@0 442 # Source the version numbers
aoqi@0 443 . $AUTOCONF_DIR/version-numbers
aoqi@0 444
aoqi@0 445 # Get the settings from parameters
aoqi@0 446 AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone],
aoqi@0 447 [Set milestone value for build @<:@internal@:>@])])
aoqi@0 448 if test "x$with_milestone" = xyes; then
aoqi@0 449 AC_MSG_ERROR([Milestone must have a value])
aoqi@0 450 elif test "x$with_milestone" != x; then
aoqi@0 451 MILESTONE="$with_milestone"
aoqi@0 452 fi
aoqi@0 453 if test "x$MILESTONE" = x; then
aoqi@0 454 MILESTONE=internal
aoqi@0 455 fi
aoqi@0 456
aoqi@0 457 AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
aoqi@0 458 [Set update version value for build @<:@b00@:>@])])
aoqi@0 459 if test "x$with_update_version" = xyes; then
aoqi@0 460 AC_MSG_ERROR([Update version must have a value])
aoqi@0 461 elif test "x$with_update_version" != x; then
aoqi@0 462 JDK_UPDATE_VERSION="$with_update_version"
aoqi@0 463 # On macosx 10.7, it's not possible to set --with-update-version=0X due
aoqi@0 464 # to a bug in expr (which reduces it to just X). To work around this, we
aoqi@0 465 # always add a 0 to one digit update versions.
aoqi@0 466 if test "${#JDK_UPDATE_VERSION}" = "1"; then
aoqi@0 467 JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
aoqi@0 468 fi
aoqi@0 469 fi
aoqi@0 470
aoqi@0 471 AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],
aoqi@0 472 [Add a custom string to the version string if build number isn't set.@<:@username_builddateb00@:>@])])
aoqi@0 473 if test "x$with_user_release_suffix" = xyes; then
aoqi@0 474 AC_MSG_ERROR([Release suffix must have a value])
aoqi@0 475 elif test "x$with_user_release_suffix" != x; then
aoqi@0 476 USER_RELEASE_SUFFIX="$with_user_release_suffix"
aoqi@0 477 fi
aoqi@0 478
aoqi@0 479 AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number],
aoqi@0 480 [Set build number value for build @<:@b00@:>@])])
aoqi@0 481 if test "x$with_build_number" = xyes; then
aoqi@0 482 AC_MSG_ERROR([Build number must have a value])
aoqi@0 483 elif test "x$with_build_number" != x; then
aoqi@0 484 JDK_BUILD_NUMBER="$with_build_number"
aoqi@0 485 fi
aoqi@0 486 # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set
aoqi@0 487 if test "x$JDK_BUILD_NUMBER" = x; then
aoqi@0 488 JDK_BUILD_NUMBER=b00
aoqi@0 489 if test "x$USER_RELEASE_SUFFIX" = x; then
aoqi@0 490 BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
aoqi@0 491 # Avoid [:alnum:] since it depends on the locale.
aoqi@0 492 CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
aoqi@0 493 USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
aoqi@0 494 fi
aoqi@0 495 fi
aoqi@0 496
aoqi@0 497 # Now set the JDK version, milestone, build number etc.
aoqi@0 498 AC_SUBST(USER_RELEASE_SUFFIX)
aoqi@0 499 AC_SUBST(JDK_MAJOR_VERSION)
aoqi@0 500 AC_SUBST(JDK_MINOR_VERSION)
aoqi@0 501 AC_SUBST(JDK_MICRO_VERSION)
aoqi@0 502 AC_SUBST(JDK_UPDATE_VERSION)
aoqi@0 503 AC_SUBST(JDK_BUILD_NUMBER)
aoqi@0 504 AC_SUBST(MILESTONE)
aoqi@0 505 AC_SUBST(LAUNCHER_NAME)
aoqi@0 506 AC_SUBST(PRODUCT_NAME)
aoqi@0 507 AC_SUBST(PRODUCT_SUFFIX)
aoqi@0 508 AC_SUBST(JDK_RC_PLATFORM_NAME)
aoqi@0 509 AC_SUBST(COMPANY_NAME)
aoqi@0 510 AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
aoqi@0 511 AC_SUBST(MACOSX_BUNDLE_ID_BASE)
aoqi@0 512
aoqi@0 513 COPYRIGHT_YEAR=`date +'%Y'`
aoqi@0 514 AC_SUBST(COPYRIGHT_YEAR)
aoqi@0 515
aoqi@0 516 if test "x$JDK_UPDATE_VERSION" != x; then
aoqi@0 517 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
aoqi@0 518 else
aoqi@0 519 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
aoqi@0 520 fi
aoqi@0 521 AC_SUBST(JDK_VERSION)
aoqi@0 522
aoqi@0 523 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
aoqi@0 524 AC_SUBST(COOKED_BUILD_NUMBER)
aoqi@0 525 ])
aoqi@0 526
aoqi@0 527 AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
aoqi@0 528 [
aoqi@0 529 HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
aoqi@0 530 AC_SUBST(HOTSPOT_MAKE_ARGS)
aoqi@0 531
aoqi@0 532 # The name of the Service Agent jar.
aoqi@0 533 SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
aoqi@0 534 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
aoqi@0 535 SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
aoqi@0 536 fi
aoqi@0 537 AC_SUBST(SALIB_NAME)
aoqi@0 538 ])
aoqi@0 539
aoqi@0 540 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
aoqi@0 541 [
aoqi@0 542 #
aoqi@0 543 # ENABLE_DEBUG_SYMBOLS
aoqi@0 544 # This must be done after the toolchain is setup, since we're looking at objcopy.
aoqi@0 545 #
aoqi@0 546 AC_ARG_ENABLE([debug-symbols],
aoqi@0 547 [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
aoqi@0 548
aoqi@0 549 AC_MSG_CHECKING([if we should generate debug symbols])
aoqi@0 550
aoqi@0 551 if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
aoqi@0 552 # explicit enabling of enable-debug-symbols and can't find objcopy
aoqi@0 553 # this is an error
aoqi@0 554 AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
aoqi@0 555 fi
aoqi@0 556
aoqi@0 557 if test "x$enable_debug_symbols" = "xyes"; then
aoqi@0 558 ENABLE_DEBUG_SYMBOLS=true
aoqi@0 559 elif test "x$enable_debug_symbols" = "xno"; then
aoqi@0 560 ENABLE_DEBUG_SYMBOLS=false
aoqi@0 561 else
aoqi@0 562 # Default is on if objcopy is found
aoqi@0 563 if test "x$OBJCOPY" != x; then
aoqi@0 564 ENABLE_DEBUG_SYMBOLS=true
aoqi@0 565 # MacOS X and Windows don't use objcopy but default is on for those OSes
aoqi@0 566 elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
aoqi@0 567 ENABLE_DEBUG_SYMBOLS=true
aoqi@0 568 else
aoqi@0 569 ENABLE_DEBUG_SYMBOLS=false
aoqi@0 570 fi
aoqi@0 571 fi
aoqi@0 572
aoqi@0 573 AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
aoqi@0 574
aoqi@0 575 #
aoqi@0 576 # ZIP_DEBUGINFO_FILES
aoqi@0 577 #
aoqi@0 578 AC_MSG_CHECKING([if we should zip debug-info files])
aoqi@0 579 AC_ARG_ENABLE([zip-debug-info],
aoqi@0 580 [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
aoqi@0 581 [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
aoqi@0 582 AC_MSG_RESULT([${enable_zip_debug_info}])
aoqi@0 583
aoqi@0 584 if test "x${enable_zip_debug_info}" = "xno"; then
aoqi@0 585 ZIP_DEBUGINFO_FILES=false
aoqi@0 586 else
aoqi@0 587 ZIP_DEBUGINFO_FILES=true
aoqi@0 588 fi
aoqi@0 589
aoqi@0 590 AC_SUBST(ENABLE_DEBUG_SYMBOLS)
aoqi@0 591 AC_SUBST(ZIP_DEBUGINFO_FILES)
aoqi@0 592 AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
aoqi@0 593 AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
aoqi@0 594 ])
aoqi@0 595
aoqi@0 596 # Support for customization of the build process. Some build files
aoqi@0 597 # will include counterparts from this location, if they exist. This allows
aoqi@0 598 # for a degree of customization of the build targets and the rules/recipes
aoqi@0 599 # to create them
aoqi@0 600 AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir],
aoqi@0 601 [use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir])
aoqi@0 602 AC_SUBST(CUSTOM_MAKE_DIR)

mercurial