< prev index next >

make/autoconf/jdk-options.m4

Print this page


   1 #
   2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   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


 227     INCLUDE_SA=false
 228   fi
 229   AC_SUBST(INCLUDE_SA)
 230 
 231   # Compress jars
 232   COMPRESS_JARS=false
 233 
 234   AC_SUBST(COMPRESS_JARS)
 235 
 236   # Setup default copyright year. Mostly overridden when building close to a new year.
 237   AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
 238       [Set copyright year value for build @<:@current year@:>@])])
 239   if test "x$with_copyright_year" = xyes; then
 240     AC_MSG_ERROR([Copyright year must have a value])
 241   elif test "x$with_copyright_year" != x; then
 242     COPYRIGHT_YEAR="$with_copyright_year"
 243   else
 244     COPYRIGHT_YEAR=`$DATE +'%Y'`
 245   fi
 246   AC_SUBST(COPYRIGHT_YEAR)
 247 
 248   # Override default library path
 249   AC_ARG_WITH([jni-libpath], [AS_HELP_STRING([--with-jni-libpath],
 250       [override default JNI library search path])])
 251   AC_MSG_CHECKING([for jni library path])
 252   if test "x${with_jni_libpath}" = "x" || test "x${with_jni_libpath}" = "xno"; then
 253     AC_MSG_RESULT([default])
 254   elif test "x${with_jni_libpath}" = "xyes"; then
 255     AC_MSG_RESULT([invalid])
 256     AC_MSG_ERROR([The --with-jni-libpath option requires an argument.])
 257   else
 258     HOTSPOT_OVERRIDE_LIBPATH=${with_jni_libpath}
 259     if test "x$OPENJDK_TARGET_OS" != "xlinux" &&
 260          test "x$OPENJDK_TARGET_OS" != "xbsd" &&
 261          test "x$OPENJDK_TARGET_OS" != "xaix"; then
 262       AC_MSG_RESULT([fail])
 263       AC_MSG_ERROR([Overriding JNI library path is supported only on Linux, BSD and AIX.])
 264     fi
 265     AC_MSG_RESULT(${HOTSPOT_OVERRIDE_LIBPATH})
 266   fi
 267   AC_SUBST(HOTSPOT_OVERRIDE_LIBPATH)
 268 
 269 ])
 270 
 271 ###############################################################################
 272 #
 273 # Enable or disable the elliptic curve crypto implementation
 274 #
 275 AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
 276 [
 277   AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
 278 
 279   if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
 280     ENABLE_INTREE_EC=true
 281     AC_MSG_RESULT([yes])
 282   else
 283     ENABLE_INTREE_EC=false
 284     AC_MSG_RESULT([no])
 285   fi
 286 
 287   AC_SUBST(ENABLE_INTREE_EC)
 288 ])


 347         # enabling of enable-debug-symbols and can't find objcopy
 348         # this is an error
 349         AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
 350       fi
 351     fi
 352 
 353     COMPILE_WITH_DEBUG_SYMBOLS=true
 354     COPY_DEBUG_SYMBOLS=true
 355     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 356   else
 357     AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
 358   fi
 359 
 360   AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS)
 361   AC_SUBST(COPY_DEBUG_SYMBOLS)
 362   AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS)
 363 ])
 364 
 365 ################################################################################
 366 #
 367 # Native and Java code coverage
 368 #
 369 AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
 370 [
 371   AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
 372       [enable native compilation with code coverage data@<:@disabled@:>@])])
 373   GCOV_ENABLED="false"
 374   if test "x$enable_native_coverage" = "xyes"; then
 375     case $TOOLCHAIN_TYPE in
 376       gcc | clang)
 377         AC_MSG_CHECKING([if native coverage is enabled])
 378         AC_MSG_RESULT([yes])
 379         GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
 380         GCOV_LDFLAGS="-fprofile-arcs"
 381         JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
 382         JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
 383         CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
 384         CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
 385         CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
 386         CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
 387         LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
 388         LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
 389         GCOV_ENABLED="true"
 390         ;;
 391       *)
 392         AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc or clang])
 393         ;;
 394     esac
 395   elif test "x$enable_native_coverage" = "xno"; then
 396     AC_MSG_CHECKING([if native coverage is enabled])
 397     AC_MSG_RESULT([no])
 398   elif test "x$enable_native_coverage" != "x"; then
 399     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
 400   fi
 401   AC_SUBST(GCOV_ENABLED)
 402 
 403   AC_ARG_WITH(jcov, [AS_HELP_STRING([--with-jcov],
 404       [jcov library location])])
 405   AC_ARG_WITH(jcov-input-jdk, [AS_HELP_STRING([--with-jcov-input-jdk],
 406       [jdk image to instrument])])
 407   AC_ARG_WITH(jcov-filters, [AS_HELP_STRING([--with-jcov-filters],
 408       [filters to limit code for jcov instrumentation and report generation])])
 409   JCOV_HOME=
 410   JCOV_INPUT_JDK=
 411   JCOV_ENABLED=
 412   JCOV_FILTERS=
 413   if test "x$with_jcov" = "x" ; then
 414     JCOV_ENABLED="false"
 415   else
 416     JCOV_HOME="$with_jcov"
 417     if test ! -f "$JCOV_HOME/lib/jcov.jar"; then
 418       AC_MSG_RESULT([fail])
 419       AC_MSG_ERROR([Invalid JCov bundle: "$JCOV_HOME/lib/jcov.jar" does not exist])
 420     fi
 421     JCOV_ENABLED="true"
 422     BASIC_FIXUP_PATH(JCOV_HOME)
 423     if test "x$with_jcov_input_jdk" != "x" ; then
 424       JCOV_INPUT_JDK="$with_jcov_input_jdk"
 425       if test ! -f "$JCOV_INPUT_JDK/bin/java$EXE_SUFFIX"; then
 426         AC_MSG_RESULT([fail])
 427         AC_MSG_ERROR([Invalid JDK bundle: "$JCOV_INPUT_JDK/bin/java$EXE_SUFFIX" does not exist])
 428       fi
 429       BASIC_FIXUP_PATH(JCOV_INPUT_JDK)
 430     fi
 431     if test "x$with_jcov_filters" != "x" ; then
 432       JCOV_FILTERS="$with_jcov_filters"
 433     fi
 434   fi
 435   AC_SUBST(JCOV_ENABLED)
 436   AC_SUBST(JCOV_HOME)
 437   AC_SUBST(JCOV_INPUT_JDK)
 438   AC_SUBST(JCOV_FILTERS)
 439 ])
 440 
 441 ###############################################################################
 442 #
 443 # AddressSanitizer
 444 #
 445 AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
 446 [
 447   AC_ARG_ENABLE(asan, [AS_HELP_STRING([--enable-asan],
 448       [enable AddressSanitizer if possible @<:@disabled@:>@])])
 449   ASAN_ENABLED="no"
 450   if test "x$enable_asan" = "xyes"; then
 451     case $TOOLCHAIN_TYPE in
 452       gcc | clang)
 453         AC_MSG_CHECKING([if asan is enabled])
 454         AC_MSG_RESULT([yes])
 455         ASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
 456         ASAN_LDFLAGS="-fsanitize=address"
 457         JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS"
 458         JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS"


   1 #
   2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   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


 227     INCLUDE_SA=false
 228   fi
 229   AC_SUBST(INCLUDE_SA)
 230 
 231   # Compress jars
 232   COMPRESS_JARS=false
 233 
 234   AC_SUBST(COMPRESS_JARS)
 235 
 236   # Setup default copyright year. Mostly overridden when building close to a new year.
 237   AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
 238       [Set copyright year value for build @<:@current year@:>@])])
 239   if test "x$with_copyright_year" = xyes; then
 240     AC_MSG_ERROR([Copyright year must have a value])
 241   elif test "x$with_copyright_year" != x; then
 242     COPYRIGHT_YEAR="$with_copyright_year"
 243   else
 244     COPYRIGHT_YEAR=`$DATE +'%Y'`
 245   fi
 246   AC_SUBST(COPYRIGHT_YEAR)






















 247 ])
 248 
 249 ###############################################################################
 250 #
 251 # Enable or disable the elliptic curve crypto implementation
 252 #
 253 AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
 254 [
 255   AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
 256 
 257   if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
 258     ENABLE_INTREE_EC=true
 259     AC_MSG_RESULT([yes])
 260   else
 261     ENABLE_INTREE_EC=false
 262     AC_MSG_RESULT([no])
 263   fi
 264 
 265   AC_SUBST(ENABLE_INTREE_EC)
 266 ])


 325         # enabling of enable-debug-symbols and can't find objcopy
 326         # this is an error
 327         AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
 328       fi
 329     fi
 330 
 331     COMPILE_WITH_DEBUG_SYMBOLS=true
 332     COPY_DEBUG_SYMBOLS=true
 333     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 334   else
 335     AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
 336   fi
 337 
 338   AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS)
 339   AC_SUBST(COPY_DEBUG_SYMBOLS)
 340   AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS)
 341 ])
 342 
 343 ################################################################################
 344 #
 345 # Gcov coverage data for hotspot
 346 #
 347 AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
 348 [
 349   AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
 350       [enable native compilation with code coverage data@<:@disabled@:>@])])
 351   GCOV_ENABLED="false"
 352   if test "x$enable_native_coverage" = "xyes"; then
 353     if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
 354       AC_MSG_CHECKING([if native coverage is enabled])
 355       AC_MSG_RESULT([yes])
 356       GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
 357       GCOV_LDFLAGS="-fprofile-arcs"
 358       JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
 359       JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
 360       CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
 361       CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
 362       CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
 363       CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
 364       LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
 365       LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
 366       GCOV_ENABLED="true"
 367     else
 368       AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
 369     fi



 370   elif test "x$enable_native_coverage" = "xno"; then
 371     AC_MSG_CHECKING([if native coverage is enabled])
 372     AC_MSG_RESULT([no])
 373   elif test "x$enable_native_coverage" != "x"; then
 374     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
 375   fi

 376 
 377   AC_SUBST(GCOV_ENABLED)



































 378 ])
 379 
 380 ###############################################################################
 381 #
 382 # AddressSanitizer
 383 #
 384 AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
 385 [
 386   AC_ARG_ENABLE(asan, [AS_HELP_STRING([--enable-asan],
 387       [enable AddressSanitizer if possible @<:@disabled@:>@])])
 388   ASAN_ENABLED="no"
 389   if test "x$enable_asan" = "xyes"; then
 390     case $TOOLCHAIN_TYPE in
 391       gcc | clang)
 392         AC_MSG_CHECKING([if asan is enabled])
 393         AC_MSG_RESULT([yes])
 394         ASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
 395         ASAN_LDFLAGS="-fsanitize=address"
 396         JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS"
 397         JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS"


< prev index next >