# HG changeset patch # User ihse # Date 1431344739 -7200 # Mon May 11 13:45:39 2015 +0200 # Node ID 7cf12efdd88d30cc51aeeab4526068010fb86d4d # Parent 34cd25653b9dfa7e0d234b49abf59c0bec9ec53b 8079891: Store configure log in $BUILD/configure.log Reviewed-by: erikj diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -929,3 +929,24 @@ IS_RECONFIGURE=no fi ]) + +# Code to run after AC_OUTPUT +AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT], +[ + # Rotate our log file (configure.log) + if test -e "$OUTPUT_ROOT/configure.log.old"; then + $RM -f "$OUTPUT_ROOT/configure.log.old" + fi + if test -e "$OUTPUT_ROOT/configure.log"; then + $MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null + fi + + # Move configure.log from current directory to the build output root + if test -e ./configure.log; then + echo found it + $MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null + fi + + # Make the compare script executable + $CHMOD +x $OUTPUT_ROOT/compare.sh +]) diff --git a/common/autoconf/configure b/common/autoconf/configure --- a/common/autoconf/configure +++ b/common/autoconf/configure @@ -250,13 +250,10 @@ set -x fi -if test "x$conf_debug_configure" = xtrue; then - # Turn on logging, but don't turn on twice when called recursive - conf_debug_logfile=./debug-configure.log - (exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile -else - ( . $conf_script_to_run "${conf_processed_arguments[@]}" ) -fi +# Now transfer control to the script generated by autoconf. This is where the +# main work is done. +conf_logfile=./configure.log +(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile conf_result_code=$? ### diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac --- a/common/autoconf/configure.ac +++ b/common/autoconf/configure.ac @@ -262,15 +262,10 @@ # Create the actual output files. Now the main work of configure is done. AC_OUTPUT + +# After AC_OUTPUT, we need to do final work CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK - -# Try to move the config.log file to the output directory. -if test -e ./config.log; then - $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null -fi - -# Make the compare script executable -$CHMOD +x $OUTPUT_ROOT/compare.sh +BASIC_POST_CONFIG_OUTPUT # Finally output some useful information to the user HELP_PRINT_SUMMARY_AND_WARNINGS diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -3497,6 +3497,9 @@ +# Code to run after AC_OUTPUT + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4396,7 +4399,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1625573051 +DATE_WHEN_GENERATED=1625576365 ############################################################################### # @@ -54555,14 +54558,26 @@ fi - -# Try to move the config.log file to the output directory. -if test -e ./config.log; then - $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null -fi - -# Make the compare script executable -$CHMOD +x $OUTPUT_ROOT/compare.sh +# After AC_OUTPUT, we need to do final work + + + # Rotate our log file (configure.log) + if test -e "$OUTPUT_ROOT/configure.log.old"; then + $RM -f "$OUTPUT_ROOT/configure.log.old" + fi + if test -e "$OUTPUT_ROOT/configure.log"; then + $MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null + fi + + # Move configure.log from current directory to the build output root + if test -e ./configure.log; then + echo found it + $MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null + fi + + # Make the compare script executable + $CHMOD +x $OUTPUT_ROOT/compare.sh + # Finally output some useful information to the user @@ -54640,14 +54655,18 @@ fi -if test -e "$OUTPUT_ROOT/config.log"; then - $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1 - if test $? -eq 0; then - printf "The following warnings were produced. Repeated here for convenience:\n" - # We must quote sed expression (using []) to stop m4 from eating the []. - $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e 's/^configure:[0-9]*: //' - printf "\n" - fi -fi - - + # Locate config.log. + if test -e "./config.log"; then + CONFIG_LOG_PATH="." + fi + + 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" + # 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" + fi + fi + diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4 --- a/common/autoconf/help.m4 +++ b/common/autoconf/help.m4 @@ -201,7 +201,7 @@ printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" fi printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" + printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" @@ -252,14 +252,18 @@ AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS], [ -if test -e "$OUTPUT_ROOT/config.log"; then - $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1 - if test $? -eq 0; then - printf "The following warnings were produced. Repeated here for convenience:\n" - # We must quote sed expression (using []) to stop m4 from eating the []. - $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ] - printf "\n" + # Locate config.log. + if test -e "./config.log"; then + CONFIG_LOG_PATH="." fi -fi + 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" + # 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" + fi + fi ])