Patchwork Toplevel newlib/libgloss disabling cleanup

login
register
mail settings
Submitter Joseph S. Myers
Date May 4, 2011, 11:24 a.m.
Message ID <Pine.LNX.4.64.1105041123200.25186@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/94000/
State New
Headers show

Comments

Joseph S. Myers - May 4, 2011, 11:24 a.m.
This patch separates cases disabling newlib and libgloss for various
target OSes from the main toplevel case statement over targets.

By doing so, the logic is significantly simplified; there is now a
single case for all *-*-linux* targets that disables newlib and
libgloss for them, for example.  (The only Linux port of newlib is for
x86, so it's correct the disable newlib for all Linux targets except
for x86 where the existing logic is retained.)  Most empty cases in
the main case statement can now be removed because once this disabling
is done consistently on a per-OS basis there is no longer a
possibility that an empty case has a use to stop falling through to
later cases such as *-*-linux*.  (A few empty cases need to be kept to
stop falling through to cases such as mips*-*-*, however.)

Where newlib and libgloss were disabled for an OS on multiple
architectures I generally wrote a patter that matched all
architectures for that OS.  For sparc-*-sunos4* the logic disabled
them only for cross compilers, but newlib and libgloss are disabled by
default for native compilers anyway so I didn't keep any such
conditional when moving that disabling up.

While there's certainly scope for more splitting up of the big
toplevel case statement (so each project sharing the toplevel has its
own case statement, eventually coming from a subdirectory file), I
think this patch may be the last piece involving substantial
simplification through splitting up case statements.

OK to commit?

2011-05-04  Joseph Myers  <joseph@codesourcery.com>

	* configure.ac (alpha*-dec-osf*, i[[3456789]]86-*-rdos*,
	sh*-*-pe|mips*-*-pe|arm-wince-pe, sparc-*-sunos4*, *-*-aix*,
	*-*-beos*, *-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-linux*
	| *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu, *-*-lynxos*,
	*-*-mingw*, *-*-netbsd*, *-*-netware*, *-*-tpf*, *-*-uclinux*,
	*-*-vxworks*): Disable newlib and libgloss in separate case
	statement.
	(i[[3456789]]86-*-linux*): Move logic allowing newlib to be built
	to separate case statement.
	(*-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-netbsd*,
	*-*-netware*, *-*-tpf*, *-*-uclinux*, *-*-vxworks*,
	alpha*-dec-osf*, alpha*-*-linux*, am33_2.0-*-linux*, sh-*-linux*,
	sh*-*-pe|mips*-*-pe|*arm-wince-pe, arm-*-coff, arm-*-elf* |
	arm*-*-eabi*, arm*-*-linux-gnueabi, arm*-*-symbianelf*, avr-*-*,
	bfin-*-*, cris-*-* | crisv32-*-*, frv-*-*, i[[3456789]]86-*-coff |
	i[[3456789]]86-*-elf, i[[3456789]]86-w64-mingw*,
	i[[3456789]]86-*-mingw*, x86_64-*-mingw*,
	i[[3456789]]86-*-interix*, i[[3456789]]86-*-beos*,
	i[[3456789]]86-*-rdos*, m32r-*-*,
	m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*, m68k-*-elf*, m68*-*-*
	| fido-*-*, powerpc-*-aix*, powerpc-*-beos*, powerpc-*-eabi,
	powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems*,
	rs6000-*-lynxos*, rs6000-*-aix*, mips*-*-linux*, sparclet-*-aout*
	| sparc86x-*-*, sparc-*-elf*, sparc64-*-elf*, sparclite-*-*,
	sparc-*-sunos4*, sparc-*-solaris* | sparc64-*-solaris* |
	sparcv9-*-solaris*, *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu |
	*-*-kopensolaris*-gnu, *-*-lynxos*, *-*-*): Don't disable newlib
	and libgloss in main case over targets.  Remove most empty cases
	in main case over targets.
	* configure: Regenerate.
Paolo Bonzini - May 5, 2011, 11:54 a.m.
There is indeed more simplification possible (alpha-vms for example
caught my attention while reviewing), but proceeding incrementally
does not hurt.

This patch is okay, thanks.

Paolo


