Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8240820: Replace AC_ARG_ENABLE with UTIL_ARG_ENABLE
Reviewed-by: erikj
  • Loading branch information
magicus committed Mar 11, 2020
1 parent 99b28da commit 441e16e2dbdadc07814ce619a0e8fc238bf773d8
Showing with 481 additions and 447 deletions.
  1. +75 −88 make/autoconf/build-performance.m4
  2. +7 −19 make/autoconf/flags-cflags.m4
  3. +9 −27 make/autoconf/hotspot.m4
  4. +124 −278 make/autoconf/jdk-options.m4
  5. +5 −17 make/autoconf/lib-ffi.m4
  6. +9 −6 make/autoconf/platform.m4
  7. +206 −12 make/autoconf/util.m4
  8. +46 −0 test/make/autoconf/test.m4
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -167,36 +167,38 @@ AC_DEFUN_ONCE([BPERF_SETUP_TEST_JOBS],

AC_DEFUN([BPERF_SETUP_CCACHE],
[
AC_ARG_ENABLE([ccache],
[AS_HELP_STRING([--enable-ccache],
[enable using ccache to speed up recompilations @<:@disabled@:>@])])
CCACHE_STATUS=
AC_MSG_CHECKING([is ccache enabled])
if test "x$enable_ccache" = xyes; then
if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then
AC_MSG_RESULT([yes])
OLD_PATH="$PATH"
if test "x$TOOLCHAIN_PATH" != x; then
PATH=$TOOLCHAIN_PATH:$PATH
fi
UTIL_REQUIRE_PROGS(CCACHE, ccache)
PATH="$OLD_PATH"
CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`]
CCACHE_STATUS="Active ($CCACHE_VERSION)"
else
AC_MSG_RESULT([no])
AC_MSG_WARN([ccache is not supported with toolchain type $TOOLCHAIN_TYPE])
fi
elif test "x$enable_ccache" = xno; then
AC_MSG_RESULT([no, explicitly disabled])
CCACHE_STATUS="Disabled"
elif test "x$enable_ccache" = x; then
AC_MSG_RESULT([no])
# Check if ccache is available
CCACHE_AVAILABLE=true
OLD_PATH="$PATH"
if test "x$TOOLCHAIN_PATH" != x; then
PATH=$TOOLCHAIN_PATH:$PATH
fi
UTIL_PATH_PROGS(CCACHE, ccache)
PATH="$OLD_PATH"
AC_MSG_CHECKING([if ccache is available])
if test "x$TOOLCHAIN_TYPE" != "xgcc" && test "x$TOOLCHAIN_TYPE" != "xclang"; then
AC_MSG_RESULT([no, not supported for toolchain type $TOOLCHAIN_TYPE])
CCACHE_AVAILABLE=false
elif test "x$CCACHE" = "x"; then
AC_MSG_RESULT([no, ccache binary missing or not executable])
CCACHE_AVAILABLE=false
else
AC_MSG_RESULT([unknown])
AC_MSG_ERROR([--enable-ccache does not accept any parameters])
AC_MSG_RESULT([yes])
fi
CCACHE_STATUS=""
UTIL_ARG_ENABLE(NAME: ccache, DEFAULT: false, AVAILABLE: $CCACHE_AVAILABLE,
DESC: [enable using ccache to speed up recompilations],
CHECKING_MSG: [if ccache is enabled],
IF_ENABLED: [
CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`]
CCACHE_STATUS="Active ($CCACHE_VERSION)"
],
IF_DISABLED: [
CCACHE=""
])
AC_SUBST(CCACHE)
AC_ARG_WITH([ccache-dir],
@@ -284,10 +286,10 @@ AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
#
AC_DEFUN([BPERF_SETUP_ICECC],
[
AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
[enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
UTIL_ARG_ENABLE(NAME: icecc, DEFAULT: false, RESULT: ENABLE_ICECC,
DESC: [enable distributed compilation of native code using icecc/icecream])
if test "x${enable_icecc}" = "xyes"; then
if test "x$ENABLE_ICECC" = "xtrue"; then
UTIL_REQUIRE_PROGS(ICECC_CMD, icecc)
old_path="$PATH"
@@ -349,56 +351,44 @@ AC_DEFUN([BPERF_SETUP_ICECC],
else
BUILD_ICECC="${ICECC}"
fi
AC_SUBST(ICECC)
AC_SUBST(BUILD_ICECC)
fi
AC_SUBST(ICECC)
AC_SUBST(BUILD_ICECC)
])

AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
[
###############################################################################
#
# Can the C/C++ compiler use precompiled headers?
#
AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers],
[disable using precompiled headers when compiling C++ @<:@enabled@:>@])],
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
USE_PRECOMPILED_HEADER=true
AC_MSG_CHECKING([If precompiled header is enabled])
if test "x$ENABLE_PRECOMPH" = xno; then
AC_MSG_RESULT([no, forced])
USE_PRECOMPILED_HEADER=false
elif test "x$ICECC" != "x"; then
# Are precompiled headers available?
PRECOMPILED_HEADERS_AVAILABLE=true
AC_MSG_CHECKING([if precompiled headers are available])
if test "x$ICECC" != "x"; then
AC_MSG_RESULT([no, does not work effectively with icecc])
USE_PRECOMPILED_HEADER=false
PRECOMPILED_HEADERS_AVAILABLE=false
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
AC_MSG_RESULT([no, does not work with Solaris Studio])
USE_PRECOMPILED_HEADER=false
PRECOMPILED_HEADERS_AVAILABLE=false
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
AC_MSG_RESULT([no, does not work with xlc])
USE_PRECOMPILED_HEADER=false
else
AC_MSG_RESULT([yes])
fi
if test "x$ENABLE_PRECOMPH" = xyes; then
PRECOMPILED_HEADERS_AVAILABLE=false
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
# Check that the compiler actually supports precomp headers.
if test "x$TOOLCHAIN_TYPE" = xgcc; then
AC_MSG_CHECKING([that precompiled headers work])
echo "int alfa();" > conftest.h
$CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
if test ! -f conftest.hpp.gch; then
USE_PRECOMPILED_HEADER=false
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
$RM conftest.h conftest.hpp.gch
echo "int alfa();" > conftest.h
$CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
if test ! -f conftest.hpp.gch; then
PRECOMPILED_HEADERS_AVAILABLE=false
AC_MSG_RESULT([no, gcc fails to compile properly with -x c++-header])
else
AC_MSG_RESULT([yes])
fi
$RM conftest.h conftest.hpp.gch
else
AC_MSG_RESULT([yes])
fi
UTIL_ARG_ENABLE(NAME: precompiled-headers, DEFAULT: auto,
RESULT: USE_PRECOMPILED_HEADER, AVAILABLE: $PRECOMPILED_HEADERS_AVAILABLE,
DESC: [enable using precompiled headers when compiling C++])
AC_SUBST(USE_PRECOMPILED_HEADER)
])

