common/autoconf/jdk-options.m4

Sat, 19 Oct 2013 08:51:39 -0700

author
amurillo
date
Sat, 19 Oct 2013 08:51:39 -0700
changeset 855
ac09e62d5e6b
parent 839
174a54ce39c4
parent 854
22c6f0b7e2b5
child 874
dfbc93f26f38
permissions
-rw-r--r--

Merge

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