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