2011/5/4, Joseph S. Myers <joseph@codesourcery.com>:
> This patch separates cases disabling newlib and libgloss for various
> target OSes from the main toplevel case statement over targets.
>
> By doing so, the logic is significantly simplified; there is now a
> single case for all *-*-linux* targets that disables newlib and
> libgloss for them, for example.  (The only Linux port of newlib is for
> x86, so it's correct the disable newlib for all Linux targets except
> for x86 where the existing logic is retained.)  Most empty cases in
> the main case statement can now be removed because once this disabling
> is done consistently on a per-OS basis there is no longer a
> possibility that an empty case has a use to stop falling through to
> later cases such as *-*-linux*.  (A few empty cases need to be kept to
> stop falling through to cases such as mips*-*-*, however.)
>
> Where newlib and libgloss were disabled for an OS on multiple
> architectures I generally wrote a patter that matched all
> architectures for that OS.  For sparc-*-sunos4* the logic disabled
> them only for cross compilers, but newlib and libgloss are disabled by
> default for native compilers anyway so I didn't keep any such
> conditional when moving that disabling up.
>
> While there's certainly scope for more splitting up of the big
> toplevel case statement (so each project sharing the toplevel has its
> own case statement, eventually coming from a subdirectory file), I
> think this patch may be the last piece involving substantial
> simplification through splitting up case statements.
>
> OK to commit?
>
> 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
>
> 	* configure.ac (alpha*-dec-osf*, i[[3456789]]86-*-rdos*,
> 	sh*-*-pe|mips*-*-pe|arm-wince-pe, sparc-*-sunos4*, *-*-aix*,
> 	*-*-beos*, *-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-linux*
> 	| *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu, *-*-lynxos*,
> 	*-*-mingw*, *-*-netbsd*, *-*-netware*, *-*-tpf*, *-*-uclinux*,
> 	*-*-vxworks*): Disable newlib and libgloss in separate case
> 	statement.
> 	(i[[3456789]]86-*-linux*): Move logic allowing newlib to be built
> 	to separate case statement.
> 	(*-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-netbsd*,
> 	*-*-netware*, *-*-tpf*, *-*-uclinux*, *-*-vxworks*,
> 	alpha*-dec-osf*, alpha*-*-linux*, am33_2.0-*-linux*, sh-*-linux*,
> 	sh*-*-pe|mips*-*-pe|*arm-wince-pe, arm-*-coff, arm-*-elf* |
> 	arm*-*-eabi*, arm*-*-linux-gnueabi, arm*-*-symbianelf*, avr-*-*,
> 	bfin-*-*, cris-*-* | crisv32-*-*, frv-*-*, i[[3456789]]86-*-coff |
> 	i[[3456789]]86-*-elf, i[[3456789]]86-w64-mingw*,
> 	i[[3456789]]86-*-mingw*, x86_64-*-mingw*,
> 	i[[3456789]]86-*-interix*, i[[3456789]]86-*-beos*,
> 	i[[3456789]]86-*-rdos*, m32r-*-*,
> 	m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*, m68k-*-elf*, m68*-*-*
> 	| fido-*-*, powerpc-*-aix*, powerpc-*-beos*, powerpc-*-eabi,
> 	powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems*,
> 	rs6000-*-lynxos*, rs6000-*-aix*, mips*-*-linux*, sparclet-*-aout*
> 	| sparc86x-*-*, sparc-*-elf*, sparc64-*-elf*, sparclite-*-*,
> 	sparc-*-sunos4*, sparc-*-solaris* | sparc64-*-solaris* |
> 	sparcv9-*-solaris*, *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu |
> 	*-*-kopensolaris*-gnu, *-*-lynxos*, *-*-*): Don't disable newlib
> 	and libgloss in main case over targets.  Remove most empty cases
> 	in main case over targets.
> 	* configure: Regenerate.
>
> Index: configure.ac
> ===================================================================
> --- configure.ac	(revision 173360)
> +++ configure.ac	(working copy)
> @@ -744,10 +744,76 @@
>      ;;
>  esac
>
> +# Disable newlib and libgloss for various target OSes.
>  case "${target}" in
> +  alpha*-dec-osf*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  i[[3456789]]86-*-linux*)
> +    # This section makes it possible to build newlib natively on linux.
> +    # If we are using a cross compiler then don't configure newlib.
> +    if test x${is_cross_compiler} != xno ; then
> +      noconfigdirs="$noconfigdirs target-newlib"
> +    fi
> +    noconfigdirs="$noconfigdirs target-libgloss"
> +    # If we are not using a cross compiler, do configure newlib.
> +    # Note however, that newlib will only be configured in this situation
> +    # if the --with-newlib option has been given, because otherwise
> +    # 'target-newlib' will appear in skipdirs.
> +    ;;
> +  i[[3456789]]86-*-rdos*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  sh*-*-pe|mips*-*-pe|arm-wince-pe)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  sparc-*-sunos4*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-aix*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-beos*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
>    *-*-chorusos)
>      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
> +  *-*-dragonfly*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-freebsd*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-lynxos*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-mingw*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-netbsd*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-netware*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-tpf*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-uclinux*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +  *-*-vxworks*)
> +    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> +    ;;
> +esac
> +
> +case "${target}" in
> +  *-*-chorusos)
> +    ;;
>    powerpc-*-darwin*)
>      noconfigdirs="$noconfigdirs ld gas gdb gprof"
>      noconfigdirs="$noconfigdirs sim target-rda"
> @@ -765,10 +831,8 @@
>      noconfigdirs="$noconfigdirs sim target-rda"
>      ;;
>    *-*-dragonfly*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
>    *-*-freebsd*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
>  	&& test -f /usr/local/include/gmp.h; then
>        with_gmp=/usr/local
> @@ -779,76 +843,45 @@
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
>    *-*-netbsd*)
> -    # Skip some stuff on all NetBSD configurations.
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
>    *-*-netware*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
>    *-*-rtems*)
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
>      # The tpf target doesn't support gdb yet.
>    *-*-tpf*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss gdb tcl tk
> libgui itcl"
> +    noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
>      ;;
>    *-*-uclinux*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda"
> +    noconfigdirs="$noconfigdirs target-rda"
>      ;;
>    *-*-vxworks*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
>    alpha*-dec-osf*)
>      # ld works, but does not support shared libraries.
> -    # newlib is not 64 bit ready.
>      # gas doesn't generate exception information.
> -    noconfigdirs="$noconfigdirs gas ld target-newlib target-libgloss"
> +    noconfigdirs="$noconfigdirs gas ld"
>      ;;
>    alpha*-*-*vms*)
>      noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
>      ;;
> -  alpha*-*-linux*)
> -    # newlib is not 64 bit ready
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> -    ;;
>    alpha*-*-*)
>      # newlib is not 64 bit ready
>      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
> -  am33_2.0-*-linux*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> -    ;;
> -  sh-*-linux*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> -    ;;
>    sh*-*-pe|mips*-*-pe|*arm-wince-pe)
>      noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
> -    noconfigdirs="$noconfigdirs target-newlib"
>      ;;
>    arc-*-*)
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
> -  arm-*-coff)
> -    ;;
> -  arm-*-elf* | arm*-*-eabi* )
> -    ;;
> -  arm*-*-linux-gnueabi)
> -    case ${with_newlib} in
> -      no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> -    esac
> -    ;;
> -  arm*-*-symbianelf*)
> -    ;;
>    arm-*-pe*)
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
>    arm-*-riscix*)
>      noconfigdirs="$noconfigdirs ld target-libgloss"
>      ;;
> -  avr-*-*)
> -    ;;
> -  bfin-*-*)
> -    ;;
>    c4x-*-* | tic4x-*-*)
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
> @@ -858,12 +891,6 @@
>    cr16-*-*)
>      noconfigdirs="$noconfigdirs gdb"
>      ;;
> -  cris-*-* | crisv32-*-*)
> -    case "${target}" in
> -      *-*-linux*)
> -	noconfigdirs="$noconfigdirs target-newlib target-libgloss";;
> -    esac
> -    ;;
>    d10v-*-*)
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
> @@ -873,8 +900,6 @@
>    fr30-*-elf*)
>      noconfigdirs="$noconfigdirs gdb"
>      ;;
> -  frv-*-*)
> -    ;;
>    moxie-*-*)
>      noconfigdirs="$noconfigdirs gprof"
>      ;;
> @@ -918,30 +943,11 @@
>      # No gdb or ld support yet.
>      noconfigdirs="$noconfigdirs readline libgui itcl gdb ld"
>      ;;
> -  i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
> -    ;;
> -  i[[3456789]]86-*-linux*)
> -    # This section makes it possible to build newlib natively on linux.
> -    # If we are using a cross compiler then don't configure newlib.
> -    if test x${is_cross_compiler} != xno ; then
> -      noconfigdirs="$noconfigdirs target-newlib"
> -    fi
> -    noconfigdirs="$noconfigdirs target-libgloss"
> -    # If we are not using a cross compiler, do configure newlib.
> -    # Note however, that newlib will only be configured in this situation
> -    # if the --with-newlib option has been given, because otherwise
> -    # 'target-newlib' will appear in skipdirs.
> -    ;;
>    i[[3456789]]86-w64-mingw*)
> -    noconfigdirs="$noconfigdirs target-libgloss target-newlib"
>      ;;
>    i[[3456789]]86-*-mingw*)
>      target_configdirs="$target_configdirs target-winsup"
> -    noconfigdirs="$noconfigdirs target-libgloss target-newlib"
>      ;;
> -  x86_64-*-mingw*)
> -    noconfigdirs="$noconfigdirs target-libgloss target-newlib"
> -    ;;
>    *-*-cygwin*)
>      target_configdirs="$target_configdirs target-libtermcap target-winsup"
>      noconfigdirs="$noconfigdirs target-libgloss"
> @@ -952,8 +958,6 @@
>        echo "Warning: winsup/cygwin is missing so newlib can't be built."
>      fi
>      ;;
> -  i[[3456789]]86-*-interix* )
> -    ;;
>    i[[3456789]]86-*-pe)
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
> @@ -972,19 +976,11 @@
>      noconfigdirs="$noconfigdirs target-libgloss"
>      ;;
>    i[[3456789]]86-*-beos*)
> -    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
> +    noconfigdirs="$noconfigdirs gdb"
>      ;;
>    i[[3456789]]86-*-rdos*)
> -    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
> +    noconfigdirs="$noconfigdirs gdb"
>      ;;
> -  m32r-*-*)
> -    ;;
> -  m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
> -    ;;
> -  m68k-*-elf*)
> -    ;;
> -  m68*-*-* | fido-*-*)
> -    ;;
>    mmix-*-*)
>      noconfigdirs="$noconfigdirs gdb"
>      ;;
> @@ -993,7 +989,7 @@
>      ;;
>    powerpc-*-aix*)
>      # copied from rs6000-*-* entry
> -    noconfigdirs="$noconfigdirs gprof target-libgloss target-newlib"
> +    noconfigdirs="$noconfigdirs gprof"
>      ;;
>    powerpc*-*-winnt* | powerpc*-*-pe*)
>      target_configdirs="$target_configdirs target-winsup"
> @@ -1006,17 +1002,13 @@
>      noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
>      ;;
>    powerpc-*-beos*)
> -    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
> +    noconfigdirs="$noconfigdirs gdb"
>      ;;
> -  powerpc-*-eabi)
> -    ;;
> -  powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems* )
> -    ;;
>    rs6000-*-lynxos*)
> -    noconfigdirs="$noconfigdirs target-newlib gprof"
> +    noconfigdirs="$noconfigdirs gprof"
>      ;;
>    rs6000-*-aix*)
> -    noconfigdirs="$noconfigdirs gprof target-libgloss target-newlib"
> +    noconfigdirs="$noconfigdirs gprof"
>      ;;
>    rs6000-*-*)
>      noconfigdirs="$noconfigdirs gprof"
> @@ -1042,7 +1034,6 @@
>      noconfigdirs="$noconfigdirs gprof target-libgloss"
>      ;;
>    mips*-*-linux*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
>    mips*-*-*)
>      noconfigdirs="$noconfigdirs gprof"
> @@ -1055,23 +1046,11 @@
>           noconfigdirs="$noconfigdirs target-libgloss" ;;
>      esac
>      ;;
> -  sparclet-*-aout* | sparc86x-*-*)
> -    ;;
> -  sparc-*-elf*)
> -    ;;
> -  sparc64-*-elf*)
> -    ;;
> -  sparclite-*-*)
> -    ;;
>    sparc-*-sunos4*)
> -    if test x${is_cross_compiler} != xno ; then
> -           noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
> -    else
> +    if test x${is_cross_compiler} = xno ; then
>             use_gnu_ld=no
>      fi
>      ;;
> -  sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
> -    ;;
>    tic6x-*-*)
>      noconfigdirs="$noconfigdirs gdb sim"
>      ;;
> @@ -1081,14 +1060,6 @@
>    vax-*-*)
>      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
>      ;;
> -  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> -    ;;
> -  *-*-lynxos*)
> -    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
> -    ;;
> -  *-*-*)
> -    ;;
>  esac
>
>  # If we aren't building newlib, then don't build libgloss, since libgloss
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
>
>

