common/autoconf/jdk-options.m4

Wed, 23 Jan 2013 11:42:29 +0100

author
erikj
date
Wed, 23 Jan 2013 11:42:29 +0100
changeset 602
0d46733cfffb
parent 575
6f8f7a5449f6
child 656
e2057191f6da
permissions
-rw-r--r--

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

mercurial