Submitted By:            Matt Burgess <matthew_at_linuxfromscratch_dot_org>
Date:                    2011-03-30
Initial Package Version: 4.6.0
Upstream Status:         Submitted Upstream
Origin:                  http://gcc.gnu.org/PR47836
Description:             Allows --disable-target-libiberty and
                         --disable-target-zlib to be passed to configure as they
                         don't build correctly in cross-compiled environments.

diff -Naur gcc-4.6.0.orig/configure gcc-4.6.0/configure
--- gcc-4.6.0.orig/configure	2011-03-16 18:27:36.000000000 +0000
+++ gcc-4.6.0/configure	2011-03-30 19:50:41.000000000 +0000
@@ -2801,6 +2801,16 @@
 # Noconfigdirs are removed loudly.
 noconfigdirs=""
 
+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
diff -Naur gcc-4.6.0.orig/configure.ac gcc-4.6.0/configure.ac
--- gcc-4.6.0.orig/configure.ac	2011-03-16 18:27:36.000000000 +0000
+++ gcc-4.6.0/configure.ac	2011-03-30 19:50:41.000000000 +0000
@@ -262,6 +262,16 @@
 # Noconfigdirs are removed loudly.
 noconfigdirs=""
 
+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
