8301197: Make sure use of printf is correct and actually needed

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2025-04-07 20:34:30 +00:00
parent cebda921dd
commit 42dc99eac1
16 changed files with 145 additions and 129 deletions

View File

@ -264,7 +264,7 @@ define create_overview_file
$$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE) $$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE)
$$(call LogInfo, Creating overview.html for $1) $$(call LogInfo, Creating overview.html for $1)
$$(call MakeDir, $$(@D)) $$(call MakeDir, $$(@D))
$$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)' $$(ECHO) -n '$$($1_OVERVIEW_TEXT)' > $$@
endef endef
################################################################################ ################################################################################

View File

@ -137,7 +137,7 @@ main: MAKEOVERRIDES :=
main: $(INIT_TARGETS) main: $(INIT_TARGETS)
ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), ) ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), )
$(call RotateLogFiles) $(call RotateLogFiles)
$(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE) $(ECHO) "Building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
ifneq ($(SEQUENTIAL_TARGETS), ) ifneq ($(SEQUENTIAL_TARGETS), )
# Don't touch build output dir since we might be cleaning. That # Don't touch build output dir since we might be cleaning. That
# means no log pipe. # means no log pipe.
@ -158,7 +158,8 @@ main: $(INIT_TARGETS)
-f make/Main.gmk $(USER_MAKE_VARS) \ -f make/Main.gmk $(USER_MAKE_VARS) \
$(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \ $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
( exitcode=$$? && \ ( exitcode=$$? && \
$(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \ $(ECHO) "" $(BUILD_LOG_PIPE_SIMPLE) && \
$(ECHO) "ERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode)" \
$(BUILD_LOG_PIPE_SIMPLE) && \ $(BUILD_LOG_PIPE_SIMPLE) && \
cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \
on-failure ; \ on-failure ; \
@ -170,7 +171,7 @@ main: $(INIT_TARGETS)
if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \ if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
exit 1 ; \ exit 1 ; \
fi fi
$(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE) $(ECHO) "Finished building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
$(call ReportProfileTimes) $(call ReportProfileTimes)
endif endif
@ -181,7 +182,8 @@ on-failure:
$(call PrintFailureReports) $(call PrintFailureReports)
$(call PrintBuildLogFailures) $(call PrintBuildLogFailures)
$(call ReportProfileTimes) $(call ReportProfileTimes)
$(PRINTF) "HELP: Run 'make doctor' to diagnose build problems.\n\n" $(ECHO) "HELP: Run 'make doctor' to diagnose build problems."
$(ECHO) ""
ifneq ($(COMPARE_BUILD), ) ifneq ($(COMPARE_BUILD), )
$(call CleanupCompareBuild) $(call CleanupCompareBuild)
endif endif

View File

@ -173,9 +173,10 @@ define PrintFailureReports
$(RM) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \ $(RM) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \ $(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \
( \ ( \
$(PRINTF) "\n=== Output from failing command(s) repeated here ===\n" ; \ $(ECHO) "" ; \
$(ECHO) "=== Output from failing command(s) repeated here ===" ; \
$(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log)), \ $(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log)), \
$(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" ; \ $(ECHO) "* For target $(notdir $(basename $(logfile))):" ; \
$(if $(filter all, $(LOG_REPORT)), \ $(if $(filter all, $(LOG_REPORT)), \
$(GREP) -v -e "^Note: including file:" < $(logfile) || true ; \ $(GREP) -v -e "^Note: including file:" < $(logfile) || true ; \
, \ , \
@ -185,8 +186,9 @@ define PrintFailureReports
fi ; \ fi ; \
) \ ) \
) \ ) \
$(PRINTF) "\n* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs.\n" ; \ $(ECHO) "" ; \
$(PRINTF) "=== End of repeated output ===\n" ; \ $(ECHO) "* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs." ; \
$(ECHO) "=== End of repeated output ===" ; \
) >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \ ) >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
) \ ) \
) )
@ -195,13 +197,16 @@ endef
define PrintBuildLogFailures define PrintBuildLogFailures
$(if $(filter none, $(LOG_REPORT)), , \ $(if $(filter none, $(LOG_REPORT)), , \
if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then \ if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then \
$(PRINTF) "\n=== Make failed targets repeated here ===\n" ; \ $(ECHO) "" ; \
$(ECHO) "=== Make failed targets repeated here ===" ; \
$(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \ $(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
$(PRINTF) "=== End of repeated output ===\n" ; \ $(ECHO) "=== End of repeated output ===" ; \
$(PRINTF) "\nHELP: Try searching the build log for the name of the first failed target.\n" ; \ $(ECHO) "" ; \
$(ECHO) "HELP: Try searching the build log for the name of the first failed target." ; \
else \ else \
$(PRINTF) "\nNo indication of failed target found.\n" ; \ $(ECHO) "" ; \
$(PRINTF) "HELP: Try searching the build log for '] Error'.\n" ; \ $(ECHO) "No indication of failed target found." ; \
$(ECHO) "HELP: Try searching the build log for '] Error'." ; \
fi >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \ fi >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(CAT) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \ $(CAT) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
) )

View File

@ -57,77 +57,77 @@ define SetupTargetBody
endef endef
define CleanDocs define CleanDocs
@$(PRINTF) "Cleaning docs ..." @$(ECHO) -n "Cleaning docs ..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/docs $(RM) -r $(SUPPORT_OUTPUTDIR)/docs
$(RM) -r $(SUPPORT_OUTPUTDIR)/javadoc $(RM) -r $(SUPPORT_OUTPUTDIR)/javadoc
$(RM) -r $(IMAGES_OUTPUTDIR)/docs $(RM) -r $(IMAGES_OUTPUTDIR)/docs
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
# Cleans the dir given as $1 # Cleans the dir given as $1
define CleanDir define CleanDir
@$(PRINTF) "Cleaning $(strip $1) build artifacts ..." @$(ECHO) -n "Cleaning $(strip $1) build artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
($(CD) $(OUTPUTDIR) && $(RM) -r $1) ($(CD) $(OUTPUTDIR) && $(RM) -r $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define CleanSupportDir define CleanSupportDir
@$(PRINTF) "Cleaning $(strip $1) build artifacts ..." @$(ECHO) -n "Cleaning$(strip $1) build artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/$(strip $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define CleanMakeSupportDir define CleanMakeSupportDir
@$(PRINTF) "Cleaning $(strip $1) make support artifacts ..." @$(ECHO) -n "Cleaning $(strip $1) make support artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1) $(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define CleanTest define CleanTest
@$(PRINTF) "Cleaning test $(strip $1) ..." @$(ECHO) -n "Cleaning test $(strip $1) ..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1)) $(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))
# Remove as much of the test directory structure as is empty # Remove as much of the test directory structure as is empty
$(RMDIR) -p $(dir $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))) 2> /dev/null || true $(RMDIR) -p $(dir $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))) 2> /dev/null || true
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define Clean-gensrc define Clean-gensrc
@$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..." @$(ECHO) -n "Cleaning gensrc $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define Clean-java define Clean-java
@$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..." @$(ECHO) -n "Cleaning java $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1) $(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/special_classes/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/special_classes/$(strip $1)
$(PRINTF) " done\n" $(ECHO) " done"
$(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..." $(ECHO) -n "Cleaning headers $(if $1,for $(strip $1) )..."
$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define Clean-native define Clean-native
@$(PRINTF) "Cleaning native $(if $1,for $(strip $1) )..." @$(ECHO) -n "Cleaning native $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define Clean-include define Clean-include
@$(PRINTF) "Cleaning include $(if $1,for $(strip $1) )..." @$(ECHO) -n "Cleaning include $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG) @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1)
@$(PRINTF) " done\n" @$(ECHO) " done"
endef endef
define CleanModule define CleanModule

View File

@ -1017,7 +1017,8 @@ define SetupRunJtregTestBody
$1_COMMAND_LINE := \ $1_COMMAND_LINE := \
for i in {0..$$(JTREG_RETRY_COUNT)}; do \ for i in {0..$$(JTREG_RETRY_COUNT)}; do \
if [ "$$$$i" != 0 ]; then \ if [ "$$$$i" != 0 ]; then \
$$(PRINTF) "\nRetrying Jtreg run. Attempt: $$$$i\n"; \ $$(ECHO) ""; \
$$(ECHO) "Retrying Jtreg run. Attempt: $$$$i"; \
fi; \ fi; \
$$($1_COMMAND_LINE); \ $$($1_COMMAND_LINE); \
if [ "`$$(CAT) $$($1_EXITCODE)`" = "0" ]; then \ if [ "`$$(CAT) $$($1_EXITCODE)`" = "0" ]; then \
@ -1030,10 +1031,12 @@ define SetupRunJtregTestBody
ifneq ($$(JTREG_REPEAT_COUNT), 0) ifneq ($$(JTREG_REPEAT_COUNT), 0)
$1_COMMAND_LINE := \ $1_COMMAND_LINE := \
for i in {1..$$(JTREG_REPEAT_COUNT)}; do \ for i in {1..$$(JTREG_REPEAT_COUNT)}; do \
$$(PRINTF) "\nRepeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)\n"; \ $$(ECHO) ""; \
$$(ECHO) "Repeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)"; \
$$($1_COMMAND_LINE); \ $$($1_COMMAND_LINE); \
if [ "`$$(CAT) $$($1_EXITCODE)`" != "0" ]; then \ if [ "`$$(CAT) $$($1_EXITCODE)`" != "0" ]; then \
$$(PRINTF) "\nFailures detected, no more repeats.\n"; \ $$(ECHO) ""; \
$$(ECHO) "Failures detected, no more repeats."; \
break; \ break; \
fi; \ fi; \
done done

View File

@ -55,7 +55,7 @@ ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
SCM_DIR := .git SCM_DIR := .git
ID_COMMAND := $(PRINTF) "git:%s%s\n" \ ID_COMMAND := $(PRINTF) "git:%s%s\n" \
"$$($(GIT) log -n1 --format=%H | cut -c1-12)" \ "$$($(GIT) log -n1 --format=%H | cut -c1-12)" \
"$$(if test -n "$$($(GIT) status --porcelain)"; then printf '+'; fi)" "$$(if test -n "$$($(GIT) status --porcelain)"; then $(PRINTF) '+'; fi)"
endif endif
ifeq ($(USE_SCM), true) ifeq ($(USE_SCM), true)

View File

@ -228,19 +228,19 @@ AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
# Print available toolchains # Print available toolchains
$PRINTF "The following toolchains are valid as arguments to --with-toolchain-type.\n" $ECHO "The following toolchains are valid as arguments to --with-toolchain-type."
$PRINTF "Which are available to use depends on the build platform.\n" $ECHO "Which are available to use depends on the build platform."
for toolchain in $VALID_TOOLCHAINS_all; do for toolchain in $VALID_TOOLCHAINS_all; do
# Use indirect variable referencing # Use indirect variable referencing
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
$PRINTF " %-22s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" $PRINTF " %-22s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
done done
$PRINTF "\n" $ECHO ""
# Print available JVM features # Print available JVM features
$PRINTF "The following JVM features are valid as arguments to --with-jvm-features.\n" $ECHO "The following JVM features are valid as arguments to --with-jvm-features."
$PRINTF "Which are available to use depends on the environment and JVM variant.\n" $ECHO "Which are available to use depends on the environment and JVM variant."
m4_foreach(FEATURE, m4_split(jvm_features_valid), [ m4_foreach(FEATURE, m4_split(jvm_features_valid), [
# Create an m4 variable containing the description for FEATURE. # Create an m4 variable containing the description for FEATURE.
m4_define(FEATURE_DESCRIPTION, [jvm_feature_desc_]m4_translit(FEATURE, -, _)) m4_define(FEATURE_DESCRIPTION, [jvm_feature_desc_]m4_translit(FEATURE, -, _))
@ -257,115 +257,117 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
[ [
# Finally output some useful information to the user # Finally output some useful information to the user
printf "\n" $ECHO ""
printf "====================================================\n" $ECHO "===================================================="
if test "x$no_create" != "xyes"; then if test "x$no_create" != "xyes"; then
if test "x$IS_RECONFIGURE" != "xyes"; then if test "x$IS_RECONFIGURE" != "xyes"; then
printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR" $ECHO "A new configuration has been successfully created in"
$ECHO "$OUTPUTDIR"
else else
printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR" $ECHO "The existing configuration has been successfully updated in"
$ECHO "$OUTPUTDIR"
fi fi
else else
if test "x$IS_RECONFIGURE" != "xyes"; then if test "x$IS_RECONFIGURE" != "xyes"; then
printf "A configuration has been successfully checked but not created\n" $ECHO "A configuration has been successfully checked but not created"
else else
printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR" $ECHO "The existing configuration has been successfully checked in"
$ECHO "$OUTPUTDIR"
fi fi
fi fi
if test "x$CONFIGURE_COMMAND_LINE" != x; then if test "x$CONFIGURE_COMMAND_LINE" != x; then
printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" $ECHO "using configure arguments '$CONFIGURE_COMMAND_LINE'."
else else
printf "using default settings.\n" $ECHO "using default settings."
fi fi
if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then
printf "\n" $ECHO ""
printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n" $ECHO "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'."
fi fi
printf "\n" $ECHO ""
printf "Configuration summary:\n" $ECHO "Configuration summary:"
printf "* Name: $CONF_NAME\n" $ECHO "* Name: $CONF_NAME"
printf "* Debug level: $DEBUG_LEVEL\n" $ECHO "* Debug level: $DEBUG_LEVEL"
printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n" $ECHO "* HS debug level: $HOTSPOT_DEBUG_LEVEL"
printf "* JVM variants: $JVM_VARIANTS\n" $ECHO "* JVM variants: $JVM_VARIANTS"
printf "* JVM features: " $ECHO -n "* JVM features: "
for variant in $JVM_VARIANTS; do for variant in $JVM_VARIANTS; do
features_var_name=JVM_FEATURES_$variant features_var_name=JVM_FEATURES_$variant
JVM_FEATURES_FOR_VARIANT=${!features_var_name} JVM_FEATURES_FOR_VARIANT=${!features_var_name}
printf "$variant: \'$JVM_FEATURES_FOR_VARIANT\' " $ECHO -n "$variant: '$JVM_FEATURES_FOR_VARIANT' "
done done
printf "\n" $ECHO ""
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" $ECHO "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS"
printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n" $ECHO "* Version string: $VERSION_STRING ($VERSION_SHORT)"
if test "x$SOURCE_DATE" != xupdated; then if test "x$SOURCE_DATE" != xupdated; then
source_date_info="$SOURCE_DATE ($SOURCE_DATE_ISO_8601)" source_date_info="$SOURCE_DATE ($SOURCE_DATE_ISO_8601)"
else else
source_date_info="Determined at build time" source_date_info="Determined at build time"
fi fi
printf "* Source date: $source_date_info\n" $ECHO "* Source date: $source_date_info"
printf "\n" $ECHO ""
printf "Tools summary:\n" $ECHO "Tools summary:"
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
printf "* Environment: %s version %s; windows version %s; prefix \"%s\"; root \"%s\"\n" \ $ECHO "* Environment: $WINENV_VENDOR version $WINENV_VERSION; windows version $WINDOWS_VERSION; prefix \"$WINENV_PREFIX\"; root \"$WINENV_ROOT\""
"$WINENV_VENDOR" "$WINENV_VERSION" "$WINDOWS_VERSION" "$WINENV_PREFIX" "$WINENV_ROOT"
fi fi
printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" $ECHO "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)"
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" $ECHO "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)"
if test "x$DEVKIT_NAME" != x; then if test "x$DEVKIT_NAME" != x; then
printf "* Devkit: $DEVKIT_NAME ($DEVKIT_ROOT)\n" $ECHO "* Devkit: $DEVKIT_NAME ($DEVKIT_ROOT)"
elif test "x$DEVKIT_ROOT" != x; then elif test "x$DEVKIT_ROOT" != x; then
printf "* Devkit: $DEVKIT_ROOT\n" $ECHO "* Devkit: $DEVKIT_ROOT"
elif test "x$SYSROOT" != x; then elif test "x$SYSROOT" != x; then
printf "* Sysroot: $SYSROOT\n" $ECHO "* Sysroot: $SYSROOT"
fi fi
printf "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})\n" $ECHO "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})"
printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})\n" $ECHO "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})"
printf "\n" $ECHO ""
printf "Build performance summary:\n" $ECHO "Build performance summary:"
printf "* Build jobs: $JOBS\n" $ECHO "* Build jobs: $JOBS"
printf "* Memory limit: $MEMORY_SIZE MB\n" $ECHO "* Memory limit: $MEMORY_SIZE MB"
if test "x$CCACHE_STATUS" != "x"; then if test "x$CCACHE_STATUS" != "x"; then
printf "* ccache status: $CCACHE_STATUS\n" $ECHO "* ccache status: $CCACHE_STATUS"
fi fi
printf "\n" $ECHO ""
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
printf "NOTE: You have requested to build more than one version of the JVM, which\n" $ECHO "NOTE: You have requested to build more than one version of the JVM, which"
printf "will result in longer build times.\n" $ECHO "will result in longer build times."
printf "\n" $ECHO ""
fi fi
if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
printf "WARNING: Your build output directory is not on a local disk.\n" $ECHO "WARNING: Your build output directory is not on a local disk."
printf "This will severely degrade build performance!\n" $ECHO "This will severely degrade build performance!"
printf "It is recommended that you create an output directory on a local disk,\n" $ECHO "It is recommended that you create an output directory on a local disk,"
printf "and run the configure script again from that directory.\n" $ECHO "and run the configure script again from that directory."
printf "\n" $ECHO ""
fi fi
if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then
printf "WARNING: The result of this configuration has overridden an older\n" $ECHO "WARNING: The result of this configuration has overridden an older"
printf "configuration. You *should* run 'make clean' to make sure you get a\n" $ECHO "configuration. You *should* run 'make clean' to make sure you get a"
printf "proper build. Failure to do so might result in strange build problems.\n" $ECHO "proper build. Failure to do so might result in strange build problems."
printf "\n" $ECHO ""
fi fi
if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then
printf "WARNING: The result of this configuration was not saved.\n" $ECHO "WARNING: The result of this configuration was not saved."
printf "You should run without '--no-create | -n' to create the configuration.\n" $ECHO "You should run without '--no-create | -n' to create the configuration."
printf "\n" $ECHO ""
fi fi
if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
printf "WARNING: The toolchain version used is known to have issues. Please\n" $ECHO "WARNING: The toolchain version used is known to have issues. Please"
printf "consider using a supported version unless you know what you are doing.\n" $ECHO "consider using a supported version unless you know what you are doing."
printf "\n" $ECHO ""
fi fi
]) ])
@ -381,10 +383,10 @@ AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
if test -e "$CONFIG_LOG_PATH/config.log"; then if test -e "$CONFIG_LOG_PATH/config.log"; then
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1 $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
if test $? -eq 0; then if test $? -eq 0; then
printf "The following warnings were produced. Repeated here for convenience:\n" $ECHO "The following warnings were produced. Repeated here for convenience:"
# We must quote sed expression (using []) to stop m4 from eating the []. # We must quote sed expression (using []) to stop m4 from eating the [].
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ] $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
printf "\n" $ECHO ""
fi fi
fi fi
]) ])

