diff --git a/config/ChangeLog b/config/ChangeLog
index 7d7dd7e11aa4b13c3bc90918c1850586dfdbc90c..8572384d882e03e840ff21a7c0b730572438346e 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+
+	* gxx-include-dir.m4: In all substitutions, leave $(gcc_version)
+	to be expanded by the Makefile.
+
 2005-03-15  Zack Weinberg  <zack@codesourcery.com>
 
 	* gcc-version.m4: Delete.
diff --git a/config/gxx-include-dir.m4 b/config/gxx-include-dir.m4
index 87a65adaa38c3cbf7e1abbef3fb492280d0e38aa..0e6e4ffc397500e46cee0074e97e37a32d716e2b 100644
--- a/config/gxx-include-dir.m4
+++ b/config/gxx-include-dir.m4
@@ -14,10 +14,10 @@ case "${with_gxx_include_dir}" in
     ;;
   no | "")
     case "${enable_version_specific_runtime_libs}" in
-      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
+      yes) gxx_include_dir='$(libsubdir)/include/c++' ;;
       *)
-	libstdcxx_incdir=c++/${gcc_version}
-	gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
+	libstdcxx_incdir='c++/$(gcc_version)'
+	gxx_include_dir='$(prefix)/include/$(libstdcxx_incdir)' ;;
     esac ;;
   *) gxx_include_dir=${with_gxx_include_dir} ;;
 esac
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 44447d43c684d098b61654f40d1204d8ee46f2b6..2d96511361f705c4dc94ed4bca04adec76c6b3c7 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,19 @@
+2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+
+	* configure.ac: Do not invoke TL_AC_GCC_VERSION.  Do not
+	set tool_include_dir.  In all substitutions, leave $(gcc_version)
+	to be expanded by the Makefile.
+	* aclocal.m4, configure: Regenerate.
+	* Makefile.am: Set gcc_version.  Replace all uses of
+	@gcc_version@ with $(gcc_version).
+	* external/Makefile.am, external/sax/Makefile.am
+	* external/w3c_dom/Makefile.am, gcj/Makefile.am
+	* testsuite/Makefile.am: Set gcc_version.
+	* include/Makefile.am: Set gcc_version and tool_include_dir.
+	* Makefile.in, external/Makefile.in, external/sax/Makefile.in
+	* external/w3c_dom/Makefile.in, gcj/Makefile.in, include/Makefile.in
+	* testsuite/Makefile.in: Regenerate.
+
 2005-03-17  Andrew Haley  <aph@redhat.com>
 
 	* java/lang/natVMSecurityManager.cc (getClassContext): Add new
@@ -73,7 +89,7 @@
 	(close): Ditto.
 	(read(byte[], int, int)): Ditto.
 	(refill): Ditto.
-	(skip): Call skip on underlying stream when possible. 
+	(skip): Call skip on underlying stream when possible.
 
 2005-03-12  Andreas Tobler  <a.tobler@schweiz.ch>
 
@@ -145,14 +161,14 @@
 	(ordinary_java_source_files): Remove obsolete files.
 	(nat_source_files): Remove obsolete files. Add natVMThrowable.cc.
 	* configure.host (fallback_backtrace_h): Set backtrace header
-	for mingw and cygwin targets. 
+	for mingw and cygwin targets.
 	* configure.ac: Make symlink for fallback backtrace headers.
 	* Makefile.in, configure: Rebuilt.
 	* defineclass.cc (_Jv_ClassReader::read_one_code_attribute):
 	Read 'LineNumberTable' attribute.
 	(_Jv_ClassReader::read_one_class_attribute): Read 'SourceFile'
 	attribute.
-	(_Jv_ClassReader::handleCodeAttribute): Initialize method line 
+	(_Jv_ClassReader::handleCodeAttribute): Initialize method line
 	table fields.
 	* exception.cc: Remove unused include.
 	* interpret.cc (DIRECT_THREADED, insn_slot): Moved to java-interp.h.
@@ -161,7 +177,7 @@
 	(_Jv_InterpMethod::compile): Translate bytecode PC values in the line
 	table to direct threaded instruction values.
 	(_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): Removed.
-	(_Jv_InterpMethod::run): No longer member function. All 
+	(_Jv_InterpMethod::run): No longer member function. All
 	callers updated. Remove _Unwind calls. Call SAVE_PC whenever a call
 	is made or where an instruction could throw.
 	(_Jv_InterpMethod::get_source_line): New. Look up source line numbers
@@ -169,7 +185,7 @@
 	* prims.cc (catch_segv): Construct exception after MAKE_THROW_FRAME.
 	(catch_fpe): Likewise.
 	* stacktrace.cc: New file. Stack trace code now here.
-	* gnu/gcj/runtime/MethodRef.java: 
+	* gnu/gcj/runtime/MethodRef.java:
 	* gnu/gcj/runtime/NameFinder.java: Mostly reimplemented. Now simply
 	calls addr2line to look up PC addresses in a given binary or shared
 	library.
@@ -186,21 +202,21 @@
 	(_Jv_InterpFrame): Renamed from _Jv_MethodChain. Add PC field.
 	* include/java-stack.h: New file. Declarations for stack tracing.
 	* include/jvm.h (_Jv_Frame_info): Removed.
-	* java/lang/Class.h: Update friend declarations.	
+	* java/lang/Class.h: Update friend declarations.
 	* java/lang/VMClassLoader.java (getSystemClassLoader): Simplify
 	exception message.
 	* java/lang/VMThrowable.java (fillInStackTrace): Now native.
 	(getStackTrace): Now native.
 	(data): New RawDataManaged field.
-	* java/lang/natClass.cc: Update includes. 
-	(forName): Use _Jv_StackTrace::GetCallingClass for 
+	* java/lang/natClass.cc: Update includes.
+	(forName): Use _Jv_StackTrace::GetCallingClass for
 	calling-classloader check.
 	(getClassLoader): Likewise.
 	* java/lang/natRuntime.cc: Update includes.
 	(_load): Use _Jv_StackTrace::GetFirstNonSystemClassLoader.
 	* java/lang/natVMSecurityManager.cc: Update includes.
 	(getClassContext): Use _Jv_StackTrace::GetClassContext.
-	* java/lang/natVMThrowable.cc: New file. Native methods for 
+	* java/lang/natVMThrowable.cc: New file. Native methods for
 	VMThrowable.
 	* java/lang/reflect/natArray.cc: Update includes.
 	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
@@ -215,9 +231,9 @@
 	(invoke): Use _Jv_StackTrace::GetCallingClass to implement
 	accessibility check.
 	* java/util/natResourceBundle.cc: Update includes.
-	(getCallingClassLoader): Use _Jv_StackTrace::GetCallingClass.	
-	* java/util/logging/natLogger.cc: Update includes. Use 
-	_Jv_StackTrace::GetCallerInfo to get call-site info.	
+	(getCallingClassLoader): Use _Jv_StackTrace::GetCallingClass.
+	* java/util/logging/natLogger.cc: Update includes. Use
+	_Jv_StackTrace::GetCallerInfo to get call-site info.
 	* sysdep/generic/backtrace.h: Fallback backtrace code. Stub
 	implementation.
 	* sysdep/i386/backtrace.h: New. Fallback backtrace code. i386
@@ -578,7 +594,7 @@
 
 	Merge serialization from GNU Classpath.
 	* gcj/method.h: Add missing #includes.
