changeset 2552:7cf12efdd88d

8079891: Store configure log in $BUILD/configure.log Reviewed-by: erikj
author ihse
date Mon, 11 May 2015 13:45:39 +0200
parents 34cd25653b9d
children 432eda47feff
files common/autoconf/basics.m4 common/autoconf/configure common/autoconf/configure.ac common/autoconf/generated-configure.sh common/autoconf/help.m4
diffstat 5 files changed, 80 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/basics.m4	Fri Nov 21 16:11:28 2014 +0100
+++ b/common/autoconf/basics.m4	Mon May 11 13:45:39 2015 +0200
@@ -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
+])
--- a/common/autoconf/configure	Fri Nov 21 16:11:28 2014 +0100
+++ b/common/autoconf/configure	Mon May 11 13:45:39 2015 +0200
@@ -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=$?
 ###
--- a/common/autoconf/configure.ac	Fri Nov 21 16:11:28 2014 +0100
+++ b/common/autoconf/configure.ac	Mon May 11 13:45:39 2015 +0200
@@ -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
--- a/common/autoconf/generated-configure.sh	Fri Nov 21 16:11:28 2014 +0100
+++ b/common/autoconf/generated-configure.sh	Mon May 11 13:45:39 2015 +0200
@@ -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
+
--- a/common/autoconf/help.m4	Fri Nov 21 16:11:28 2014 +0100
+++ b/common/autoconf/help.m4	Mon May 11 13:45:39 2015 +0200
@@ -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
 ])