# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gcc/no-include-fixed-dir.patch
# Copyright (C) 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---

# Do not create a 'include-fixed' directory containing certain header files,
# but install the header file into the default include directory.
#
# Without this patch a 'include-fixed' directory is created on install, where
# the 'limits.h' and 'syslimits.h' header files get installed as following
# flist output is demonstrating:
# --------------------------------------------------------------------------
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed/README
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed/limits.h
# gcc: usr/lib/gcc/i686-unknown-linux-gnu/4.4.3/include-fixed/syslimits.h
# --------------------------------------------------------------------------

--- gcc-4.4.3/gcc/Makefile.in.orig	2010-03-22 12:15:16.545004067 +0100
+++ gcc-4.4.3/gcc/Makefile.in	2010-03-22 12:21:27.841867139 +0100
@@ -4277,10 +4277,10 @@
 	if [ $$? -eq 0 ]; then \
 	  dir=`cd include-fixed; ${PWD_COMMAND}`; \
 	  for i in $$files; do \
-	    dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \
+	    dest=`ls -ld $(DESTDIR)$(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
 	    if expr "$$dest" : "$$dir.*" > /dev/null; then \
 	      rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
-	      ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
+	      ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include/$$i; \
 	    fi; \
 	  done; \
 	fi
@@ -4288,9 +4288,6 @@
 # Create or recreate the gcc private include file directory.
 install-include-dir: installdirs
 	$(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
-	-rm -rf $(DESTDIR)$(libsubdir)/include-fixed
-	mkdir $(DESTDIR)$(libsubdir)/include-fixed
-	-chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed
 
 # Create or recreate the install-tools include file directory.
 itoolsdir = $(libexecsubdir)/install-tools
@@ -4308,7 +4305,7 @@
 	(cd `${PWD_COMMAND}`/include ; \
 	 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
 	(cd `${PWD_COMMAND}`/include-fixed ; \
-	 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
+	 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
 # /bin/sh on some systems returns the status of the first tar,
 # and that can lose with GNU tar which always writes a full block.
 # So use `exit 0' to ignore its exit status.
@@ -4319,7 +4316,7 @@
 	cd `${PWD_COMMAND}`/include ; \
 	find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
 	cd `${PWD_COMMAND}`/include-fixed ; \
-	find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
+	find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
 
 # Install the include directory using cp.
 install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
@@ -4329,11 +4326,11 @@
 # Targets without dependencies, for use in prev-gcc during bootstrap.
 real-install-headers-tar:
 	(cd `${PWD_COMMAND}`/include-fixed ; \
-	 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
+	 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
 
 real-install-headers-cpio:
 	cd `${PWD_COMMAND}`/include-fixed ; \
-	find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
+	find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
 
 real-install-headers-cp:
 	cp -p -r include-fixed $(DESTDIR)$(libsubdir)