-	* java/io/ObjectInputStream.java (readClassDescriptor): Check for 
+	* java/io/ObjectInputStream.java (readClassDescriptor): Check for
 	primitive class IDs on the stream here...
 	(resolveClass): ...not here.
 	* java/io/ObjectStreamField.java: Use VMObjectStream class calls to set
@@ -609,7 +625,7 @@
 	# Fixes bug #11957
 	* java/io/ObjectInputStream.java (resolveClass): Don't check "void"
 	twice.
-	
+
 2005-02-21  Mark Wielaard  <mark@klomp.org>
 
 	Fixes bug #11618.
@@ -651,7 +667,7 @@
 
 	* java/io/ObjectStreamClass.java
 	(firstNonSerializableParent): Removed.
-	(firstNonSerializableParentConstructor): Added.	
+	(firstNonSerializableParentConstructor): Added.
 
 2005-02-21  Mark Wielaard  <mark@klomp.org>
 
@@ -692,15 +708,15 @@
 
 2005-02-21  Sven de Marothy  <sven@physto.se>
 
-	* java/util/Calendar.java 
+	* java/util/Calendar.java
 	(clear): Dates should clear to local time.
-	* java/util/GregorianCalendar.java      
+	* java/util/GregorianCalendar.java
 	(computeTime): Fix priority problem with DAY_OF_WEEK,
 	Handle non-sunday-startig weeks and minimumDaysInFirstWeek.
 
 2005-02-21  Sven de Marothy  <sven@physto.se>
 
-	* java/util/Calendar.java 
+	* java/util/Calendar.java
 	(Calendar): Constructor should clear fields.
 
 2005-02-21  Sven de Marothy  <sven@physto.se>
@@ -756,14 +772,14 @@
 
 2005-02-21  Sven de Marothy <sven@physto.se>
 
-        * java/util/GregorianCalendar.java
-        (GregorianCalendar): Update fields in the constructor
+	* java/util/GregorianCalendar.java
+	(GregorianCalendar): Update fields in the constructor
 
 2005-02-21  Noa Resare  <noa@resare.com>
 
-        * java/util/Calendar.java (explicitDSTOffset): New instance field.
-        (set(int,int)): Set and use new field.
-        (set(int,int,int)): Check new field.
+	* java/util/Calendar.java (explicitDSTOffset): New instance field.
+	(set(int,int)): Set and use new field.
+	(set(int,int,int)): Check new field.
 
 2005-02-21  Noa Resare  <address@hidden>
 
@@ -1095,7 +1111,7 @@
 
 2005-02-18  Bryce McKinlay  <mckinlay@redhat.com>
 
-	* java/util/LinkedHashMap (addEntry): Call remove() with key argument, 
+	* java/util/LinkedHashMap (addEntry): Call remove() with key argument,
 	not the HashEntry. Reported by Jean-Marie White.
 
 2005-02-18  Tom Tromey  <tromey@redhat.com>
@@ -2217,19 +2233,19 @@
 	* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
 	(finalize): Call finish from here.
 	(produce): Not from here.
-	* Makefile.am (gtk_c_source_files): 
+	* Makefile.am (gtk_c_source_files):
 	Remove jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c.
 	* Makefile.in: Regenerate.
 	* gnu/java/awt/peer/gtk/GdkGraphics2D.java
 	(cairoSetFont):
 	(cairoDrawGdkTextLayout):
-	(cairoDrawString): 
+	(cairoDrawString):
 	(getPeerTextMetrics):
 	(getPeerFontMetrics): Remove.
 	(setFont): Don't call cairoSetFont.
 	(cairoDrawGlyphVector): Accept font peer argument.
 	(drawGlyphVector): Pass font peer to cairoDrawGlyphVector.
-	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c	
+	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
 	(ensure_metrics_cairo):
 	(gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFont):
 	(gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawString):
@@ -2258,9 +2274,9 @@
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c: Remove.
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
 	(Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector):
-	(Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics): 
-	(Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics): New methods.	
-	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c: Remove.	
+	(Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics):
+	(Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics): New methods.
+	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c: Remove.
 	* gnu/java/awt/peer/gtk/GdkFontPeer.java
 	(getGlyphVector):
 	(getFontMetrics):
@@ -2841,9 +2857,9 @@
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
 	Rewrite uses of extern variable to be function calls.
-	* jni/gtk-peer/gtkpeer.h (gdk_env): Change declaration to 
+	* jni/gtk-peer/gtkpeer.h (gdk_env): Change declaration to
 	function, from extern variable.
-	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c 
+	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
 	(gdk_env): Remove variable, add new function.
 	(java_vm): Add new variable.
 	(Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit): Initialize
@@ -2866,11 +2882,11 @@
 	* gnu/gcj/xlib/natXAnyEvent.cc: Likewise.
 	* gnu/java/awt/ClasspathToolkit.java: Likewise.
 	* gnu/java/awt/peer/gtk/GtkToolkit.java: Likewise.
-	* java/awt/EventQueue.java (getNextEvent): 
+	* java/awt/EventQueue.java (getNextEvent):
 	Adjust event loop to switch to native mode after 100ms.
 	* javax/swing/Timer.java (drainEvents): Reuse Runnable.
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
-	(Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): 
+	(Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose):
 	Wake up event thread.
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
 	(Java_gnu_java_awt_peer_gtk_GtkToolkit_iterateNativeQueue):
@@ -3003,23 +3019,23 @@
 
 2005-02-15  Graydon Hoare  <graydon@redhat.com>
 
-	* gnu/java/awt/ClasspathToolkit.java 
+	* gnu/java/awt/ClasspathToolkit.java
 	(registerImageIOSpis): New method.
-	* gnu/java/awt/image/ImageDecoder.java 
+	* gnu/java/awt/image/ImageDecoder.java
 	(imageDecoder): New constructor using InputStream
 	(startProduction): Handle existing InputStream.
-	* gnu/java/awt/peer/gtk/GdkGraphics2D.java 
+	* gnu/java/awt/peer/gtk/GdkGraphics2D.java
 	(findSimpleIntegerArray): Make public and static.
 	(updateBufferedImage): Set each pixel, in a loop.
-	* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java: 
+	* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
 	Implement ImageIO SPI classes.
 	(createBufferedImage): Rewrite in terms of SPI classes.
 	* gnu/java/awt/peer/gtk/GtkToolkit.java
 	(registerImageIOSpis): New method.
-	* java/lang/reflect/natMethod.cc 
-	(_Jv_CallAnyMethodA): Borrow a patch from aph, applied to trunk, 
+	* java/lang/reflect/natMethod.cc
+	(_Jv_CallAnyMethodA): Borrow a patch from aph, applied to trunk,
 	which lets JNI call interface methods properly.
-	* javax/imageio/ImageIO.java 
+	* javax/imageio/ImageIO.java
 	(WriterFormatFilter.filter): Fix copy-and-paste typos.
 	(WriterMIMETypeFilter.filter): Likewise.
 	(ImageReaderIterator): Pass extension argument through to SPI.
@@ -3033,7 +3049,7 @@
 	(getImageWritersBySuffix): Likewise.
 	(read): Implement.
 	(write): Implement.
-	* javax/imageio/ImageReader.java 
+	* javax/imageio/ImageReader.java
 	(progressListeners): Initialize.
 	(setInput): Implement.
 	* javax/imageio/ImageWriter.java
