diff --git a/make/Docs.gmk b/make/Docs.gmk index 49c97946f75..0948f8ff76c 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -264,7 +264,7 @@ define create_overview_file $$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE) $$(call LogInfo, Creating overview.html for $1) $$(call MakeDir, $$(@D)) - $$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)' + $$(ECHO) -n '$$($1_OVERVIEW_TEXT)' > $$@ endef ################################################################################ diff --git a/make/Init.gmk b/make/Init.gmk index 2a8f6399a18..5dd1a71dd9a 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -137,7 +137,7 @@ main: MAKEOVERRIDES := main: $(INIT_TARGETS) ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), ) $(call RotateLogFiles) - $(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE) + $(ECHO) "Building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE) ifneq ($(SEQUENTIAL_TARGETS), ) # Don't touch build output dir since we might be cleaning. That # means no log pipe. @@ -158,7 +158,8 @@ main: $(INIT_TARGETS) -f make/Main.gmk $(USER_MAKE_VARS) \ $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \ ( 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) && \ cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ on-failure ; \ @@ -170,7 +171,7 @@ main: $(INIT_TARGETS) if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \ exit 1 ; \ fi - $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE) + $(ECHO) "Finished building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE) $(call ReportProfileTimes) endif @@ -181,7 +182,8 @@ on-failure: $(call PrintFailureReports) $(call PrintBuildLogFailures) $(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), ) $(call CleanupCompareBuild) endif diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index a9af44e4225..809d1128692 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -173,9 +173,10 @@ define PrintFailureReports $(RM) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.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)), \ - $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" ; \ + $(ECHO) "* For target $(notdir $(basename $(logfile))):" ; \ $(if $(filter all, $(LOG_REPORT)), \ $(GREP) -v -e "^Note: including file:" < $(logfile) || true ; \ , \ @@ -185,8 +186,9 @@ define PrintFailureReports fi ; \ ) \ ) \ - $(PRINTF) "\n* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs.\n" ; \ - $(PRINTF) "=== End of repeated output ===\n" ; \ + $(ECHO) "" ; \ + $(ECHO) "* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs." ; \ + $(ECHO) "=== End of repeated output ===" ; \ ) >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \ ) \ ) @@ -195,13 +197,16 @@ endef define PrintBuildLogFailures $(if $(filter none, $(LOG_REPORT)), , \ 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) ; \ - $(PRINTF) "=== End of repeated output ===\n" ; \ - $(PRINTF) "\nHELP: Try searching the build log for the name of the first failed target.\n" ; \ + $(ECHO) "=== End of repeated output ===" ; \ + $(ECHO) "" ; \ + $(ECHO) "HELP: Try searching the build log for the name of the first failed target." ; \ else \ - $(PRINTF) "\nNo indication of failed target found.\n" ; \ - $(PRINTF) "HELP: Try searching the build log for '] Error'.\n" ; \ + $(ECHO) "" ; \ + $(ECHO) "No indication of failed target found." ; \ + $(ECHO) "HELP: Try searching the build log for '] Error'." ; \ fi >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \ $(CAT) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \ ) diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk index f7ba4de2d53..ae4858c35af 100644 --- a/make/MainSupport.gmk +++ b/make/MainSupport.gmk @@ -57,77 +57,77 @@ define SetupTargetBody endef define CleanDocs - @$(PRINTF) "Cleaning docs ..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning docs ..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(SUPPORT_OUTPUTDIR)/docs $(RM) -r $(SUPPORT_OUTPUTDIR)/javadoc $(RM) -r $(IMAGES_OUTPUTDIR)/docs - @$(PRINTF) " done\n" + @$(ECHO) " done" endef # Cleans the dir given as $1 define CleanDir - @$(PRINTF) "Cleaning $(strip $1) build artifacts ..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning $(strip $1) build artifacts ..." + @$(ECHO) "" $(LOG_DEBUG) ($(CD) $(OUTPUTDIR) && $(RM) -r $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define CleanSupportDir - @$(PRINTF) "Cleaning $(strip $1) build artifacts ..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning$(strip $1) build artifacts ..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(SUPPORT_OUTPUTDIR)/$(strip $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define CleanMakeSupportDir - @$(PRINTF) "Cleaning $(strip $1) make support artifacts ..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning $(strip $1) make support artifacts ..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define CleanTest - @$(PRINTF) "Cleaning test $(strip $1) ..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning test $(strip $1) ..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1)) # Remove as much of the test directory structure as is empty $(RMDIR) -p $(dir $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))) 2> /dev/null || true - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define Clean-gensrc - @$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning gensrc $(if $1,for $(strip $1) )..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define Clean-java - @$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning java $(if $1,for $(strip $1) )..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/special_classes/$(strip $1) - $(PRINTF) " done\n" - $(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..." + $(ECHO) " done" + $(ECHO) -n "Cleaning headers $(if $1,for $(strip $1) )..." $(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define Clean-native - @$(PRINTF) "Cleaning native $(if $1,for $(strip $1) )..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning native $(if $1,for $(strip $1) )..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1) $(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define Clean-include - @$(PRINTF) "Cleaning include $(if $1,for $(strip $1) )..." - @$(PRINTF) "\n" $(LOG_DEBUG) + @$(ECHO) -n "Cleaning include $(if $1,for $(strip $1) )..." + @$(ECHO) "" $(LOG_DEBUG) $(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1) - @$(PRINTF) " done\n" + @$(ECHO) " done" endef define CleanModule diff --git a/make/RunTests.gmk b/make/RunTests.gmk index b9fd3e755d1..7aa0082e0ae 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -1017,7 +1017,8 @@ define SetupRunJtregTestBody $1_COMMAND_LINE := \ for i in {0..$$(JTREG_RETRY_COUNT)}; do \ if [ "$$$$i" != 0 ]; then \ - $$(PRINTF) "\nRetrying Jtreg run. Attempt: $$$$i\n"; \ + $$(ECHO) ""; \ + $$(ECHO) "Retrying Jtreg run. Attempt: $$$$i"; \ fi; \ $$($1_COMMAND_LINE); \ if [ "`$$(CAT) $$($1_EXITCODE)`" = "0" ]; then \ @@ -1030,10 +1031,12 @@ define SetupRunJtregTestBody ifneq ($$(JTREG_REPEAT_COUNT), 0) $1_COMMAND_LINE := \ 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); \ if [ "`$$(CAT) $$($1_EXITCODE)`" != "0" ]; then \ - $$(PRINTF) "\nFailures detected, no more repeats.\n"; \ + $$(ECHO) ""; \ + $$(ECHO) "Failures detected, no more repeats."; \ break; \ fi; \ done diff --git a/make/SourceRevision.gmk b/make/SourceRevision.gmk index 285aaae17b5..15399527e6a 100644 --- a/make/SourceRevision.gmk +++ b/make/SourceRevision.gmk @@ -55,7 +55,7 @@ ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), ) SCM_DIR := .git ID_COMMAND := $(PRINTF) "git:%s%s\n" \ "$$($(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 ifeq ($(USE_SCM), true) diff --git a/make/autoconf/help.m4 b/make/autoconf/help.m4 index 400acf11a63..93796d27f06 100644 --- a/make/autoconf/help.m4 +++ b/make/autoconf/help.m4 @@ -228,19 +228,19 @@ AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then # Print available toolchains - $PRINTF "The following toolchains are valid as arguments to --with-toolchain-type.\n" - $PRINTF "Which are available to use depends on the build platform.\n" + $ECHO "The following toolchains are valid as arguments to --with-toolchain-type." + $ECHO "Which are available to use depends on the build platform." for toolchain in $VALID_TOOLCHAINS_all; do # Use indirect variable referencing toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} $PRINTF " %-22s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" done - $PRINTF "\n" + $ECHO "" # Print available JVM features - $PRINTF "The following JVM features are valid as arguments to --with-jvm-features.\n" - $PRINTF "Which are available to use depends on the environment and JVM variant.\n" + $ECHO "The following JVM features are valid as arguments to --with-jvm-features." + $ECHO "Which are available to use depends on the environment and JVM variant." m4_foreach(FEATURE, m4_split(jvm_features_valid), [ # Create an m4 variable containing the description for 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 - printf "\n" - printf "====================================================\n" + $ECHO "" + $ECHO "====================================================" if test "x$no_create" != "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 - 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 else 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 - 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 if test "x$CONFIGURE_COMMAND_LINE" != x; then - printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" + $ECHO "using configure arguments '$CONFIGURE_COMMAND_LINE'." else - printf "using default settings.\n" + $ECHO "using default settings." fi if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then - printf "\n" - printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n" + $ECHO "" + $ECHO "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'." fi - printf "\n" - printf "Configuration summary:\n" - printf "* Name: $CONF_NAME\n" - printf "* Debug level: $DEBUG_LEVEL\n" - printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n" - printf "* JVM variants: $JVM_VARIANTS\n" - printf "* JVM features: " + $ECHO "" + $ECHO "Configuration summary:" + $ECHO "* Name: $CONF_NAME" + $ECHO "* Debug level: $DEBUG_LEVEL" + $ECHO "* HS debug level: $HOTSPOT_DEBUG_LEVEL" + $ECHO "* JVM variants: $JVM_VARIANTS" + $ECHO -n "* JVM features: " for variant in $JVM_VARIANTS; do features_var_name=JVM_FEATURES_$variant JVM_FEATURES_FOR_VARIANT=${!features_var_name} - printf "$variant: \'$JVM_FEATURES_FOR_VARIANT\' " + $ECHO -n "$variant: '$JVM_FEATURES_FOR_VARIANT' " done - printf "\n" + $ECHO "" - printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" - printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n" + $ECHO "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS" + $ECHO "* Version string: $VERSION_STRING ($VERSION_SHORT)" if test "x$SOURCE_DATE" != xupdated; then source_date_info="$SOURCE_DATE ($SOURCE_DATE_ISO_8601)" else source_date_info="Determined at build time" fi - printf "* Source date: $source_date_info\n" + $ECHO "* Source date: $source_date_info" - printf "\n" - printf "Tools summary:\n" + $ECHO "" + $ECHO "Tools summary:" if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - printf "* Environment: %s version %s; windows version %s; prefix \"%s\"; root \"%s\"\n" \ - "$WINENV_VENDOR" "$WINENV_VERSION" "$WINDOWS_VERSION" "$WINENV_PREFIX" "$WINENV_ROOT" + $ECHO "* Environment: $WINENV_VENDOR version $WINENV_VERSION; windows version $WINDOWS_VERSION; prefix \"$WINENV_PREFIX\"; root \"$WINENV_ROOT\"" fi - printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" + $ECHO "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)" + $ECHO "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)" 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 - printf "* Devkit: $DEVKIT_ROOT\n" + $ECHO "* Devkit: $DEVKIT_ROOT" elif test "x$SYSROOT" != x; then - printf "* Sysroot: $SYSROOT\n" + $ECHO "* Sysroot: $SYSROOT" fi - printf "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})\n" - printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})\n" + $ECHO "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})" + $ECHO "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})" - printf "\n" - printf "Build performance summary:\n" - printf "* Build jobs: $JOBS\n" - printf "* Memory limit: $MEMORY_SIZE MB\n" + $ECHO "" + $ECHO "Build performance summary:" + $ECHO "* Build jobs: $JOBS" + $ECHO "* Memory limit: $MEMORY_SIZE MB" if test "x$CCACHE_STATUS" != "x"; then - printf "* ccache status: $CCACHE_STATUS\n" + $ECHO "* ccache status: $CCACHE_STATUS" fi - printf "\n" + $ECHO "" 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" - printf "will result in longer build times.\n" - printf "\n" + $ECHO "NOTE: You have requested to build more than one version of the JVM, which" + $ECHO "will result in longer build times." + $ECHO "" fi if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then - printf "WARNING: Your build output directory is not on a local disk.\n" - printf "This will severely degrade build performance!\n" - printf "It is recommended that you create an output directory on a local disk,\n" - printf "and run the configure script again from that directory.\n" - printf "\n" + $ECHO "WARNING: Your build output directory is not on a local disk." + $ECHO "This will severely degrade build performance!" + $ECHO "It is recommended that you create an output directory on a local disk," + $ECHO "and run the configure script again from that directory." + $ECHO "" fi if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then - printf "WARNING: The result of this configuration has overridden an older\n" - printf "configuration. You *should* run 'make clean' to make sure you get a\n" - printf "proper build. Failure to do so might result in strange build problems.\n" - printf "\n" + $ECHO "WARNING: The result of this configuration has overridden an older" + $ECHO "configuration. You *should* run 'make clean' to make sure you get a" + $ECHO "proper build. Failure to do so might result in strange build problems." + $ECHO "" fi if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then - printf "WARNING: The result of this configuration was not saved.\n" - printf "You should run without '--no-create | -n' to create the configuration.\n" - printf "\n" + $ECHO "WARNING: The result of this configuration was not saved." + $ECHO "You should run without '--no-create | -n' to create the configuration." + $ECHO "" fi if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then - printf "WARNING: The toolchain version used is known to have issues. Please\n" - printf "consider using a supported version unless you know what you are doing.\n" - printf "\n" + $ECHO "WARNING: The toolchain version used is known to have issues. Please" + $ECHO "consider using a supported version unless you know what you are doing." + $ECHO "" fi ]) @@ -381,10 +383,10 @@ AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS], if test -e "$CONFIG_LOG_PATH/config.log"; then $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1 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 []. $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ] - printf "\n" + $ECHO "" fi fi ]) diff --git a/make/common/FindTests.gmk b/make/common/FindTests.gmk index 1f3a70b3035..41cf08d9e48 100644 --- a/make/common/FindTests.gmk +++ b/make/common/FindTests.gmk @@ -58,13 +58,15 @@ ifeq ($(GENERATE_FIND_TESTS_FILE), true) $(TOPDIR)/test/make/TestMake.gmk $(call MakeTargetDir) ( $(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' \ $($(root)_JTREG_GROUP_FILES) \ | $(SORT) -u | $(TR) '\n' ' ' ; \ ) \ ) > $@ - $(PRINTF) "\nMAKE_TEST_TARGETS := " >> $@ + $(ECHO) "" >> $@ + $(ECHO) -n "MAKE_TEST_TARGETS := " >> $@ $(MAKE) -s --no-print-directory $(MAKE_ARGS) \ SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \ TARGETS_FILE=$@ diff --git a/make/common/JarArchive.gmk b/make/common/JarArchive.gmk index 1f8ed1bc002..26a98f28949 100644 --- a/make/common/JarArchive.gmk +++ b/make/common/JarArchive.gmk @@ -256,7 +256,7 @@ define SetupJarArchiveBody $$(if $$($1_JARMAIN), \ $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \ $$(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) \ $$($1_JAR_CMD) --create $$($1_JAR_OPTIONS) --file $$@ --manifest $$($1_MANIFEST_FILE) $$(NEWLINE) \ $$($1_SCAPTURE_CONTENTS) \ diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index f4f815c740d..663e9075cf8 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -180,7 +180,7 @@ ifeq ($(GENERATE_MODULE_DEPS_FILE), true) $(call MakeTargetDir) $(RM) $@ $(foreach m, $(MODULE_INFOS), \ - ( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \ + ( $(ECHO) -n "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \ $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \ BEGIN { if (MODULE != "java.base") printf(" java.base"); } \ /^ *requires/ { sub(/;/, ""); \ @@ -194,7 +194,7 @@ ifeq ($(GENERATE_MODULE_DEPS_FILE), true) gsub(/\r/, ""); \ printf(" %s", $$0) } \ END { printf("\n") }' $m && \ - $(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) := " && \ + $(ECHO) -n "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) := " && \ $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \ BEGIN { if (MODULE != "java.base") printf(" java.base"); } \ /^ *requires *transitive/ { \ diff --git a/make/common/modules/GensrcCommon.gmk b/make/common/modules/GensrcCommon.gmk index 64d1f71d82e..2a94c3f9a42 100644 --- a/make/common/modules/GensrcCommon.gmk +++ b/make/common/modules/GensrcCommon.gmk @@ -41,8 +41,8 @@ include $(TOPDIR)/make/ToolsJdk.gmk define SetupVersionProperties $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2): $$(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) endef diff --git a/make/modules/java.base/Copy.gmk b/make/modules/java.base/Copy.gmk index e33676529cd..4625c1f7dbc 100644 --- a/make/modules/java.base/Copy.gmk +++ b/make/modules/java.base/Copy.gmk @@ -99,7 +99,7 @@ JVMCFG := $(LIB_DST_DIR)/jvm.cfg define print-cfg-line $(call LogInfo, Adding -$1 $2 to jvm.cfg) - $(PRINTF) -- "-$1 $2\n" >> $@ $(NEWLINE) + $(ECHO) "-$1 $2" >> $@ $(NEWLINE) endef $(JVMCFG): $(call DependOnVariable, ORDERED_CFG_VARIANTS) diff --git a/make/modules/java.base/gensrc/GensrcBuffer.gmk b/make/modules/java.base/gensrc/GensrcBuffer.gmk index f769a8e61e0..dd91c8c870a 100644 --- a/make/modules/java.base/gensrc/GensrcBuffer.gmk +++ b/make/modules/java.base/gensrc/GensrcBuffer.gmk @@ -272,7 +272,7 @@ define SetupGenBuffer $$($1_long_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 - $(PRINTF) "}\n" >> $$($1_DST).tmp + $(ECHO) "}" >> $$($1_DST).tmp mv $$($1_DST).tmp $$($1_DST) endif diff --git a/make/modules/java.base/gensrc/GensrcScopedMemoryAccess.gmk b/make/modules/java.base/gensrc/GensrcScopedMemoryAccess.gmk index 00fba64394b..ea51e4fd4ee 100644 --- a/make/modules/java.base/gensrc/GensrcScopedMemoryAccess.gmk +++ b/make/modules/java.base/gensrc/GensrcScopedMemoryAccess.gmk @@ -163,7 +163,7 @@ $(SCOPED_MEMORY_ACCESS_DEST): $(BUILD_TOOLS_JDK) $(SCOPED_MEMORY_ACCESS_TEMPLATE $(foreach t, $(SCOPE_MEMORY_ACCESS_TYPES), \ $(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) ;) - $(PRINTF) "}\n" >> $(SCOPED_MEMORY_ACCESS_DEST) + $(ECHO) "}" >> $(SCOPED_MEMORY_ACCESS_DEST) TARGETS += $(SCOPED_MEMORY_ACCESS_DEST) diff --git a/make/scripts/compare.sh b/make/scripts/compare.sh index cc2f4adf2ed..250b5a37b9f 100644 --- a/make/scripts/compare.sh +++ b/make/scripts/compare.sh @@ -203,12 +203,12 @@ compare_permissions() { do if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi if [ ! -f ${THIS_DIR}/$f ]; then continue; fi - OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` - TP=`ls -l ${THIS_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);}'` if [ "$OP" != "$TP" ] then 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 done if [ -z "$found" ]; then @@ -260,7 +260,7 @@ compare_file_types() { continue else 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 done diff --git a/test/make/autoconf/test.m4 b/test/make/autoconf/test.m4 index 07fb91f6ff7..0aa002ef9bf 100644 --- a/test/make/autoconf/test.m4 +++ b/test/make/autoconf/test.m4 @@ -92,14 +92,16 @@ AC_DEFUN([TEST_ARG_ENABLE], # Use the CUSTOM_EARLY_HOOK to inject our test after basic init is done. AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK], [ - $PRINTF "\nStarting configure tests\n" - $PRINTF "==============================\n" + $ECHO "" + $ECHO "Starting configure tests" + $ECHO "==============================" TEST_STRING_OPS TEST_ARG_ENABLE # If no assertions failed, report success - $PRINTF "==============================\n" - $PRINTF "Configure tests finished successfully\n\n" + $ECHO "==============================" + $ECHO "Configure tests finished successfully" + $ECHO "" exit 0 ])