fix installed fixincludes

Geoffrey Keating gkeating@apple.com
Fri Nov 5 04:32:00 GMT 2004


The 'mkheaders' script that GCC installs in $libexecdir/install-tools
was:

1. Just plain broken.  It didn't work.  It couldn't have worked since
   fixincludes was made its own directory.  It appears that it was
   never tested during while this was happening.
2. The wrong architecture when cross-building.  It should be the
   host's architecture, not the build machine's!

This patch fixes these problems.

Tested with a powerpc-darwin bootstrap & dejagnu testrun; by building
a powerpc-darwin X i686-darwin on powerpc-darwin; and by building
an i686-darwin native on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-fixinchost.patch======================
Index: ChangeLog
2004-11-04  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.def: Build fixincludes for the host, too.
	* Makefile.in: Regenerate.
	* configure.in (host_tools): Add fixincludes.
	* configure: Regenerate.

Index: fixincludes/ChangeLog
2004-11-04  Geoffrey Keating  <geoffk@apple.com>

	* configure.ac: Add code to determine noncanonical_target,
	local_prefix, gcc_version; process mkheaders.in to make mkheaders.
	* configure: Regenerate.
	* fixinc.in: Move here from gcc/; fix many cross-hosting bugs.
	* mkfixinc.sh: Move here from gcc/; update for changes to fixinc.in.
	* mkheaders.in: Move here from gcc/; remove some unnecessary macros;
	update for changes to fixinc.in.
	* Makefile.in: Add many new macros.
	(install): New target.
	(mkheaders): New target.
	(fixinc.sh): New target.
	(all): Add mkheaders and fixinc.sh.
	* README-fixinc: Move here from gcc/.

Index: gcc/ChangeLog
2004-11-04  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.in (distclean): Don't delete nonexistent fixinc/ directory.
	(install-mkheaders): Install the version built for the
	host, not for the build machine.
	* configure.ac: Always run fixincludes.
	(all_outputs): Remove mkheaders.
	* configure: Regenerate.
	* fixinc.in: Move to fixincludes/.
	* mkfixinc.sh: Likewise.
	* mkheaders.in: Likewise.
	* README-fixinc: Likewise.

