8024620: config.log does not end up in corresponding configuration

Reviewed-by: erikj
diff --git a/common/autoconf/configure b/common/autoconf/configure
index 8e4560d..7378efe3 100644
--- a/common/autoconf/configure
+++ b/common/autoconf/configure
@@ -219,9 +219,4 @@
   echo configure exiting with result code $conf_result_code
 fi
 
-# Move the log file to the output root, if this was successfully created
-if test -d "$OUTPUT_ROOT"; then
-  mv -f config.log "$OUTPUT_ROOT" 2> /dev/null
-fi
-
 exit $conf_result_code
diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac
index 274f278..ad8bd97 100644
--- a/common/autoconf/configure.ac
+++ b/common/autoconf/configure.ac
@@ -232,9 +232,15 @@
 # We're messing a bit with internal autoconf variables to put the config.status
 # in the output directory instead of the current directory.
 CONFIG_STATUS="$OUTPUT_ROOT/config.status"
+
 # Create the actual output files. Now the main work of configure is done.
 AC_OUTPUT
 
+# 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
 
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 84c38a6..f273159 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -3806,7 +3806,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1378980507
+DATE_WHEN_GENERATED=1379070243
 
 ###############################################################################
 #
@@ -33186,6 +33186,7 @@
 # We're messing a bit with internal autoconf variables to put the config.status
 # in the output directory instead of the current directory.
 CONFIG_STATUS="$OUTPUT_ROOT/config.status"
+
 # Create the actual output files. Now the main work of configure is done.
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -34467,6 +34468,11 @@
 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