< prev index next >

make/autoconf/hotspot.m4

Print this page




   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # All valid JVM features, regardless of platform
  27 VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
  28     graal vm-structs jni-check services management all-gcs nmt cds \
  29     static-build link-time-opt aot"
  30 
  31 # All valid JVM variants
  32 VALID_JVM_VARIANTS="server client minimal core zero custom"
  33 
  34 ###############################################################################
  35 # Check if the specified JVM variant should be built. To be used in shell if
  36 # constructs, like this:
  37 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
  38 #
  39 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
  40 
  41 # Definition kept in one line to allow inlining in if statements.
  42 # Additional [] needed to keep m4 from mangling shell constructs.
  43 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
  44 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
  45 
  46 ###############################################################################
  47 # Check if the specified JVM features are explicitly enabled. To be used in
  48 # shell if constructs, like this:


 288     HOTSPOT_TARGET_CPU=arm_32
 289     HOTSPOT_TARGET_CPU_DEFINE="ARM32"
 290   elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then
 291     HOTSPOT_TARGET_CPU=arm_64
 292     HOTSPOT_TARGET_CPU_ARCH=arm
 293   fi
 294 
 295   # Verify that dependencies are met for explicitly set features.
 296   if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then
 297     AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services'])
 298   fi
 299 
 300   if HOTSPOT_CHECK_JVM_FEATURE(management) && ! HOTSPOT_CHECK_JVM_FEATURE(nmt); then
 301     AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
 302   fi
 303 
 304   if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
 305     AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
 306   fi
 307 
 308   if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
 309     AC_MSG_ERROR([Specified JVM feature 'compiler2' requires feature 'all-gcs'])
 310   fi
 311 
 312   if HOTSPOT_CHECK_JVM_FEATURE(vm-structs) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
 313     AC_MSG_ERROR([Specified JVM feature 'vm-structs' requires feature 'all-gcs'])
 314   fi
 315 
 316   # Turn on additional features based on other parts of configure
 317   if test "x$INCLUDE_DTRACE" = "xtrue"; then
 318     JVM_FEATURES="$JVM_FEATURES dtrace"
 319   else
 320     if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
 321       AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
 322     fi
 323   fi
 324 
 325   if test "x$STATIC_BUILD" = "xtrue"; then
 326     JVM_FEATURES="$JVM_FEATURES static-build"
 327   else
 328     if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
 329       AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
 330     fi
 331   fi
 332 
 333   if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then


 378       AC_MSG_RESULT([yes])
 379     fi
 380     JVM_FEATURES_aot="aot"
 381   else
 382     if test "x$enable_aot" = "xno"; then
 383       AC_MSG_RESULT([no, forced])
 384     else
 385       AC_MSG_RESULT([no])
 386     fi
 387     JVM_FEATURES_aot=""
 388   fi
 389 
 390   if test "x$OPENJDK_TARGET_CPU" = xarm ; then
 391     # Default to use link time optimizations on minimal on arm
 392     JVM_FEATURES_link_time_opt="link-time-opt"
 393   else
 394     JVM_FEATURES_link_time_opt=""
 395   fi
 396 
 397   # All variants but minimal (and custom) get these features
 398   NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti vm-structs jni-check services management all-gcs nmt"
 399   if test "x$ENABLE_CDS" = "xtrue"; then
 400     NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
 401   fi
 402 
 403   # Enable default features depending on variant.
 404   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
 405   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 406   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
 407   JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt"
 408   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
 409   JVM_FEATURES_custom="$JVM_FEATURES"
 410 
 411   AC_SUBST(JVM_FEATURES_server)
 412   AC_SUBST(JVM_FEATURES_client)
 413   AC_SUBST(JVM_FEATURES_core)
 414   AC_SUBST(JVM_FEATURES_minimal)
 415   AC_SUBST(JVM_FEATURES_zero)
 416   AC_SUBST(JVM_FEATURES_custom)
 417 
 418   # Used for verification of Makefiles by check-jvm-feature
 419   AC_SUBST(VALID_JVM_FEATURES)
 420 
 421   # We don't support --with-jvm-interpreter anymore, use zero instead.
 422   BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
 423 ])
 424 
 425 ###############################################################################
 426 # Finalize JVM features once all setup is complete, including custom setup.
 427 #
 428 AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES],
 429 [
 430   for variant in $JVM_VARIANTS; do
 431     AC_MSG_CHECKING([JVM features for JVM variant '$variant'])
 432     features_var_name=JVM_FEATURES_$variant
 433     JVM_FEATURES_FOR_VARIANT=${!features_var_name}
 434 
 435     # Filter out user-requested disabled features
 436     BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT, $DISABLED_JVM_FEATURES)
 437 
 438     # Keep feature lists sorted and free of duplicates
 439     BASIC_SORT_LIST(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT)
 440 
 441     # Update real feature set variable
 442     eval $features_var_name='"'$JVM_FEATURES_FOR_VARIANT'"'
 443     AC_MSG_RESULT(["$JVM_FEATURES_FOR_VARIANT"])






 444 
 445     # Validate features (for configure script errors, not user errors)
 446     BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES_FOR_VARIANT, $VALID_JVM_FEATURES)
 447     if test "x$INVALID_FEATURES" != x; then
 448       AC_MSG_ERROR([Internal configure script error. Invalid JVM feature(s): $INVALID_FEATURES])
 449     fi
 450   done
 451 ])
 452 
 453 ################################################################################
 454 #
 455 # Specify which sources will be used to build the 64-bit ARM port
 456 #
 457 # --with-cpu-port=arm64   will use hotspot/src/cpu/arm
 458 # --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64
 459 #
 460 AC_DEFUN([SETUP_HOTSPOT_TARGET_CPU_PORT],
 461 [
 462   AC_ARG_WITH(cpu-port, [AS_HELP_STRING([--with-cpu-port],
 463       [specify sources to use for Hotspot 64-bit ARM port (arm64,aarch64) @<:@aarch64@:>@ ])])




   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # All valid JVM features, regardless of platform
  27 VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
  28     graal vm-structs jni-check services management cmsgc g1gc parallelgc serialgc nmt cds \
  29     static-build link-time-opt aot"
  30 
  31 # All valid JVM variants
  32 VALID_JVM_VARIANTS="server client minimal core zero custom"
  33 
  34 ###############################################################################
  35 # Check if the specified JVM variant should be built. To be used in shell if
  36 # constructs, like this:
  37 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
  38 #
  39 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
  40 
  41 # Definition kept in one line to allow inlining in if statements.
  42 # Additional [] needed to keep m4 from mangling shell constructs.
  43 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
  44 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
  45 
  46 ###############################################################################
  47 # Check if the specified JVM features are explicitly enabled. To be used in
  48 # shell if constructs, like this:


 288     HOTSPOT_TARGET_CPU=arm_32
 289     HOTSPOT_TARGET_CPU_DEFINE="ARM32"
 290   elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then
 291     HOTSPOT_TARGET_CPU=arm_64
 292     HOTSPOT_TARGET_CPU_ARCH=arm
 293   fi
 294 
 295   # Verify that dependencies are met for explicitly set features.
 296   if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then
 297     AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services'])
 298   fi
 299 
 300   if HOTSPOT_CHECK_JVM_FEATURE(management) && ! HOTSPOT_CHECK_JVM_FEATURE(nmt); then
 301     AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
 302   fi
 303 
 304   if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
 305     AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
 306   fi
 307 
 308   if HOTSPOT_CHECK_JVM_FEATURE(cmsgc) && ! HOTSPOT_CHECK_JVM_FEATURE(serialgc); then
 309     AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])




 310   fi
 311 
 312   # Turn on additional features based on other parts of configure
 313   if test "x$INCLUDE_DTRACE" = "xtrue"; then
 314     JVM_FEATURES="$JVM_FEATURES dtrace"
 315   else
 316     if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
 317       AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
 318     fi
 319   fi
 320 
 321   if test "x$STATIC_BUILD" = "xtrue"; then
 322     JVM_FEATURES="$JVM_FEATURES static-build"
 323   else
 324     if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
 325       AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
 326     fi
 327   fi
 328 
 329   if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then


 374       AC_MSG_RESULT([yes])
 375     fi
 376     JVM_FEATURES_aot="aot"
 377   else
 378     if test "x$enable_aot" = "xno"; then
 379       AC_MSG_RESULT([no, forced])
 380     else
 381       AC_MSG_RESULT([no])
 382     fi
 383     JVM_FEATURES_aot=""
 384   fi
 385 
 386   if test "x$OPENJDK_TARGET_CPU" = xarm ; then
 387     # Default to use link time optimizations on minimal on arm
 388     JVM_FEATURES_link_time_opt="link-time-opt"
 389   else
 390     JVM_FEATURES_link_time_opt=""
 391   fi
 392 
 393   # All variants but minimal (and custom) get these features
 394   NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc jni-check jvmti management nmt services vm-structs"
 395   if test "x$ENABLE_CDS" = "xtrue"; then
 396     NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
 397   fi
 398 
 399   # Enable default features depending on variant.
 400   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
 401   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 402   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
 403   JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt"
 404   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
 405   JVM_FEATURES_custom="$JVM_FEATURES"
 406 
 407   AC_SUBST(JVM_FEATURES_server)
 408   AC_SUBST(JVM_FEATURES_client)
 409   AC_SUBST(JVM_FEATURES_core)
 410   AC_SUBST(JVM_FEATURES_minimal)
 411   AC_SUBST(JVM_FEATURES_zero)
 412   AC_SUBST(JVM_FEATURES_custom)
 413 
 414   # Used for verification of Makefiles by check-jvm-feature
 415   AC_SUBST(VALID_JVM_FEATURES)
 416 
 417   # We don't support --with-jvm-interpreter anymore, use zero instead.
 418   BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
 419 ])
 420 
 421 ###############################################################################
 422 # Finalize JVM features once all setup is complete, including custom setup.
 423 #
 424 AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES],
 425 [
 426   for variant in $JVM_VARIANTS; do
 427     AC_MSG_CHECKING([JVM features for JVM variant '$variant'])
 428     features_var_name=JVM_FEATURES_$variant
 429     JVM_FEATURES_FOR_VARIANT=${!features_var_name}
 430 
 431     # Filter out user-requested disabled features
 432     BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT, $DISABLED_JVM_FEATURES)
 433 
 434     # Keep feature lists sorted and free of duplicates
 435     BASIC_SORT_LIST(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT)
 436 
 437     # Update real feature set variable
 438     eval $features_var_name='"'$JVM_FEATURES_FOR_VARIANT'"'
 439     AC_MSG_RESULT(["$JVM_FEATURES_FOR_VARIANT"])
 440 
 441     # Verify that we have at least one gc selected
 442     GC_FEATURES=`$ECHO $JVM_FEATURES_FOR_VARIANT | $GREP gc`
 443     if test "x$GC_FEATURES" = x; then
 444       AC_MSG_WARN([Invalid JVM features: No gc selected for variant $variant.])
 445     fi
 446 
 447     # Validate features (for configure script errors, not user errors)
 448     BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES_FOR_VARIANT, $VALID_JVM_FEATURES)
 449     if test "x$INVALID_FEATURES" != x; then
 450       AC_MSG_ERROR([Internal configure script error. Invalid JVM feature(s): $INVALID_FEATURES])
 451     fi
 452   done
 453 ])
 454 
 455 ################################################################################
 456 #
 457 # Specify which sources will be used to build the 64-bit ARM port
 458 #
 459 # --with-cpu-port=arm64   will use hotspot/src/cpu/arm
 460 # --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64
 461 #
 462 AC_DEFUN([SETUP_HOTSPOT_TARGET_CPU_PORT],
 463 [
 464   AC_ARG_WITH(cpu-port, [AS_HELP_STRING([--with-cpu-port],
 465       [specify sources to use for Hotspot 64-bit ARM port (arm64,aarch64) @<:@aarch64@:>@ ])])


< prev index next >