Index: Makefile.def
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.def,v
retrieving revision 1.37
diff -u -p -u -p -r1.37 Makefile.def
--- Makefile.def	9 Sep 2004 20:53:16 -0000	1.37
+++ Makefile.def	5 Nov 2004 04:23:17 -0000
@@ -51,6 +51,7 @@ host_modules= { module= fastjar; no_chec
 host_modules= { module= fileutils; };
 host_modules= { module= findutils; };
 host_modules= { module= find; };
+host_modules= { module= fixincludes; };
 host_modules= { module= flex; no_check_cross= true; };
 host_modules= { module= gas; bootstrap=true; };
 host_modules= { module= gcc; bootstrap=true; 
@@ -253,13 +254,16 @@ dependencies = { module=all-gcc; on=all-
 dependencies = { module=all-gcc; on=all-ld; };
 dependencies = { module=all-gcc; on=all-zlib; };
 dependencies = { module=all-gcc; on=all-libcpp; hard=true; };
-dependencies = { module=all-gcc; on=all-build-libiberty; };
+dependencies = { module=all-gcc; on=all-libiberty; };
+dependencies = { module=all-gcc; on=all-fixincludes; };
 
 dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; };
 dependencies = { module=configure-libcpp; on=configure-intl; };
 dependencies = { module=all-libcpp; on=all-libiberty; hard=true; };
 dependencies = { module=all-libcpp; on=all-intl; };
 
+dependencies = { module=all-fixincludes; on=all-libiberty; };
+
 // Host modules specific to gdb.
 dependencies = { module=configure-gdb; on=configure-itcl; };
 dependencies = { module=configure-gdb; on=configure-tcl; };
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.242
diff -u -p -u -p -r1.242 Makefile.in
--- Makefile.in	6 Oct 2004 10:09:19 -0000	1.242
+++ Makefile.in	5 Nov 2004 04:23:18 -0000
@@ -667,6 +667,7 @@ configure-host:  \
     maybe-configure-fileutils \
     maybe-configure-findutils \
     maybe-configure-find \
+    maybe-configure-fixincludes \
     maybe-configure-flex \
     maybe-configure-gas \
     maybe-configure-gcc \
@@ -768,6 +769,7 @@ all-host:  \
     maybe-all-fileutils \
     maybe-all-findutils \
     maybe-all-find \
+    maybe-all-fixincludes \
     maybe-all-flex \
     maybe-all-gas \
     maybe-all-gcc \
@@ -864,6 +866,7 @@ info-host:  \
     maybe-info-fileutils \
     maybe-info-findutils \
     maybe-info-find \
+    maybe-info-fixincludes \
     maybe-info-flex \
     maybe-info-gas \
     maybe-info-gcc \
@@ -956,6 +959,7 @@ dvi-host:  \
     maybe-dvi-fileutils \
     maybe-dvi-findutils \
     maybe-dvi-find \
+    maybe-dvi-fixincludes \
     maybe-dvi-flex \
     maybe-dvi-gas \
     maybe-dvi-gcc \
@@ -1048,6 +1052,7 @@ TAGS-host:  \
     maybe-TAGS-fileutils \
     maybe-TAGS-findutils \
     maybe-TAGS-find \
+    maybe-TAGS-fixincludes \
     maybe-TAGS-flex \
     maybe-TAGS-gas \
     maybe-TAGS-gcc \
@@ -1140,6 +1145,7 @@ install-info-host:  \
     maybe-install-info-fileutils \
     maybe-install-info-findutils \
     maybe-install-info-find \
+    maybe-install-info-fixincludes \
     maybe-install-info-flex \
     maybe-install-info-gas \
     maybe-install-info-gcc \
@@ -1232,6 +1238,7 @@ installcheck-host:  \
     maybe-installcheck-fileutils \
     maybe-installcheck-findutils \
     maybe-installcheck-find \
+    maybe-installcheck-fixincludes \
     maybe-installcheck-flex \
     maybe-installcheck-gas \
     maybe-installcheck-gcc \
@@ -1324,6 +1331,7 @@ mostlyclean-host:  \
     maybe-mostlyclean-fileutils \
     maybe-mostlyclean-findutils \
     maybe-mostlyclean-find \
+    maybe-mostlyclean-fixincludes \
     maybe-mostlyclean-flex \
     maybe-mostlyclean-gas \
     maybe-mostlyclean-gcc \
@@ -1416,6 +1424,7 @@ clean-host:  \
     maybe-clean-fileutils \
     maybe-clean-findutils \
     maybe-clean-find \
+    maybe-clean-fixincludes \
     maybe-clean-flex \
     maybe-clean-gas \
     maybe-clean-gcc \
@@ -1508,6 +1517,7 @@ distclean-host:  \
     maybe-distclean-fileutils \
     maybe-distclean-findutils \
     maybe-distclean-find \
+    maybe-distclean-fixincludes \
     maybe-distclean-flex \
     maybe-distclean-gas \
     maybe-distclean-gcc \
@@ -1600,6 +1610,7 @@ maintainer-clean-host:  \
     maybe-maintainer-clean-fileutils \
     maybe-maintainer-clean-findutils \
     maybe-maintainer-clean-find \
+    maybe-maintainer-clean-fixincludes \
     maybe-maintainer-clean-flex \
     maybe-maintainer-clean-gas \
     maybe-maintainer-clean-gcc \
@@ -1749,6 +1760,7 @@ do-check: unstage  \
     maybe-check-fileutils \
     maybe-check-findutils \
     maybe-check-find \
+    maybe-check-fixincludes \
     maybe-check-flex \
     maybe-check-gas \
     maybe-check-gcc \
@@ -1861,6 +1873,7 @@ install-host-nogcc:  \
     maybe-install-fileutils \
     maybe-install-findutils \
     maybe-install-find \
+    maybe-install-fixincludes \
     maybe-install-flex \
     maybe-install-gas \
     maybe-install-gawk \
@@ -1928,6 +1941,7 @@ install-host:  \
     maybe-install-fileutils \
     maybe-install-findutils \
     maybe-install-find \
+    maybe-install-fixincludes \
     maybe-install-flex \
     maybe-install-gas \
     maybe-install-gcc \
@@ -7994,6 +8008,310 @@ maintainer-clean-find: 
 @endif find
 
 
+.PHONY: configure-fixincludes maybe-configure-fixincludes
+maybe-configure-fixincludes:
+@if fixincludes
+maybe-configure-fixincludes: configure-fixincludes
+configure-fixincludes:
+	@test ! -f fixincludes/Makefile || exit 0; \
+	[ -d fixincludes ] || mkdir fixincludes; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring in fixincludes; \
+	cd fixincludes || exit 1; \
+	case $(srcdir) in \
+	  \.) \
+	    srcdiroption="--srcdir=."; \
+	    libsrcdir=".";; \
+	  /* | [A-Za-z]:[\\/]*) \
+	    srcdiroption="--srcdir=$(srcdir)/fixincludes"; \
+	    libsrcdir="$$s/fixincludes";; \
+	  *) \
+	    srcdiroption="--srcdir=../$(srcdir)/fixincludes"; \
+	    libsrcdir="$$s/fixincludes";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
+	  || exit 1
+@endif fixincludes
+
+.PHONY: all-fixincludes maybe-all-fixincludes
+maybe-all-fixincludes:
+@if fixincludes
+TARGET-fixincludes=all
+maybe-all-fixincludes: all-fixincludes
+all-fixincludes: configure-fixincludes
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd fixincludes && $(MAKE) $(FLAGS_TO_PASS)  \
+	  $(TARGET-fixincludes))
+@endif fixincludes
+
+.PHONY: check-fixincludes maybe-check-fixincludes
+maybe-check-fixincludes:
+@if fixincludes
+maybe-check-fixincludes: check-fixincludes
+
+check-fixincludes:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd fixincludes && $(MAKE) $(FLAGS_TO_PASS) check)
+
+@endif fixincludes
+
+.PHONY: install-fixincludes maybe-install-fixincludes
+maybe-install-fixincludes:
+@if fixincludes
+maybe-install-fixincludes: install-fixincludes
+
+install-fixincludes: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd fixincludes && $(MAKE) $(FLAGS_TO_PASS) install)
+
+@endif fixincludes
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-fixincludes info-fixincludes
+maybe-info-fixincludes:
+@if fixincludes
+maybe-info-fixincludes: info-fixincludes
+
+info-fixincludes: \
+    configure-fixincludes 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          info) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-dvi-fixincludes dvi-fixincludes
+maybe-dvi-fixincludes:
+@if fixincludes
+maybe-dvi-fixincludes: dvi-fixincludes
+
+dvi-fixincludes: \
+    configure-fixincludes 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing dvi in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          dvi) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-TAGS-fixincludes TAGS-fixincludes
+maybe-TAGS-fixincludes:
+@if fixincludes
+maybe-TAGS-fixincludes: TAGS-fixincludes
+
+TAGS-fixincludes: \
+    configure-fixincludes 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing TAGS in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          TAGS) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-install-info-fixincludes install-info-fixincludes
+maybe-install-info-fixincludes:
+@if fixincludes
+maybe-install-info-fixincludes: install-info-fixincludes
+
+install-info-fixincludes: \
+    configure-fixincludes \
+    info-fixincludes 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-info in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-info) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-installcheck-fixincludes installcheck-fixincludes
+maybe-installcheck-fixincludes:
+@if fixincludes
+maybe-installcheck-fixincludes: installcheck-fixincludes
+
+installcheck-fixincludes: \
+    configure-fixincludes 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing installcheck in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          installcheck) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-mostlyclean-fixincludes mostlyclean-fixincludes
+maybe-mostlyclean-fixincludes:
+@if fixincludes
+maybe-mostlyclean-fixincludes: mostlyclean-fixincludes
+
+mostlyclean-fixincludes: 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing mostlyclean in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          mostlyclean) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-clean-fixincludes clean-fixincludes
+maybe-clean-fixincludes:
+@if fixincludes
+maybe-clean-fixincludes: clean-fixincludes
+
+clean-fixincludes: 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing clean in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          clean) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-distclean-fixincludes distclean-fixincludes
+maybe-distclean-fixincludes:
+@if fixincludes
+maybe-distclean-fixincludes: distclean-fixincludes
+
+distclean-fixincludes: 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing distclean in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          distclean) \
+	  || exit 1
+
+@endif fixincludes
+
+.PHONY: maybe-maintainer-clean-fixincludes maintainer-clean-fixincludes
+maybe-maintainer-clean-fixincludes:
+@if fixincludes
+maybe-maintainer-clean-fixincludes: maintainer-clean-fixincludes
+
+maintainer-clean-fixincludes: 
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing maintainer-clean in fixincludes" ; \
+	(cd fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          maintainer-clean) \
+	  || exit 1
+
+@endif fixincludes
+
+
 .PHONY: configure-flex maybe-configure-flex
 maybe-configure-flex:
 @if flex
@@ -28133,7 +28451,7 @@ stage1-bubble:: 
 all-stage1:     \
   maybe-all-stage1-bfd \
   maybe-all-stage1-opcodes \
-  maybe-all-stage1-binutils             \
+  maybe-all-stage1-binutils              \
   maybe-all-stage1-gas \
   maybe-all-stage1-gcc        \
   maybe-all-stage1-intl   \
@@ -28146,7 +28464,7 @@ do-clean: clean-stage1
 clean-stage1:     \
   maybe-clean-stage1-bfd \
   maybe-clean-stage1-opcodes \
-  maybe-clean-stage1-binutils             \
+  maybe-clean-stage1-binutils              \
   maybe-clean-stage1-gas \
   maybe-clean-stage1-gcc        \
   maybe-clean-stage1-intl   \
@@ -28830,7 +29148,7 @@ stage2-bubble:: stage1-bubble
 all-stage2:     \
   maybe-all-stage2-bfd \
   maybe-all-stage2-opcodes \
-  maybe-all-stage2-binutils             \
+  maybe-all-stage2-binutils              \
   maybe-all-stage2-gas \
   maybe-all-stage2-gcc        \
   maybe-all-stage2-intl   \
@@ -28843,7 +29161,7 @@ do-clean: clean-stage2
 clean-stage2:     \
   maybe-clean-stage2-bfd \
   maybe-clean-stage2-opcodes \
-  maybe-clean-stage2-binutils             \
+  maybe-clean-stage2-binutils              \
   maybe-clean-stage2-gas \
   maybe-clean-stage2-gcc        \
   maybe-clean-stage2-intl   \
@@ -29551,7 +29869,7 @@ stage3-bubble:: stage2-bubble
 all-stage3:     \
   maybe-all-stage3-bfd \
   maybe-all-stage3-opcodes \
-  maybe-all-stage3-binutils             \
+  maybe-all-stage3-binutils              \
   maybe-all-stage3-gas \
   maybe-all-stage3-gcc        \
   maybe-all-stage3-intl   \
@@ -29564,7 +29882,7 @@ do-clean: clean-stage3
 clean-stage3:     \
   maybe-clean-stage3-bfd \
   maybe-clean-stage3-opcodes \
-  maybe-clean-stage3-binutils             \
+  maybe-clean-stage3-binutils              \
   maybe-clean-stage3-gas \
   maybe-clean-stage3-gcc        \
   maybe-clean-stage3-intl   \
@@ -30302,7 +30620,7 @@ stage4-bubble:: stage3-bubble
 all-stage4:     \
   maybe-all-stage4-bfd \
   maybe-all-stage4-opcodes \
-  maybe-all-stage4-binutils             \
+  maybe-all-stage4-binutils              \
   maybe-all-stage4-gas \
   maybe-all-stage4-gcc        \
   maybe-all-stage4-intl   \
@@ -30315,7 +30633,7 @@ do-clean: clean-stage4
 clean-stage4:     \
   maybe-clean-stage4-bfd \
   maybe-clean-stage4-opcodes \
-  maybe-clean-stage4-binutils             \
+  maybe-clean-stage4-binutils              \
   maybe-clean-stage4-gas \
   maybe-clean-stage4-gcc        \
   maybe-clean-stage4-intl   \
@@ -31049,7 +31367,7 @@ stageprofile-bubble:: stage1-bubble
 all-stageprofile:     \
   maybe-all-stageprofile-bfd \
   maybe-all-stageprofile-opcodes \
-  maybe-all-stageprofile-binutils             \
+  maybe-all-stageprofile-binutils              \
   maybe-all-stageprofile-gas \
   maybe-all-stageprofile-gcc        \
   maybe-all-stageprofile-intl   \
@@ -31062,7 +31380,7 @@ do-clean: clean-stageprofile
 clean-stageprofile:     \
   maybe-clean-stageprofile-bfd \
   maybe-clean-stageprofile-opcodes \
-  maybe-clean-stageprofile-binutils             \
+  maybe-clean-stageprofile-binutils              \
   maybe-clean-stageprofile-gas \
   maybe-clean-stageprofile-gcc        \
   maybe-clean-stageprofile-intl   \
@@ -31766,7 +32084,7 @@ stagefeedback-bubble:: stage1-bubble
 all-stagefeedback:     \
   maybe-all-stagefeedback-bfd \
   maybe-all-stagefeedback-opcodes \
-  maybe-all-stagefeedback-binutils             \
+  maybe-all-stagefeedback-binutils              \
   maybe-all-stagefeedback-gas \
   maybe-all-stagefeedback-gcc        \
   maybe-all-stagefeedback-intl   \
@@ -31779,7 +32097,7 @@ do-clean: clean-stagefeedback
 clean-stagefeedback:     \
   maybe-clean-stagefeedback-bfd \
   maybe-clean-stagefeedback-opcodes \
-  maybe-clean-stagefeedback-binutils             \
+  maybe-clean-stagefeedback-binutils              \
   maybe-clean-stagefeedback-gas \
   maybe-clean-stagefeedback-gcc        \
   maybe-clean-stagefeedback-intl   \
@@ -32647,15 +32965,22 @@ all-stage3-gcc: all-stage3-libcpp
 all-stage4-gcc: all-stage4-libcpp
 all-stageprofile-gcc: all-stageprofile-libcpp
 all-stagefeedback-gcc: all-stagefeedback-libcpp
-all-gcc: maybe-all-build-libiberty
+all-gcc: maybe-all-libiberty
 
-all-stage1-gcc: maybe-all-build-libiberty
-all-stage2-gcc: maybe-all-build-libiberty
-all-stage3-gcc: maybe-all-build-libiberty
-all-stage4-gcc: maybe-all-build-libiberty
-all-stageprofile-gcc: maybe-all-build-libiberty
-all-stagefeedback-gcc: maybe-all-build-libiberty
-all-prebootstrap: maybe-all-build-libiberty
+all-stage1-gcc: maybe-all-stage1-libiberty
+all-stage2-gcc: maybe-all-stage2-libiberty
+all-stage3-gcc: maybe-all-stage3-libiberty
+all-stage4-gcc: maybe-all-stage4-libiberty
+all-stageprofile-gcc: maybe-all-stageprofile-libiberty
+all-stagefeedback-gcc: maybe-all-stagefeedback-libiberty
+all-gcc: maybe-all-fixincludes
+
+all-stage1-gcc: maybe-all-stage1-fixincludes
+all-stage2-gcc: maybe-all-stage2-fixincludes
+all-stage3-gcc: maybe-all-stage3-fixincludes
+all-stage4-gcc: maybe-all-stage4-fixincludes
+all-stageprofile-gcc: maybe-all-stageprofile-fixincludes
+all-stagefeedback-gcc: maybe-all-stagefeedback-fixincludes
 configure-libcpp: configure-libiberty
 
 configure-stage1-libcpp: configure-stage1-libiberty
@@ -32688,6 +33013,7 @@ all-stage3-libcpp: maybe-all-stage3-intl
 all-stage4-libcpp: maybe-all-stage4-intl
 all-stageprofile-libcpp: maybe-all-stageprofile-intl
 all-stagefeedback-libcpp: maybe-all-stagefeedback-intl
+all-fixincludes: maybe-all-libiberty
 configure-gdb: maybe-configure-itcl
 configure-gdb: maybe-configure-tcl
 configure-gdb: maybe-configure-tk
Index: configure
===================================================================
RCS file: /cvs/gcc/gcc/configure,v
retrieving revision 1.192
diff -u -p -u -p -r1.192 configure
--- configure	4 Nov 2004 17:55:46 -0000	1.192
+++ configure	5 Nov 2004 04:23:19 -0000
@@ -903,7 +903,7 @@ host_libs="intl mmalloc libiberty opcode
 # know that we are building the simulator.
 # binutils, gas and ld appear in that order because it makes sense to run
 # "make check" in that particular order.
-host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
+host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.329
diff -u -p -u -p -r1.329 configure.in
--- configure.in	4 Nov 2004 17:55:49 -0000	1.329
+++ configure.in	5 Nov 2004 04:23:19 -0000
@@ -150,7 +150,7 @@ host_libs="intl mmalloc libiberty opcode
 # know that we are building the simulator.
 # binutils, gas and ld appear in that order because it makes sense to run
 # "make check" in that particular order.
-host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
+host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
Index: fixincludes/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/Makefile.in,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 Makefile.in
--- fixincludes/Makefile.in	15 Oct 2004 07:58:38 -0000	1.2
+++ fixincludes/Makefile.in	5 Nov 2004 04:23:20 -0000
@@ -37,8 +37,32 @@ FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUD
 srcdir = @srcdir@
 VPATH = $(srcdir)
 
+# Directory in which to put the directories used by the compiler.
+libdir = @libdir@
+# Directory in which GCC puts its executables.
+libexecdir = @libexecdir@
+
 # End of variables for you to override.
 
+# The target that we're configured for.
+target = @target@
+target_noncanonical:=@target_noncanonical@
+
+# The version of GCC in this tree
+gcc_version=@gcc_version@
+
+# Directory in which the compiler finds libraries etc.
+libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
+# Directory in which the compiler finds executables
+libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
+# Where our executable files go
+itoolsdir = $(libexecsubdir)/install-tools
+# Where our data files go
+itoolsdatadir = $(libsubdir)/install-tools
+
+# Locate mkinstalldirs.
+mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
+
 default : all
 
 # Now figure out from those variables how to compile and link.
@@ -70,7 +94,7 @@ HDR = server.h fixlib.h
 FI  = fixincl@EXEEXT@
 AF  = applyfix@EXEEXT@
 
-all : @TARGET@
+all : @TARGET@ fixinc.sh mkheaders
 gen : $(srcdir)/fixincl.x
 
 
@@ -96,6 +120,9 @@ server.o    : server.c
 procopen.o  : procopen.c
 fixlib.o    : fixlib.c
 
+fixinc.sh : fixinc.in mkfixinc.sh Makefile
+	srcdir="$(srcdir)" $(SHELL) $(srcdir)/mkfixinc.sh $(target)
+
 $(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def
 	cd $(srcdir) ; $(SHELL) ./genfixes
 
@@ -108,6 +135,9 @@ maintainer-clean : clean
 Makefile: $(srcdir)/Makefile.in config.status
 	$(SHELL) ./config.status Makefile
 
+mkheaders: $(srcdir)/mkheaders.in config.status
+	CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status
+
 config.h: stamp-h
 stamp-h: $(srcdir)/config.h.in config.status
 	$(SHELL) ./config.status config.h
@@ -128,3 +158,14 @@ check : all
 	autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
 	$(SHELL) ./check.sh $(srcdir)/tests/base
 	@rm -f ./check.sh
+
+install : all
+	-rm -rf $(DESTDIR)$(itoolsdir)
+	$(mkinstalldirs) $(DESTDIR)$(itoolsdir) 
+	$(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
+	$(INSTALL_DATA) $(srcdir)/README-fixinc \
+	  $(DESTDIR)$(itoolsdatadir)/include/README
+	$(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh
+	$(INSTALL_PROGRAM) fixincl$(build_exeext) \
+	  $(DESTDIR)$(itoolsdir)/fixincl
+	$(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
Index: fixincludes/README-fixinc
===================================================================
RCS file: fixincludes/README-fixinc
diff -N fixincludes/README-fixinc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/README-fixinc	5 Nov 2004 04:23:20 -0000
@@ -0,0 +1,14 @@
+This README file is copied into the directory for GCC-only header files
+when fixincludes is run by the makefile for GCC.
+
+Many of the files in this directory were automatically edited from the
+standard system header files by the fixincludes process.  They are
+system-specific, and will not work on any other kind of system.  They
+are also not part of GCC.  The reason we have to do this is because
+GCC requires ANSI C headers and many vendors supply ANSI-incompatible
+headers.
+
+Because this is an automated process, sometimes headers get "fixed"
+that do not, strictly speaking, need a fix.  As long as nothing is broken
+by the process, it is just an unfortunate collateral inconvenience.
+We would like to rectify it, if it is not "too inconvenient".
Index: fixincludes/configure
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/configure,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 configure
--- fixincludes/configure	27 Oct 2004 14:42:56 -0000	1.3
+++ fixincludes/configure	5 Nov 2004 04:23:21 -0000
@@ -309,7 +309,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 host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT TARGET CPP EGREP MAINT 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 host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT target_noncanonical TARGET gcc_version CPP EGREP MAINT LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -851,6 +851,11 @@ Optional Features:
   --enable-maintainer-mode enable make rules and dependencies not useful
                           (and sometimes confusing) to the casual installer
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-local-prefix=DIR specifies directory to put local include
+
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
@@ -951,7 +956,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd "$ac_popdir"
+    cd $ac_popdir
   done
 fi
 
@@ -1984,7 +1989,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2042,7 +2048,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2158,7 +2165,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2212,7 +2220,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2257,7 +2266,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2301,7 +2311,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2341,6 +2352,45 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+# Determine the noncanonical target name, for directory use.
+ case ${build_alias} in
+  "") build_noncanonical=${build} ;;
+  *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+  "") host_noncanonical=${build_noncanonical} ;;
+  *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+  "") target_noncanonical=${host_noncanonical} ;;
+  *) target_noncanonical=${target_alias} ;;
+esac
+
+
+
+
+# Specify the local prefix
+local_prefix=
+
+# Check whether --with-local-prefix or --without-local-prefix was given.
+if test "${with_local_prefix+set}" = set; then
+  withval="$with_local_prefix"
+  case "${withval}" in
+yes)	{ { echo "$as_me:$LINENO: error: bad value ${withval} given for local include directory prefix" >&5
+echo "$as_me: error: bad value ${withval} given for local include directory prefix" >&2;}
+   { (exit 1); exit 1; }; } ;;
+no)	;;
+*)	local_prefix=$with_local_prefix ;;
+esac
+fi;
+
+# Default local prefix if it is empty
+if test x$local_prefix = x; then
+	local_prefix=/usr/local
+fi
+
 # Choose one or two-process fix methodology.  Systems that cannot handle
 # bi-directional pipes must use the two process method.
 #
@@ -2375,6 +2425,10 @@ _ACEOF
 
 fi
 
+# Get GCC's version number.
+gcc_version=`sed -n '/version_string/ { s/.*"\([^ "]*\)[^"]*".*/\1/p ; }' ${srcdir}/../gcc/version.c`
+
+
 case $host in
 	vax-dec-bsd* )
 
