common/autoconf/jdk-options.m4

Tue, 11 Jun 2013 13:25:21 +0200

author
erikj
date
Tue, 11 Jun 2013 13:25:21 +0200
changeset 734
3cbcc2b6ba41
parent 727
44259699e0b5
child 802
9286a6e61291
child 965
3ef3f4174c2b
permissions
-rw-r--r--

8010785: JDK 8 build on Linux fails with new build mechanism
Reviewed-by: dholmes, tbell

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

mercurial