common/autoconf/hotspot.m4
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk9-arm3264 Sdiff common/autoconf

common/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 shark minimal dtrace jvmti jvmci \
  28     fprof vm-structs jni-check services management all-gcs nmt cds static-build"

  29 
  30 # All valid JVM variants
  31 VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
  32 
  33 ###############################################################################
  34 # Check if the specified JVM variant should be built. To be used in shell if
  35 # constructs, like this:
  36 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
  37 #
  38 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
  39 
  40 # Definition kept in one line to allow inlining in if statements.
  41 # Additional [] needed to keep m4 from mangling shell constructs.
  42 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
  43 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
  44 
  45 ###############################################################################
  46 # Check if the specified JVM features are explicitly enabled. To be used in
  47 # shell if constructs, like this:
  48 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then


  97   NEEDLE=${VALID_JVM_VARIANTS// /$'\n'}
  98   STACK=${JVM_VARIANTS// /$'\n'}
  99   INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
 100   if test "x$INVALID_VARIANTS" != x; then
 101     AC_MSG_NOTICE([Unknown variant(s) specified: $INVALID_VARIANTS])
 102     AC_MSG_ERROR([The available JVM variants are: $VALID_JVM_VARIANTS])
 103   fi
 104 
 105   # All "special" variants share the same output directory ("server")
 106   VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
 107   NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}
 108   STACK=${JVM_VARIANTS// /$'\n'}
 109   INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
 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   AC_SUBST(JVM_VARIANTS)
 115   AC_SUBST(VALID_JVM_VARIANTS)
 116 














 117   if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
 118     # zero behaves as a platform and rewrites these values. This is really weird. :(
 119     # We are guaranteed that we do not build any other variants when building zero.
 120     HOTSPOT_TARGET_CPU=zero
 121     HOTSPOT_TARGET_CPU_ARCH=zero
 122   fi



 123 ])
 124 
 125 ###############################################################################
 126 # Check if dtrace should be enabled and has all prerequisites present.
 127 #
 128 AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
 129 [
 130   # Test for dtrace dependencies
 131   AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@],
 132       [enable dtrace. Default is auto, where dtrace is enabled if all dependencies
 133       are present.])])
 134 
 135   DTRACE_DEP_MISSING=false
 136 
 137   AC_MSG_CHECKING([for dtrace tool])
 138   if test "x$DTRACE" != "x" && test -x "$DTRACE"; then
 139     AC_MSG_RESULT([$DTRACE])
 140   else
 141     AC_MSG_RESULT([not found, cannot build dtrace])
 142     DTRACE_DEP_MISSING=true


 231     if HOTSPOT_CHECK_JVM_FEATURE(zero); then
 232       AC_MSG_ERROR([To enable zero/zeroshark, you must use --with-jvm-variants=zero/zeroshark])
 233     fi
 234   fi
 235 
 236   if ! HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
 237     if HOTSPOT_CHECK_JVM_FEATURE(shark); then
 238       AC_MSG_ERROR([To enable shark, you must use --with-jvm-variants=zeroshark])
 239     fi
 240   fi
 241 
 242   # Only enable jvmci on x86_64, sparcv9 and aarch64.
 243   if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
 244       test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
 245       test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
 246     JVM_FEATURES_jvmci="jvmci"
 247   else
 248     JVM_FEATURES_jvmci=""
 249   fi
 250 









 251   # All variants but minimal (and custom) get these features
 252   NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
 253 
 254   # Enable features depending on variant.
 255   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 256   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 257   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
 258   JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"
 259   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
 260   JVM_FEATURES_zeroshark="zero shark $NON_MINIMAL_FEATURES $JVM_FEATURES"
 261   JVM_FEATURES_custom="$JVM_FEATURES"
 262 
 263   AC_SUBST(JVM_FEATURES_server)
 264   AC_SUBST(JVM_FEATURES_client)
 265   AC_SUBST(JVM_FEATURES_core)
 266   AC_SUBST(JVM_FEATURES_minimal)
 267   AC_SUBST(JVM_FEATURES_zero)
 268   AC_SUBST(JVM_FEATURES_zeroshark)
 269   AC_SUBST(JVM_FEATURES_custom)
 270 
 271   # Used for verification of Makefiles by check-jvm-feature
 272   AC_SUBST(VALID_JVM_FEATURES)
 273 
 274   # We don't support --with-jvm-interpreter anymore, use zero instead.
 275   BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
 276 ])
 277 
 278 ###############################################################################




   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 shark minimal dtrace jvmti jvmci \
  28     fprof vm-structs jni-check services management all-gcs nmt cds \
  29     static-build link-time-opt"
  30 
  31 # All valid JVM variants
  32 VALID_JVM_VARIANTS="server client minimal core zero zeroshark 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:
  49 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then


  98   NEEDLE=${VALID_JVM_VARIANTS// /$'\n'}
  99   STACK=${JVM_VARIANTS// /$'\n'}
 100   INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
 101   if test "x$INVALID_VARIANTS" != x; then
 102     AC_MSG_NOTICE([Unknown variant(s) specified: $INVALID_VARIANTS])
 103     AC_MSG_ERROR([The available JVM variants are: $VALID_JVM_VARIANTS])
 104   fi
 105 
 106   # All "special" variants share the same output directory ("server")
 107   VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
 108   NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}
 109   STACK=${JVM_VARIANTS// /$'\n'}
 110   INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
 111   if  test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
 112     AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
 113   fi
 114 
 115   AC_SUBST(JVM_VARIANTS)
 116   AC_SUBST(VALID_JVM_VARIANTS)
 117 
 118   # Override hotspot cpu definitions
 119   if test "x$OPENJDK_TARGET_CPU" = xarm; then
 120     HOTSPOT_TARGET_CPU=arm_32
 121     HOTSPOT_TARGET_CPU_DEFINE="ARM32"
 122     JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char"
 123     JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char"
 124   elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then
 125     AC_MSG_CHECKING([OPENJDK_TARGET_ABI_PROFILE == arm64])
 126     HOTSPOT_TARGET_CPU=arm_64
 127     HOTSPOT_TARGET_CPU_ARCH=arm
 128     JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char"
 129     JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char"
 130   fi
 131 
 132   if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
 133     # zero behaves as a platform and rewrites these values. This is really weird. :(
 134     # We are guaranteed that we do not build any other variants when building zero.
 135     HOTSPOT_TARGET_CPU=zero
 136     HOTSPOT_TARGET_CPU_ARCH=zero
 137   fi
 138 
 139 
 140 
 141 ])
 142 
 143 ###############################################################################
 144 # Check if dtrace should be enabled and has all prerequisites present.
 145 #
 146 AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
 147 [
 148   # Test for dtrace dependencies
 149   AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@],
 150       [enable dtrace. Default is auto, where dtrace is enabled if all dependencies
 151       are present.])])
 152 
 153   DTRACE_DEP_MISSING=false
 154 
 155   AC_MSG_CHECKING([for dtrace tool])
 156   if test "x$DTRACE" != "x" && test -x "$DTRACE"; then
 157     AC_MSG_RESULT([$DTRACE])
 158   else
 159     AC_MSG_RESULT([not found, cannot build dtrace])
 160     DTRACE_DEP_MISSING=true


 249     if HOTSPOT_CHECK_JVM_FEATURE(zero); then
 250       AC_MSG_ERROR([To enable zero/zeroshark, you must use --with-jvm-variants=zero/zeroshark])
 251     fi
 252   fi
 253 
 254   if ! HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
 255     if HOTSPOT_CHECK_JVM_FEATURE(shark); then
 256       AC_MSG_ERROR([To enable shark, you must use --with-jvm-variants=zeroshark])
 257     fi
 258   fi
 259 
 260   # Only enable jvmci on x86_64, sparcv9 and aarch64.
 261   if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
 262       test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
 263       test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
 264     JVM_FEATURES_jvmci="jvmci"
 265   else
 266     JVM_FEATURES_jvmci=""
 267   fi
 268 
 269   if test "x$OPENJDK_TARGET_CPU" = xarm \
 270       && ! HOTSPOT_CHECK_JVM_FEATURE(pregen-interpreter); then
 271     # Default to use link time optimizations on minimal on arm, unless
 272     # pregen-interpreter is active.
 273     JVM_FEATURES_link_time_opt="link-time-opt"
 274   else
 275     JVM_FEATURES_link_time_opt=""
 276   fi
 277 
 278   # All variants but minimal (and custom) get these features
 279   NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
 280 
 281   # Enable features depending on variant.
 282   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 283   JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
 284   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
 285   JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt"
 286   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
 287   JVM_FEATURES_zeroshark="zero shark $NON_MINIMAL_FEATURES $JVM_FEATURES"
 288   JVM_FEATURES_custom="$JVM_FEATURES"
 289 
 290   AC_SUBST(JVM_FEATURES_server)
 291   AC_SUBST(JVM_FEATURES_client)
 292   AC_SUBST(JVM_FEATURES_core)
 293   AC_SUBST(JVM_FEATURES_minimal)
 294   AC_SUBST(JVM_FEATURES_zero)
 295   AC_SUBST(JVM_FEATURES_zeroshark)
 296   AC_SUBST(JVM_FEATURES_custom)
 297 
 298   # Used for verification of Makefiles by check-jvm-feature
 299   AC_SUBST(VALID_JVM_FEATURES)
 300 
 301   # We don't support --with-jvm-interpreter anymore, use zero instead.
 302   BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
 303 ])
 304 
 305 ###############################################################################


common/autoconf/hotspot.m4
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File