< prev index next >

make/autoconf/hotspot.m4

Print this page




   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 jfr"
  30 
  31 # Deprecated JVM features (these are ignored, but with a warning)
  32 DEPRECATED_JVM_FEATURES="trace"
  33 
  34 # All valid JVM variants
  35 VALID_JVM_VARIANTS="server client minimal core zero custom"
  36 
  37 ###############################################################################
  38 # Check if the specified JVM variant should be built. To be used in shell if
  39 # constructs, like this:
  40 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
  41 #
  42 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
  43 
  44 # Definition kept in one line to allow inlining in if statements.
  45 # Additional [] needed to keep m4 from mangling shell constructs.
  46 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
  47 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
  48 
  49 ###############################################################################
  50 # Check if the specified JVM features are explicitly enabled. To be used in
  51 # shell if constructs, like this:
  52 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
  53 #
  54 # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
  55 
  56 # Definition kept in one line to allow inlining in if statements.
  57 # Additional [] needed to keep m4 from mangling shell constructs.
  58 AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE],
  59 [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
  60 
  61 ###############################################################################
  62 # Check which variants of the JVM that we want to build. Available variants are:
  63 #   server: normal interpreter, and a tiered C1/C2 compiler

  64 #   client: normal interpreter, and C1 (no C2 compiler)
  65 #   minimal: reduced form of client with optional features stripped out
  66 #   core: normal interpreter only, no compiler
  67 #   zero: C++ based interpreter only, no compiler
  68 #   custom: baseline JVM with no default features
  69 #
  70 AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
  71 [
  72   AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
  73       [JVM variants (separated by commas) to build (server,client,minimal,core,zero,custom) @<:@server@:>@])])
  74 
  75   SETUP_HOTSPOT_TARGET_CPU_PORT
  76 
  77   if test "x$with_jvm_variants" = x; then
  78     with_jvm_variants="server"
  79   fi
  80   JVM_VARIANTS_OPT="$with_jvm_variants"
  81 
  82   # Has the user listed more than one variant?
  83   # Additional [] needed to keep m4 from mangling shell constructs.
  84   if [ [[ "$JVM_VARIANTS_OPT" =~ "," ]] ]; then
  85     BUILDING_MULTIPLE_JVM_VARIANTS=true
  86   else
  87     BUILDING_MULTIPLE_JVM_VARIANTS=false
  88   fi
  89   # Replace the commas with AND for use in the build directory name.
  90   JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'`
  91 
  92   AC_MSG_CHECKING([which variants of the JVM to build])
  93   # JVM_VARIANTS is a space-separated list.
  94   # Also use minimal, not minimal1 (which is kept for backwards compatibility).
  95   JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'`
  96   AC_MSG_RESULT([$JVM_VARIANTS])
  97 
  98   # Check that the selected variants are valid
  99   BASIC_GET_NON_MATCHING_VALUES(INVALID_VARIANTS, $JVM_VARIANTS, $VALID_JVM_VARIANTS)
 100   if test "x$INVALID_VARIANTS" != x; then
 101     AC_MSG_NOTICE([Unknown variant(s) specified: "$INVALID_VARIANTS"])
 102     AC_MSG_NOTICE([The available JVM variants are: "$VALID_JVM_VARIANTS"])
 103     AC_MSG_ERROR([Cannot continue])
 104   fi
 105 
 106   # All "special" variants share the same output directory ("server")
 107   VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
 108   BASIC_GET_NON_MATCHING_VALUES(INVALID_MULTIPLE_VARIANTS, $JVM_VARIANTS, $VALID_MULTIPLE_JVM_VARIANTS)
 109   if  test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
 110     AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
 111   fi
 112 
 113   # The "main" variant is the one used by other libs to link against during the
 114   # build.
 115   if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
 116     MAIN_VARIANT_PRIO_ORDER="server client minimal"
 117     for variant in $MAIN_VARIANT_PRIO_ORDER; do
 118       if HOTSPOT_CHECK_JVM_VARIANT($variant); then
 119         JVM_VARIANT_MAIN="$variant"
 120         break
 121       fi
 122     done
 123   else
 124     JVM_VARIANT_MAIN="$JVM_VARIANTS"
 125   fi
 126 
 127   AC_SUBST(JVM_VARIANTS)
 128   AC_SUBST(VALID_JVM_VARIANTS)
 129   AC_SUBST(JVM_VARIANT_MAIN)

 130 
 131   if HOTSPOT_CHECK_JVM_VARIANT(zero); then
 132     # zero behaves as a platform and rewrites these values. This is really weird. :(
 133     # We are guaranteed that we do not build any other variants when building zero.
 134     HOTSPOT_TARGET_CPU=zero
 135     HOTSPOT_TARGET_CPU_ARCH=zero
 136   fi
 137 ])
 138 
 139 ###############################################################################
 140 # Check if dtrace should be enabled and has all prerequisites present.
 141 #
 142 AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
 143 [
 144   # Test for dtrace dependencies
 145   AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@],
 146       [enable dtrace. Default is auto, where dtrace is enabled if all dependencies
 147       are present.])])
 148 
 149   DTRACE_DEP_MISSING=false


 400       AC_MSG_RESULT([no])
 401     fi
 402     JVM_FEATURES_aot=""
 403   fi
 404 
 405   if test "x$OPENJDK_TARGET_CPU" = xarm ; then
 406     # Default to use link time optimizations on minimal on arm
 407     JVM_FEATURES_link_time_opt="link-time-opt"
 408   else
 409     JVM_FEATURES_link_time_opt=""
 410   fi
 411 
 412   # All variants but minimal (and custom) get these features
 413   NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc jni-check jvmti management nmt services vm-structs"
 414   if test "x$ENABLE_CDS" = "xtrue"; then
 415     NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
 416   fi
 417 
 418   # Enable features depending on variant.
 419   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"

 420   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 421   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
 422   JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt"
 423   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
 424   JVM_FEATURES_custom="$JVM_FEATURES"
 425 
 426   AC_SUBST(JVM_FEATURES_server)

 427   AC_SUBST(JVM_FEATURES_client)
 428   AC_SUBST(JVM_FEATURES_core)
 429   AC_SUBST(JVM_FEATURES_minimal)
 430   AC_SUBST(JVM_FEATURES_zero)
 431   AC_SUBST(JVM_FEATURES_custom)
 432 
 433   # Used for verification of Makefiles by check-jvm-feature
 434   AC_SUBST(VALID_JVM_FEATURES)
 435 
 436   # We don't support --with-jvm-interpreter anymore, use zero instead.
 437   BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
 438 ])
 439 
 440 ###############################################################################
 441 # Finalize JVM features once all setup is complete, including custom setup.
 442 #
 443 AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES],
 444 [
 445   for variant in $JVM_VARIANTS; do
 446     AC_MSG_CHECKING([JVM features for JVM variant '$variant'])




   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 jfr no-speculative-cti"
  30 
  31 # Deprecated JVM features (these are ignored, but with a warning)
  32 DEPRECATED_JVM_FEATURES="trace"
  33 
  34 # All valid JVM variants
  35 VALID_JVM_VARIANTS="server client minimal hardened core zero custom"
  36 
  37 ###############################################################################
  38 # Check if the specified JVM variant should be built. To be used in shell if
  39 # constructs, like this:
  40 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
  41 #
  42 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
  43 
  44 # Definition kept in one line to allow inlining in if statements.
  45 # Additional [] needed to keep m4 from mangling shell constructs.
  46 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
  47 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
  48 
  49 ###############################################################################
  50 # Check if the specified JVM features are explicitly enabled. To be used in
  51 # shell if constructs, like this:
  52 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
  53 #
  54 # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
  55 
  56 # Definition kept in one line to allow inlining in if statements.
  57 # Additional [] needed to keep m4 from mangling shell constructs.
  58 AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE],
  59 [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
  60 
  61 ###############################################################################
  62 # Check which variants of the JVM that we want to build. Available variants are:
  63 #   server: normal interpreter, and a tiered C1/C2 compiler
  64 #   hardened: same as server but compiled with speculative calls disabled
  65 #   client: normal interpreter, and C1 (no C2 compiler)
  66 #   minimal: reduced form of client with optional features stripped out
  67 #   core: normal interpreter only, no compiler
  68 #   zero: C++ based interpreter only, no compiler
  69 #   custom: baseline JVM with no default features
  70 #
  71 AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
  72 [
  73   AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
  74       [JVM variants (separated by commas) to build (server,hardened,client,minimal,core,zero,custom) @<:@server@:>@])])
  75 
  76   SETUP_HOTSPOT_TARGET_CPU_PORT
  77 
  78   if test "x$with_jvm_variants" = x; then
  79     with_jvm_variants="server"
  80   fi
  81   JVM_VARIANTS_OPT="$with_jvm_variants"
  82 
  83   # Has the user listed more than one variant?
  84   # Additional [] needed to keep m4 from mangling shell constructs.
  85   if [ [[ "$JVM_VARIANTS_OPT" =~ "," ]] ]; then
  86     BUILDING_MULTIPLE_JVM_VARIANTS=true
  87   else
  88     BUILDING_MULTIPLE_JVM_VARIANTS=false
  89   fi
  90   # Replace the commas with AND for use in the build directory name.
  91   JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'`
  92 
  93   AC_MSG_CHECKING([which variants of the JVM to build])
  94   # JVM_VARIANTS is a space-separated list.
  95   # Also use minimal, not minimal1 (which is kept for backwards compatibility).
  96   JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'`
  97   AC_MSG_RESULT([$JVM_VARIANTS])
  98 
  99   # Check that the selected variants are valid
 100   BASIC_GET_NON_MATCHING_VALUES(INVALID_VARIANTS, $JVM_VARIANTS, $VALID_JVM_VARIANTS)
 101   if test "x$INVALID_VARIANTS" != x; then
 102     AC_MSG_NOTICE([Unknown variant(s) specified: "$INVALID_VARIANTS"])
 103     AC_MSG_NOTICE([The available JVM variants are: "$VALID_JVM_VARIANTS"])
 104     AC_MSG_ERROR([Cannot continue])
 105   fi
 106 
 107   # All "special" variants share the same output directory ("server")
 108   VALID_MULTIPLE_JVM_VARIANTS="server client minimal hardened"
 109   BASIC_GET_NON_MATCHING_VALUES(INVALID_MULTIPLE_VARIANTS, $JVM_VARIANTS, $VALID_MULTIPLE_JVM_VARIANTS)
 110   if  test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
 111     AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
 112   fi
 113 
 114   # The "main" variant is the one used by other libs to link against during the
 115   # build.
 116   if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
 117     MAIN_VARIANT_PRIO_ORDER="server client minimal hardened"
 118     for variant in $MAIN_VARIANT_PRIO_ORDER; do
 119       if HOTSPOT_CHECK_JVM_VARIANT($variant); then
 120         JVM_VARIANT_MAIN="$variant"
 121         break
 122       fi
 123     done
 124   else
 125     JVM_VARIANT_MAIN="$JVM_VARIANTS"
 126   fi
 127 
 128   AC_SUBST(JVM_VARIANTS)
 129   AC_SUBST(VALID_JVM_VARIANTS)
 130   AC_SUBST(JVM_VARIANT_MAIN)
 131   AC_SUBST(VALID_MULTIPLE_JVM_VARIANTS)
 132 
 133   if HOTSPOT_CHECK_JVM_VARIANT(zero); then
 134     # zero behaves as a platform and rewrites these values. This is really weird. :(
 135     # We are guaranteed that we do not build any other variants when building zero.
 136     HOTSPOT_TARGET_CPU=zero
 137     HOTSPOT_TARGET_CPU_ARCH=zero
 138   fi
 139 ])
 140 
 141 ###############################################################################
 142 # Check if dtrace should be enabled and has all prerequisites present.
 143 #
 144 AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
 145 [
 146   # Test for dtrace dependencies
 147   AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@],
 148       [enable dtrace. Default is auto, where dtrace is enabled if all dependencies
 149       are present.])])
 150 
 151   DTRACE_DEP_MISSING=false


 402       AC_MSG_RESULT([no])
 403     fi
 404     JVM_FEATURES_aot=""
 405   fi
 406 
 407   if test "x$OPENJDK_TARGET_CPU" = xarm ; then
 408     # Default to use link time optimizations on minimal on arm
 409     JVM_FEATURES_link_time_opt="link-time-opt"
 410   else
 411     JVM_FEATURES_link_time_opt=""
 412   fi
 413 
 414   # All variants but minimal (and custom) get these features
 415   NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc jni-check jvmti management nmt services vm-structs"
 416   if test "x$ENABLE_CDS" = "xtrue"; then
 417     NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
 418   fi
 419 
 420   # Enable features depending on variant.
 421   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
 422   JVM_FEATURES_hardened="$JVM_FEATURES_server no-speculative-cti"
 423   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 424   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
 425   JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt"
 426   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
 427   JVM_FEATURES_custom="$JVM_FEATURES"
 428 
 429   AC_SUBST(JVM_FEATURES_server)
 430   AC_SUBST(JVM_FEATURES_hardened)
 431   AC_SUBST(JVM_FEATURES_client)
 432   AC_SUBST(JVM_FEATURES_core)
 433   AC_SUBST(JVM_FEATURES_minimal)
 434   AC_SUBST(JVM_FEATURES_zero)
 435   AC_SUBST(JVM_FEATURES_custom)
 436 
 437   # Used for verification of Makefiles by check-jvm-feature
 438   AC_SUBST(VALID_JVM_FEATURES)
 439 
 440   # We don't support --with-jvm-interpreter anymore, use zero instead.
 441   BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
 442 ])
 443 
 444 ###############################################################################
 445 # Finalize JVM features once all setup is complete, including custom setup.
 446 #
 447 AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES],
 448 [
 449   for variant in $JVM_VARIANTS; do
 450     AC_MSG_CHECKING([JVM features for JVM variant '$variant'])


< prev index next >