@@ -3063,22 +3079,22 @@
 	(rowAtPoint): Likewise.
 	(countSelections): Fixed few small count errors.
 	(getSelections): Likewise.
-	(setSelectionMode): Set selection mode for column 
+	(setSelectionMode): Set selection mode for column
 	selection model in addition to row selection model.
 	* javax/swing/plaf/basic/BasicTableUI.java:
 	(getRowForPoint): Removed. Replaced by
 	JTable.rowAtPoint().
-	(getColForPoint): Removed. Replaced by 
+	(getColForPoint): Removed. Replaced by
 	JTable.columnAtPoint().
-	(updateSelection): Updated to call JTable.columnAtPoint 
+	(updateSelection): Updated to call JTable.columnAtPoint
 	and JTable.rowAtPoint.
 	* javax/swing/table/DefaultTableColumnModel.java:
 	(getSelectedColumns): Implemented.
-	(getSelectedColumnCount): Implemented.		
+	(getSelectedColumnCount): Implemented.
 
 2005-02-15  Graydon Hoare  <graydon@redhat.com>
 
-	* Makefile.am 
+	* Makefile.am
 	(jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c)
 	(gnu/java/awt/peer/gtk/GtkMainThread.java) : Remove.
 	* Makefile.in: Regenerate.
@@ -3087,7 +3103,7 @@
 	* gnu/awt/xlib/XToolkit.java: Likewise.
 	* gnu/gcj/xlib/XAnyEvent.java: Likewise.
 	* gnu/gcj/xlib/natXAnyEvent.cc: Likewise.
-	* gnu/java/awt/ClasspathToolkit.java 
+	* gnu/java/awt/ClasspathToolkit.java
 	(nativeQueueEmpty)
 	(wakeNativeQueue)
 	(iterateNativeQueue): New methods.
@@ -3101,7 +3117,7 @@
 	(wakeNativeQueue)
 	(iterateNativeQueue): New methods.
 	* java/awt/Component.java (removeNotify): Remove race.
-	* java/awt/EventDispatchThread.java 
+	* java/awt/EventDispatchThread.java
 	(EventDispatchThread): Don't start on construction.
 	(run): Remove isInterrupted check.
 	* java/awt/EventQueue.java (shutdown): New flag.
@@ -3110,7 +3126,7 @@
 	(getNextEvent): Restructure to use ClasspathToolkit.
 	(postEvent): Activate new thread on posting, wake thread on
 	post of possible shutdown condition event.
-	* java/awt/Frame.java 
+	* java/awt/Frame.java
 	(Frame): Call noteFrame in all constructors.
 	(fireDummyEvent): New helper method.
 	(addNotify): Fire a dummy event to wake up queue.
@@ -3118,7 +3134,7 @@
 	(noteFrame): New method.
 	(weakFrames): New static field.
 	(getFrames): Implement.
-	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: 
+	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c:
 	Remove.
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c:
 	Move everything from GtkMainThread into this file
@@ -3300,7 +3316,7 @@
 	not in dataModel.
 	(removeColumn): Implemented.
 	(moveColumm): Likewise.
-	(setRowHeight): throw IllegalArgumentException if height is 
+	(setRowHeight): throw IllegalArgumentException if height is
 	less then 1.
 	* javax/swing/table/DefaultTableColumnModel.java: Add javadocs.
 	(DefaultTableColumnModel):Add call to createSelectionModel().
@@ -3316,8 +3332,8 @@
 	(fireColumnMarginChanged): Likewise.
 	(getListeners): Changed parameter name.
 	(propertyChange): Implemented.
-	(valueChanged): Changed parameter name. 
-	(createSelectionModel): Implemented.	
+	(valueChanged): Changed parameter name.
+	(createSelectionModel): Implemented.
 
 2005-02-15  Michael Koch  <konqueror@gmx.de>
 
@@ -3882,14 +3898,14 @@
 
 2005-02-15  Graydon Hoare  <graydon@redhat.com>
 
-	* gnu/java/awt/peer/gtk/GdkGraphics2D.java: 
+	* gnu/java/awt/peer/gtk/GdkGraphics2D.java:
 	Rework painting into BufferedImages
 	* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
 	Construct BufferedImage with alpha only when alpha is
 	present in colormodel.
 	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
 	Rework painting into client-side jint arrays.
-	* jni/gtk-peer/gtkcairopeer.h: 
+	* jni/gtk-peer/gtkcairopeer.h:
 	Likewise.
 
 2005-02-15  Michael Koch  <konqueror@gmx.de>
@@ -3977,7 +3993,7 @@
 
 	* java/awt/image/IndexColorModel.java:
 	Add FIXME with respect to alpha handling.
-	(getAlpha): Default to returning opaque pixels. 
+	(getAlpha): Default to returning opaque pixels.
 	* java/awt/image/MultiPixelPackedSampleModel.java
 	(MultiPixelPackedSampleModel): Corrected parameters, order of
 	bit shifts and masks, stride length off by one.
@@ -4039,7 +4055,7 @@
 	implementation class names to conform to Classpath guidelines.  Make
 	DomLSException use JDK 1.4+ exception chaining.
 	* gnu/xml/util/SAXNullTransformerFactory.java,
-	gnu/xml/xpath/Predicate.java: Use constants relative to 
+	gnu/xml/xpath/Predicate.java: Use constants relative to
 	declaring class or interface.
 
 2005-02-16  Andrew Haley  <aph@redhat.com>
@@ -4058,14 +4074,14 @@
 	(addStub): New method.
 	(deleteStub): New method.
 	(toStub): Rewrite.
-	
+
 	* java/lang/VMCompiler.java (loadSharedLibrary): Pass
 	true to findHelper (tryParents).
 	* gnu/gcj/runtime/SharedLibLoader.java (SharedLibLoader):
 	Likewise.
 	* java/net/URLClassLoader.java (SoURLLoader): Likewise.
 	* gnu/gcj/runtime/SharedLibHelper.java (SharedLibHelper): Pass
-	ProtectionDomain.  
+	ProtectionDomain.
 	If tryParents is false, don't scan parent class loaders.
 
 	* java/security/Permissions.java (PermissionsHash.implies):
@@ -4101,7 +4117,7 @@
 
 2005-02-15  David Daney <ddaney@avtrex.com>
 	    Bryce McKinlay  <mckinlay@redhat.com>
-	    
+
 	* prims.cc (_Jv_CreateJavaVM): Add comment about initialization order.
 	* posix-threads.cc (_Jv_InitThreads): Call block_sigchld() here to
 	ensure that GC threads inherit the new signal mask.
@@ -4137,7 +4153,7 @@
 	(FileResource.toString): Removed method.
 
 2005-02-15  Mark Wielaard  <mark@klomp.org>
- 
+
 	* javax/net/ssl/SSLContext.java (getInstance): Add exception message
 	and/or cause before throwing.
 
@@ -4223,7 +4239,7 @@
 
 2005-02-10  Bryce McKinlay  <mckinlay@redhat.com>
 
-	* testsuite/libjava.mauve/xfails: Updated to reflect current state 
+	* testsuite/libjava.mauve/xfails: Updated to reflect current state
 	of mauve and libjava.
 
 2005-02-09  Tom Tromey  <tromey@redhat.com>
@@ -4269,21 +4285,21 @@
 
 2005-02-07  Mark Wielaard  <mark@klomp.org>
 