Patch

Index: configure.ac
===================================================================
--- configure.ac	(revision 173360)
+++ configure.ac	(working copy)
@@ -744,10 +744,76 @@ 
     ;;
 esac
 
+# Disable newlib and libgloss for various target OSes.
 case "${target}" in
+  alpha*-dec-osf*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  i[[3456789]]86-*-linux*)
+    # This section makes it possible to build newlib natively on linux.
+    # If we are using a cross compiler then don't configure newlib.
+    if test x${is_cross_compiler} != xno ; then
+      noconfigdirs="$noconfigdirs target-newlib"
+    fi
+    noconfigdirs="$noconfigdirs target-libgloss"
+    # If we are not using a cross compiler, do configure newlib.
+    # Note however, that newlib will only be configured in this situation
+    # if the --with-newlib option has been given, because otherwise
+    # 'target-newlib' will appear in skipdirs.
+    ;;
+  i[[3456789]]86-*-rdos*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  sh*-*-pe|mips*-*-pe|arm-wince-pe)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  sparc-*-sunos4*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-aix*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-beos*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
   *-*-chorusos)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
+  *-*-dragonfly*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-freebsd*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-lynxos*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;; 
+  *-*-mingw*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-netbsd*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-netware*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-tpf*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-uclinux*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+  *-*-vxworks*)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    ;;
+esac
+
+case "${target}" in
+  *-*-chorusos)
+    ;;
   powerpc-*-darwin*)
     noconfigdirs="$noconfigdirs ld gas gdb gprof"
     noconfigdirs="$noconfigdirs sim target-rda"