@@ -2681,7 +2735,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2851,7 +2906,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2925,7 +2981,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3114,7 +3171,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3178,7 +3236,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3247,7 +3306,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3316,7 +3376,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3385,7 +3446,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3454,7 +3516,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3523,7 +3586,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3592,7 +3656,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3708,7 +3773,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3772,7 +3838,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3950,7 +4017,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4067,7 +4135,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4159,7 +4228,7 @@ fi
 
           ac_config_headers="$ac_config_headers config.h"
 
-          ac_config_files="$ac_config_files Makefile"
+                    ac_config_files="$ac_config_files Makefile mkheaders"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -4686,6 +4755,7 @@ do
   case "$ac_config_target" in
   # Handling of arguments.
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "mkheaders" ) CONFIG_FILES="$CONFIG_FILES mkheaders" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -4790,7 +4860,9 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
 s,@ac_ct_CC@,$ac_ct_CC,;t t
 s,@EXEEXT@,$EXEEXT,;t t
 s,@OBJEXT@,$OBJEXT,;t t
+s,@target_noncanonical@,$target_noncanonical,;t t
 s,@TARGET@,$TARGET,;t t
+s,@gcc_version@,$gcc_version,;t t
 s,@CPP@,$CPP,;t t
 s,@EGREP@,$EGREP,;t t
 s,@MAINT@,$MAINT,;t t
@@ -4958,6 +5030,11 @@ esac
 
 
 
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -4996,12 +5073,6 @@ echo "$as_me: error: cannot find input f
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
Index: fixincludes/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/configure.ac,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 configure.ac
--- fixincludes/configure.ac	27 Oct 2004 14:42:56 -0000	1.3
+++ fixincludes/configure.ac	5 Nov 2004 04:23:21 -0000
@@ -6,6 +6,24 @@ AC_CONFIG_AUX_DIR(..)
 AC_CANONICAL_SYSTEM
 AC_PROG_CC
 
+# Determine the noncanonical target name, for directory use.
+ACX_NONCANONICAL_TARGET
+
+# Specify the local prefix
+local_prefix=
+AC_ARG_WITH(local-prefix,
+[  --with-local-prefix=DIR specifies directory to put local include],
+[case "${withval}" in
+yes)	AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
+no)	;;
+*)	local_prefix=$with_local_prefix ;;
+esac])
+
+# Default local prefix if it is empty
+if test x$local_prefix = x; then
+	local_prefix=/usr/local
+fi
+
 # Choose one or two-process fix methodology.  Systems that cannot handle
 # bi-directional pipes must use the two process method.
 #
@@ -34,6 +52,12 @@ if test $TARGET = twoprocess; then
 		  [Define if testing and fixing are done by separate process])
 fi
 
+# Get GCC's version number.
+changequote(,)dnl
+gcc_version=`sed -n '/version_string/ { s/.*"\([^ "]*\)[^"]*".*/\1/p ; }' ${srcdir}/../gcc/version.c`
+changequote([,])dnl
+AC_SUBST(gcc_version)
+
 case $host in
 	vax-dec-bsd* )
 		AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit])
