# HG changeset patch # User erikj # Date 1372413757 -7200 # Node ID 78aaf5d3314de82ac70e2702e2c2edc4d21492d1 # Parent 0e533ceee717504fed313698a8bc5f84811868dc 8010385: build with LOG=trace broken on mac Reviewed-by: dholmes, tbell, prr diff -r 0e533ceee717 -r 78aaf5d3314d common/autoconf/basics.m4 --- a/common/autoconf/basics.m4 Fri Jun 28 12:00:03 2013 +0200 +++ b/common/autoconf/basics.m4 Fri Jun 28 12:02:37 2013 +0200 @@ -622,6 +622,14 @@ AC_PATH_PROG(HG, hg) AC_PATH_PROG(STAT, stat) AC_PATH_PROG(TIME, time) +# Check if it's GNU time +IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` +if test "x$IS_GNU_TIME" != x; then + IS_GNU_TIME=yes +else + IS_GNU_TIME=no +fi +AC_SUBST(IS_GNU_TIME) if test "x$OPENJDK_TARGET_OS" = "xwindows"; then BASIC_REQUIRE_PROG(COMM, comm) diff -r 0e533ceee717 -r 78aaf5d3314d common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Fri Jun 28 12:00:03 2013 +0200 +++ b/common/autoconf/generated-configure.sh Fri Jun 28 12:02:37 2013 +0200 @@ -799,6 +799,7 @@ PKG_CONFIG CODESIGN XATTR +IS_GNU_TIME TIME STAT HG @@ -3785,7 +3786,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1372413413 +DATE_WHEN_GENERATED=1372413705 ############################################################################### # @@ -10472,6 +10473,14 @@ fi +# Check if it's GNU time +IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` +if test "x$IS_GNU_TIME" != x; then + IS_GNU_TIME=yes +else + IS_GNU_TIME=no +fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then diff -r 0e533ceee717 -r 78aaf5d3314d common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in Fri Jun 28 12:00:03 2013 +0200 +++ b/common/autoconf/spec.gmk.in Fri Jun 28 12:02:37 2013 +0200 @@ -510,6 +510,7 @@ TAIL:=@TAIL@ TEE:=@TEE@ TIME:=@TIME@ +IS_GNU_TIME:=@IS_GNU_TIME@ TR:=@TR@ TOUCH:=@TOUCH@ UNIQ:=@UNIQ@ diff -r 0e533ceee717 -r 78aaf5d3314d common/makefiles/MakeBase.gmk --- a/common/makefiles/MakeBase.gmk Fri Jun 28 12:00:03 2013 +0200 +++ b/common/makefiles/MakeBase.gmk Fri Jun 28 12:02:37 2013 +0200 @@ -332,9 +332,11 @@ # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make # For each target executed, will print # Building (from ) ( newer) - # but with a limit of 20 on , to avoid cluttering logs too much (and causing a crash on Cygwin). - OLD_SHELL:=$$(SHELL) - WRAPPER_SHELL:=$$(OLD_SHELL) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(TIME),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(OLD_SHELL) + # but with a limit of 20 on , to avoid cluttering logs too much + # (and causing a crash on Cygwin). + # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris. + # Only use time if it's GNU time which supports format and output file. + WRAPPER_SHELL:=/bin/bash $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log /bin/bash SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL) endif # Never remove warning messages; this is just for completeness