@@ -765,10 +831,8 @@ 
     noconfigdirs="$noconfigdirs sim target-rda"
     ;;
   *-*-dragonfly*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
   *-*-freebsd*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
 	&& test -f /usr/local/include/gmp.h; then
       with_gmp=/usr/local
@@ -779,76 +843,45 @@ 
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
   *-*-netbsd*)
-    # Skip some stuff on all NetBSD configurations.
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
   *-*-netware*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
   *-*-rtems*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
     # The tpf target doesn't support gdb yet.
   *-*-tpf*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss gdb tcl tk libgui itcl"
+    noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
     ;;
   *-*-uclinux*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda"
+    noconfigdirs="$noconfigdirs target-rda"
     ;;
   *-*-vxworks*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
   alpha*-dec-osf*)
     # ld works, but does not support shared libraries.
-    # newlib is not 64 bit ready.
     # gas doesn't generate exception information.
-    noconfigdirs="$noconfigdirs gas ld target-newlib target-libgloss"
+    noconfigdirs="$noconfigdirs gas ld"
     ;;
   alpha*-*-*vms*)
     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
     ;;
-  alpha*-*-linux*)
-    # newlib is not 64 bit ready
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
   alpha*-*-*)
     # newlib is not 64 bit ready
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
-  am33_2.0-*-linux*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
-  sh-*-linux*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;    
   sh*-*-pe|mips*-*-pe|*arm-wince-pe)
     noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