View File

@ -58,13 +58,15 @@ ifeq ($(GENERATE_FIND_TESTS_FILE), true)
$(TOPDIR)/test/make/TestMake.gmk $(TOPDIR)/test/make/TestMake.gmk
$(call MakeTargetDir) $(call MakeTargetDir)
( $(foreach root, $(JTREG_TESTROOTS), \ ( $(foreach root, $(JTREG_TESTROOTS), \
$(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \ $(ECHO) ""; \
$(ECHO) -n "$(root)_JTREG_TEST_GROUPS := "; \
$(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \ $(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
$($(root)_JTREG_GROUP_FILES) \ $($(root)_JTREG_GROUP_FILES) \
| $(SORT) -u | $(TR) '\n' ' ' ; \ | $(SORT) -u | $(TR) '\n' ' ' ; \
) \ ) \
) > $@ ) > $@
$(PRINTF) "\nMAKE_TEST_TARGETS := " >> $@ $(ECHO) "" >> $@
$(ECHO) -n "MAKE_TEST_TARGETS := " >> $@
$(MAKE) -s --no-print-directory $(MAKE_ARGS) \ $(MAKE) -s --no-print-directory $(MAKE_ARGS) \
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \ SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
TARGETS_FILE=$@ TARGETS_FILE=$@

View File

@ -256,7 +256,7 @@ define SetupJarArchiveBody
$$(if $$($1_JARMAIN), \ $$(if $$($1_JARMAIN), \
$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \ $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
$$(if $$($1_EXTRA_MANIFEST_ATTR), \ $$(if $$($1_EXTRA_MANIFEST_ATTR), \
$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \ $(ECHO) "$$($1_EXTRA_MANIFEST_ATTR)" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
$(ECHO) Creating $$($1_NAME) $$(NEWLINE) \ $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
$$($1_JAR_CMD) --create $$($1_JAR_OPTIONS) --file $$@ --manifest $$($1_MANIFEST_FILE) $$(NEWLINE) \ $$($1_JAR_CMD) --create $$($1_JAR_OPTIONS) --file $$@ --manifest $$($1_MANIFEST_FILE) $$(NEWLINE) \
$$($1_SCAPTURE_CONTENTS) \ $$($1_SCAPTURE_CONTENTS) \

View File

@ -180,7 +180,7 @@ ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
$(call MakeTargetDir) $(call MakeTargetDir)
$(RM) $@ $(RM) $@
$(foreach m, $(MODULE_INFOS), \ $(foreach m, $(MODULE_INFOS), \
( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \ ( $(ECHO) -n "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \ $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \ BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/^ *requires/ { sub(/;/, ""); \ /^ *requires/ { sub(/;/, ""); \
@ -194,7 +194,7 @@ ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
gsub(/\r/, ""); \ gsub(/\r/, ""); \
printf(" %s", $$0) } \ printf(" %s", $$0) } \
END { printf("\n") }' $m && \ END { printf("\n") }' $m && \
$(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) := " && \ $(ECHO) -n "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) := " && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \ $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \ BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/^ *requires *transitive/ { \ /^ *requires *transitive/ { \

View File

@ -41,8 +41,8 @@ include $(TOPDIR)/make/ToolsJdk.gmk
define SetupVersionProperties define SetupVersionProperties
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2): $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2):
$$(call MakeTargetDir) $$(call MakeTargetDir)
$(PRINTF) "jdk=$(VERSION_NUMBER)\nfull=$(VERSION_STRING)\nrelease=$(VERSION_SHORT)\n" \ $(PRINTF) "jdk=%s\nfull=%s\nrelease=%s\n" \
> $$@ $(VERSION_NUMBER) $(VERSION_STRING) $(VERSION_SHORT) > $$@
$$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2) $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2)
endef endef

View File

@ -99,7 +99,7 @@ JVMCFG := $(LIB_DST_DIR)/jvm.cfg
define print-cfg-line define print-cfg-line
$(call LogInfo, Adding -$1 $2 to jvm.cfg) $(call LogInfo, Adding -$1 $2 to jvm.cfg)
$(PRINTF) -- "-$1 $2\n" >> $@ $(NEWLINE) $(ECHO) "-$1 $2" >> $@ $(NEWLINE)
endef endef
$(JVMCFG): $(call DependOnVariable, ORDERED_CFG_VARIANTS) $(JVMCFG): $(call DependOnVariable, ORDERED_CFG_VARIANTS)

View File

@ -272,7 +272,7 @@ define SetupGenBuffer
$$($1_long_CMD) -i$$($1_SRC_BIN) -o$$($1_DST).tmp $$($1_long_CMD) -i$$($1_SRC_BIN) -o$$($1_DST).tmp
$$($1_float_CMD) -i$$($1_SRC_BIN) -o$$($1_DST).tmp $$($1_float_CMD) -i$$($1_SRC_BIN) -o$$($1_DST).tmp
$$($1_double_CMD) -i$$($1_SRC_BIN) -o$$($1_DST).tmp $$($1_double_CMD) -i$$($1_SRC_BIN) -o$$($1_DST).tmp
$(PRINTF) "}\n" >> $$($1_DST).tmp $(ECHO) "}" >> $$($1_DST).tmp
mv $$($1_DST).tmp $$($1_DST) mv $$($1_DST).tmp $$($1_DST)
endif endif

View File

@ -163,7 +163,7 @@ $(SCOPED_MEMORY_ACCESS_DEST): $(BUILD_TOOLS_JDK) $(SCOPED_MEMORY_ACCESS_TEMPLATE
$(foreach t, $(SCOPE_MEMORY_ACCESS_TYPES), \ $(foreach t, $(SCOPE_MEMORY_ACCESS_TYPES), \
$(TOOL_SPP) -nel -K$(BIN_$t_type) -Dtype=$(BIN_$t_type) -DType=$(BIN_$t_Type) $(BIN_$t_ARGS) \ $(TOOL_SPP) -nel -K$(BIN_$t_type) -Dtype=$(BIN_$t_type) -DType=$(BIN_$t_Type) $(BIN_$t_ARGS) \
-i$(SCOPED_MEMORY_ACCESS_BIN_TEMPLATE) -o$(SCOPED_MEMORY_ACCESS_DEST) ;) -i$(SCOPED_MEMORY_ACCESS_BIN_TEMPLATE) -o$(SCOPED_MEMORY_ACCESS_DEST) ;)
$(PRINTF) "}\n" >> $(SCOPED_MEMORY_ACCESS_DEST) $(ECHO) "}" >> $(SCOPED_MEMORY_ACCESS_DEST)
TARGETS += $(SCOPED_MEMORY_ACCESS_DEST) TARGETS += $(SCOPED_MEMORY_ACCESS_DEST)

View File

@ -203,12 +203,12 @@ compare_permissions() {
do do
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` OP=`ls -l ${OTHER_DIR}/$f | $AWK '{printf("%.10s\n", $1);}'`
TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` TP=`ls -l ${THIS_DIR}/$f | $AWK '{printf("%.10s\n", $1);}'`
if [ "$OP" != "$TP" ] if [ "$OP" != "$TP" ]
then then
if [ -z "$found" ]; then echo ; found="yes"; fi if [ -z "$found" ]; then echo ; found="yes"; fi
$PRINTF "\tother: ${OP} this: ${TP}\t$f\n" $PRINTF "\tother: %s this: %s\t%s\n" "${OP}" "${TP}" "$f"
fi fi
done done
if [ -z "$found" ]; then if [ -z "$found" ]; then
@ -260,7 +260,7 @@ compare_file_types() {
continue continue
else else
if [ -z "$found" ]; then echo ; found="yes"; fi if [ -z "$found" ]; then echo ; found="yes"; fi
$PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" $PRINTF "\tother: %s\n\tthis : %s\n" "${OF}" "${TF}"
fi fi
fi fi
done done

View File

@ -92,14 +92,16 @@ AC_DEFUN([TEST_ARG_ENABLE],
# Use the CUSTOM_EARLY_HOOK to inject our test after basic init is done. # Use the CUSTOM_EARLY_HOOK to inject our test after basic init is done.
AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK], AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK],
[ [
$PRINTF "\nStarting configure tests\n" $ECHO ""
$PRINTF "==============================\n" $ECHO "Starting configure tests"
$ECHO "=============================="
TEST_STRING_OPS TEST_STRING_OPS
TEST_ARG_ENABLE TEST_ARG_ENABLE
# If no assertions failed, report success # If no assertions failed, report success
$PRINTF "==============================\n" $ECHO "=============================="
$PRINTF "Configure tests finished successfully\n\n" $ECHO "Configure tests finished successfully"
$ECHO ""
exit 0 exit 0
]) ])