jdk-options.m4 revision 837:174a54ce39c4
1258945Sroberto# 2258945Sroberto# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 3258945Sroberto# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4258945Sroberto# 5258945Sroberto# This code is free software; you can redistribute it and/or modify it 6258945Sroberto# under the terms of the GNU General Public License version 2 only, as 7258945Sroberto# published by the Free Software Foundation. Oracle designates this 8258945Sroberto# particular file as subject to the "Classpath" exception as provided 9258945Sroberto# by Oracle in the LICENSE file that accompanied this code. 10258945Sroberto# 11258945Sroberto# This code is distributed in the hope that it will be useful, but WITHOUT 12258945Sroberto# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13258945Sroberto# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14258945Sroberto# version 2 for more details (a copy is included in the LICENSE file that 15258945Sroberto# accompanied this code). 16258945Sroberto# 17258945Sroberto# You should have received a copy of the GNU General Public License version 18258945Sroberto# 2 along with this work; if not, write to the Free Software Foundation, 19258945Sroberto# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20258945Sroberto# 21258945Sroberto# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22258945Sroberto# or visit www.oracle.com if you need additional information or have any 23258945Sroberto# questions. 24258945Sroberto# 25258945Sroberto 26258945SrobertoAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT], 27258945Sroberto[ 28258945Sroberto ############################################################################### 29258945Sroberto # 30258945Sroberto # Check which variant of the JDK that we want to build. 31258945Sroberto # Currently we have: 32258945Sroberto # normal: standard edition 33258945Sroberto # but the custom make system may add other variants 34258945Sroberto # 35258945Sroberto # Effectively the JDK variant gives a name to a specific set of 36258945Sroberto # modules to compile into the JDK. In the future, these modules 37258945Sroberto # might even be Jigsaw modules. 38258945Sroberto # 39258945Sroberto AC_MSG_CHECKING([which variant of the JDK to build]) 40258945Sroberto AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant], 41258945Sroberto [JDK variant to build (normal) @<:@normal@:>@])]) 42258945Sroberto 43258945Sroberto if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then 44258945Sroberto JDK_VARIANT="normal" 45258945Sroberto else 46258945Sroberto AC_MSG_ERROR([The available JDK variants are: normal]) 47258945Sroberto fi 48258945Sroberto 49258945Sroberto AC_SUBST(JDK_VARIANT) 50258945Sroberto 51258945Sroberto AC_MSG_RESULT([$JDK_VARIANT]) 52258945Sroberto]) 53258945Sroberto 54258945SrobertoAC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS], 55258945Sroberto[ 56258945Sroberto 57258945Sroberto ############################################################################### 58258945Sroberto # 59258945Sroberto # Check which variants of the JVM that we want to build. 60258945Sroberto # Currently we have: 61258945Sroberto # server: normal interpreter and a tiered C1/C2 compiler 62258945Sroberto # client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms) 63258945Sroberto # minimal1: reduced form of client with optional VM services and features stripped out 64258945Sroberto # kernel: kernel footprint JVM that passes the TCK without major performance problems, 65258945Sroberto # ie normal interpreter and C1, only the serial GC, kernel jvmti etc 66258945Sroberto # zero: no machine code interpreter, no compiler 67258945Sroberto # zeroshark: zero interpreter and shark/llvm compiler backend 68258945Sroberto AC_MSG_CHECKING([which variants of the JVM to build]) 69258945Sroberto AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], 70258945Sroberto [JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark) @<:@server@:>@])]) 71258945Sroberto 72258945Sroberto if test "x$with_jvm_variants" = x; then 73258945Sroberto with_jvm_variants="server" 74258945Sroberto fi 75258945Sroberto 76258945Sroberto JVM_VARIANTS=",$with_jvm_variants," 77258945Sroberto TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'` 78258945Sroberto 79258945Sroberto if test "x$TEST_VARIANTS" != "x,"; then 80258945Sroberto AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark]) 81258945Sroberto fi 82258945Sroberto AC_MSG_RESULT([$with_jvm_variants]) 83258945Sroberto 84258945Sroberto JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'` 85258945Sroberto JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'` 86258945Sroberto JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'` 87258945Sroberto JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'` 88258945Sroberto JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'` 89258945Sroberto JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'` 90258945Sroberto 91258945Sroberto if test "x$JVM_VARIANT_CLIENT" = xtrue; then 92258945Sroberto if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 93258945Sroberto AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.]) 94258945Sroberto fi 95258945Sroberto fi 96258945Sroberto if test "x$JVM_VARIANT_KERNEL" = xtrue; then 97258945Sroberto if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 98258945Sroberto AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.]) 99258945Sroberto fi 100258945Sroberto fi 101258945Sroberto if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then 102258945Sroberto if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 103258945Sroberto AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.]) 104258945Sroberto fi 105258945Sroberto fi 106258945Sroberto 107258945Sroberto # Replace the commas with AND for use in the build directory name. 108258945Sroberto ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'` 109258945Sroberto 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/'` 110258945Sroberto if test "x$COUNT_VARIANTS" != "x,1"; then 111258945Sroberto BUILDING_MULTIPLE_JVM_VARIANTS=yes 112258945Sroberto else 113258945Sroberto BUILDING_MULTIPLE_JVM_VARIANTS=no 114258945Sroberto fi 115258945Sroberto 116258945Sroberto AC_SUBST(JVM_VARIANTS) 117258945Sroberto AC_SUBST(JVM_VARIANT_SERVER) 118258945Sroberto AC_SUBST(JVM_VARIANT_CLIENT) 119258945Sroberto AC_SUBST(JVM_VARIANT_MINIMAL1) 120258945Sroberto AC_SUBST(JVM_VARIANT_KERNEL) 121258945Sroberto AC_SUBST(JVM_VARIANT_ZERO) 122258945Sroberto AC_SUBST(JVM_VARIANT_ZEROSHARK) 123258945Sroberto 124258945Sroberto INCLUDE_SA=true 125258945Sroberto if test "x$JVM_VARIANT_ZERO" = xtrue ; then 126258945Sroberto INCLUDE_SA=false 127258945Sroberto fi 128258945Sroberto if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then 129258945Sroberto INCLUDE_SA=false 130258945Sroberto fi 131258945Sroberto AC_SUBST(INCLUDE_SA) 132258945Sroberto 133258945Sroberto if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 134258945Sroberto MACOSX_UNIVERSAL="true" 135258945Sroberto fi 136258945Sroberto 137258945Sroberto AC_SUBST(MACOSX_UNIVERSAL) 138258945Sroberto]) 139258945Sroberto 140258945SrobertoAC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL], 141258945Sroberto[ 142258945Sroberto ############################################################################### 143258945Sroberto # 144258945Sroberto # Set the debug level 145258945Sroberto # release: no debug information, all optimizations, no asserts. 146258945Sroberto # fastdebug: debug information (-g), all optimizations, all asserts 147258945Sroberto # slowdebug: debug information (-g), no optimizations, all asserts 148258945Sroberto # 149258945Sroberto DEBUG_LEVEL="release" 150258945Sroberto AC_MSG_CHECKING([which debug level to use]) 151258945Sroberto AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], 152258945Sroberto [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])], 153258945Sroberto [ 154258945Sroberto ENABLE_DEBUG="${enableval}" 155258945Sroberto DEBUG_LEVEL="fastdebug" 156258945Sroberto ], [ENABLE_DEBUG="no"]) 157258945Sroberto 158258945Sroberto AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level], 159258945Sroberto [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])], 160258945Sroberto [ 161258945Sroberto DEBUG_LEVEL="${withval}" 162258945Sroberto if test "x$ENABLE_DEBUG" = xyes; then 163258945Sroberto AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.]) 164258945Sroberto fi 165258945Sroberto ]) 166258945Sroberto AC_MSG_RESULT([$DEBUG_LEVEL]) 167258945Sroberto 168258945Sroberto if test "x$DEBUG_LEVEL" != xrelease && \ 169258945Sroberto test "x$DEBUG_LEVEL" != xfastdebug && \ 170258945Sroberto test "x$DEBUG_LEVEL" != xslowdebug; then 171258945Sroberto AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug]) 172258945Sroberto fi 173258945Sroberto 174258945Sroberto 175258945Sroberto ############################################################################### 176258945Sroberto # 177258945Sroberto # Setup legacy vars/targets and new vars to deal with different debug levels. 178258945Sroberto # 179258945Sroberto 180258945Sroberto case $DEBUG_LEVEL in 181258945Sroberto release ) 182258945Sroberto VARIANT="OPT" 183258945Sroberto FASTDEBUG="false" 184258945Sroberto DEBUG_CLASSFILES="false" 185258945Sroberto BUILD_VARIANT_RELEASE="" 186258945Sroberto HOTSPOT_DEBUG_LEVEL="product" 187258945Sroberto HOTSPOT_EXPORT="product" 188258945Sroberto ;; 189258945Sroberto fastdebug ) 190258945Sroberto VARIANT="DBG" 191258945Sroberto FASTDEBUG="true" 192258945Sroberto DEBUG_CLASSFILES="true" 193258945Sroberto BUILD_VARIANT_RELEASE="-fastdebug" 194258945Sroberto HOTSPOT_DEBUG_LEVEL="fastdebug" 195258945Sroberto HOTSPOT_EXPORT="fastdebug" 196258945Sroberto ;; 197258945Sroberto slowdebug ) 198258945Sroberto VARIANT="DBG" 199258945Sroberto FASTDEBUG="false" 200258945Sroberto DEBUG_CLASSFILES="true" 201258945Sroberto BUILD_VARIANT_RELEASE="-debug" 202258945Sroberto HOTSPOT_DEBUG_LEVEL="jvmg" 203258945Sroberto HOTSPOT_EXPORT="debug" 204258945Sroberto ;; 205258945Sroberto esac 206258945Sroberto 207258945Sroberto ##### 208258945Sroberto # Generate the legacy makefile targets for hotspot. 209258945Sroberto # The hotspot api for selecting the build artifacts, really, needs to be improved. 210258945Sroberto # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to 211258945Sroberto # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc 212258945Sroberto # But until then ... 213258945Sroberto HOTSPOT_TARGET="" 214258945Sroberto 215258945Sroberto if test "x$JVM_VARIANT_SERVER" = xtrue; then 216258945Sroberto HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} " 217258945Sroberto fi 218290000Sglebius 219290000Sglebius if test "x$JVM_VARIANT_CLIENT" = xtrue; then 220290000Sglebius HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 " 221258945Sroberto fi 222258945Sroberto 223258945Sroberto if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then 224258945Sroberto HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 " 225258945Sroberto fi 226258945Sroberto 227258945Sroberto if test "x$JVM_VARIANT_KERNEL" = xtrue; then 228258945Sroberto HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel " 229258945Sroberto fi 230258945Sroberto 231258945Sroberto if test "x$JVM_VARIANT_ZERO" = xtrue; then 232258945Sroberto HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero " 233258945Sroberto fi 234258945Sroberto 235258945Sroberto if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then 236258945Sroberto HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark " 237258945Sroberto fi 238258945Sroberto 239258945Sroberto HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" 240258945Sroberto 241258945Sroberto # On Macosx universal binaries are produced, but they only contain 242258945Sroberto # 64 bit intel. This invalidates control of which jvms are built 243258945Sroberto # from configure, but only server is valid anyway. Fix this 244258945Sroberto # when hotspot makefiles are rewritten. 245258945Sroberto if test "x$MACOSX_UNIVERSAL" = xtrue; then 246258945Sroberto HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT} 247258945Sroberto fi 248258945Sroberto 249258945Sroberto ##### 250258945Sroberto 251258945Sroberto AC_SUBST(DEBUG_LEVEL) 252258945Sroberto AC_SUBST(VARIANT) 253258945Sroberto AC_SUBST(FASTDEBUG) 254258945Sroberto AC_SUBST(DEBUG_CLASSFILES) 255258945Sroberto AC_SUBST(BUILD_VARIANT_RELEASE) 256258945Sroberto]) 257258945Sroberto 258258945Sroberto 259258945Sroberto############################################################################### 260258945Sroberto# 261258945Sroberto# Should we build only OpenJDK even if closed sources are present? 262258945Sroberto# 263258945SrobertoAC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM], 264258945Sroberto[ 265258945Sroberto AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only], 266258945Sroberto [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"]) 267258945Sroberto 268258945Sroberto AC_MSG_CHECKING([for presence of closed sources]) 269258945Sroberto if test -d "$SRC_ROOT/jdk/src/closed"; then 270258945Sroberto CLOSED_SOURCE_PRESENT=yes 271258945Sroberto else 272258945Sroberto CLOSED_SOURCE_PRESENT=no 273258945Sroberto fi 274258945Sroberto AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT]) 275258945Sroberto 276258945Sroberto AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)]) 277258945Sroberto SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only" 278258945Sroberto AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE]) 279258945Sroberto 280258945Sroberto if test "x$CLOSED_SOURCE_PRESENT" = xno; then 281258945Sroberto OPENJDK=true 282258945Sroberto if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then 283258945Sroberto AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense]) 284258945Sroberto fi 285258945Sroberto else 286258945Sroberto if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then 287258945Sroberto OPENJDK=true 288258945Sroberto else 289258945Sroberto OPENJDK=false 290258945Sroberto fi 291258945Sroberto fi 292258945Sroberto 293258945Sroberto if test "x$OPENJDK" = "xtrue"; then 294258945Sroberto SET_OPENJDK="OPENJDK=true" 295258945Sroberto fi 296258945Sroberto 297258945Sroberto AC_SUBST(SET_OPENJDK) 298258945Sroberto]) 299258945Sroberto 300258945SrobertoAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], 301258945Sroberto[ 302258945Sroberto 303258945Sroberto ############################################################################### 304258945Sroberto # 305258945Sroberto # Should we build a JDK/JVM with headful support (ie a graphical ui)? 306258945Sroberto # We always build headless support. 307258945Sroberto # 308258945Sroberto AC_MSG_CHECKING([headful support]) 309258945Sroberto AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful], 310258945Sroberto [disable building headful support (graphical UI support) @<:@enabled@:>@])], 311258945Sroberto [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes]) 312258945Sroberto 313258945Sroberto SUPPORT_HEADLESS=yes 314258945Sroberto BUILD_HEADLESS="BUILD_HEADLESS:=true" 315258945Sroberto 316258945Sroberto if test "x$SUPPORT_HEADFUL" = xyes; then 317258945Sroberto # We are building both headful and headless. 318258945Sroberto headful_msg="include support for both headful and headless" 319258945Sroberto fi 320258945Sroberto 321258945Sroberto if test "x$SUPPORT_HEADFUL" = xno; then 322258945Sroberto # Thus we are building headless only. 323258945Sroberto BUILD_HEADLESS="BUILD_HEADLESS:=true" 324258945Sroberto headful_msg="headless only" 325258945Sroberto fi 326258945Sroberto 327258945Sroberto AC_MSG_RESULT([$headful_msg]) 328258945Sroberto 329258945Sroberto AC_SUBST(SUPPORT_HEADLESS) 330258945Sroberto AC_SUBST(SUPPORT_HEADFUL) 331258945Sroberto AC_SUBST(BUILD_HEADLESS) 332258945Sroberto 333258945Sroberto # Control wether Hotspot runs Queens test after build. 334258945Sroberto AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build], 335258945Sroberto [run the Queens test after Hotspot build @<:@disabled@:>@])],, 336258945Sroberto [enable_hotspot_test_in_build=no]) 337258945Sroberto if test "x$enable_hotspot_test_in_build" = "xyes"; then 338258945Sroberto TEST_IN_BUILD=true 339258945Sroberto else 340258945Sroberto TEST_IN_BUILD=false 341258945Sroberto fi 342258945Sroberto AC_SUBST(TEST_IN_BUILD) 343258945Sroberto 344258945Sroberto ############################################################################### 345258945Sroberto # 346258945Sroberto # Choose cacerts source file 347258945Sroberto # 348258945Sroberto AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file], 349258945Sroberto [specify alternative cacerts file])]) 350258945Sroberto if test "x$with_cacerts_file" != x; then 351258945Sroberto CACERTS_FILE=$with_cacerts_file 352258945Sroberto else 353258945Sroberto CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts 354258945Sroberto fi 355258945Sroberto AC_SUBST(CACERTS_FILE) 356258945Sroberto 357258945Sroberto ############################################################################### 358258945Sroberto # 359258945Sroberto # Enable or disable unlimited crypto 360258945Sroberto # 361258945Sroberto AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto], 362258945Sroberto [Enable unlimited crypto policy @<:@disabled@:>@])],, 363258945Sroberto [enable_unlimited_crypto=no]) 364258945Sroberto if test "x$enable_unlimited_crypto" = "xyes"; then 365258945Sroberto UNLIMITED_CRYPTO=true 366258945Sroberto else 367258945Sroberto UNLIMITED_CRYPTO=false 368258945Sroberto fi 369258945Sroberto AC_SUBST(UNLIMITED_CRYPTO) 370258945Sroberto 371258945Sroberto ############################################################################### 372258945Sroberto # 373258945Sroberto # Enable or disable the elliptic curve crypto implementation 374258945Sroberto # 375258945Sroberto AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC], 376258945Sroberto [ 377258945Sroberto AC_MSG_CHECKING([if elliptic curve crypto implementation is present]) 378258945Sroberto 379258945Sroberto if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then 380258945Sroberto ENABLE_INTREE_EC=yes 381258945Sroberto AC_MSG_RESULT([yes]) 382258945Sroberto else 383258945Sroberto ENABLE_INTREE_EC=no 384258945Sroberto AC_MSG_RESULT([no]) 385258945Sroberto fi 386258945Sroberto 387258945Sroberto AC_SUBST(ENABLE_INTREE_EC) 388258945Sroberto ]) 389258945Sroberto 390258945Sroberto ############################################################################### 391258945Sroberto # 392258945Sroberto # Compress jars 393258945Sroberto # 394258945Sroberto COMPRESS_JARS=false 395258945Sroberto 396258945Sroberto AC_SUBST(COMPRESS_JARS) 397258945Sroberto]) 398258945Sroberto 399258945Sroberto############################################################################### 400258945Sroberto# 401258945Sroberto# Setup version numbers 402258945Sroberto# 403258945SrobertoAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], 404258945Sroberto[ 405258945Sroberto # Source the version numbers 406258945Sroberto . $AUTOCONF_DIR/version-numbers 407258945Sroberto 408258945Sroberto # Get the settings from parameters 409258945Sroberto AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone], 410258945Sroberto [Set milestone value for build @<:@internal@:>@])]) 411258945Sroberto if test "x$with_milestone" = xyes; then 412258945Sroberto AC_MSG_ERROR([Milestone must have a value]) 413258945Sroberto elif test "x$with_milestone" != x; then 414258945Sroberto MILESTONE="$with_milestone" 415258945Sroberto fi 416258945Sroberto if test "x$MILESTONE" = x; then 417258945Sroberto MILESTONE=internal 418258945Sroberto fi 419258945Sroberto 420258945Sroberto AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version], 421258945Sroberto [Set update version value for build @<:@b00@:>@])]) 422258945Sroberto if test "x$with_update_version" = xyes; then 423258945Sroberto AC_MSG_ERROR([Update version must have a value]) 424258945Sroberto elif test "x$with_update_version" != x; then 425258945Sroberto JDK_UPDATE_VERSION="$with_update_version" 426258945Sroberto fi 427258945Sroberto 428258945Sroberto AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix], 429258945Sroberto [Add a custom string to the version string if build number isn't set.@<:@username_builddateb00@:>@])]) 430258945Sroberto if test "x$with_user_release_suffix" = xyes; then 431258945Sroberto AC_MSG_ERROR([Release suffix must have a value]) 432258945Sroberto elif test "x$with_user_release_suffix" != x; then 433258945Sroberto USER_RELEASE_SUFFIX="$with_user_release_suffix" 434258945Sroberto fi 435258945Sroberto 436258945Sroberto AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number], 437258945Sroberto [Set build number value for build @<:@b00@:>@])]) 438258945Sroberto if test "x$with_build_number" = xyes; then 439258945Sroberto AC_MSG_ERROR([Build number must have a value]) 440258945Sroberto elif test "x$with_build_number" != x; then 441258945Sroberto JDK_BUILD_NUMBER="$with_build_number" 442258945Sroberto fi 443258945Sroberto # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set 444 if test "x$JDK_BUILD_NUMBER" = x; then 445 JDK_BUILD_NUMBER=b00 446 if test "x$USER_RELEASE_SUFFIX" = x; then 447 BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` 448 # Avoid [:alnum:] since it depends on the locale. 449 CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'` 450 USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 451 fi 452 fi 453 454 # Now set the JDK version, milestone, build number etc. 455 AC_SUBST(USER_RELEASE_SUFFIX) 456 AC_SUBST(JDK_MAJOR_VERSION) 457 AC_SUBST(JDK_MINOR_VERSION) 458 AC_SUBST(JDK_MICRO_VERSION) 459 AC_SUBST(JDK_UPDATE_VERSION) 460 AC_SUBST(JDK_BUILD_NUMBER) 461 AC_SUBST(MILESTONE) 462 AC_SUBST(LAUNCHER_NAME) 463 AC_SUBST(PRODUCT_NAME) 464 AC_SUBST(PRODUCT_SUFFIX) 465 AC_SUBST(JDK_RC_PLATFORM_NAME) 466 AC_SUBST(COMPANY_NAME) 467 AC_SUBST(MACOSX_BUNDLE_NAME_BASE) 468 AC_SUBST(MACOSX_BUNDLE_ID_BASE) 469 470 COPYRIGHT_YEAR=`date +'%Y'` 471 AC_SUBST(COPYRIGHT_YEAR) 472 473 if test "x$JDK_UPDATE_VERSION" != x; then 474 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}" 475 else 476 JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}" 477 fi 478 AC_SUBST(JDK_VERSION) 479 480 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` 481 AC_SUBST(COOKED_BUILD_NUMBER) 482]) 483 484AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS], 485[ 486 HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET" 487 AC_SUBST(HOTSPOT_MAKE_ARGS) 488 489 # The name of the Service Agent jar. 490 SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}" 491 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 492 SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}" 493 fi 494 AC_SUBST(SALIB_NAME) 495]) 496 497AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], 498[ 499 # 500 # ENABLE_DEBUG_SYMBOLS 501 # This must be done after the toolchain is setup, since we're looking at objcopy. 502 # 503 AC_ARG_ENABLE([debug-symbols], 504 [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])]) 505 506 AC_MSG_CHECKING([if we should generate debug symbols]) 507 508 if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then 509 # explicit enabling of enable-debug-symbols and can't find objcopy 510 # this is an error 511 AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols]) 512 fi 513 514 if test "x$enable_debug_symbols" = "xyes"; then 515 ENABLE_DEBUG_SYMBOLS=true 516 elif test "x$enable_debug_symbols" = "xno"; then 517 ENABLE_DEBUG_SYMBOLS=false 518 else 519 # default on macosx is false 520 if test "x$OPENJDK_TARGET_OS" = xmacosx; then 521 ENABLE_DEBUG_SYMBOLS=false 522 # Default is on if objcopy is found, otherwise off 523 elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then 524 ENABLE_DEBUG_SYMBOLS=true 525 else 526 ENABLE_DEBUG_SYMBOLS=false 527 fi 528 fi 529 530 AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS]) 531 532 # 533 # ZIP_DEBUGINFO_FILES 534 # 535 AC_MSG_CHECKING([if we should zip debug-info files]) 536 AC_ARG_ENABLE([zip-debug-info], 537 [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])], 538 [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"]) 539 AC_MSG_RESULT([${enable_zip_debug_info}]) 540 541 if test "x${enable_zip_debug_info}" = "xno"; then 542 ZIP_DEBUGINFO_FILES=false 543 else 544 ZIP_DEBUGINFO_FILES=true 545 fi 546 547 AC_SUBST(ENABLE_DEBUG_SYMBOLS) 548 AC_SUBST(ZIP_DEBUGINFO_FILES) 549 AC_SUBST(CFLAGS_DEBUG_SYMBOLS) 550 AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) 551]) 552 553# Support for customization of the build process. Some build files 554# will include counterparts from this location, if they exist. This allows 555# for a degree of customization of the build targets and the rules/recipes 556# to create them 557AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir], 558[use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir]) 559AC_SUBST(CUSTOM_MAKE_DIR) 560