This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: include configure arguments in gccbug


This patch changes how the toplevel configure arguments are saved and
compiled into gcc, and makes gccbug include them automatically.  The
improvements are:

* The toplevel configure was saving them too late; some changes, such
as "--prefix /foo" changing to "--prefix=/foo", were already made by
then.  This patch saves $@ before any such changes have been made.

* This patch includes the name ($0) by which configure was invoked -
so cases where GCC was configured in the source directory may be
distinguished from when it was configured outside, which may
occasionally be of use.

* The old version didn't make the information available in
gcc/configargs.h in time for it to be substituted into gccbug.  Since
the main purpose of this patch is to get gccbug to include that
information, the change was necessary so that the configure in the gcc
directory has this information.  Use of an environment variable may
also make it more useful for other programs compiled in a unified
source tree that might wish to include this information but not in a
header "gcc/configargs.h".

* This version also detects reconfiguration and in such a case appends
the arguments that get used on reconfiguration (which may include
synthetic ones in some cases) to the existing ones in configargs.h,
giving a clearer configuration history.

Bootstrapped with no regressions on i686-pc-linux-gnu.  OK to commit?

ChangeLog:
2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>

	* configure: Provide the original toplevel configure arguments
	(including $0) to subprocesses in the environment rather than
	through gcc/configargs.h.

gcc/ChangeLog:
2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>

	* configure.in: Take toplevel configure arguments from the
	environment to create configargs.h and substitute
	gcc_config_arguments, taking account of any existing configargs.h
	if reconfiguring.
	* configure: Regenerate.
	* gccbug.in: Include toplevel configure arguments in gccbug.

--- configure.orig	Tue Oct 17 06:46:06 2000
+++ configure	Tue Nov  7 00:51:17 2000
@@ -161,6 +161,10 @@
         ;;
 esac

+# Export original configure arguments for use by sub-configures.
+TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
+export TOPLEVEL_CONFIGURE_ARGUMENTS
+
 # Loop over all args

 while :
@@ -400,10 +404,6 @@
 	esac
 done

-# Remember the pristine configure arguments for later.  $arguments gets
-# built up with further defaults in preparation for recursion.
-original_arguments=$arguments
-
 # process host and target

 # Do some error checking and defaulting for the host and target type.
@@ -1602,14 +1602,6 @@
                         cd ${POPDIR}
                 fi
         done
-fi
-
-# Remember configure arguments for later.
-if [ -d gcc ]; then
-	cat > gcc/configargs.h <<EOF
-/* Generated automatically. */
-static const char configuration_arguments[] = "$original_arguments";
-EOF
 fi

 # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
--- gcc/configure.in.orig	Sun Nov  5 10:24:20 2000
+++ gcc/configure.in	Tue Nov  7 00:58:20 2000
@@ -4179,6 +4179,19 @@
 changequote(,)dnl
 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+
+# Compile in configure arguments.
+if [ -e configargs.h ]; then
+	# Being re-configured.
+	gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+	gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
+else
+	gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
+fi
+cat > configargs.h <<EOF
+/* Generated automatically. */
+static const char configuration_arguments[] = "$gcc_config_arguments";
+EOF
 changequote([,])dnl

 # Internationalization
@@ -5149,6 +5162,7 @@
 AC_SUBST(extra_passes)
 AC_SUBST(extra_programs)
 AC_SUBST(float_h_file)
+AC_SUBST(gcc_config_arguments)
 AC_SUBST(gcc_gxx_include_dir)
 AC_SUBST(gcc_version)
 AC_SUBST(gcc_version_full)
@@ -5264,6 +5278,7 @@
 dep_tmake_file='${dep_tmake_file}'
 tmake_file='${tmake_file}'
 thread_file='${thread_file}'
+gcc_config_arguments='${gcc_config_arguments}'
 gcc_version='${gcc_version}'
 gcc_version_full='${gcc_version_full}'
 gcc_version_trigger='${gcc_version_trigger}'
--- gcc/gccbug.in.orig	Sat Oct 28 21:42:36 2000
+++ gcc/gccbug.in	Tue Nov  7 00:59:14 2000
@@ -322,6 +322,7 @@
 host: @host@
 build: @build@
 target: @target@
+configured with: @gcc_config_arguments@
 >Description:
 	$DESCRIPTION_C
 >How-To-Repeat:

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]