-    noconfigdirs="$noconfigdirs target-newlib"
     ;;
   arc-*-*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
-  arm-*-coff)
-    ;;
-  arm-*-elf* | arm*-*-eabi* )
-    ;;
-  arm*-*-linux-gnueabi)
-    case ${with_newlib} in
-      no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    esac
-    ;;
-  arm*-*-symbianelf*)
-    ;;
   arm-*-pe*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
   arm-*-riscix*)
     noconfigdirs="$noconfigdirs ld target-libgloss"
     ;;
-  avr-*-*)
-    ;;
-  bfin-*-*)
-    ;;
   c4x-*-* | tic4x-*-*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
@@ -858,12 +891,6 @@ 
   cr16-*-*)
     noconfigdirs="$noconfigdirs gdb"
     ;;
-  cris-*-* | crisv32-*-*)
-    case "${target}" in
-      *-*-linux*)
-	noconfigdirs="$noconfigdirs target-newlib target-libgloss";;
-    esac
-    ;;
   d10v-*-*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
@@ -873,8 +900,6 @@ 
   fr30-*-elf*)
     noconfigdirs="$noconfigdirs gdb"
     ;;
-  frv-*-*)
-    ;;
   moxie-*-*)
     noconfigdirs="$noconfigdirs gprof"
     ;;
@@ -918,30 +943,11 @@ 
     # No gdb or ld support yet.
     noconfigdirs="$noconfigdirs readline libgui itcl gdb ld"
     ;;