-        Reported by Timo Lindfors <timo.lindfors@iki.fi>
-        java/util/regex/Matcher.java (lookingAt): Set position when match
-        found.
-        (matches): Implemented through lookingAt().
+	Reported by Timo Lindfors <timo.lindfors@iki.fi>
+	java/util/regex/Matcher.java (lookingAt): Set position when match
+	found.
+	(matches): Implemented through lookingAt().
 
 2005-02-07  Mark Wielaard  <mark@klomp.org>
 
-        Fix suggested by Timo Lindfors <timo.lindfors@iki.fi>
-        * java/util/regex/Pattern.java (split(CharSequence,int)):
-        Fix while empties > 0 loops.
+	Fix suggested by Timo Lindfors <timo.lindfors@iki.fi>
+	* java/util/regex/Pattern.java (split(CharSequence,int)):
+	Fix while empties > 0 loops.
 
 2005-02-07  Robert Schuster  <thebohemian@gmx.net>
 
 	* gnu/java/nio/charset/ISO_8859_1.java,
-	gnu/java/nio/charset/US_ASCII.java, 
+	gnu/java/nio/charset/US_ASCII.java,
 	gnu/java/nio/charset/UTF_16.java,
 	gnu/java/nio/charset/UTF_16_LE.java,
 	gnu/java/nio/charset/UTF_16_BE.java,
@@ -4293,7 +4309,7 @@
 	 "http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html"
 	 and "http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL".
 	* gnu/java/nio/charset/Provider.java: Made charset lookup
-	 case-insensitive which fixes bug #11740. 
+	 case-insensitive which fixes bug #11740.
 
 2005-02-07  Tom Tromey  <tromey@redhat.com>
 
@@ -8916,7 +8932,7 @@
 2004-11-06  Michael Koch  <konqueror@gmx.de>
 
 	* javax/imageio/event/IIOReadProgressListener.java,
-        javax/imageio/event/IIOReadUpdateListener.java,
+	javax/imageio/event/IIOReadUpdateListener.java,
 	javax/imageio/event/IIOReadWarningListener.java,
 	javax/imageio/event/IIOWriteProgressListener.java,
 	javax/imageio/event/IIOWriteWarningListener.java,
@@ -9833,8 +9849,8 @@
 
 2004-10-15  Andrew Haley  <aph@redhat.com>
 
-        * Makefile.am (nat_files, xlib_nat_files): New.
-        * Makefile.in: Regenerate.
+	* Makefile.am (nat_files, xlib_nat_files): New.
+	* Makefile.in: Regenerate.
 
 2004-10-14  Ulrich Weigand  <uweigand@de.ibm.com>
 
@@ -10049,7 +10065,7 @@
 	* testsuite/libjava.compile/pr17500.java: New file.
 
 2004-09-25  Shashank Bapat  <shashankbapat@yahoo.com>
-            Mark Wielaard  <mark@klomp.org>
+	    Mark Wielaard  <mark@klomp.org>
 
 	* gnu/regexp/RE.java (initialize): Add RETokenLookAhead support.
 	* gnu/regexp/RETokenLookAhead.java: New file.
@@ -10614,7 +10630,7 @@
 	Changed pfn from static local to local.
 
 2004-09-03  Bryce McKinlay  <mckinlay@redhat.com>
-            H.J. Lu  <hongjiu.lu@intel.com>
+	    H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR libgcj/17290
 	* Makefile.am (GCJCOMPILE): Remove definition.
@@ -12933,25 +12949,25 @@
 2004-07-21  Michael Koch  <konqueror@gmx.de>
 
 	* javax/swing/JCheckBox.java: Reformated.
-        (JCheckBox): Fixed all constructors.
-        (isBorderPaintedFlat): New method.
-        (setBorderPaintedFlat): New method.
+	(JCheckBox): Fixed all constructors.
+	(isBorderPaintedFlat): New method.
+	(setBorderPaintedFlat): New method.
 	* javax/swing/JEditorPane.java
-        (createEditorKitForContentType): Made public.
-        (scrollToReference): Likewise.
+	(createEditorKitForContentType): Made public.
+	(scrollToReference): Likewise.
 	* javax/swing/JTextArea.java
-        (setLineWrap): Fire property change.
+	(setLineWrap): Fire property change.
 	* javax/swing/JToggleButton.java
-        (JToggleButton): New constructor.
-        (JToggleButton): Simplified.
+	(JToggleButton): New constructor.
+	(JToggleButton): Simplified.
 	* javax/swing/text/AttributeSet.java
-        (FontAttribute): Renamed from FontCharacterAttribute.
+	(FontAttribute): Renamed from FontCharacterAttribute.
 	* javax/swing/text/JTextComponent.java
-        (KeyBinBinding): Added javadoc.
-        (JTextComponent): Likewise.
-        (getAccessibleContext): Fixed javadoc.
+	(KeyBinBinding): Added javadoc.
+	(JTextComponent): Likewise.
+	(getAccessibleContext): Fixed javadoc.
 	* javax/swing/text/View.java
-        (View): Added javadoc.
+	(View): Added javadoc.
 	* javax/swing/text/TabableView.java: New file.
 	* Makefile.am: Added javax/swing/text/TabableView.java.
 	* Makefile.in: Regenerated.
@@ -14062,18 +14078,18 @@
 	java/nio/ShortBuffer.java,
 	java/nio/ShortBufferImpl.java,
 	java/nio/ShortViewBufferImpl.java:
-        Fixed javadocs all over. Improved input error
-        checking.
+	Fixed javadocs all over. Improved input error
+	checking.
 
 	* java/nio/Buffer.java
 	(checkForUnderflow, checkForOverflow, checkIndex,
 	checkIfReadOnly, checkArraySize): New helper methods
-        for error checking.
+	for error checking.
 
 	* java/nio/ByteBufferHelper.java
 	(checkRemainingForRead, checkRemainingForWrite,
 	checkAvailableForRead, checkAvailableForWrite): Removed
-        no longer needed methods.
+	no longer needed methods.
 
 2004-07-09  Michael Koch  <konqueror@gmx.de>
 
@@ -16553,15 +16569,15 @@
 2004-05-07  Jerry Quinn  <jlquinn@optonline.net>
 
 	* java/util/SimpleTimeZone.java (startTimeMode, endTimeMode,
-        WALL_TIME, STANDARD_TIME, UTC_TIME): New members.
+	WALL_TIME, STANDARD_TIME, UTC_TIME): New members.
 	(SimpleTimeZone): Tweak docs.  Add new variation.
 	(setStartRule,setEndRule): Add new variations.  Use
-        startTimeMode and endTimeMode.
+	startTimeMode and endTimeMode.
 
 2004-05-07  Jerry Quinn  <jlquinn@optonline.net>
 
 	* java/util/Calendar.java (getActualMinimum,
-        getActualMaximum):  Remove abstract.  Implement.
+	getActualMaximum):  Remove abstract.  Implement.
 
 2004-05-06  Bryce McKinlay  <mckinlay@redhat.com>
 
@@ -16818,7 +16834,7 @@
 2004-05-04  Ingo Proetel  <proetel@aicas.com>
 
 	* java/awt/image/ColorModel.java (getRGBdefault): Default ColorModel has
-        32 bit pixels not 8 bit pixels.
+	32 bit pixels not 8 bit pixels.
 	(isCompatibleRaster): Added javadoc comment.
 
 2004-05-04  Ingo Proetel  <proetel@aicas.com>