@@ -74,5 +98,5 @@ fi	
 AC_SUBST(MAINT)
 
 AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
-AC_CONFIG_FILES(Makefile)
+AC_CONFIG_FILES(Makefile mkheaders)
 AC_OUTPUT
Index: fixincludes/fixinc.in
===================================================================
RCS file: fixincludes/fixinc.in
diff -N fixincludes/fixinc.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/fixinc.in	5 Nov 2004 04:23:21 -0000
@@ -0,0 +1,500 @@
+#!/bin/sh
+#
+# Install modified versions of certain ANSI-incompatible system header
+# files which are fixed to work correctly with ANSI C and placed in a
+# directory that GCC will search.
+#
+# See README-fixinc for more information.
+#
+#  fixincludes copyright (c) 1998, 1999, 2000, 2002
+#  The Free Software Foundation, Inc.
+#
+# fixincludes is free software.
+# 
+# You may redistribute it and/or modify it under the terms of the
+# GNU General Public License, as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+# 
+# fixincludes is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with fixincludes.  See the file "COPYING".  If not,
+# write to:  The Free Software Foundation, Inc.,
+#            59 Temple Place - Suite 330,
+#            Boston,  MA  02111-1307, USA.
+#
+# # # # # # # # # # # # # # # # # # # # #
+
+# Usage: fixinc.sh output-dir input-dir
+#
+# Directory in which to store the results.
+# Fail if no arg to specify a directory for the output.
+if [ "x$1" = "x" ]
+then
+  echo fixincludes: no output directory specified
+  exit 1
+fi
+
+LIB=${1}
+shift
+
+# Make sure it exists.
+if [ ! -d $LIB ]; then
+  mkdir $LIB || {
+    echo fixincludes:  output dir '`'$LIB"' cannot be created"
+    exit 1
+  }
+else
+  ( cd $LIB && touch DONE && rm DONE ) || {
+    echo fixincludes:  output dir '`'$LIB"' is an invalid directory"
+    exit 1
+  }
+fi
+
+if test -z "$VERBOSE"
+then
+  VERBOSE=2
+  export VERBOSE
+else
+  case "$VERBOSE" in
+  [0-9] ) : ;;
+  * )  VERBOSE=3 ;;
+  esac
+fi
+
+# Define what target system we're fixing.
+#
+if test -r ./Makefile; then
+  target_canonical="`sed -n -e 's,^target[ 	]*=[ 	]*\(.*\)$,\1,p' < Makefile`"
+fi
+
+# If not from the Makefile, then try config.guess
+#
+if test -z "${target_canonical}" ; then
+  if test -x ./config.guess ; then
+    target_canonical="`config.guess`" ; fi
+  test -z "${target_canonical}" && target_canonical=unknown
+fi
+export target_canonical
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# Define PWDCMD as a command to use to get the working dir
+# in the form that we want.
+PWDCMD=${PWDCMD-pwd}
+
+case "`$PWDCMD`" in
+//*)
+    # On an Apollo, discard everything before `/usr'.
+    PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
+    ;;
+esac
+
+# Original directory.
+ORIGDIR=`${PWDCMD}`
+export ORIGDIR
+FIXINCL=`${PWDCMD}`/fixincl
+if [ ! -x $FIXINCL ] ; then
+  echo "Cannot find fixincl" >&2
+  exit 1
+fi
+export FIXINCL
+
+# Make LIB absolute only if needed to avoid problems with the amd.
+case $LIB in
+/*)
+    ;;
+*)
+    cd $LIB; LIB=`${PWDCMD}`
+    ;;
+esac
+
+if test $VERBOSE -gt 0
+then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
+
+# Determine whether this system has symbolic links.
+if test -n "$DJDIR"; then
+  LINKS=false
+elif ln -s X $LIB/ShouldNotExist 2>/dev/null; then
+  rm -f $LIB/ShouldNotExist
+  LINKS=true
+elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
+  rm -f /tmp/ShouldNotExist
+  LINKS=true
+else
+  LINKS=false
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+#  In the file macro_list are listed all the predefined
+#  macros that are not in the C89 reserved namespace (the reserved
+#  namespace is all identifiers beginnning with two underscores or one
+#  underscore followed by a capital letter).  A regular expression to find
+#  any of those macros in a header file is written to MN_NAME_PAT.
+#
+#  Note dependency on ASCII. \012 = newline.
+#  tr ' ' '\n' is, alas, not portable.
+
+if test -s ${MACRO_LIST}
+then
+  if test $VERBOSE -gt 0; then
+    echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`"
+  fi
+  MN_NAME_PAT="`sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' \
+      < ${MACRO_LIST} | tr -d '\012'`"
+  export MN_NAME_PAT
+else
+  if test $VERBOSE -gt 0
+  then echo "No forbidden identifiers defined by this target" ; fi
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+#  Search each input directory for broken header files.
+#  This loop ends near the end of the file.
+#
+if test $# -eq 0
+then
+    INPUTLIST="/usr/include"
+else
+    INPUTLIST="$@"
+fi
+
+for INPUT in ${INPUTLIST} ; do
+
+cd ${ORIGDIR}
+
+#  Make sure a directory exists before changing into it,
+#  otherwise Solaris2 will fail-exit the script.
+#
+if [ ! -d ${INPUT} ]; then
+  continue
+fi
+cd ${INPUT}
+
+INPUT=`${PWDCMD}`
+export INPUT
+
+#
+# # # # # # # # # # # # # # # # # # # # #
+#
+if test $VERBOSE -gt 1
+then echo Finding directories and links to directories ; fi
+
+# Find all directories and all symlinks that point to directories.
+# Put the list in $all_dirs.
+# Each time we find a symlink, add it to newdirs
+# so that we do another find within the dir the link points to.
+# Note that $all_dirs may have duplicates in it;
+# later parts of this file are supposed to ignore them.
+dirs="."
+levels=2
+all_dirs=""
+search_dirs=""
+
+while [ -n "$dirs" ] && [ $levels -gt 0 ]
+do
+  levels=`expr $levels - 1`
+  newdirs=
+  for d in $dirs
+  do
+    if test $VERBOSE -gt 1
+    then echo " Searching $INPUT/$d" ; fi
+
+    # Find all directories under $d, relative to $d, excluding $d itself.
+    # (The /. is needed after $d in case $d is a symlink.)
+    all_dirs="$all_dirs `find $d/. -type d -print | \
+               sed -e '/\/\.$/d' -e 's@/./@/@g'`"
+    # Find all links to directories.
+    # Using `-exec test -d' in find fails on some systems,
+    # and trying to run test via sh fails on others,
+    # so this is the simplest alternative left.
+    # First find all the links, then test each one.
+    theselinks=
+    $LINKS && \
+      theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
+    for d1 in $theselinks --dummy--
+    do
+      # If the link points to a directory,
+      # add that dir to $newdirs
+      if [ -d $d1 ]
+      then
+        all_dirs="$all_dirs $d1"
+        if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
+        then
+          newdirs="$newdirs $d1"
+          search_dirs="$search_dirs $d1"
+        fi
+      fi
+    done
+  done
+
+  dirs="$newdirs"
+done
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+dirs=
+if test $VERBOSE -gt 2
+then echo "All directories (including links to directories):"
+     echo $all_dirs
+fi
+
+for file in $all_dirs; do
+  rm -rf $LIB/$file
+  if [ ! -d $LIB/$file ]
+  then mkdir $LIB/$file
+  fi
+done
+mkdir $LIB/root
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# treetops gets an alternating list
+# of old directories to copy
+# and the new directories to copy to.
+treetops=". ${LIB}"
+
+if $LINKS; then
+  if test $VERBOSE -gt 1
+  then echo 'Making symbolic directory links' ; fi
+  cwd=`${PWDCMD}`
+
+  for sym_link in $search_dirs; do
+    cd ${INPUT}
+    dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
+
+    # In case $dest is relative, get to ${sym_link}'s dir first.
+    #
+    cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
+
+    # Check that the target directory exists.
+    # Redirections changed to avoid bug in sh on Ultrix.
+    #
+    (cd $dest) > /dev/null 2>&1
+    if [ $? = 0 ]; then
+      cd $dest
+
+      # full_dest_dir gets the dir that the link actually leads to.
+      #
+      full_dest_dir=`${PWDCMD}`
+
+      # Canonicalize ${INPUT} now to minimize the time an
+      # automounter has to change the result of ${PWDCMD}.
+      #
+      cinput=`cd ${INPUT}; ${PWDCMD}`
+
+      # If a link points to ., make a similar link to .
+      #
+      if [ ${full_dest_dir} = ${cinput} ]; then
+        if test $VERBOSE -gt 2
+        then echo ${sym_link} '->' . ': Making self link' ; fi
+        rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+        ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
+
+      # If link leads back into ${INPUT},
+      # make a similar link here.
+      #
+      elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
+        # Y gets the actual target dir name, relative to ${INPUT}.
+        y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
+        # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
+        dots=`echo "${sym_link}" |
+          sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
+        if test $VERBOSE -gt 2
+        then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
+        rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+        ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
+
+      else
+        # If the link is to a dir $target outside ${INPUT},
+        # repoint the link at ${INPUT}/root$target
+        # and process $target into ${INPUT}/root$target
+        # treat this directory as if it actually contained the files.
+        #
+        if test $VERBOSE -gt 2
+        then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+        fi
+        if [ -d $LIB/root${full_dest_dir} ]
+        then true
+        else
+          dirname=root${full_dest_dir}/
+          dirmade=.
+          cd $LIB
+          while [ x$dirname != x ]; do
+            component=`echo $dirname | sed -e 's|/.*$||'`
+            mkdir $component >/dev/null 2>&1
+            cd $component
+            dirmade=$dirmade/$component
+            dirname=`echo $dirname | sed -e 's|[^/]*/||'`
+          done
+        fi
+
+        # Duplicate directory structure created in ${LIB}/${sym_link} in new
+        # root area.
+        #
+        for file2 in $all_dirs; do
+          case $file2 in
+            ${sym_link}/*)
+              dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
+                      sed -n "s|^${sym_link}/||p"`
+              if test $VERBOSE -gt 2
+              then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
+              if [ -d ${dupdir} ]
+              then true
+              else
+                mkdir ${dupdir}
+              fi
+              ;;
+            *)
+              ;;
+          esac
+        done
+
+        # Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
+        #
+        parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
+        libabs=`cd ${LIB}; ${PWDCMD}`
+        file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
+
+        # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
+        #
+        dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
+        rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+        ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
+        treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
+      fi
+    fi
+  done
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+required=
+set x $treetops
+shift
+while [ $# != 0 ]; do
+  # $1 is an old directory to copy, and $2 is the new directory to copy to.
+  #
+  SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
+  export SRCDIR
+
+  FIND_BASE=$1
+  export FIND_BASE
+  shift
+
+  DESTDIR=`cd $1;${PWDCMD}`
+  export DESTDIR
+  shift
+
+  # The same dir can appear more than once in treetops.
+  # There's no need to scan it more than once.
+  #
+  if [ -f ${DESTDIR}/DONE ]
+  then continue ; fi
+
+  touch ${DESTDIR}/DONE
+  if test $VERBOSE -gt 1
+  then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
+
+  # Check files which are symlinks as well as those which are files.
+  #
+  cd ${INPUT}
+  required="$required `if $LINKS; then
+    find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
+  else
+    find ${FIND_BASE}/. -name '*.h' -type f -print
+  fi | \
+    sed -e 's;/\./;/;g' -e 's;//*;/;g' | \
+    ${FIXINCL}`"
+done
+
+## Make sure that any include files referenced using double quotes
+## exist in the fixed directory.  This comes last since otherwise
+## we might end up deleting some of these files "because they don't
+## need any change."
+set x `echo $required`
+shift
+while [ $# != 0 ]; do
+  newreq=
+  while [ $# != 0 ]; do
+    # $1 is the directory to copy from,
+    # $2 is the unfixed file,
+    # $3 is the fixed file name.
+    #
+    cd ${INPUT}
+    cd $1
+    if [ -f $2 ] ; then
+      if [ -r $2 ] && [ ! -r $3 ]; then
+        cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
+        chmod +w $3 2>/dev/null
+        chmod a+r $3 2>/dev/null
+        if test $VERBOSE -gt 2
+        then echo Copied $2 ; fi
+        for include in `egrep '^[ 	]*#[ 	]*include[ 	]*"[^/]' $3 |
+             sed -e 's/^[ 	]*#[ 	]*include[ 	]*"\([^"]*\)".*$/\1/'`
+        do
+	  dir=`echo $2 | sed -e s'|/[^/]*$||'`
+	  dir2=`echo $3 | sed -e s'|/[^/]*$||'`
+	  newreq="$newreq $1 $dir/$include $dir2/$include"
+        done
+      fi
+    fi
+    shift; shift; shift
+  done
+  set x $newreq
+  shift
+done
+
+if test $VERBOSE -gt 2
+then echo 'Cleaning up DONE files.' ; fi
+cd $LIB
+# Look for files case-insensitively, for the benefit of
+# DOS/Windows filesystems.
+find . -name '[Dd][Oo][Nn][Ee]' -exec rm -f '{}' ';'
+
+if test $VERBOSE -gt 1
+then echo 'Cleaning up unneeded directories:' ; fi
+cd $LIB
+all_dirs=`find . -type d \! -name '.' -print | sort -r`
+for file in $all_dirs; do
+  if rmdir $LIB/$file > /dev/null
+  then
+    test $VERBOSE -gt 3 && echo "  removed $file"
+  fi
+done 2> /dev/null
+
+# On systems which don't support symlinks, `find' may barf
+# if called with "-type l" predicate.  So only use that if
+# we know we should look for symlinks.
+if $LINKS; then
+  test $VERBOSE -gt 2 && echo "Removing unused symlinks"
+
+  all_dirs=`find . -type l -print`
+  for file in $all_dirs
+  do
+    if test ! -d $file
+    then
+      rm -f $file
+      test $VERBOSE -gt 3 && echo "  removed $file"
+      rmdir `dirname $file` > /dev/null && \
+           test $VERBOSE -gt 3 && \
+           echo "  removed `dirname $file`"
+    fi
+  done 2> /dev/null
+fi
+
+if test $VERBOSE -gt 0
+then echo fixincludes is done ; fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# End of for INPUT directories
+#
+done
+#
+# # # # # # # # # # # # # # # # # # # # #
Index: fixincludes/mkfixinc.sh
===================================================================
RCS file: fixincludes/mkfixinc.sh
diff -N fixincludes/mkfixinc.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/mkfixinc.sh	5 Nov 2004 04:23:21 -0000
@@ -0,0 +1,42 @@
+#! /bin/sh
+
+if [ $# -ne 1 ]
+then
+  echo "Usage: $0 <target-mach-triplet>"
+  exit 1
+fi
+
+machine=$1
+target=fixinc.sh
+
+# Check for special fix rules for particular targets
+case $machine in
+    alpha*-dec-*vms* | \
+    arm-semi-aof | \
+    hppa1.1-*-osf* | \
+    hppa1.1-*-bsd* | \
+    i370-*-openedition | \
+    i?86-moss-msdos* | \
+    i?86-*-moss* | \
+    i?86-*-pe | \
+    i?86-*-cygwin* | \
+    i?86-*-mingw32* | \
+    i?86-*-uwin* | \
+    i?86-*-interix* | \
+    powerpc-*-eabiaix* | \
+    powerpc-*-eabisim* | \
+    powerpc-*-eabi*    | \
+    powerpc-*-rtems*   | \
+    powerpcle-*-eabisim* | \
+    powerpcle-*-eabi* )
+	#  IF there is no include fixing,
+	#  THEN create a no-op fixer and exit
+	(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
+        ;;
+
+    *)
+	../${build_subdir}/fixincludes/fixincl -v < /dev/null
+	cat < ${srcdir}/fixinc.in > ${target}
+	;;
+esac
+chmod 755 ${target}
Index: fixincludes/mkheaders.in
===================================================================
RCS file: fixincludes/mkheaders.in
diff -N fixincludes/mkheaders.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/mkheaders.in	5 Nov 2004 04:23:21 -0000
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# Copyright (C) 2002 Free Software Foundation, Inc.
+
+#This file is part of GCC.
+
+#GCC is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 2, or (at your option) any later
+#version.
+
+#GCC is distributed in the hope that it will be useful, but WITHOUT
+#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING.  If not, write to the Free
+#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+#02111-1307, USA.
+
+# Basic information
+target=@target@
+target_noncanonical=@target_noncanonical@
+version=@gcc_version@
+
+VERBOSE=0
+while [ x$1 = x-v ] ; do
+    shift
+    VERBOSE=`expr $VERBOSE + 1`
+done
+export VERBOSE
+
+if [ x$1 = x--help ] ; then
+    echo "Usage: mkheaders [options] [prefix]"
+    echo "Options:"
+    echo "  -v        Print more output (may be repeated for even more output)"
+    echo "  --help    This help"
+    echo "  --version Print version information"
+    exit 0
+fi
+
+if [ x$1 = x--version ] ; then
+    echo "mkheaders (GCC) version $version"
+    echo "Copyright 2002 Free Software Foundation, Inc."
+    echo "This program is free software; you may redistribute it under the"
+    echo "terms of the GNU General Public License.  This program has"
+    echo "absolutely no warranty."
+    exit 0
+fi
+
+# Common prefix for installation directories.
+if [ x$1 != x ] ; then
+  prefix=$1
+else
+  prefix=@prefix@
+fi
+# Directory in which to put host dependent programs and libraries
+exec_prefix=@exec_prefix@
+# Directory in which to put the directories used by the compiler.
+libdir=@libdir@
+libexecdir=@libexecdir@
+# Directory in which the compiler finds libraries, etc.
+libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
+# Directory in which the compiler finds executables
+libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
+
+itoolsdir=${libexecsubdir}/install-tools
+itoolsdatadir=${libsubdir}/install-tools
+incdir=${libsubdir}/include
+
+. ${itoolsdatadir}/mkheaders.conf
+
+cd ${itoolsdir}
+rm -rf ${incdir}/*
+
+if [ x${STMP_FIXINC} != x ] ; then
+	TARGET_MACHINE="${target}" target_canonical="${target}" \
+	    MACRO_LIST="${itoolsdatadir}/macro_list" \
+	    ${SHELL} ./fixinc.sh ${incdir} \
+	    ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
+	rm -f ${incdir}/syslimits.h
+	if [ -f ${incdir}/limits.h ]; then
+	  mv ${incdir}/limits.h ${incdir}/syslimits.h
+	else
+	  cp ${itoolsdatadir}/gsyslimits.h ${incdir}/syslimits.h
+	fi
+fi
+
+cp ${itoolsdatadir}/include/* ${incdir}
+
+if [ x${STMP_FIXPROTO} != x ] ; then
+  mkinstalldirs="${SHELL} ${itoolsdir}/mkinstalldirs"
+  export FIXPROTO_DEFINES mkinstalldirs
+  ${SHELL} fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1
+fi
Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1417
diff -u -p -u -p -r1.1417 Makefile.in
--- gcc/Makefile.in	2 Nov 2004 21:16:47 -0000	1.1417
+++ gcc/Makefile.in	5 Nov 2004 04:23:22 -0000
@@ -1080,9 +1080,6 @@ gccbug:	$(srcdir)/gccbug.in
 mklibgcc: $(srcdir)/mklibgcc.in
 	CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
 
-mkheaders: $(srcdir)/mkheaders.in
-	CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status
-
 # cstamp-h.in controls rebuilding of config.in.
 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
 # delete it.  A stamp file is needed as autoheader won't update the file if
@@ -2783,31 +2780,24 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) 
 	chmod a+r include/limits.h
 # Install the README
 	rm -f include/README
-	cp $(srcdir)/README-fixinc include/README
+	cp $(srcdir)/../fixincludes/README-fixinc include/README
 	chmod a+r include/README
 	$(STAMP) $@
 
-# fixinc.sh depends on this, not on specs directly.
-# The idea is to make sure specs gets built, but not rerun fixinc.sh
-# after each stage just because specs' mtime has changed.
-# It also depends on cc1 since fixinc.sh uses it.
-specs.ready: specs cc1$(exeext)
-	-if [ -f specs.ready ] ; then \
-		true; \
-	else \
-		$(STAMP) specs.ready; \
-	fi
-
-fixinc.sh: mkfixinc.sh fixinc.in
-	build_subdir="$(build_subdir)" srcdir="$(srcdir)" \
-	  $(SHELL) $(srcdir)/mkfixinc.sh $(build) $(target)
-
 .PHONY: install-gcc-tooldir
 install-gcc-tooldir:
 	$(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
 
+macro_list : $(GCC_PASSES)
+	echo | $(GCC_FOR_TARGET) -E -dM - | \
+	  sed -n 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p ; \
+		s/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
+	  sort -u > $@
+
 # Build fixed copies of system files.
-stmp-fixinc: fixinc.sh gsyslimits.h specs.ready
+stmp-fixinc: gsyslimits.h macro_list \
+  ../$(build_subdir)/fixincludes/fixincl \
+  ../$(build_subdir)/fixincludes/fixinc.sh
 	@if test ! -d ${SYSTEM_HEADER_DIR}; then \
 	  echo The directory that should contain system headers does not exist: >&2 ; \
 	  echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
@@ -2817,24 +2807,20 @@ stmp-fixinc: fixinc.sh gsyslimits.h spec
 	rm -rf include; mkdir include
 	-chmod a+rx include
 	(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
-	SHELL='$(SHELL)' ;\
-	export TARGET_MACHINE srcdir SHELL ; \
-	$(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \
-	rm -f include/syslimits.h; \
+	  SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
+	  export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
+	  cd ../$(build_subdir)/fixincludes && \
+	  $(SHELL) ./fixinc.sh ../../gcc/include \
+	    $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) )
+	rm -f include/syslimits.h
 	if [ -f include/limits.h ]; then \
 	  mv include/limits.h include/syslimits.h; \
 	else \
 	  cp $(srcdir)/gsyslimits.h include/syslimits.h; \
-	fi; \
-	chmod a+r include/syslimits.h)
+	fi
+	chmod a+r include/syslimits.h
 	$(STAMP) stmp-fixinc
 
-# We can't run fixinc (it's being built for a different host), but we still
-# need to install it so that the user can run it when the compiler is
-# installed.
-stmp-install-fixinc: fixinc.sh gsyslimits.h
-	$(STAMP) $@
-
 # Files related to the fixproto script.
 # gen-protos and fix-header are compiled with CC_FOR_BUILD, but they are only
 # used in native and host-x-target builds, so it's safe to link them with
@@ -3065,10 +3051,8 @@ mostlyclean: lang.mostlyclean
 	-rm -f specs $(SPECS) SYSCALLS.c.X SYSCALLS.c
 	-rm -f collect collect2 mips-tfile mips-tdump
 # Delete files generated for fixproto
-	-rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
+	-rm -rf $(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
 	  gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
-# Delete files generated for fixincl
-	-rm -rf fixinc.sh specs.ready
 # Delete unwanted output files from TeX.
 	-rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
 	-rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
@@ -3126,12 +3110,11 @@ distclean: clean lang.distclean
 	-cd testsuite && rm -f *.out *.gcov *$(coverageexts)
 	-rm -rf ${QMTEST_DIR} stamp-qmtest
 	-rm -f cxxmain.c
-	-rm -f mklibgcc mkheaders gccbug .gdbinit configargs.h
+	-rm -f mklibgcc gccbug .gdbinit configargs.h
 	-rm -f gcov.pod
-	-rm -f fixinc/Makefile
 # Delete po/*.gmo only if we are not building in the source directory.
 	-if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
-	-rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null
+	-rmdir ada cp f java objc intl po testsuite 2>/dev/null
 
 # Get rid of every file that's generated from some other file, except for `configure'.
 # Most of these files ARE PRESENT in the GCC distribution.
@@ -3361,28 +3344,18 @@ install-headers-cp: stmp-int-hdrs $(STMP
 
 itoolsdir = $(libexecsubdir)/install-tools
 itoolsdatadir = $(libsubdir)/install-tools
-# Don't install the headers.  Instead, install appropriate scripts
-# and supporting files for fixincludes to be run later.
+# Install supporting files for fixincludes to be run later.
 install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
-    mkheaders xlimits.h
-	-rm -rf $(DESTDIR)$(itoolsdir) $(DESTDIR)$(itoolsdatadir)
-	$(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
-	$(mkinstalldirs) $(DESTDIR)$(itoolsdir)
+  macro_list xlimits.h
 	for file in $(USER_H); do \
 	  realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
 	  $(INSTALL_DATA) $$file \
 	    $(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \
 	done
 	$(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h
-	if [ x$(STMP_FIXINC) != x ] ; then \
-	  $(INSTALL_DATA) $(srcdir)/README-fixinc \
-	    $(DESTDIR)$(itoolsdatadir)/include/README ; \
-	  $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
-	  $(INSTALL_PROGRAM) ../$(build_subdir)/fixincludes/fixincl$(build_exeext) \
-		$(DESTDIR)$(itoolsdir)/fixincl ; \
-	  $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
-	    $(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \
-	else :; fi
+	$(INSTALL_DATA) $(srcdir)/gsyslimits.h \
+	  $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
+	$(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
 	if [ x$(STMP_FIXPROTO) != x ] ; then \
 	  $(INSTALL_SCRIPT) $(mkinstalldirs) \
 		$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
@@ -3390,7 +3363,6 @@ install-mkheaders: stmp-int-hdrs $(STMP_
 	  $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
 		$(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
 	else :; fi
-	$(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
 	echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
 		> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
 	echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
Index: gcc/README-fixinc
===================================================================
RCS file: gcc/README-fixinc
diff -N gcc/README-fixinc
--- gcc/README-fixinc	27 May 2001 18:21:04 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-This README file is copied into the directory for GCC-only header files
-when fixincludes is run by the makefile for GCC.
-
-Many of the files in this directory were automatically edited from the
-standard system header files by the fixincludes process.  They are
-system-specific, and will not work on any other kind of system.  They
-are also not part of GCC.  The reason we have to do this is because
-GCC requires ANSI C headers and many vendors supply ANSI-incompatible
-headers.
-
-Because this is an automated process, sometimes headers get "fixed"
-that do not, strictly speaking, need a fix.  As long as nothing is broken
-by the process, it is just an unfortunate collateral inconvenience.
-We would like to rectify it, if it is not "too inconvenient".
Index: gcc/configure
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure,v
retrieving revision 1.873
diff -u -p -u -p -r1.873 configure
--- gcc/configure	2 Nov 2004 21:16:51 -0000	1.873
+++ gcc/configure	5 Nov 2004 04:23:22 -0000
@@ -12683,20 +12683,12 @@ then
     BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
 
     if test "x$TARGET_SYSTEM_ROOT" = x; then
-	STMP_FIXINC=stmp-install-fixinc
 	if  "x$STMP_FIXPROTO" != x  ; then
 	  STMP_FIXPROTO=stmp-install-fixproto
 	fi
     fi
 fi
 
-# When bootstrapping from the toplevel, only run fixincludes during stage1
-if test -d ../prev-gcc
-then
-    STMP_FIXINC=stmp-install-fixinc
-    cp -R ../prev-gcc/include include
-fi
-
 # Expand extra_headers to include complete path.
 # This substitutes for lots of t-* files.
 extra_headers_list=
@@ -14992,7 +14984,7 @@ all_languages=
 all_boot_languages=
 all_compilers=
 all_stagestuff=
-all_outputs='Makefile gccbug mklibgcc mkheaders libada-mk'
+all_outputs='Makefile gccbug mklibgcc libada-mk'
 # List of language makefile fragments.
 all_lang_makefrags=
 # List of language subdirectory makefiles.  Deprecated.
Index: gcc/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.82
diff -u -p -u -p -r2.82 configure.ac
--- gcc/configure.ac	2 Nov 2004 21:16:51 -0000	2.82
+++ gcc/configure.ac	5 Nov 2004 04:23:22 -0000
@@ -1684,20 +1684,12 @@ then
     BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
 
     if test "x$TARGET_SYSTEM_ROOT" = x; then
-	STMP_FIXINC=stmp-install-fixinc
 	if [ "x$STMP_FIXPROTO" != x ] ; then
 	  STMP_FIXPROTO=stmp-install-fixproto
 	fi
     fi
 fi
 
-# When bootstrapping from the toplevel, only run fixincludes during stage1
-if test -d ../prev-gcc
-then
-    STMP_FIXINC=stmp-install-fixinc
-    cp -R ../prev-gcc/include include
-fi
-
 # Expand extra_headers to include complete path.
 # This substitutes for lots of t-* files.
 extra_headers_list=
@@ -3034,7 +3026,7 @@ all_languages=
 all_boot_languages=
 all_compilers=
 all_stagestuff=
-all_outputs='Makefile gccbug mklibgcc mkheaders libada-mk'
+all_outputs='Makefile gccbug mklibgcc libada-mk'
 # List of language makefile fragments.
 all_lang_makefrags=
 # List of language subdirectory makefiles.  Deprecated.
Index: gcc/fixinc.in
===================================================================
RCS file: gcc/fixinc.in
diff -N gcc/fixinc.in
--- gcc/fixinc.in	31 Aug 2004 09:26:47 -0000	2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,506 +0,0 @@
-#!/bin/sh
-#
-# Install modified versions of certain ANSI-incompatible system header
-# files which are fixed to work correctly with ANSI C and placed in a
-# directory that GCC will search.
-#
-# See README-fixinc for more information.
-#
-#  fixincludes copyright (c) 1998, 1999, 2000, 2002
-#  The Free Software Foundation, Inc.
-#
-# fixincludes is free software.
-# 
-# You may redistribute it and/or modify it under the terms of the
-# GNU General Public License, as published by the Free Software
-# Foundation; either version 2, or (at your option) any later version.
-# 
-# fixincludes is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with fixincludes.  See the file "COPYING".  If not,
-# write to:  The Free Software Foundation, Inc.,
-#            59 Temple Place - Suite 330,
-#            Boston,  MA  02111-1307, USA.
-#
-# # # # # # # # # # # # # # # # # # # # #
-
-# Usage: fixinc.sh output-dir input-dir
-#
-# Directory in which to store the results.
-# Fail if no arg to specify a directory for the output.
-if [ "x$1" = "x" ]
-then
-  echo fixincludes: no output directory specified
-  exit 1
-fi
-
-LIB=${1}
-shift
-
-# Make sure it exists.
-if [ ! -d $LIB ]; then
-  mkdir $LIB || {
-    echo fixincludes:  output dir '`'$LIB"' cannot be created"
-    exit 1
-  }
-else
-  ( cd $LIB && touch DONE && rm DONE ) || {
-    echo fixincludes:  output dir '`'$LIB"' is an invalid directory"
-    exit 1
-  }
-fi
-
-if test -z "$VERBOSE"
-then
-  VERBOSE=2
-  export VERBOSE
-else
-  case "$VERBOSE" in
-  [0-9] ) : ;;
-  * )  VERBOSE=3 ;;
-  esac
-fi
-
-# Define what target system we're fixing.
-#
-if test -r ./Makefile; then
-  target_canonical="`sed -n -e 's,^target[ 	]*=[ 	]*\(.*\)$,\1,p' < Makefile`"
-fi
-
-# If not from the Makefile, then try config.guess
-#
-if test -z "${target_canonical}" ; then
-  if test -x ./config.guess ; then
-    target_canonical="`config.guess`" ; fi
-  test -z "${target_canonical}" && target_canonical=unknown
-fi
-export target_canonical
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-# Define PWDCMD as a command to use to get the working dir
-# in the form that we want.
-PWDCMD=${PWDCMD-pwd}
-
-case "`$PWDCMD`" in
-//*)
-    # On an Apollo, discard everything before `/usr'.
-    PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
-    ;;
-esac
-
-# Original directory.
-ORIGDIR=`${PWDCMD}`
-export ORIGDIR
-FIXINCL="@FIXINCL@"
-if [ ! -x $FIXINCL ] ; then
-  echo "Cannot find working fixincl" >&2
-  exit 1
-fi
-export FIXINCL
-
-# Make LIB absolute only if needed to avoid problems with the amd.
-case $LIB in
-/*)
-    ;;
-*)
-    cd $LIB; LIB=`${PWDCMD}`
-    ;;
-esac
-
-if test $VERBOSE -gt 0
-then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
-
-# Determine whether this system has symbolic links.
-if test -n "$DJDIR"; then
-  LINKS=false
-elif ln -s X $LIB/ShouldNotExist 2>/dev/null; then
-  rm -f $LIB/ShouldNotExist
-  LINKS=true
-elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
-  rm -f /tmp/ShouldNotExist
-  LINKS=true
-else
-  LINKS=false
-fi
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-#  Extract from the gcc -dM and from the specs file all the predefined
-#  macros that are not in the C89 reserved namespace (the reserved
-#  namespace is all  identifiers beginnning with two underscores or one
-#  underscore followed by a capital letter).  The specs file is in
-#  ${ORIGDIR}, as is cc1.  A regular expression to find any of those
-#  macros in a header file is written to MN_NAME_PAT.
-#
-#  Note dependency on ASCII. \012 = newline.
-#  tr ' ' '\n' is, alas, not portable.
-
-echo | ${ORIGDIR}/cc1 -quiet -dM -E - |
-  sed -n 's/^#define \([a-zA-Z][a-zA-Z0-9_]*\).*/\1/p' > mn.T
-tr -s '\040\011' '\012\012' < ${ORIGDIR}/specs |
-  sed -n 's/^.*-D\([a-zA-Z_][a-zA-Z0-9_]*\).*/\1/p' >> mn.T
-
-if sort -u mn.T | grep -v '^_[_A-Z]' > mn.U
-then
-  if test $VERBOSE -gt 0
-  then echo "Forbidden identifiers: `tr '\012' ' ' <mn.U`" ; fi
-  sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' < mn.U | tr -d '\012' > mn.V
-  MN_NAME_PAT="`cat mn.V`"
-  export MN_NAME_PAT
-else
-  if test $VERBOSE -gt 0
-  then echo "No forbidden identifiers defined by this target" ; fi
-fi
-rm -f mn.[TUV]
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-#  Search each input directory for broken header files.
-#  This loop ends near the end of the file.
-#
-if test $# -eq 0
-then
-    INPUTLIST="/usr/include"
-else
-    INPUTLIST="$@"
-fi
-
-for INPUT in ${INPUTLIST} ; do
-
-cd ${ORIGDIR}
-
-#  Make sure a directory exists before changing into it,
-#  otherwise Solaris2 will fail-exit the script.
-#
-if [ ! -d ${INPUT} ]; then
-  continue
-fi
-cd ${INPUT}
-
-INPUT=`${PWDCMD}`
-export INPUT
-
-#
-# # # # # # # # # # # # # # # # # # # # #
-#
-if test $VERBOSE -gt 1
-then echo Finding directories and links to directories ; fi
-
-# Find all directories and all symlinks that point to directories.
-# Put the list in $all_dirs.
-# Each time we find a symlink, add it to newdirs
-# so that we do another find within the dir the link points to.
-# Note that $all_dirs may have duplicates in it;
-# later parts of this file are supposed to ignore them.
-dirs="."
-levels=2
-all_dirs=""
-search_dirs=""
-
-while [ -n "$dirs" ] && [ $levels -gt 0 ]
-do
-  levels=`expr $levels - 1`
-  newdirs=
-  for d in $dirs
-  do
-    if test $VERBOSE -gt 1
-    then echo " Searching $INPUT/$d" ; fi
-
-    # Find all directories under $d, relative to $d, excluding $d itself.
-    # (The /. is needed after $d in case $d is a symlink.)
-    all_dirs="$all_dirs `find $d/. -type d -print | \
-               sed -e '/\/\.$/d' -e 's@/./@/@g'`"
-    # Find all links to directories.
-    # Using `-exec test -d' in find fails on some systems,
-    # and trying to run test via sh fails on others,
-    # so this is the simplest alternative left.
-    # First find all the links, then test each one.
-    theselinks=
-    $LINKS && \
-      theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
-    for d1 in $theselinks --dummy--
-    do
-      # If the link points to a directory,
-      # add that dir to $newdirs
-      if [ -d $d1 ]
-      then
-        all_dirs="$all_dirs $d1"
-        if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
-        then
-          newdirs="$newdirs $d1"
-          search_dirs="$search_dirs $d1"
-        fi
-      fi
-    done
-  done
-
-  dirs="$newdirs"
-done
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-dirs=
-if test $VERBOSE -gt 2
-then echo "All directories (including links to directories):"
-     echo $all_dirs
-fi
-
-for file in $all_dirs; do
-  rm -rf $LIB/$file
-  if [ ! -d $LIB/$file ]
-  then mkdir $LIB/$file
-  fi
-done
-mkdir $LIB/root
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-# treetops gets an alternating list
-# of old directories to copy
-# and the new directories to copy to.
-treetops=". ${LIB}"
-
-if $LINKS; then
-  if test $VERBOSE -gt 1
-  then echo 'Making symbolic directory links' ; fi
-  cwd=`${PWDCMD}`
-
-  for sym_link in $search_dirs; do
-    cd ${INPUT}
-    dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
-
-    # In case $dest is relative, get to ${sym_link}'s dir first.
-    #
-    cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
-
-    # Check that the target directory exists.
-    # Redirections changed to avoid bug in sh on Ultrix.
-    #
-    (cd $dest) > /dev/null 2>&1
-    if [ $? = 0 ]; then
-      cd $dest
-
-      # full_dest_dir gets the dir that the link actually leads to.
-      #
-      full_dest_dir=`${PWDCMD}`
-
-      # Canonicalize ${INPUT} now to minimize the time an
-      # automounter has to change the result of ${PWDCMD}.
-      #
-      cinput=`cd ${INPUT}; ${PWDCMD}`
-
-      # If a link points to ., make a similar link to .
-      #
-      if [ ${full_dest_dir} = ${cinput} ]; then
-        if test $VERBOSE -gt 2
-        then echo ${sym_link} '->' . ': Making self link' ; fi
-        rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
-        ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
-
-      # If link leads back into ${INPUT},
-      # make a similar link here.
-      #
-      elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
-        # Y gets the actual target dir name, relative to ${INPUT}.
-        y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
-        # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
-        dots=`echo "${sym_link}" |
-          sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
-        if test $VERBOSE -gt 2
-        then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
-        rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
-        ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
-
-      else
-        # If the link is to a dir $target outside ${INPUT},
-        # repoint the link at ${INPUT}/root$target
-        # and process $target into ${INPUT}/root$target
-        # treat this directory as if it actually contained the files.
-        #
-        if test $VERBOSE -gt 2
-        then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
-        fi
-        if [ -d $LIB/root${full_dest_dir} ]
-        then true
-        else
-          dirname=root${full_dest_dir}/
-          dirmade=.
-          cd $LIB
-          while [ x$dirname != x ]; do
-            component=`echo $dirname | sed -e 's|/.*$||'`
-            mkdir $component >/dev/null 2>&1
-            cd $component
-            dirmade=$dirmade/$component
-            dirname=`echo $dirname | sed -e 's|[^/]*/||'`
-          done
-        fi
-
-        # Duplicate directory structure created in ${LIB}/${sym_link} in new
-        # root area.
-        #
-        for file2 in $all_dirs; do
-          case $file2 in
-            ${sym_link}/*)
-              dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
-                      sed -n "s|^${sym_link}/||p"`
-              if test $VERBOSE -gt 2
-              then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
-              if [ -d ${dupdir} ]
-              then true
-              else
-                mkdir ${dupdir}
-              fi
-              ;;
-            *)
-              ;;
-          esac
-        done
-
-        # Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
-        #
-        parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
-        libabs=`cd ${LIB}; ${PWDCMD}`
-        file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
-
-        # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
-        #
-        dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
-        rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
-        ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
-        treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
-      fi
-    fi
-  done
-fi
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-required=
-set x $treetops
-shift
-while [ $# != 0 ]; do
-  # $1 is an old directory to copy, and $2 is the new directory to copy to.
-  #
-  SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
-  export SRCDIR
-
-  FIND_BASE=$1
-  export FIND_BASE
-  shift
-
-  DESTDIR=`cd $1;${PWDCMD}`
-  export DESTDIR
-  shift
-
-  # The same dir can appear more than once in treetops.
-  # There's no need to scan it more than once.
-  #
-  if [ -f ${DESTDIR}/DONE ]
-  then continue ; fi
-
-  touch ${DESTDIR}/DONE
-  if test $VERBOSE -gt 1
-  then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
-
-  # Check files which are symlinks as well as those which are files.
-  #
-  cd ${INPUT}
-  required="$required `if $LINKS; then
-    find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
-  else
-    find ${FIND_BASE}/. -name '*.h' -type f -print
-  fi | \
-    sed -e 's;/\./;/;g' -e 's;//*;/;g' | \
-    ${FIXINCL}`"
-done
-
-## Make sure that any include files referenced using double quotes
-## exist in the fixed directory.  This comes last since otherwise
-## we might end up deleting some of these files "because they don't
-## need any change."
-set x `echo $required`
-shift
-while [ $# != 0 ]; do
-  newreq=
-  while [ $# != 0 ]; do
-    # $1 is the directory to copy from,
-    # $2 is the unfixed file,
-    # $3 is the fixed file name.
-    #
-    cd ${INPUT}
-    cd $1
-    if [ -f $2 ] ; then
-      if [ -r $2 ] && [ ! -r $3 ]; then
-        cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
-        chmod +w $3 2>/dev/null
-        chmod a+r $3 2>/dev/null
-        if test $VERBOSE -gt 2
-        then echo Copied $2 ; fi
-        for include in `egrep '^[ 	]*#[ 	]*include[ 	]*"[^/]' $3 |
-             sed -e 's/^[ 	]*#[ 	]*include[ 	]*"\([^"]*\)".*$/\1/'`
-        do
-	  dir=`echo $2 | sed -e s'|/[^/]*$||'`
-	  dir2=`echo $3 | sed -e s'|/[^/]*$||'`
-	  newreq="$newreq $1 $dir/$include $dir2/$include"
-        done
-      fi
-    fi
-    shift; shift; shift
-  done
-  set x $newreq
-  shift
-done
-
-if test $VERBOSE -gt 2
-then echo 'Cleaning up DONE files.' ; fi
-cd $LIB
-# Look for files case-insensitively, for the benefit of
-# DOS/Windows filesystems.
-find . -name '[Dd][Oo][Nn][Ee]' -exec rm -f '{}' ';'
-
-if test $VERBOSE -gt 1
-then echo 'Cleaning up unneeded directories:' ; fi
-cd $LIB
-all_dirs=`find . -type d \! -name '.' -print | sort -r`
-for file in $all_dirs; do
-  if rmdir $LIB/$file > /dev/null
-  then
-    test $VERBOSE -gt 3 && echo "  removed $file"
-  fi
-done 2> /dev/null
-
-# On systems which don't support symlinks, `find' may barf
-# if called with "-type l" predicate.  So only use that if
-# we know we should look for symlinks.
-if $LINKS; then
-  test $VERBOSE -gt 2 && echo "Removing unused symlinks"
-
-  all_dirs=`find . -type l -print`
-  for file in $all_dirs
-  do
-    if test ! -d $file
-    then
-      rm -f $file
-      test $VERBOSE -gt 3 && echo "  removed $file"
-      rmdir `dirname $file` > /dev/null && \
-           test $VERBOSE -gt 3 && \
-           echo "  removed `dirname $file`"
-    fi
-  done 2> /dev/null
-fi
-
-if test $VERBOSE -gt 0
-then echo fixincludes is done ; fi
-
-# # # # # # # # # # # # # # # # # # # # #
-#
-# End of for INPUT directories
-#
-done
-#
-# # # # # # # # # # # # # # # # # # # # #
Index: gcc/mkfixinc.sh
===================================================================
RCS file: gcc/mkfixinc.sh
diff -N gcc/mkfixinc.sh
--- gcc/mkfixinc.sh	31 Aug 2004 09:26:47 -0000	2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,44 +0,0 @@
-#! /bin/sh
-
-if [ $# -ne 2 ]
-then
-  echo "Usage: $0 <build-mach-triplet> <target-mach-triplet>"
-  exit 1
-fi
-
-build=$1
-machine=$2
-target=fixinc.sh
-
-# Check for special fix rules for particular targets
-case $machine in
-    alpha*-dec-*vms* | \
-    arm-semi-aof | \
-    hppa1.1-*-osf* | \
-    hppa1.1-*-bsd* | \
-    i370-*-openedition | \
-    i?86-moss-msdos* | \
-    i?86-*-moss* | \
-    i?86-*-pe | \
-    i?86-*-cygwin* | \
-    i?86-*-mingw32* | \
-    i?86-*-uwin* | \
-    i?86-*-interix* | \
-    powerpc-*-eabiaix* | \
-    powerpc-*-eabisim* | \
-    powerpc-*-eabi*    | \
-    powerpc-*-rtems*   | \
-    powerpcle-*-eabisim* | \
-    powerpcle-*-eabi* )
-	#  IF there is no include fixing,
-	#  THEN create a no-op fixer and exit
-	(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
-        ;;
-
-    *)
-	../${build_subdir}/fixincludes/fixincl -v < /dev/null
-	sed "s,@FIXINCL@,\${ORIGDIR}/../${build_subdir}/fixincludes/fixincl,g" \
-	  ${srcdir}/fixinc.in > ${target}
-	;;
-esac
-chmod 755 ${target}
Index: gcc/mkheaders.in
===================================================================
RCS file: gcc/mkheaders.in
diff -N gcc/mkheaders.in
--- gcc/mkheaders.in	1 Aug 2004 00:44:43 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,105 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2002 Free Software Foundation, Inc.
-
-#This file is part of GCC.
-
-#GCC is free software; you can redistribute it and/or modify it under
-#the terms of the GNU General Public License as published by the Free
-#Software Foundation; either version 2, or (at your option) any later
-#version.
-
-#GCC is distributed in the hope that it will be useful, but WITHOUT
-#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-#for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GCC; see the file COPYING.  If not, write to the Free
-#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-# Basic information
-target=@target@
-target_noncanonical=@target_noncanonical@
-version=@gcc_version@
-
-VERBOSE=0
-while [ x$1 = x-v ] ; do
-    shift
-    VERBOSE=`expr $VERBOSE + 1`
-done
-export VERBOSE
-
-if [ x$1 = x--help ] ; then
-    echo "Usage: mkheaders [options] [prefix]"
-    echo "Options:"
-    echo "  -v        Print more output (may be repeated for even more output)"
-    echo "  --help    This help"
-    echo "  --version Print version information"
-    exit 0
-fi
-
-if [ x$1 = x--version ] ; then
-    echo "mkheaders (GCC) version $version"
-    echo "Copyright 2002 Free Software Foundation, Inc."
-    echo "This program is free software; you may redistribute it under the"
-    echo "terms of the GNU General Public License.  This program has"
-    echo "absolutely no warranty."
-    exit 0
-fi
-
-# Common prefix for installation directories.
-if [ x$1 != x ] ; then
-  prefix=$1
-else
-  prefix=@prefix@
-fi
-# Directory in which to put localized header files. On the systems with
-# gcc as the native cc, `local_prefix' may not be `prefix' which is
-# `/usr'.
-# NOTE: local_prefix *should not* default from prefix.
-local_prefix=@local_prefix@
-# Directory in which to put host dependent programs and libraries
-exec_prefix=@exec_prefix@
-# Directory in which to put the directories used by the compiler.
-libdir=@libdir@
-libexecdir=@libexecdir@
-# Directory in which the compiler finds libraries, etc.
-libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
-# Directory in which the compiler finds executables
-libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
-# Since gcc_tooldir does not exist at build-time, use -B${build_tooldir}/bin/
-build_tooldir=${exec_prefix}/${target_noncanonical}
-# Directory to search for site-specific includes.
-local_includedir=${local_prefix}/include
-includedir=${prefix}/include
-
-itoolsdir=${libexecsubdir}/install-tools
-itoolsdatadir=${libsubdir}/install-tools
-incdir=${libsubdir}/include
-
-. ${itoolsdatadir}/mkheaders.conf
-
-cd ${itoolsdir}
-rm -rf ${incdir}/*
-
-if [ x${STMP_FIXINC} != x ] ; then
-	TARGET_MACHINE="${target}" target_canonical="${target}" \
-	    ${SHELL} ./fixinc.sh ${incdir} \
-	    ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
-	rm -f ${incdir}/syslimits.h
-	if [ -f ${incdir}/limits.h ]; then
-	  mv ${incdir}/limits.h ${incdir}/syslimits.h
-	else
-	  cp ${itoolsdatadir}/gsyslimits.h ${incdir}/syslimits.h
-	fi
-fi
-
-cp ${itoolsdatadir}/include/* ${incdir}
-
-if [ x${STMP_FIXPROTO} != x ] ; then
-  mkinstalldirs="${SHELL} ${itoolsdir}/mkinstalldirs"
-  export FIXPROTO_DEFINES mkinstalldirs
-  ${SHELL} fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1
-fi
Index: gcc/config/rs6000/t-darwin
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/t-darwin,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 t-darwin
--- gcc/config/rs6000/t-darwin	14 Oct 2004 22:30:43 -0000	1.14
+++ gcc/config/rs6000/t-darwin	5 Nov 2004 04:23:34 -0000
@@ -1,9 +1,9 @@
 LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \
 	$(srcdir)/config/rs6000/darwin-ldouble.c \
+	$(srcdir)/config/rs6000/darwin-fpsave.asm  \
 	$(srcdir)/config/rs6000/darwin-fallback.c
 
 LIB2FUNCS_STATIC_EXTRA = \
-	$(srcdir)/config/rs6000/darwin-fpsave.asm  \
 	$(srcdir)/config/rs6000/darwin-vecsave.asm  \
 	$(srcdir)/config/rs6000/darwin-world.asm
 
============================================================



More information about the Gcc-patches mailing list