make/autoconf/jdk-options.m4
changeset 53833 45e6ec6fa679
parent 52774 56ca125c973b
child 53857 7a034b1de98b
equal deleted inserted replaced
53832:842b45d8e25e 53833:45e6ec6fa679
     1 #
     1 #
     2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     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.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
   370 [
   370 [
   371   AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
   371   AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
   372       [enable native compilation with code coverage data@<:@disabled@:>@])])
   372       [enable native compilation with code coverage data@<:@disabled@:>@])])
   373   GCOV_ENABLED="false"
   373   GCOV_ENABLED="false"
   374   if test "x$enable_native_coverage" = "xyes"; then
   374   if test "x$enable_native_coverage" = "xyes"; then
   375     if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
   375     case $TOOLCHAIN_TYPE in
   376       AC_MSG_CHECKING([if native coverage is enabled])
   376       gcc | clang)
   377       AC_MSG_RESULT([yes])
   377         AC_MSG_CHECKING([if native coverage is enabled])
   378       GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
   378         AC_MSG_RESULT([yes])
   379       GCOV_LDFLAGS="-fprofile-arcs"
   379         GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
   380       JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
   380         GCOV_LDFLAGS="-fprofile-arcs"
   381       JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
   381         JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
   382       CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
   382         JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
   383       CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
   383         CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
   384       CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
   384         CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
   385       CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
   385         CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
   386       LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
   386         CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
   387       LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
   387         LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
   388       GCOV_ENABLED="true"
   388         LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
   389     else
   389         GCOV_ENABLED="true"
   390       AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
   390         ;;
   391     fi
   391       *)
       
   392         AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc or clang])
       
   393         ;;
       
   394     esac
   392   elif test "x$enable_native_coverage" = "xno"; then
   395   elif test "x$enable_native_coverage" = "xno"; then
   393     AC_MSG_CHECKING([if native coverage is enabled])
   396     AC_MSG_CHECKING([if native coverage is enabled])
   394     AC_MSG_RESULT([no])
   397     AC_MSG_RESULT([no])
   395   elif test "x$enable_native_coverage" != "x"; then
   398   elif test "x$enable_native_coverage" != "x"; then
   396     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
   399     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])