@@ -16930,7 +16946,7 @@
 	(getByName): Return null when no interface was found.
 
 2004-04-30  Ranjit Mathew  <rmathew@hotmail.com>
-            Tom Tromey  <tromey@redhat.com>
+	    Tom Tromey  <tromey@redhat.com>
 
 	* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use
 	additional option "-Wmissing-prototypes" for compiling C sources.
@@ -16952,7 +16968,7 @@
 2004-04-24  Jerry Quinn  <jlquinn@optonline.net>
 
 	* java/text/CollationElementIterator.java (reset): Reset
-        lookahead variables.
+	lookahead variables.
 
 2004-04-23  Mark Wielaard  <mark@klomp.org>
 
@@ -17430,7 +17446,7 @@
 
 2004-04-20  Guilhem Lavaux <guilhem@kaffe.org>
 
-        Reported by Nektarios Papadopoulos <npapadop@inaccessnetworks.com>
+	Reported by Nektarios Papadopoulos <npapadop@inaccessnetworks.com>
 	* java/io/FileOutputStream.java
 	(FileOutputStream) Reorganized constructors. Constructors now
 	check whether the given path is directory.
@@ -17673,7 +17689,7 @@
 	(SCROLL_TAB_LAYOUT): Make public, value is 1.
 	(WRAP_TAB_LAYOUT): Make public, value is 0.
 	* javax/swing/plaf/basic/BasicTabbedPaneUI.java (ScrollingButton):
-        Make private static inner class.
+	Make private static inner class.
 
 2004-04-16  Bryce McKinlay  <mckinlay@redhat.com>
 
@@ -17957,7 +17973,7 @@
 	* java/lang/natString.cc (_Jv_AllocString): Move to prims.cc.
 
 2004-04-14  Andrew Haley  <aph@redhat.com>
-            Bryce McKinlay  <mckinlay@redhat.com>
+	    Bryce McKinlay  <mckinlay@redhat.com>
 
 	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Use
 	_Jv_LookupInterfaceMethodIdx for calls to interfaces.
@@ -18000,8 +18016,8 @@
 
 2004-03-21  Ito Kazumitsu <kaz@maczuka.gcd.org>
 
-        * java/net/ServerSocket.java
-        (accept): Close the socket when error occured.
+	* java/net/ServerSocket.java
+	(accept): Close the socket when error occured.
 
 2004-03-21  Jeroen Frijters  <jeroen@frijters.net>
 
@@ -18352,7 +18368,7 @@
 	(setFont): Call new native method gtkSetFont.
 	* gnu/java/awt/peer/gtk/GtkContainerPeer.java
 	(setFont): For all child components who do not their fonts set,
-        set their peers' fonts with this container's font.
+	set their peers' fonts with this container's font.
 	* gnu/java/awt/peer/gtk/GtkLabelPeer.java:
 	Move all native method declarations to the top for readability.
 	(gtkSetFont): New native method declaration.
@@ -18709,9 +18725,9 @@
 2004-02-13  David Jee  <djee@redhat.com>
 
 	* java/awt/Component.java
-        (show): Only do something if component is invisible at the moment.
-        (hide): Only do something if component is visible at the moment.
-        (reshape): If lightweight, erase old bounds and repaint new bounds.
+	(show): Only do something if component is invisible at the moment.
+	(hide): Only do something if component is visible at the moment.
+	(reshape): If lightweight, erase old bounds and repaint new bounds.
 
 2004-02-13  Kim Ho  <kho@redhat.com>
 
@@ -19158,7 +19174,7 @@
 2004-02-15  Ito Kazumitsu  <kaz@maczuka.gcd.org>
 
 	* java/io/ObjectInputStream.java (readClassDescriptor): Avoid the
-        overflow of fieldmapping.
+	overflow of fieldmapping.
 
 2004-02-14  Sascha Brawer  <brawer@dandelis.ch>
 
@@ -19785,7 +19801,7 @@
 	* gnu/java/awt/peer/gtk/GtkComponentPeer.java
 	(handleEvent): Implemented. Handles PaintEvents.
 	(paint): Implemented. Use GTK native methods to queue updates
-        for this heavyweight peer.
+	for this heavyweight peer.
 	* gnu/java/awt/peer/gtk/GtkContainerPeer.java
 	(handleEvent): Removed.
 	* java/awt/Component.java
@@ -20131,7 +20147,7 @@
 	* testsuite/libjava.compile/PR13733.xfail: New file.
 
 2004-01-22  Arnaud Vandyck  <arnaud.vandyck@ulg.ac.be>
-            Michael Koch  <konqueror@gmx.de>
+	    Michael Koch  <konqueror@gmx.de>
 
 	* javax/swing/table/DefaultTableCellRenderer.java
 	(DefaultTableCellRenderer): Added javadoc for the class and for
@@ -20323,7 +20339,7 @@
 
 2004-01-16  Kim Ho  <kho@redhat.com>
 
-        * gnu/java/awt/peer/gtk/GtkComponentPeer.java (GtkComponentPeer): If
+	* gnu/java/awt/peer/gtk/GtkComponentPeer.java (GtkComponentPeer): If
 	it is a FileDialog and has dimensions of 0 by 0, then the initial
 	size is set to size request plus insets.
 	* gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index a4fd81038fb560857f8b0e0af0f99c47e638fa88..a9141a0f038e5b839f027660c321c4d33419076c 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -4,6 +4,9 @@ AUTOMAKE_OPTIONS = foreign subdir-objects
 
 ACLOCAL_AMFLAGS = -I . -I ../config
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 ## Garbage collector conditionals.
 if USING_BOEHMGC
 BOEHMGC_SRC = boehm.cc
@@ -116,7 +119,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libgcj.pc
 
 jardir = $(datadir)/java
-jar_DATA = libgcj-@gcc_version@.jar
+jar_DATA = libgcj-$(gcc_version).jar
 
 ## FIXME: Using libdir violates GNU coding standards.
 secdir = $(libdir)/security
@@ -124,7 +127,7 @@ secdir = $(libdir)/security
 propdir = $(libdir)
 
 ## Where the standard .db file is found.
-dbexecdir = $(libdir)/gcj-@gcc_version@
+dbexecdir = $(libdir)/gcj-$(gcc_version)
 ## Name of the default .db.
 db_name = classmap.db
 