-  i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
-    ;;
-  i[[3456789]]86-*-linux*)
-    # This section makes it possible to build newlib natively on linux.
-    # If we are using a cross compiler then don't configure newlib.
-    if test x${is_cross_compiler} != xno ; then
-      noconfigdirs="$noconfigdirs target-newlib"
-    fi
-    noconfigdirs="$noconfigdirs target-libgloss"
-    # If we are not using a cross compiler, do configure newlib.
-    # Note however, that newlib will only be configured in this situation
-    # if the --with-newlib option has been given, because otherwise
-    # 'target-newlib' will appear in skipdirs.
-    ;;
   i[[3456789]]86-w64-mingw*)
-    noconfigdirs="$noconfigdirs target-libgloss target-newlib"
     ;;
   i[[3456789]]86-*-mingw*)
     target_configdirs="$target_configdirs target-winsup"
-    noconfigdirs="$noconfigdirs target-libgloss target-newlib"
     ;;
-  x86_64-*-mingw*)
-    noconfigdirs="$noconfigdirs target-libgloss target-newlib"
-    ;;
   *-*-cygwin*)
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
     noconfigdirs="$noconfigdirs target-libgloss"
@@ -952,8 +958,6 @@ 
       echo "Warning: winsup/cygwin is missing so newlib can't be built."
     fi
     ;;
-  i[[3456789]]86-*-interix* )
-    ;;
   i[[3456789]]86-*-pe)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
@@ -972,19 +976,11 @@ 
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
   i[[3456789]]86-*-beos*)
-    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
+    noconfigdirs="$noconfigdirs gdb"
     ;;
   i[[3456789]]86-*-rdos*)
-    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
+    noconfigdirs="$noconfigdirs gdb"
     ;;
-  m32r-*-*)
-    ;;
-  m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
-    ;;
-  m68k-*-elf*)
-    ;;
-  m68*-*-* | fido-*-*)
-    ;;
   mmix-*-*)
     noconfigdirs="$noconfigdirs gdb"
     ;;
@@ -993,7 +989,7 @@ 
     ;;
   powerpc-*-aix*)
     # copied from rs6000-*-* entry
-    noconfigdirs="$noconfigdirs gprof target-libgloss target-newlib"
+    noconfigdirs="$noconfigdirs gprof"
     ;;
   powerpc*-*-winnt* | powerpc*-*-pe*)
     target_configdirs="$target_configdirs target-winsup"
@@ -1006,17 +1002,13 @@ 
     noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
     ;;
   powerpc-*-beos*)
-    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
+    noconfigdirs="$noconfigdirs gdb"
     ;;
-  powerpc-*-eabi)
-    ;;
-  powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems* )
-    ;;
   rs6000-*-lynxos*)
-    noconfigdirs="$noconfigdirs target-newlib gprof"
+    noconfigdirs="$noconfigdirs gprof"
     ;;
   rs6000-*-aix*)
-    noconfigdirs="$noconfigdirs gprof target-libgloss target-newlib"
+    noconfigdirs="$noconfigdirs gprof"
     ;;
   rs6000-*-*)
     noconfigdirs="$noconfigdirs gprof"
@@ -1042,7 +1034,6 @@ 
     noconfigdirs="$noconfigdirs gprof target-libgloss"
     ;;
   mips*-*-linux*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
   mips*-*-*)
     noconfigdirs="$noconfigdirs gprof"
@@ -1055,23 +1046,11 @@ 
          noconfigdirs="$noconfigdirs target-libgloss" ;;
     esac
     ;;
-  sparclet-*-aout* | sparc86x-*-*)
-    ;;
-  sparc-*-elf*)
-    ;;
-  sparc64-*-elf*)
-    ;;
-  sparclite-*-*)
-    ;;
   sparc-*-sunos4*)
-    if test x${is_cross_compiler} != xno ; then
-           noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
-    else
+    if test x${is_cross_compiler} = xno ; then
            use_gnu_ld=no
     fi
     ;;
-  sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
-    ;;
   tic6x-*-*)
     noconfigdirs="$noconfigdirs gdb sim"
     ;;
@@ -1081,14 +1060,6 @@ 
   vax-*-*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
-  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
-  *-*-lynxos*)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;; 
-  *-*-*)
-    ;;
 esac
 
 # If we aren't building newlib, then don't build libgloss, since libgloss