@@ -442,30 +432,27 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
if test "$MX_VALUE" -lt "512"; then
MX_VALUE=512
fi
UTIL_ADD_JVM_ARG_IF_OK([-Xms${MS_VALUE}M -Xmx${MX_VALUE}M],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS)
AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
[use sjavac to do fast incremental compiles @<:@disabled@:>@])],
[ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC="no"])
JAVAC_SERVER_AVAILABLE=true
SJAVAC_MEMORY_OPT=-Xms${MS_VALUE}M -Xmx${MX_VALUE}M
UTIL_ADD_JVM_ARG_IF_OK([$SJAVAC_MEMORY_OPT],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
if test "x$JVM_ARG_OK" = "xfalse"; then
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac])
ENABLE_SJAVAC="no"
AC_MSG_WARN([Could not set '$SJAVAC_MEMORY_OPT' on bootjdk, disabling sjavac and javac server])
JAVAC_SERVER_AVAILABLE=false
fi
AC_MSG_CHECKING([whether to use sjavac])
AC_MSG_RESULT([$ENABLE_SJAVAC])
AC_SUBST(ENABLE_SJAVAC)
AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS)
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--disable-javac-server],
[disable javac server @<:@enabled@:>@])],
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="yes"])
if test "x$JVM_ARG_OK" = "xfalse"; then
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
ENABLE_JAVAC_SERVER="no"
fi
AC_MSG_CHECKING([whether to use javac server])
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
AC_SUBST(ENABLE_JAVAC_SERVER)
UTIL_ARG_ENABLE(NAME: sjavac, DEFAULT: false, AVAILABLE: $JAVAC_SERVER_AVAILABLE,
DESC: [use sjavac to do fast incremental compiles],
CHECKING_MSG: [whether to use sjavac],
IF_ENABLED: [ ENABLE_SJAVAC="yes" ],
IF_DISABLED: [ ENABLE_SJAVAC="no" ])
UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true, AVAILABLE: $JAVAC_SERVER_AVAILABLE,
DESC: [enable javac server],
CHECKING_MSG: [whether to use javac server],
IF_ENABLED: [ ENABLE_JAVAC_SERVER="yes" ],
IF_DISABLED: [ ENABLE_JAVAC_SERVER="no" ])
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
# When using a server javac, the small client instances do not need much
@@ -132,29 +132,17 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],