@@ -255,7 +258,7 @@ libgcj_la_LIBADD = \
 	external/w3c_dom/libw3c_convenience.la \
 	libgcj0_convenience.la \
 	$(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
-libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
+libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
 	java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
 	$(LIBLTDL) $(libgcj_la_LIBADD)
 libgcj_la_LINK = $(LIBLINK)
@@ -474,7 +477,7 @@ lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
 	$(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
 lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni
 lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
-lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-@gcc_version@.jar libgcj.la libgcj.spec
+lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-$(gcc_version).jar libgcj.la libgcj.spec
 ## The mysterious backslash in the grep pattern is consumed by make.
 lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
@@ -492,7 +495,7 @@ libjawt_la_LINK = $(LIBLINK)
 lib_gnu_awt_xlib_la_SOURCES = \
 	$(xlib_java_source_files) \
 	$(xlib_nat_source_files)
-lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-@gcc_version@.jar libgcj.la libgcj.spec
+lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar libgcj.la libgcj.spec
 lib_gnu_awt_xlib_la_LIBADD = $(xlib_javao_files)
 ## We require libstdc++-v3 to be in the same build tree.
 lib_gnu_awt_xlib_la_CPPFLAGS = \
@@ -557,8 +560,8 @@ classes.stamp: $(all_java_class_files) $(all_property_files)
 
 endif
 
-libgcj-@gcc_version@.jar: classes.stamp
-	-@rm -f libgcj-@gcc_version@.jar
+libgcj-$(gcc_version).jar: classes.stamp
+	-@rm -f libgcj-$(gcc_version).jar
 ## Note that we explicitly want to include directory information.
 	(find java gnu javax org -type d -o -type f -name '*.class'; \
 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
@@ -581,7 +584,7 @@ libgcj-@gcc_version@.jar: classes.stamp
 	  $(ZIP) -ufM0E@ $@; \
 	done
 
-CLEANFILES = libgcj-@gcc_version@.jar classes.stamp
+CLEANFILES = libgcj-$(gcc_version).jar classes.stamp
 
 mostlyclean-local:
 ## Use libtool rm to remove each libtool object
@@ -856,7 +859,7 @@ maintainer-check: libgcj.la
 
 ## This rule can be used to see if the headers are more or less
 ## correct.
-header-check: libgcj-@gcc_version@.jar $(nat_headers)
+header-check: libgcj-$(gcc_version).jar $(nat_headers)
 	rm -f htest.cc; \
 	for h in $(nat_headers); do \
 	  echo "#include \"$$h\"" >> htest.cc; \
@@ -865,7 +868,7 @@ header-check: libgcj-@gcc_version@.jar $(nat_headers)
 
 ## This rule can be used to see if all the .class files verify
 ## correctly.
-class-check: libgcj-@gcc_version@.jar
+class-check: libgcj-$(gcc_version).jar
 	@ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
 	while read f; do \
 	  echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
@@ -3866,7 +3869,7 @@ src.zip:
 sourcesdir = $(jardir)
 
 install-src.zip: src.zip
-	$(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-@gcc_version@.zip
+	$(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
 
 
 ## ################################################################
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index f748632c6df7e81cbb2e9f8abc3b8f36424197c1..c98a225002a816cbf144c735cc4a479e80b75dc1 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -59,16 +59,14 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/../compile \
 	ChangeLog NEWS THANKS
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -5016,9 +5014,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -5054,12 +5049,14 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
 AUTOMAKE_OPTIONS = foreign subdir-objects
 ACLOCAL_AMFLAGS = -I . -I ../config
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 @USING_BOEHMGC_FALSE@BOEHMGC_SRC = 
 @USING_BOEHMGC_TRUE@BOEHMGC_SRC = boehm.cc
 @USING_NOGC_FALSE@NOGC_SRC = 
@@ -5104,10 +5101,10 @@ toolexecmainlib_DATA = libgcj.spec
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libgcj.pc
 jardir = $(datadir)/java
-jar_DATA = libgcj-@gcc_version@.jar
+jar_DATA = libgcj-$(gcc_version).jar
 secdir = $(libdir)/security
 propdir = $(libdir)
-dbexecdir = $(libdir)/gcj-@gcc_version@
+dbexecdir = $(libdir)/gcj-$(gcc_version)
 db_name = classmap.db
 @NATIVE_TRUE@dbexec_DATA = $(db_name)
 bin_SCRIPTS = addr2name.awk
@@ -5187,7 +5184,7 @@ libgcj_la_LIBADD = \
 	libgcj0_convenience.la \
 	$(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
 
-libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
+libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
 	java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
 	$(LIBLTDL) $(libgcj_la_LIBADD)
 
@@ -5302,7 +5299,7 @@ lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
 
 lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni
 lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
-lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-@gcc_version@.jar libgcj.la libgcj.spec
+lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-$(gcc_version).jar libgcj.la libgcj.spec
 lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
 
@@ -5319,7 +5316,7 @@ lib_gnu_awt_xlib_la_SOURCES = \
 	$(xlib_java_source_files) \
 	$(xlib_nat_source_files)
 
-lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-@gcc_version@.jar libgcj.la libgcj.spec
+lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar libgcj.la libgcj.spec
 lib_gnu_awt_xlib_la_LIBADD = $(xlib_javao_files)
 lib_gnu_awt_xlib_la_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
@@ -5350,7 +5347,7 @@ gnu/regexp/MessagesBundle_fr.properties \
 org/ietf/jgss/MessagesBundle.properties
 
 propertyo_files = $(property_files:.properties=.properties.lo) 
-CLEANFILES = libgcj-@gcc_version@.jar classes.stamp
+CLEANFILES = libgcj-$(gcc_version).jar classes.stamp
 SUFFIXES = .class .java .h .properties
 ordinary_nat_headers = \
     $(ordinary_java_source_files:.java=.h) \
@@ -26614,8 +26611,8 @@ $(lib_gnu_java_awt_peer_gtk_la_OBJECTS): $(lib_gnu_java_awt_peer_gtk_la_DEPENDEN
 @ONESTEP_FALSE@classes.stamp: $(all_java_class_files) $(all_property_files)
 @ONESTEP_FALSE@	echo > classes.stamp
 
-libgcj-@gcc_version@.jar: classes.stamp
-	-@rm -f libgcj-@gcc_version@.jar
+libgcj-$(gcc_version).jar: classes.stamp
+	-@rm -f libgcj-$(gcc_version).jar
 	(find java gnu javax org -type d -o -type f -name '*.class'; \
 	for file in $(all_property_files); do \
 	  echo "x-C" | sed -e 's/^.//'; \
@@ -26840,14 +26837,14 @@ maintainer-check: libgcj.la
 	  | grep -v 'Jv' \
 	  | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
 
-header-check: libgcj-@gcc_version@.jar $(nat_headers)
+header-check: libgcj-$(gcc_version).jar $(nat_headers)
 	rm -f htest.cc; \
 	for h in $(nat_headers); do \
 	  echo "#include \"$$h\"" >> htest.cc; \
 	done; \
 	$(CXXCOMPILE) -fsyntax-only htest.cc
 
-class-check: libgcj-@gcc_version@.jar
+class-check: libgcj-$(gcc_version).jar
 	@ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
 	while read f; do \
 	  echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
@@ -26956,7 +26953,7 @@ src.zip:
 	done
 
 install-src.zip: src.zip
-	$(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-@gcc_version@.zip
+	$(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
 
 all-recursive: classes.stamp $(nat_headers) $(xlib_nat_headers)
 
diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4
index ce57d9fd4db03900716fc938736a05689a71800f..286f26a86186eaab09e2cbd4c85bacd9fd5a0518 100644
--- a/libjava/aclocal.m4
+++ b/libjava/aclocal.m4
@@ -924,14 +924,13 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
-m4_include([pkg.m4])
 m4_include([../config/accross.m4])
 m4_include([../config/acx.m4])
-m4_include([../config/gcc-version.m4])
 m4_include([../config/gxx-include-dir.m4])
 m4_include([../config/iconv.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lib-ld.m4])
 m4_include([../config/lib-link.m4])
 m4_include([../config/lib-prefix.m4])
+m4_include([pkg.m4])
 m4_include([acinclude.m4])
diff --git a/libjava/configure b/libjava/configure
index 980f4a4e567760900ef526e6b81e8aef4985f97b..d689da0ad2c59c68b757685d1a9696899e6a3a81 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -310,7 +310,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir libgcj_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS LIBGCJ_LD_SYMBOLIC INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs TESTSUBDIR_TRUE TESTSUBDIR_FALSE ONESTEP_TRUE ONESTEP_FALSE LIBGCJDEBUG INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_ECOS_PLATFORM_TRUE USING_ECOS_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE gcc_version_trigger gcc_version_full gcc_version tool_include_dir LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS SUPPLY_BACKTRACE_TRUE SUPPLY_BACKTRACE_FALSE GCJH ZIP CLASSPATH_SEPARATOR ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir GCJVERSION gxx_include_dir libstdcxx_incdir ALLOCA PERL BACKTRACESPEC SYSDEP_SOURCES here LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir libgcj_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS LIBGCJ_LD_SYMBOLIC INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs TESTSUBDIR_TRUE TESTSUBDIR_FALSE ONESTEP_TRUE ONESTEP_FALSE LIBGCJDEBUG INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_ECOS_PLATFORM_TRUE USING_ECOS_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS SUPPLY_BACKTRACE_TRUE SUPPLY_BACKTRACE_FALSE GCJH ZIP CLASSPATH_SEPARATOR ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir GCJVERSION gxx_include_dir libstdcxx_incdir ALLOCA PERL BACKTRACESPEC SYSDEP_SOURCES here LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -8471,7 +8471,6 @@ fi
 
 
 
-
 if test "$GCC" = yes; then
   USING_GCC_TRUE=
   USING_GCC_FALSE='#'
@@ -8484,27 +8483,6 @@ fi
 # We're in the tree with gcc, and need to include some of its headers.
 GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
 
-
-if test "${with_gcc_version_trigger+set}" = set; then
-  gcc_version_trigger=$with_gcc_version_trigger
-else
-  gcc_version_trigger=$srcdir/../gcc/version.c
-fi
-if test -f "${gcc_version_trigger}"; then
-  gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'`
-else
-  gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'`
-fi
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-
-
-
-
-
-# Figure out where generated headers like libgcj-config.h get installed.
-tool_include_dir='$(libdir)/gcc/$(target_noncanonical)/'${gcc_version}/include
-
-
 if test "x${with_newlib}" = "xyes"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
    # may not work correctly, because the compiler may not be able to
@@ -13814,9 +13792,9 @@ case ${version_specific_libs} in
     # Need the gcc compiler version to know where to install libraries
     # and header files if --enable-version-specific-runtime-libs option
     # is selected.
-    includedir='${libdir}/gcc/${target_noncanonical}/'$gcc_version/include/
+    includedir='$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include/'
     toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
-    toolexecmainlibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+    toolexecmainlibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
     toolexeclibdir=$toolexecmainlibdir
     ;;
   no)
@@ -13859,10 +13837,10 @@ echo "$as_me: error: --with-gxx-include-dir=[dir] requires a directory" >&2;}
     ;;
   no | "")
     case "${enable_version_specific_runtime_libs}" in
-      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
+      yes) gxx_include_dir='$(libsubdir)/include/c++' ;;
       *)
-	libstdcxx_incdir=c++/${gcc_version}
-	gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
+	libstdcxx_incdir='c++/$(gcc_version)'
+	gxx_include_dir='$(prefix)/include/$(libstdcxx_incdir)' ;;
     esac ;;
   *) gxx_include_dir=${with_gxx_include_dir} ;;
 esac
@@ -16728,10 +16706,6 @@ s,@USING_NO_THREADS_FALSE@,$USING_NO_THREADS_FALSE,;t t
 s,@HASH_SYNC_SPEC@,$HASH_SYNC_SPEC,;t t
 s,@USING_GCC_TRUE@,$USING_GCC_TRUE,;t t
 s,@USING_GCC_FALSE@,$USING_GCC_FALSE,;t t
-s,@gcc_version_trigger@,$gcc_version_trigger,;t t
-s,@gcc_version_full@,$gcc_version_full,;t t
-s,@gcc_version@,$gcc_version,;t t
-s,@tool_include_dir@,$tool_include_dir,;t t
 s,@LIBICONV@,$LIBICONV,;t t
 s,@LTLIBICONV@,$LTLIBICONV,;t t
 s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t
diff --git a/libjava/configure.ac b/libjava/configure.ac
index 2e40268038a24d35cce39a4ae03d985b4b72de5c..8366523de9045d79b023f2f62302d0f2c0a3ae96 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -720,18 +720,11 @@ if test "$enable_hash_synchronization" = yes && test "$THREADS" != "none"; then
 fi
 AC_SUBST(HASH_SYNC_SPEC)
 
-
 AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
 
 # We're in the tree with gcc, and need to include some of its headers.
 GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
 
-TL_AC_GCC_VERSION([$srcdir/..])
-
-# Figure out where generated headers like libgcj-config.h get installed.
-tool_include_dir='$(libdir)/gcc/$(target_noncanonical)/'${gcc_version}/include
-AC_SUBST(tool_include_dir)
-
 if test "x${with_newlib}" = "xyes"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
    # may not work correctly, because the compiler may not be able to
@@ -1171,9 +1164,9 @@ case ${version_specific_libs} in
     # Need the gcc compiler version to know where to install libraries
     # and header files if --enable-version-specific-runtime-libs option
     # is selected.
-    includedir='${libdir}/gcc/${target_noncanonical}/'$gcc_version/include/
+    includedir='$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include/'
     toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
-    toolexecmainlibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+    toolexecmainlibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
     toolexeclibdir=$toolexecmainlibdir
     ;;
   no)
diff --git a/libjava/external/Makefile.am b/libjava/external/Makefile.am
index 1f9b1753b20f43ae88546584a968ba3f1fedfe40..0031d6b7b000c7fccf88f17549b6b432ec99ab7e 100644
--- a/libjava/external/Makefile.am
+++ b/libjava/external/Makefile.am
@@ -1,5 +1,8 @@
 ## Input file for automake to generate the Makefile.in used by configure
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 SUBDIRS = sax w3c_dom
 
 # Work around what appears to be a GNU make bug handling MAKEFLAGS
diff --git a/libjava/external/Makefile.in b/libjava/external/Makefile.in
index d6e6ddd4c838284a24868a0889ddfd633e90b804..57f7c071529d7be01c0349f0184404dcd11f3ed8 100644
--- a/libjava/external/Makefile.in
+++ b/libjava/external/Makefile.in
@@ -39,16 +39,14 @@ target_triplet = @target@
 subdir = external
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -252,9 +250,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -288,10 +283,12 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 SUBDIRS = sax w3c_dom
 
 # Work around what appears to be a GNU make bug handling MAKEFLAGS
diff --git a/libjava/external/sax/Makefile.am b/libjava/external/sax/Makefile.am
index d2d6ec9d08738be67fb2549a3a26c8d6c273abc4..41760e5349239a7b95ac467229173fe21b8aab0f 100644
--- a/libjava/external/sax/Makefile.am
+++ b/libjava/external/sax/Makefile.am
@@ -2,6 +2,9 @@
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 ## The compiler with whatever flags we want for both -c and -C
 ## compiles.
 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fbootclasspath=$(BOOTCLASSPATH)
diff --git a/libjava/external/sax/Makefile.in b/libjava/external/sax/Makefile.in
index b73f186cfe6d658a909cd472b54cae61d200a30d..88bac2296e5d7f4d00e06815cc10c24cb4f9c753 100644
--- a/libjava/external/sax/Makefile.in
+++ b/libjava/external/sax/Makefile.in
@@ -42,16 +42,14 @@ target_triplet = @target@
 subdir = external/sax
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -289,9 +287,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -325,11 +320,13 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
 AUTOMAKE_OPTIONS = foreign subdir-objects
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fbootclasspath=$(BOOTCLASSPATH)
 BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(top_srcdir)'$(CLASSPATH_SEPARATOR)'$(top_builddir)
 AM_GCJFLAGS = \
diff --git a/libjava/external/w3c_dom/Makefile.am b/libjava/external/w3c_dom/Makefile.am
index 37ba5746a486f8cfc9b9a2796e0fa2331f7bf8dc..9eaa39a39eb85355f47503bb67c7191a34304029 100644
--- a/libjava/external/w3c_dom/Makefile.am
+++ b/libjava/external/w3c_dom/Makefile.am
@@ -2,6 +2,9 @@
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 ## The compiler with whatever flags we want for both -c and -C
 ## compiles.
 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fbootclasspath=$(BOOTCLASSPATH)
diff --git a/libjava/external/w3c_dom/Makefile.in b/libjava/external/w3c_dom/Makefile.in
index ffbb84ce078562d1f840dabe25570b4ff8ffd63d..8d64e75cbb3604c3acf693c85dfd9ffc1e347067 100644
--- a/libjava/external/w3c_dom/Makefile.in
+++ b/libjava/external/w3c_dom/Makefile.in
@@ -42,16 +42,14 @@ target_triplet = @target@
 subdir = external/w3c_dom
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -383,9 +381,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -419,11 +414,13 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
 AUTOMAKE_OPTIONS = foreign subdir-objects
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated -fbootclasspath=$(BOOTCLASSPATH)
 BOOTCLASSPATH = $(here)'$(CLASSPATH_SEPARATOR)'$(srcdir)'$(CLASSPATH_SEPARATOR)'$(top_srcdir)'$(CLASSPATH_SEPARATOR)'$(top_builddir)
 AM_GCJFLAGS = \
diff --git a/libjava/gcj/Makefile.am b/libjava/gcj/Makefile.am
index 961f1e8673901a6f6223bb11f8991eec1fce2558..6fd187dfa566289df4d5bea44ae964d31c0f02a0 100644
--- a/libjava/gcj/Makefile.am
+++ b/libjava/gcj/Makefile.am
@@ -2,11 +2,15 @@
 
 AUTOMAKE_OPTIONS = foreign
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 # autoconf2.13's target_alias
 target_noncanonical = @target_noncanonical@
 
 gcjdir = $(gxx_include_dir)/gcj
 gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
 
-toolgcjdir = @tool_include_dir@/gcj
+tool_include_dir := $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
+toolgcjdir       := $(tool_include_dir)/gcj
 toolgcj_HEADERS = libgcj-config.h
diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in
index 09e0dbcd80e34e6c2235ce0ad55962af5e3ecc18..dcb332acadf851b3e2fb4858145a7ffda9360bc3 100644
--- a/libjava/gcj/Makefile.in
+++ b/libjava/gcj/Makefile.in
@@ -42,16 +42,14 @@ DIST_COMMON = $(gcj_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/libgcj-config.h.in \
 	$(toolgcj_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -257,9 +255,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -295,14 +290,17 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
 AUTOMAKE_OPTIONS = foreign
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 gcjdir = $(gxx_include_dir)/gcj
 gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
-toolgcjdir = @tool_include_dir@/gcj
+tool_include_dir := $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
+toolgcjdir := $(tool_include_dir)/gcj
 toolgcj_HEADERS = libgcj-config.h
 all: libgcj-config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/libjava/include/Makefile.am b/libjava/include/Makefile.am
index 089884b5fbd5876952f60eb5a32fbd3b7f5ba3ee..f2553114cdcf146e16c1261b5425ddd963ea2169 100644
--- a/libjava/include/Makefile.am
+++ b/libjava/include/Makefile.am
@@ -2,7 +2,11 @@
 
 AUTOMAKE_OPTIONS = foreign
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 # autoconf2.13's target_alias
 target_noncanonical = @target_noncanonical@
 
+tool_include_dir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
 tool_include__HEADERS = jni.h jawt.h jawt_md.h jvmpi.h
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 17f6d2b2d37eb08bef06a624524e71fe2b7ab3d8..56280f3761c3acca08b807a8567ea9457ea3ffc3 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -41,16 +41,14 @@ subdir = include
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/config.h.in $(tool_include__HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -256,9 +254,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -294,11 +289,14 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
 AUTOMAKE_OPTIONS = foreign
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+tool_include_dir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
 tool_include__HEADERS = jni.h jawt.h jawt_md.h jvmpi.h
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/libjava/testsuite/Makefile.am b/libjava/testsuite/Makefile.am
index 0cd4aee0b88ebbef0eba1bed3cab0d8d26bf46d7..e2775f164b8fa9454e8a5f2b5aaa321b1f332c01 100644
--- a/libjava/testsuite/Makefile.am
+++ b/libjava/testsuite/Makefile.am
@@ -2,6 +2,9 @@
 
 AUTOMAKE_OPTIONS = foreign dejagnu
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 # autoconf2.13's target_alias
 target_noncanonical = @target_noncanonical@
 
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in
index 36bb5b7963f2a3540bf51ab724e68e17207cb299..3336bcbe8d747cc48ed520d16860d92b5d3058ab 100644
--- a/libjava/testsuite/Makefile.in
+++ b/libjava/testsuite/Makefile.in
@@ -39,16 +39,14 @@ target_triplet = @target@
 subdir = testsuite
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/pkg.m4 \
-	$(top_srcdir)/../config/accross.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \
 	$(top_srcdir)/../config/acx.m4 \
-	$(top_srcdir)/../config/gcc-version.m4 \
 	$(top_srcdir)/../config/gxx-include-dir.m4 \
 	$(top_srcdir)/../config/iconv.m4 \
 	$(top_srcdir)/../config/lcmessage.m4 \
 	$(top_srcdir)/../config/lib-ld.m4 \
 	$(top_srcdir)/../config/lib-link.m4 \
-	$(top_srcdir)/../config/lib-prefix.m4 \
+	$(top_srcdir)/../config/lib-prefix.m4 $(top_srcdir)/pkg.m4 \
 	$(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/../config/no-executables.m4 \
 	$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
@@ -245,9 +243,6 @@ build_subdir = @build_subdir@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
-gcc_version = @gcc_version@
-gcc_version_full = @gcc_version_full@
-gcc_version_trigger = @gcc_version_trigger@
 gxx_include_dir = @gxx_include_dir@
 here = @here@
 host = @host@
@@ -283,12 +278,14 @@ target_noncanonical = @target_noncanonical@
 target_os = @target_os@
 target_subdir = @target_subdir@
 target_vendor = @target_vendor@
-tool_include_dir = @tool_include_dir@
 toolexecdir = @toolexecdir@
 toolexeclibdir = @toolexeclibdir@
 toolexecmainlibdir = @toolexecmainlibdir@
 AUTOMAKE_OPTIONS = foreign dejagnu
 
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
 # Setup the testing framework, if you have one
 EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
             echo $(top_builddir)/../expect/expect ; \