AC_DEFUN([FLAGS_SETUP_WARNINGS],
[
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
[do not consider native warnings to be an error @<:@enabled@:>@])])
# Set default value.
if test "x$TOOLCHAIN_TYPE" = xxlc; then
WARNINGS_AS_ERRORS=false
else
WARNINGS_AS_ERRORS=true
fi
AC_MSG_CHECKING([if native warnings are errors])
if test "x$enable_warnings_as_errors" = "xyes"; then
AC_MSG_RESULT([yes (explicitly set)])
WARNINGS_AS_ERRORS=true
elif test "x$enable_warnings_as_errors" = "xno"; then
AC_MSG_RESULT([no (explicitly set)])
WARNINGS_AS_ERRORS=false
elif test "x$enable_warnings_as_errors" = "x"; then
AC_MSG_RESULT([${WARNINGS_AS_ERRORS} (default)])
if test "x$TOOLCHAIN_TYPE" != xxlc; then
WARNINGS_AS_ERRORS_DEFAULT=true
else
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
WARNINGS_AS_ERRORS_DEFAULT=false
fi
UTIL_ARG_ENABLE(NAME: warnings-as-errors, DEFAULT: $WARNINGS_AS_ERRORS_DEFAULT,
RESULT: WARNINGS_AS_ERRORS,
DEFAULT_DESC: [auto]
DESC: [consider native warnings to be an error])
AC_SUBST(WARNINGS_AS_ERRORS)
case "${TOOLCHAIN_TYPE}" in
@@ -116,50 +116,32 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
#
AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
[
AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
[Disables building of the Hotspot unit tests @<:@enabled@:>@])])
GTEST_AVAILABLE=true
AC_MSG_CHECKING([if Hotspot gtest test source is present])
if test -e "${TOPDIR}/test/hotspot/gtest"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, cannot run gtest])
AC_MSG_RESULT([no, cannot build gtest])
GTEST_AVAILABLE=false
fi
# On solaris, we also must have the libstlport.so.1 library, setup in
# LIB_SETUP_LIBRARIES.
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
if test "x$STLPORT_LIB" = "x"; then
GTEST_AVAILABLE=false
fi
fi
AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
if test "x$enable_hotspot_gtest" = "xyes"; then
if test "x$GTEST_AVAILABLE" = "xtrue"; then
AC_MSG_RESULT([yes, forced])
BUILD_GTEST="true"
else
AC_MSG_ERROR([Cannot build gtest with missing dependencies])
fi
elif test "x$enable_hotspot_gtest" = "xno"; then
AC_MSG_RESULT([no, forced])
BUILD_GTEST="false"
elif test "x$enable_hotspot_gtest" = "x"; then
if test "x$GTEST_AVAILABLE" = "xtrue"; then
AC_MSG_CHECKING([if the libstlport.so.1 library is present])
if test "x$STLPORT_LIB" != "x"; then
AC_MSG_RESULT([yes])
BUILD_GTEST="true"
else
AC_MSG_RESULT([no])
BUILD_GTEST="false"
AC_MSG_RESULT([no, cannot build gtest])
GTEST_AVAILABLE=false
fi
else
AC_MSG_ERROR([--enable-gtest must be either yes or no])
fi
UTIL_ARG_ENABLE(NAME: hotspot-gtest, DEFAULT: auto,
RESULT: BUILD_GTEST, AVAILABLE: $GTEST_AVAILABLE,
DEFAULT_DESC: [enabled if possible to build]
DESC: [enable building of the Hotspot unit tests])
AC_SUBST(BUILD_GTEST)
])

0 comments on commit 441e16e

Please sign in to comment.