Index: src/newlib/ChangeLog
diff -u src/newlib/ChangeLog:1.733 src/newlib/ChangeLog:1.779
--- src/newlib/ChangeLog:1.733	Fri Dec 17 20:17:12 2004
+++ src/newlib/ChangeLog	Thu Apr 28 18:26:07 2005
@@ -1,3 +1,371 @@
+2005-04-28  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/stdio/vfscanf.c (__svfscanf_r): Fix code thinko
+	when checking for multiple flags.
+
+2005-04-18  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure.host <cris-*-* | crisv32-*-*>: Set
+        default_newlib_io_long_long="yes".
+
+2005-04-08  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/include/libgen.h: New file.
+
+2005-04-08  Shaun Jackman  <sjackman@gmail.com>
+
+	* libc/unix/Makefile.am: Add support for basename and dirname.
+	* libc/unix/Makefile.in: Regenerated.
+	* libc/unix/basename.c: New file.
+	* libc/unix/dirname.c: New file.
+
+2005-04-07  Shaun Jackman  <sjackman@gmail.com>
+
+	* libc/sys/linux/inode.c (lchown): New function.
+
+2005-04-07  Shaun Jackman  <sjackman@gmail.com>
+
+	* libc/unix/Makefile.am (LIB_OBJS): Include all the ELIX objects if no
+	ELIX level is defined.
+	* libc/unix/Makefile.in: Regenerated.
+
+2005-04-05  Dave Korn  <dave.korn@artimi.com>
+
+	* libc/stdio/vfscanf.c (__svfscanf_r): If an error occurs processing
+	something that looks like a "NaN", put back the characters processed.
+
+2005-04-01  Corinna Vinschen  <corinna@vinschen.de>
+
+	* libc/stdlib/strtod.c (_strtod_r): Never change s00.
+
+2005-03-23  Christopher Faylor  <cgf@timesys.com>
+
+	* configure.host: For cygwin, redefine CC with cygwin include directory
+	first to mimic the behavior of the top-level configury.  Move include
+	directory out of newlib_cflags.
+
+2005-03-22  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* configure.host: For arc, set -DREENTRANT_SYSCALLS_PROVIDED flag on.
+	* libc/sys/arc/syscalls.c: Change functions to use __errno_r rather 
+	than errno.
+
+2005-03-22  Christopher Faylor  <cgf@timesys.com>
+
+	* libc/include/machine/_types.h: Make trivial change to comment to
+	avoid a spurious warning from gcc.
+
+2005-03-21  Nicholas Wourms  <nwourms@netscape.net>
+
+	* libc/stdio/vfprintf.c: Move newlib.h before _WANT_IO_POS_ARGS test,
+	since _WANT_IO_POS_ARGS is now defined in there.  Remove duplicate
+	reent.h include.
+
+2005-03-18  Hans-Peter Nilsson  <hp@axis.com>
+            Corinna Vinschen  <corinna@vinschen.de>
+
+        * libc/include/ctype.h: Remove invalid +1 offset from
+        ctype macro references to __ctype_ptr.
+        (_ctype_): Move declaration outside #ifndef __cplusplus.
+
+2005-03-18  Corinna Vinschen  <corinna@vinschen.de>
+
+	* libc/include/machine/setjmp.h (sigsetjmp): Use GCC extension to
+	evaluate first parameter only once.
+	(siglongjmp): Ditto.
+
+2005-03-17  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* configure.in: Add new check to see if compiler supports
+	aliasing of arrays and define _HAVE_ARRAY_ALIASING if true.
+	* configure: Regenerated.
+	* Makefile.in: Ditto.
+	* newlib.hin: Add _HAVE_ARRAY_ALIASING.
+	* libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before
+	aliasing the _ctype_ array to _ctype_b.
+	* libc/include/ctype.h: Change macros to use __ctype_ptr.  Mark
+	_ctype_ as deprecated.
+
+2005-03-17  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure.host (newlib_cflags) <cris-*-*, crisv32-*-*>: Add
+	-DCOMPACT_CTYPE.
+
+2005-03-06  Ralf Corsepious  <ralf.corsepius@rtems.org>
+
+	* libc/sys/rtems/include/inttypes.h: New file.
+	* libc/sys/rtems/include/stdint.h: Ditto.
+
+2005-03-06  Ralf Corsepious  <ralf.corsepius@rtems.org>
+
+	* libc/string/memcmp.c: Fix to avoid pointer signedness warning.
+
+2005-03-06  Ralf Corsepious  <ralf.corsepius@rtems.org>
+
+	* libc/include/machine/_types.h: New file.
+	* libc/include/sys/types.h: Do not check for __rtems__
+	when including <machine/_types.h>.  Remove some redundant
+	declarations now that <machine/_types.h> is included.
+	* libc/sys/rtems/machine/_types.h: Removed.  Replaced with
+	shared header file.
+
+2005-02-25  Ralf Corsepious  <ralf.corsepius@rtems.org>
+
+	* libm/common/fdlibm.h (FLT_UWORD_MAX, FLT_UWORD_HALF_MAX): Add
+	L qualifier for these long constants.
+
+2005-02-25  Eric Blake  <ebb9@byu.net>
+
+	* libc/include/time.h (__tzrule_struct): Make offset long, since
+	a 16-bit int overflows on a 12-hour offset.
+	* libc/sys/linux/include/time.h: Ditto.
+	* libc/time/mktime.c (mktime): Use new type of __tzrule.offset.
+	* libc/time/mktm_r.c: Ditto.
+	* libc/time/gettzinfo.c: Ditto.
+	* libc/time/strftime.c (strftime): Fix '%x' to deal with negative
+	years.  Fix '%z' to use long, not int.
+
+2005-02-24  Ralf Corsepious  <ralf.corsepius@rtems.org>
+
+	* libm/common/s_fpclassify.c: Use __uint32_t instead of int to
+	manipulate float values in integer form.
+	* libm/common/sf_round.c: Ditto.
+
+2005-02-24  Ralf Corsepious  <ralf.corsepius@rtems.org>
+
+	* libc/include/sys/types.h [__rtems__]: Include new
+	header file machine/_types.h.
+	* libc/include/machine/types.h: Ditto.
+	* libc/sys/rtems/machine/_types.h: New file.
+
+2005-02-23  Corinna Vinschen  <corinna@vinschen.de>
+
+	* libc/include/time.h (_timezone): Change to long also for Cygwin.
+	(timezone): Drop cast from definition.
+
+2005-02-23  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/include/time.h [!CYGWIN](_timezone): Change to long.
+	(__tzrule_type, __tzinfo_type): New types.
+	(__gettzinfo): New function.
+	* libc/sys/linux/include/time.h: Ditto.
+	* libc/time/Makefile.am: Add gettzinfo.c.
+	* libc/time/Makefile.in: Regenerated.
+	* libc/time/local.h: Moved __tzrule_type to time.h.
+	* libc/time/mktime.c: Call __gettzinfo to reference
+	__tznorth, __tzyear, and __tzrule array.
+	* libc/time/mktm_r.c: Ditto.
+	* libc/time/strftime.c: Ditto.
+	* libc/time/tzset_r.c: Ditto.  Also remove definition
+	of __tzrule which is now in gettzinfo.c.  Change _timezone
+	references to not cast to time_t.
+	* libc/time/gettzinfo.c: New file.
+
+2005-02-23  Corinna Vinschen  <corinna@vinschen.de>
+
+	* libc/include/sys/unistd.h: Define getpeereid for Cygwin.
+
+2005-02-22  Corinna Vinschen  <corinna@vinschen.de>
+
+	* libc/include/sys/unistd.h: Define fdatasync also for Cygwin.
+
+2005-02-16  Eric Blake  <ebb9@byu.net>
+
+	* libc/time/time.tex: Improve the documentation.
+	* libc/time/strftime.c: Improve the documentation.
+	(iso_year_adjust): New helper function.
+	(strftime): Simplify '%E' and '%O'. Change '%c' to use
+	recursion. Fix '%C', '%y', and '%Y' to deal with years with more
+	than 4 characters.  Combine '%d' and '%e'. Implement '%D', '%F',
+	'%g', '%G', '%n', '%R', '%t', '%T', '%u', '%V', '%X', and '%z'.
+	Avoid core dumps on valid inputs (maxsize == 0, or
+	tim_p->tm_isdst > 1).
+
+2005-02-08  Corinna Vinschen  <corinna@vinschen.de>
+
+	* libc/include/pwd.h (struct passwd): Change pw_uid and pw_gid
+	members to uid_t and gid_t according to SUSv3.
+	* libc/include/sys/time.h (utimes):  Change second parameter
+	to const according to SUSv3.
+
+2005-02-07  Antony King  <antony.king@st.com>
+
+	* libc/stdio/clearerr.c (clearerr): Ensure CHECK_INIT() is
+	called before _flockfile to prevent lock object use before
+	initialisation. _REENT_SMALL_CHECK_INIT() and CHECK_INIT()
+	take a struct _reent * instead of a FILE *.
+	* libc/stdio/fclose.c (_fclose_r): Ditto.
+	* libc/stdio/feof.c (feof): Ditto.
+	* libc/stdio/ferror.c (ferror): Ditto.
+	* libc/stdio/fflush.c (fflush): Ditto.
+	* libc/stdio/fgetc.c (fgetc): Ditto.
+	* libc/stdio/fgets.c (fgets): Ditto.
+	* libc/stdio/fileno.c (fileno): Ditto.
+	* libc/stdio/fputc.c (fputc): Ditto.
+	* libc/stdio/fputs.c (fputs): Ditto.
+	* libc/stdio/fread.c (fread): Ditto.
+	* libc/stdio/freopen.c (_freopen_r): Ditto.
+	* libc/stdio/fseek.c (_fseek_r): Ditto.
+	* libc/stdio/ftell.c (_ftell_r): Ditto.
+	* libc/stdio/fwrite.c (fwrite): Ditto.
+	* libc/stdio/getc.c (getc): Ditto.
+	* libc/stdio/getdelim.c (__getdelim): Ditto.
+	* libc/stdio/putc.c (putc): Ditto.
+	* libc/stdio/setvbuf.c (setvbuf): Ditto.
+	* libc/stdio/ungetc.c (_ungetc_r): Ditto.
+	* libc/stdio/vfprintf.c (_VFPRINTF_R): Ditto.
+	* libc/stdio64/freopen64.c (_freopen64_r): Ditto.
+	* libc/stdio64/fseeko64.c (_fseeko64_r): Ditto.
+	* libc/stdio64/ftello64.c (_ftello64_r): Ditto.
+	* libc/stdio/local.h (CHECK_INIT): Argument is now a struct
+	_reent * instead of a FILE * and so replace incorrect use of
+	_REENT with argument.
+	* libc/sys/arm/syscalls.c (CHECK_INIT): Ditto.
+	* libc/stdio/getchar.c (getchar): _REENT_SMALL_CHECK_INIT() and
+	CHECK_INIT() take a struct _reent * instead of a FILE *.
+	* libc/stdio/iprintf.c (iprintf, _iprintf_r): Ditto.
+	* libc/stdio/iscanf.c (iscanf, _iscanf_r): Ditto.
+	* libc/stdio/perror.c (perror): Ditto.
+	* libc/stdio/printf.c (printf, _printf_r): Ditto.
+	* libc/stdio/putchar.c (putchar): Ditto.
+	* libc/stdio/puts.c (puts): Ditto.
+	* libc/stdio/refill.c (__srefill): Ditto.
+	* libc/stdio/scanf.c (scanf, _scanf_r): Ditto.
+	* libc/stdio/vfscanf.c (VFSCANF, _VFSCANF_R): Ditto.
+	* libc/stdio/viprintf.c (viprintf, _viprintf_r): Ditto.
+	* libc/stdio/viscanf.c (viscanf, _viscanf_r): Ditto.
+	* libc/stdio/vprintf.c (vprintf, _vprintf_r): Ditto.
+	* libc/stdio/vscanf.c (vscanf, _vscanf_r): Ditto.
+	* libc/stdio/wbuf.c (__swbuf): Ditto.
+	* libc/stdio/wsetup.c (__swsetup): Ditto.
+	* libc/stdlib/mallocr.c (malloc_stats): Ditto.
+	* libc/stdlib/mstats.c (_mstats_r): Ditto.
+	* libc/include/sys/reent.h (_REENT_SMALL_CHECK_INIT): Ditto.
+	* libc/machine/powerpc/vfscanf.c (vfscanf): Ditto.
+	* libc/stdio/fgetpos.c (_fgetpos_r): Removed unnecessary calls
+	to _flockfile and _funlockfile; rely on locking in _ftell_r.
+	* libc/stdio64/fgetpos64.c (_fgetpos64_r): Ditto (_ftello64_r).
+	* libc/machine/powerpc/vfprintf.c (__sbprintf): Removed unnecessary
+	initialision of _data field in FILE structure.
+	* libc/machine/powerpc/vfprintf.c (VFPRINTF): Added CHECK_INIT() call.
+
+2005-02-07  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/stdio/findfp.c (__sinit): Protect with new lock.
+	(__sinit_lock): New lock.
+	(__sinit_lock_acquire, __sinit_lock_release): New functions.
+	* libc/stdio/local.h: Add reference to new __sinit locking
+	functions.
+
+2005-02-07  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/include/math.h (isfinite, isnormal, isunordered): Change
+	input variable names to avoid mixups with nesting macros.
+
+2005-01-27  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure.host: Add support for cris-*-* and crisv32-*-*.
+	* libc/include/machine/ieeefp.h: Ditto.
+	* libc/include/machine/setjmp.h: Ditto.
+	* libc/machine/cris/configure.in, libc/machine/cris/Makefile.am,
+	libc/machine/cris/libcdtor.c, libc/machine/cris/setjmp.c,
+	libc/machine/cris/memmove.c, libc/machine/cris/memcpy.c,
+	libc/machine/cris/memset.c, libc/machine/cris/include/pthread.h,
+	libc/machine/cris/sys/signal.h, libc/machine/cris/sys/fcntl.h,
+	libc/machine/cris/sys/errno.h, libc/machine/cris/aclocal.m4,
+	libc/machine/cris/configure, libc/machine/cris/Makefile.in: New
+	files.
+
+2005-01-27  Hans-Peter Nilsson  <hp@axis.com>
+
+	* testsuite/newlib.string/memmove1.c: New test.
+
+2005-01-27  Hans-Peter Nilsson  <hp@axis.com>
+
+	* testsuite/include/check.h: Include stdlib.h.
+
+2005-01-27  Hans-Peter Nilsson  <hp@axis.com>
+
+	* Makefile.am (stmp-targ-include): Support include header files
+	from machine directories.
+	(install-data-local): Ditto.
+	* Makefile.in: Regenerate.
+
+2005-01-24  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/include/string.h: Remove Linux-specific declaration of
+	strsignal and add #include <sys/string.h>.
+	* libc/include/sys/string.h: New file.
+	* libc/include/sys/linux/sys/string.h: New file with strsignal
+	declaration deleted above.
+
+2005-01-20  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/time/strftime.c (strftime): Change %r and %x to be compliant
+	to POSIX standard for "C" locale.  Allow %E and %O modifiers
+	to be ignored as long as they precede valid specifiers according
+	to POSIX.
+
+2005-01-19  Shaun Jackman  <sjackman@gmail.com>
+
+	* libc/stdlib/setenv_r.c (_setenv_r): Call tzset() if the TZ
+	environment variable is set.
+
+2005-01-19  Shaun Jackman  <sjackman@gmail.com>
+
+        * tzset_r.c (_tzname): Add a comma.
+
+2005-01-18  Aldy Hernandez  <aldyh@redhat.com>
+
+	* libc/machine/powerpc/vfprintf.c: Use _REENT when calling
+	_VFPRINTF_R.
+
+2005-01-07  Paul Brook  <paul@codesourcery.com>
+                                                                                
+	* configure.in: Add test for .init_array.
+	* configure: Regenerate.
+	* newlib.hin: Add HAVE_INITFINI_ARRAY.
+	* libc/misc/Makefile.am: Add init.c
+	* libc/misc/Makefile.in: Regenerate.
+	* libc/misc/init.c: New file.
+	* libc/sys/arm/crt0.S: Call __libc_{init,fini}_array instead of
+	_init/_fini if they exist.
+                                                                                
+2005-01-06  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* libc/stdlib/strtod.c (_strtod_r): Add NaN support.
+	* (strtof): Ditto.
+	* libc/stdio/vfscanf.c (__svfscanf_r): Ditto.
+	* Makefile.am (MATHOBJS_IN_LIBC): Add s_nan and sf_nan
+	functions for use by strtod and strtof.
+	* Makefile.in: Regenerated.
+                                                                                
+2005-01-06  Hans-Peter Nilsson  <hp@axis.com>
+                                                                                
+	* libc/stdio/ftell.c (ftell_r): Add parenthesis for __SWR
+	bit-test in combination with NULL test.
+                                                                                
+2005-01-06  Hans-Peter Nilsson  <hp@axis.com>
+                                                                                
+        * README: Fix typo of LGPL.  Change "license" to "copyright".
+                                                                                
+2004-12-17  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* NEWS: Update with 1.13.0 info.
+	* README: Ditto.
+	* acinclude.m4: Change version number to 1.13.0.
+	* aclocal.m4: Regenerated.
+	* configure: Ditto.
+	* doc/aclocal.m4: Ditto.
+	* doc/configure: Ditto.
+	* libc/*/aclocal.m4: Ditto.
+	* libc/*/configure: Ditto.
+	* libc/libc.texinfo: Ditto.
+	* libm/*/aclocal.m4: Ditto.
+	* libm/*/configure: Ditto.
+	* libm/libm.texinfo: Ditto.
+	* libc/sys/linux/shared.ld: Add VERS_1.13.
+
 2004-12-17  Christian Groessler  <chris@groessler.org>
 
 	* libc/machine/z8k/memcmp.S: New file.
Index: src/newlib/Makefile.am
diff -u src/newlib/Makefile.am:1.31 src/newlib/Makefile.am:1.33
--- src/newlib/Makefile.am:1.31	Fri Dec  3 23:46:28 2004
+++ src/newlib/Makefile.am	Thu Jan 27 19:13:54 2005
@@ -89,6 +89,7 @@
 MATHOBJS_IN_LIBC = \
 	s_isinf.$(oext) sf_isinf.$(oext) \
 	s_isnan.$(oext) sf_isnan.$(oext) \
+	s_nan.$(oext) sf_nan.$(oext) \
 	s_ldexp.$(oext) sf_ldexp.$(oext) \
 	s_frexp.$(oext) sf_frexp.$(oext) \
 	s_modf.$(oext) \
@@ -200,6 +201,11 @@
 	      cp $$i targ-include/sys/`basename $$i`; \
 	    else true; fi ; \
 	  done
+	-for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \
+	    if [ -f $$i ]; then \
+	      cp $$i targ-include/`basename $$i`; \
+	    else true; fi ; \
+	  done
 	-for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \
 	    if [ -f $$i ]; then \
 	      cp $$i targ-include/`basename $$i`; \
@@ -260,6 +266,11 @@
 	     $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
 	    else true; fi ; \
 	  done ; \
+	  for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \
+	    if [ -f $$i ]; then \
+	     $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \
+	    else true; fi ; \
+	  done ; \
 	  for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
 	    if [ -f $$i ]; then \
 	     $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
Index: src/newlib/Makefile.in
diff -u src/newlib/Makefile.in:1.33 src/newlib/Makefile.in:1.37
--- src/newlib/Makefile.in:1.33	Fri Dec  3 23:46:28 2004
+++ src/newlib/Makefile.in	Thu Mar 17 20:11:17 2005
@@ -103,6 +103,8 @@
 UNIX_OBJECTLIST = @UNIX_OBJECTLIST@
 VERSION = @VERSION@
 aext = @aext@
+libc_cv_array_aliasing = @libc_cv_array_aliasing@
+libc_cv_initfinit_array = @libc_cv_initfinit_array@
 libm_machine_dir = @libm_machine_dir@
 machine_dir = @machine_dir@
 newlib_basedir = @newlib_basedir@
@@ -151,7 +153,7 @@
 # The functions ldexp, frexp and modf are traditionally supplied in
 # both libc.a and libm.a.  We build them in libm.a and copy them over,
 # along with some required supporting routines.
-MATHOBJS_IN_LIBC =  	s_isinf.$(oext) sf_isinf.$(oext) 	s_isnan.$(oext) sf_isnan.$(oext) 	s_ldexp.$(oext) sf_ldexp.$(oext) 	s_frexp.$(oext) sf_frexp.$(oext) 	s_modf.$(oext) 	sf_modf.$(oext) s_scalbn.$(oext) 	sf_scalbn.$(oext) 	s_finite.$(oext) sf_finite.$(oext) 	s_copysign.$(oext) sf_copysign.$(oext) 	s_infconst.$(oext)
+MATHOBJS_IN_LIBC =  	s_isinf.$(oext) sf_isinf.$(oext) 	s_isnan.$(oext) sf_isnan.$(oext) 	s_nan.$(oext) sf_nan.$(oext) 	s_ldexp.$(oext) sf_ldexp.$(oext) 	s_frexp.$(oext) sf_frexp.$(oext) 	s_modf.$(oext) 	sf_modf.$(oext) s_scalbn.$(oext) 	sf_scalbn.$(oext) 	s_finite.$(oext) sf_finite.$(oext) 	s_copysign.$(oext) sf_copysign.$(oext) 	s_infconst.$(oext)
 
 
 LIBC_OBJECTLISTS =  	$(POSIX_OBJECTLIST) 	$(SIGNAL_OBJECTLIST) 	$(SYSCALL_OBJECTLIST) 	$(UNIX_OBJECTLIST) 	$(STDIO64_OBJECTLIST) 	libc/argz/objectlist.awk.in 	libc/stdlib/objectlist.awk.in 	libc/time/objectlist.awk.in 	libc/ctype/objectlist.awk.in 	libc/search/objectlist.awk.in 	libc/string/objectlist.awk.in 	libc/locale/objectlist.awk.in 	libc/misc/objectlist.awk.in 	libc/reent/objectlist.awk.in 	libc/errno/objectlist.awk.in 	libc/stdio/objectlist.awk.in 	$(MACHINE_OBJECTLIST) 	$(SYS_OBJECTLIST) 	$(SYS_MACH_OBJECTLIST)
@@ -710,6 +712,11 @@
 	      cp $$i targ-include/sys/`basename $$i`; \
 	    else true; fi ; \
 	  done
+	-for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \
+	    if [ -f $$i ]; then \
+	      cp $$i targ-include/`basename $$i`; \
+	    else true; fi ; \
+	  done
 	-for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \
 	    if [ -f $$i ]; then \
 	      cp $$i targ-include/`basename $$i`; \
@@ -765,6 +772,11 @@
 	     $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
 	    else true; fi ; \
 	  done ; \
+	  for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \
+	    if [ -f $$i ]; then \
+	     $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \
+	    else true; fi ; \
+	  done ; \
 	  for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
 	    if [ -f $$i ]; then \
 	     $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
Index: src/newlib/README
diff -u src/newlib/README:1.11 src/newlib/README:1.13
--- src/newlib/README:1.11	Fri Dec 17 22:47:49 2004
+++ src/newlib/README	Mon Jan 10 16:24:12 2005
@@ -5,9 +5,9 @@
 of board support packages.
 
 The newlib and libgloss subdirectories are a collection of software from
-several sources, each with their own copyright.  See the file COPYING.NEWLIB
-for details.  The rest of the release tree is under either the GNU GPL or
-LPGL copyright.
+several sources, each with their own copyright and license.  See the file
+COPYING.NEWLIB for details.  The rest of the release tree is under either
+the GNU GPL or LGPL licenses.
 
 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
Index: src/newlib/configure
diff -u src/newlib/configure:1.37 src/newlib/configure:1.39
--- src/newlib/configure:1.37	Fri Dec 17 22:47:49 2004
+++ src/newlib/configure	Thu Mar 17 20:11:17 2005
@@ -3425,6 +3425,68 @@
   done
 fi;
 
+echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
+echo "configure:3430: checking for .preinit_array/.init_array/.fini_array support" >&5
+if eval "test \"`echo '$''{'libc_cv_initfinit_array'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+int _start (void) { return 0; }
+int __start (void) { return 0; }
+int foo (void) { return 1; }
+int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
+EOF
+if { ac_try='${CC} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
+		   -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD'; { (eval echo configure:3441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+then
+  if readelf -S conftest | grep -e INIT_ARRAY > /dev/null; then
+    libc_cv_initfinit_array=yes
+  else
+    libc_cv_initfinit_array=no
+  fi
+else
+  libc_cv_initfinit_array=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$libc_cv_initfinit_array" 1>&6
+
+if test $libc_cv_initfinit_array = yes; then
+  cat >> confdefs.h <<EOF
+#define HAVE_INITFINI_ARRAY 1
+EOF
+
+fi
+
+echo $ac_n "checking for array aliasing support""... $ac_c" 1>&6
+echo "configure:3464: checking for array aliasing support" >&5
+if eval "test \"`echo '$''{'libc_cv_array_aliasing'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+char x3 = { 'a', 'b', 'c' };
+extern char y2 __attribute__((alias ("x+1")));
+EOF
+if { ac_try='${CC} $CFLAGS $CPPFLAGS -c conftest.c
+		   1>&AS_MESSAGE_LOG_FD'; { (eval echo configure:3473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+then
+  libc_cv_array_aliasing=yes
+else
+  libc_cv_array_aliasing=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$libc_cv_array_aliasing" 1>&6
+
+if test $libc_cv_array_aliasing = yes; then
+  cat >> confdefs.h <<EOF
+#define _HAVE_ARRAY_ALIASING 1
+EOF
+
+fi
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -3641,6 +3703,8 @@
 s%@UNIX_OBJECTLIST@%$UNIX_OBJECTLIST%g
 s%@STDIO64_OBJECTLIST@%$STDIO64_OBJECTLIST%g
 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
+s%@libc_cv_initfinit_array@%$libc_cv_initfinit_array%g
+s%@libc_cv_array_aliasing@%$libc_cv_array_aliasing%g
 
 CEOF
 EOF
Index: src/newlib/configure.host
diff -u src/newlib/configure.host:1.66 src/newlib/configure.host:1.72
--- src/newlib/configure.host:1.66	Tue Oct  5 19:44:24 2004
+++ src/newlib/configure.host	Mon Apr 18 02:52:21 2005
@@ -93,6 +93,9 @@
   avr*)
 	newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mcall-prologues"
 	;;
+  cris | crisv32)
+	machine_dir=cris
+	;;
   crx*)
 	machine_dir=crx
 	;;
@@ -452,7 +455,8 @@
 	default_newlib_io_long_long="yes"
 	default_newlib_io_long_double="yes"
 	default_newlib_io_pos_args="yes"
-	newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_FCNTL -DMALLOC_PROVIDED -I${cygwin_srcdir}/include"
+	CC="${CC} -I${cygwin_srcdir}/include"
+	newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_FCNTL -DMALLOC_PROVIDED"
 	syscall_dir=syscalls
 	;;
 # RTEMS supplies its own versions of some routines:
@@ -499,11 +503,19 @@
 	  newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
 	fi
 	;;
+  arc*)
+	newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED"
+	;;
   avr*)
 	newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
 	;;
+  cris-*-* | crisv32-*-*)
+	default_newlib_io_long_long="yes"
+	newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DHAVE_GETTIMEOFDAY -D_USE_WRITE -DCOMPACT_CTYPE"
+	syscall_dir=syscalls
+	;;
   crx-*-*)
-  	newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DMISSING_SYSCALL_NAMES"
+	newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DMISSING_SYSCALL_NAMES"
 	syscall_dir=
 	;;
   d10v*)
Index: src/newlib/configure.in
diff -u src/newlib/configure.in:1.25 src/newlib/configure.in:1.27
--- src/newlib/configure.in:1.25	Wed Sep 15 20:50:06 2004
+++ src/newlib/configure.in	Thu Mar 17 20:11:17 2005
@@ -329,6 +329,50 @@
   done
 fi;
 
+AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
+	       libc_cv_initfinit_array, [dnl
+cat > conftest.c <<EOF
+int _start (void) { return 0; }
+int __start (void) { return 0; }
+int foo (void) { return 1; }
+int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
+EOF
+if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
+		   -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
+then
+  if readelf -S conftest | grep -e INIT_ARRAY > /dev/null; then
+    libc_cv_initfinit_array=yes
+  else
+    libc_cv_initfinit_array=no
+  fi
+else
+  libc_cv_initfinit_array=no
+fi
+rm -f conftest*])
+AC_SUBST(libc_cv_initfinit_array)
+if test $libc_cv_initfinit_array = yes; then
+  AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY)
+fi
+
+AC_CACHE_CHECK(for array aliasing support,
+	       libc_cv_array_aliasing, [dnl
+cat > conftest.c <<EOF
+char x[3] = { 'a', 'b', 'c' };
+extern char y[2] __attribute__((alias ("x+1")));
+EOF
+if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c conftest.c
+		   1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_array_aliasing=yes
+else
+  libc_cv_array_aliasing=no
+fi
+rm -f conftest*])
+AC_SUBST(libc_cv_array_aliasing)
+if test $libc_cv_array_aliasing = yes; then
+  AC_DEFINE_UNQUOTED(_HAVE_ARRAY_ALIASING)
+fi
+
 AC_OUTPUT(Makefile,
 [if test -n "$CONFIG_FILES"; then
   unset ac_file
Index: src/newlib/newlib.hin
diff -u src/newlib/newlib.hin:1.7 src/newlib/newlib.hin:1.9
--- src/newlib/newlib.hin:1.7	Fri Jun 25 20:32:31 2004
+++ src/newlib/newlib.hin	Thu Mar 17 20:11:17 2005
@@ -137,5 +137,12 @@
 #undef _ICONV_FROM_ENCODING_WIN_1257
 #undef _ICONV_FROM_ENCODING_WIN_1258
 
+/* Define if the linker supports .preinit_array/.init_array/.fini_array
+ * sections.  */
+#undef  HAVE_INITFINI_ARRAY
+
+/* Define if the compiler supports aliasing an array to an address.  */
+#undef  _HAVE_ARRAY_ALIASING
+
 #endif /* !__NEWLIB_H__ */
 
Index: src/newlib/libc/ctype/ctype_.c
diff -u src/newlib/libc/ctype/ctype_.c:1.3 src/newlib/libc/ctype/ctype_.c:1.4
--- src/newlib/libc/ctype/ctype_.c:1.3	Tue May 13 09:46:47 2003
+++ src/newlib/libc/ctype/ctype_.c	Thu Mar 17 20:11:22 2005
@@ -84,21 +84,40 @@
 	_CTYPE_DATA_128_256
 };
 
-#if defined(__CYGWIN__)
-extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+#  if defined(__CYGWIN__)
 _CONST char __declspec(dllexport) *__ctype_ptr = _ctype_b + 128;
-#else
-extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+#  else
 _CONST char *__ctype_ptr = _ctype_b + 128;
-#endif
+#  endif
+
+#  if defined(_HAVE_ARRAY_ALIASING)
+
+#    if defined(__CYGWIN__)
+extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+#    else
+extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+#    endif
+
+#  else /* !_HAVE_ARRAY_ALIASING */
+
+#    if defined(__CYGWIN__)
+_CONST char __declspec(dllexport) _ctype_[1 + 256] = {
+#    else
+_CONST char _ctype_[1 + 256] = {
+#    endif
+	0,
+	_CTYPE_DATA_0_127,
+	_CTYPE_DATA_128_256
+};
+#  endif /* !_HAVE_ARRAY_ALIASING */
 
 #else	/* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
 
-#if defined(__CYGWIN__)
+# if defined(__CYGWIN__)
 _CONST char __declspec(dllexport) _ctype_[1 + 256] = {
-#else
+# else
 _CONST char _ctype_[1 + 256] = {
-#endif
+# endif
 	0,
 	_CTYPE_DATA_0_127,
 	_CTYPE_DATA_128_256
Index: src/newlib/libc/include/ctype.h
diff -u src/newlib/libc/include/ctype.h:1.7 src/newlib/libc/include/ctype.h:1.9
--- src/newlib/libc/include/ctype.h:1.7	Thu Jun 27 23:58:38 2002
+++ src/newlib/libc/include/ctype.h	Fri Mar 18 17:18:59 2005
@@ -36,20 +36,23 @@
 #define _X	0100
 #define	_B	0200
 
-extern	__IMPORT _CONST char	_ctype_[];
+extern	__IMPORT _CONST char	*__ctype_ptr;
+extern	__IMPORT _CONST char	_ctype_[];  /* For backward compatibility.  */
 
 #ifndef __cplusplus
-#define	isalpha(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L))
-#define	isupper(c)	((_ctype_+1)[(unsigned)(c)]&_U)
-#define	islower(c)	((_ctype_+1)[(unsigned)(c)]&_L)
-#define	isdigit(c)	((_ctype_+1)[(unsigned)(c)]&_N)
-#define	isxdigit(c)	((_ctype_+1)[(unsigned)(c)]&(_X|_N))
-#define	isspace(c)	((_ctype_+1)[(unsigned)(c)]&_S)
-#define ispunct(c)	((_ctype_+1)[(unsigned)(c)]&_P)
-#define isalnum(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
-#define isprint(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
-#define	isgraph(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
-#define iscntrl(c)	((_ctype_+1)[(unsigned)(c)]&_C)
+#define	isalpha(c)	((__ctype_ptr)[(unsigned)(c)]&(_U|_L))
+#define	isupper(c)	((__ctype_ptr)[(unsigned)(c)]&_U)
+#define	islower(c)	((__ctype_ptr)[(unsigned)(c)]&_L)
+#define	isdigit(c)	((__ctype_ptr)[(unsigned)(c)]&_N)
+#define	isxdigit(c)	((__ctype_ptr)[(unsigned)(c)]&(_X|_N))
+#define	isspace(c)	((__ctype_ptr)[(unsigned)(c)]&_S)
+#define ispunct(c)	((__ctype_ptr)[(unsigned)(c)]&_P)
+#define isalnum(c)	((__ctype_ptr)[(unsigned)(c)]&(_U|_L|_N))
+#define isprint(c)	((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
+#define	isgraph(c)	((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N))
+#define iscntrl(c)	((__ctype_ptr)[(unsigned)(c)]&_C)
+
+
 /* Non-gcc versions will get the library versions, and will be
    slightly slower */
 #ifdef __GNUC__
Index: src/newlib/libc/include/libgen.h
diff -u /dev/null src/newlib/libc/include/libgen.h:1.1
--- /dev/null	Thu May 12 14:25:15 2005
+++ src/newlib/libc/include/libgen.h	Fri Apr  8 20:48:40 2005
@@ -0,0 +1,23 @@
+/*
+ * libgen.h - defined by XPG4
+ */
+
+#ifndef _LIBGEN_H_
+#define _LIBGEN_H_
+
+#include "_ansi.h"
+#include <sys/reent.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char      *_EXFUN(basename,     (char *));
+char      *_EXFUN(dirname,     (char *));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBGEN_H_ */
+
Index: src/newlib/libc/include/math.h
diff -u src/newlib/libc/include/math.h:1.17 src/newlib/libc/include/math.h:1.18
--- src/newlib/libc/include/math.h:1.17	Wed Aug 13 17:36:10 2003
+++ src/newlib/libc/include/math.h	Mon Feb  7 21:04:22 2005
@@ -88,12 +88,12 @@
           (__extension__ ({__typeof__(x) __x = (x); \
                            (sizeof (__x) == sizeof (float))  ? __fpclassifyf(__x) : __fpclassifyd(__x);}))
 
-#define isfinite(x) \
-          (__extension__ ({__typeof__(x) __x = (x); \
-                           fpclassify(__x) != FP_INFINITE && fpclassify(__x) != FP_NAN;}))
-#define isnormal(x) \
-          (__extension__ ({__typeof__(x) __x = (x); \
-                           fpclassify(__x) == FP_NORMAL;}))
+#define isfinite(y) \
+          (__extension__ ({__typeof__(y) __y = (y); \
+                           fpclassify(__y) != FP_INFINITE && fpclassify(__y) != FP_NAN;}))
+#define isnormal(z) \
+          (__extension__ ({__typeof__(z) __z = (z); \
+                           fpclassify(__z) == FP_NORMAL;}))
 #define signbit(x) \
           (__extension__ ({__typeof__(x) __x = (x); \
                            (sizeof(__x) == sizeof(float)) ? __signbitf(__x) : __signbitd(__x);}))
@@ -114,9 +114,9 @@
           (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
                            !isunordered(__x,__y) && (__x < __y || __x > __y);}))
 
-#define isunordered(x,y) \
-          (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
-                           fpclassify(__x) == FP_NAN || fpclassify(__y) == FP_NAN;}))
+#define isunordered(a,b) \
+          (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \
+                           fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;}))
 
 /* Non ANSI double precision functions.  */
 
Index: src/newlib/libc/include/pwd.h
diff -u src/newlib/libc/include/pwd.h:1.2 src/newlib/libc/include/pwd.h:1.3
--- src/newlib/libc/include/pwd.h:1.2	Sun Mar  9 21:08:51 2003
+++ src/newlib/libc/include/pwd.h	Tue Feb  8 20:55:18 2005
@@ -50,8 +50,8 @@
 struct passwd {
 	char	*pw_name;		/* user name */
 	char	*pw_passwd;		/* encrypted password */
-	int	pw_uid;			/* user uid */
-	int	pw_gid;			/* user gid */
+	uid_t	pw_uid;			/* user uid */
+	gid_t	pw_gid;			/* user gid */
 	char	*pw_comment;		/* comment */
 	char	*pw_gecos;		/* Honeywell login info */
 	char	*pw_dir;		/* home directory */
Index: src/newlib/libc/include/string.h
diff -u src/newlib/libc/include/string.h:1.14 src/newlib/libc/include/string.h:1.15
--- src/newlib/libc/include/string.h:1.14	Tue Jul 23 21:38:00 2002
+++ src/newlib/libc/include/string.h	Mon Jan 24 18:46:08 2005
@@ -75,8 +75,6 @@
 const char  *_EXFUN(strsignal, (int __signo));
 #endif
 int     _EXFUN(strtosigno, (const char *__name));
-#elif defined(__linux__)
-char	*_EXFUN(strsignal, (int __signo));
 #endif
 
 /* These function names are used on Windows and perhaps other systems.  */
@@ -95,6 +93,8 @@
 
 #endif /* ! __STRICT_ANSI__ */
 
+#include <sys/string.h>
+
 _END_STD_C
 
 #endif /* _STRING_H_ */
Index: src/newlib/libc/include/time.h
diff -u src/newlib/libc/include/time.h:1.13 src/newlib/libc/include/time.h:1.16
--- src/newlib/libc/include/time.h:1.13	Mon Feb  9 22:56:46 2004
+++ src/newlib/libc/include/time.h	Fri Feb 25 22:31:20 2005
@@ -71,6 +71,26 @@
 _VOID      _EXFUN(tzset,	(_VOID));
 _VOID      _EXFUN(_tzset_r,	(struct _reent *));
 
+typedef struct __tzrule_struct
+{
+  char ch;
+  int m;
+  int n;
+  int d;
+  int s;
+  time_t change;
+  long offset; /* Match type of _timezone. */
+} __tzrule_type;
+
+typedef struct __tzinfo_struct
+{
+  int __tznorth;
+  int __tzyear;
+  __tzrule_type __tzrule[2];
+} __tzinfo_type;
+
+__tzinfo_type *_EXFUN (__gettzinfo, (_VOID));
+
 /* getdate functions */
 
 #ifdef HAVE_GETDATE
@@ -95,7 +115,7 @@
 #endif /* HAVE_GETDATE */
 
 /* defines for the opengroup specifications Derived from Issue 1 of the SVID.  */
-extern __IMPORT time_t _timezone;
+extern __IMPORT long _timezone;
 extern __IMPORT int _daylight;
 extern __IMPORT char *_tzname[2];
 
@@ -111,7 +131,7 @@
 #endif
 #ifdef timezonevar
 #ifndef timezone
-#define timezone ((long int) _timezone)
+#define timezone _timezone
 #endif
 #else
 char *_EXFUN(timezone, (void));
Index: src/newlib/libc/include/machine/_types.h
diff -u /dev/null src/newlib/libc/include/machine/_types.h:1.2
--- /dev/null	Thu May 12 14:25:16 2005
+++ src/newlib/libc/include/machine/_types.h	Tue Mar 22 18:12:29 2005
@@ -0,0 +1,121 @@
+/*
+ *  $Id: _types.h,v 1.2 2005/03/22 18:12:29 cgf Exp $
+ */
+
+#ifndef _MACHINE__TYPES_H
+#define _MACHINE__TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Guess on types by examining *_MIN / *_MAX defines.
+ */
+#if defined(__GNUC__) && (__GNUC__ >= 3 ) \
+  && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ) 
+/* GCC >= 3.3.0 has __<val>__ implicitly defined. */
+#define __EXP(x) __##x##__
+#else
+/* Fall back to POSIX versions from <limits.h> */
+#define __EXP(x) x
+#include <limits.h>
+#endif
+
+#if __EXP(SCHAR_MAX) == 0x7f
+typedef signed char __int8_t ;
+typedef unsigned char __uint8_t ;
+#define ___int8_t_defined 1
+#endif
+
+#if __EXP(INT_MAX) == 0x7fff
+typedef signed int __int16_t;
+typedef unsigned int __uint16_t;
+#define ___int16_t_defined 1
+#elif __EXP(SHRT_MAX) == 0x7fff
+typedef signed short __int16_t;
+typedef unsigned short __uint16_t;
+#define ___int16_t_defined 1
+#elif __EXP(SCHAR_MAX) == 0x7fff
+typedef signed char __int16_t;
+typedef unsigned char __uint16_t;
+#define ___int16_t_defined 1
+#endif
+
+#if ___int16_t_defined
+typedef __int16_t __int_least16_t;
+typedef __uint16_t __uint_least16_t;
+#define ___int_least16_t_defined 1
+
+#if !___int8_t_defined
+typedef __int16_t __int_least8_t;
+typedef __uint16_t __uint_least8_t;
+#define ___int_least8_t_defined 1
+#endif
+#endif
+
+#if __EXP(INT_MAX) == 0x7fffffffL
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#define ___int32_t_defined 1
+#elif __EXP(LONG_MAX) == 0x7fffffffL
+typedef signed long __int32_t;
+typedef unsigned long __uint32_t;
+#define ___int32_t_defined 1
+#elif __EXP(SHRT_MAX) == 0x7fffffffL
+typedef signed short __int32_t;
+typedef unsigned short __uint32_t;
+#define ___int32_t_defined 1
+#elif __EXP(SCHAR_MAX) == 0x7fffffffL
+typedef signed char __int32_t;
+typedef unsigned char __uint32_t;
+#define ___int32_t_defined 1
+#endif
+
+#if ___int32_t_defined
+typedef __int32_t __int_least32_t;
+typedef __uint32_t __uint_least32_t;
+#define ___int_least32_t_defined 1
+
+#if !___int8_t_defined
+typedef __int32_t __int_least8_t;
+typedef __uint32_t __uint_least8_t;
+#define ___int_least8_t_defined 1
+#endif
+#if !___int16_t_defined
+typedef __int32_t __int_least16_t;
+typedef __uint32_t __uint_least16_t;
+#define ___int_least16_t_defined 1
+#endif
+#endif
+
+#if __EXP(LONG_MAX) > 0x7fffffff
+typedef signed long __int64_t;
+typedef unsigned long __uint64_t;
+#define ___int64_t_defined 1
+
+/* GCC has __LONG_LONG_MAX__ */
+#elif  defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
+typedef signed long long __int64_t;
+typedef unsigned long long __uint64_t;
+#define ___int64_t_defined 1
+
+/* POSIX mandates LLONG_MAX in <limits.h> */
+#elif  defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
+typedef signed long long __int64_t;
+typedef unsigned long long __uint64_t;
+#define ___int64_t_defined 1
+
+#elif  __EXP(INT_MAX) > 0x7fffffff
+typedef signed int __int64_t;
+typedef unsigned int __uint64_t;
+#define ___int64_t_defined 1
+#endif
+
+#undef __EXP
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MACHINE__TYPES_H */
Index: src/newlib/libc/include/machine/ieeefp.h
diff -u src/newlib/libc/include/machine/ieeefp.h:1.24 src/newlib/libc/include/machine/ieeefp.h:1.25
--- src/newlib/libc/include/machine/ieeefp.h:1.24	Tue Oct  5 19:44:24 2004
+++ src/newlib/libc/include/machine/ieeefp.h	Thu Jan 27 23:54:42 2005
@@ -265,6 +265,10 @@
 #endif /* __ARMEL__ */
 #endif /* __MAVERICK__ */
 
+#ifdef __CRIS__
+#define __IEEE_LITTLE_ENDIAN
+#endif
+
 #ifndef __IEEE_BIG_ENDIAN
 #ifndef __IEEE_LITTLE_ENDIAN
 #error Endianess not declared!!
Index: src/newlib/libc/include/machine/setjmp.h
diff -u src/newlib/libc/include/machine/setjmp.h:1.22 src/newlib/libc/include/machine/setjmp.h:1.24
--- src/newlib/libc/include/machine/setjmp.h:1.22	Mon Oct 25 17:53:19 2004
+++ src/newlib/libc/include/machine/setjmp.h	Fri Mar 18 09:46:30 2005
@@ -205,6 +205,10 @@
 #define _JBLEN 8
 #endif
 
+#ifdef __CRIS__
+#define _JBLEN 18
+#endif
+
 #ifdef _JBLEN
 #ifdef _JBTYPE
 typedef	_JBTYPE jmp_buf[_JBLEN];
@@ -232,6 +236,27 @@
 # define _CYGWIN_WORKING_SIGSETJMP
 #endif
 
+#if defined(__GNUC__)
+
+#define sigsetjmp(env, savemask) \
+            ({ \
+              sigjmp_buf *_sjbuf = &(env); \
+              ((*_sjbuf)[_SAVEMASK] = savemask,\
+              sigprocmask (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\
+              setjmp (*_sjbuf)); \
+            })
+
+#define siglongjmp(env, val) \
+            ({ \
+              sigjmp_buf *_sjbuf = &(env); \
+              ((((*_sjbuf)[_SAVEMASK]) ? \
+               sigprocmask (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\
+               : 0), \
+               longjmp (*_sjbuf, val)); \
+            })
+
+#else /* !__GNUC__ */
+
 #define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
                sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
                setjmp (env))
@@ -240,6 +265,8 @@
                sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
                longjmp (env, val))
 
+#endif
+
 #ifdef __cplusplus
 }
 #endif
Index: src/newlib/libc/include/machine/types.h
diff -u src/newlib/libc/include/machine/types.h:1.6 src/newlib/libc/include/machine/types.h:1.7
--- src/newlib/libc/include/machine/types.h:1.6	Thu Jan 16 22:37:54 2003
+++ src/newlib/libc/include/machine/types.h	Thu Feb 24 18:29:31 2005
@@ -6,25 +6,8 @@
  *  closely match the types defined in the BSD machine/types.h.
  *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
  */
-
 #if defined(__rtems__)
-typedef signed long long   int64_t;
-#if defined( __h8300__)
-typedef signed long        int32_t;
-#else
-typedef signed int         int32_t;
-#endif
-typedef signed short       int16_t;
-typedef signed char        int8_t;
-
-typedef unsigned long long u_int64_t;
-#if defined( __h8300__)
-typedef unsigned long      u_int32_t;
-#else
-typedef unsigned int       u_int32_t;
-#endif
-typedef unsigned short     u_int16_t;
-typedef unsigned char      u_int8_t;
+#include <machine/_types.h>
 #endif
 
 #define	_CLOCK_T_	unsigned long		/* clock() */
Index: src/newlib/libc/include/sys/reent.h
diff -u src/newlib/libc/include/sys/reent.h:1.33 src/newlib/libc/include/sys/reent.h:1.34
--- src/newlib/libc/include/sys/reent.h:1.33	Wed Sep 15 21:44:38 2004
+++ src/newlib/libc/include/sys/reent.h	Tue Feb  8 01:33:16 2005
@@ -158,9 +158,9 @@
   struct _reent *_data;
 };
 /* CHECK_INIT() comes from stdio/local.h; be sure to include that.  */
-# define _REENT_SMALL_CHECK_INIT(fp) CHECK_INIT(fp)
+# define _REENT_SMALL_CHECK_INIT(ptr) CHECK_INIT(ptr)
 #else
-# define _REENT_SMALL_CHECK_INIT(fp) /* nothing */
+# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */
 #endif
 
 struct __sFILE {
Index: src/newlib/libc/include/sys/string.h
diff -u /dev/null src/newlib/libc/include/sys/string.h:1.1
--- /dev/null	Thu May 12 14:25:16 2005
+++ src/newlib/libc/include/sys/string.h	Mon Jan 24 18:46:09 2005
@@ -0,0 +1,2 @@
+/* This is a dummy <sys/string.h> used as a placeholder for
+   systems that need to have a special header file.  */
Index: src/newlib/libc/include/sys/time.h
diff -u src/newlib/libc/include/sys/time.h:1.4 src/newlib/libc/include/sys/time.h:1.5
--- src/newlib/libc/include/sys/time.h:1.4	Sat Apr 21 03:22:47 2001
+++ src/newlib/libc/include/sys/time.h	Tue Feb  8 20:55:18 2005
@@ -72,7 +72,7 @@
 
 int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z));
 int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
-int _EXFUN(utimes, (const char *__path, struct timeval *__tvp));
+int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp));
 int _EXFUN(getitimer, (int __which, struct itimerval *__value));
 int _EXFUN(setitimer, (int __which, const struct itimerval *__value,
 					struct itimerval *__ovalue));
Index: src/newlib/libc/include/sys/types.h
diff -u src/newlib/libc/include/sys/types.h:1.19 src/newlib/libc/include/sys/types.h:1.21
--- src/newlib/libc/include/sys/types.h:1.19	Wed Jul  2 20:32:07 2003
+++ src/newlib/libc/include/sys/types.h	Sun Mar  6 20:32:16 2005
@@ -21,24 +21,38 @@
 
 #ifndef __INTTYPES_DEFINED__
 #define __INTTYPES_DEFINED__
-typedef short int __int16_t;
-typedef unsigned short int __uint16_t;
 
-#if __INT_MAX__ == 32767
-typedef long int __int32_t;
-typedef unsigned long int __uint32_t;
-#else
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
+#include <machine/_types.h>
+
+#if defined(__rtems__)
+/*
+ *  The following section is RTEMS specific and is needed to more
+ *  closely match the types defined in the BSD sys/types.h.
+ *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
+ */
+
+/* deprecated */
+#if ___int8_t_defined
+typedef __uint8_t	u_int8_t;
+#endif
+#if ___int16_t_defined
+typedef __uint16_t	u_int16_t;
+#endif 
+#if ___int32_t_defined
+typedef __uint32_t	u_int32_t;
+#endif
+
+#if ___int64_t_defined
+typedef __uint64_t	u_int64_t;
+
+/* deprecated */
+typedef	__uint64_t	u_quad_t;
+typedef	__int64_t	quad_t;
+typedef	quad_t *	qaddr_t;
 #endif
 
-#if __LONG_MAX__ > 2147483647 || !defined(__GNUC__)
-typedef long int __int64_t;
-typedef unsigned long int __uint64_t;
-#else
-__extension__ typedef long long __int64_t;
-__extension__ typedef unsigned long long __uint64_t;
 #endif
+
 #endif /* ! __INTTYPES_DEFINED */
 
 #ifndef __need_inttypes
Index: src/newlib/libc/include/sys/unistd.h
diff -u src/newlib/libc/include/sys/unistd.h:1.53 src/newlib/libc/include/sys/unistd.h:1.55
--- src/newlib/libc/include/sys/unistd.h:1.53	Mon Aug 23 18:39:52 2004
+++ src/newlib/libc/include/sys/unistd.h	Wed Feb 23 17:42:07 2005
@@ -53,9 +53,7 @@
 pid_t   _EXFUN(fork, (void ));
 long    _EXFUN(fpathconf, (int __fd, int __name ));
 int     _EXFUN(fsync, (int __fd));
-#ifndef __CYGWIN__
 int     _EXFUN(fdatasync, (int __fd));
-#endif
 char    _EXFUN(*getcwd, (char *__buf, size_t __size ));
 #if defined(__CYGWIN__)
 int	_EXFUN(getdomainname ,(char *__name, size_t __len));
@@ -75,6 +73,9 @@
 #endif
 char 	_EXFUN(*getpass, (const char *__prompt));
 size_t  _EXFUN(getpagesize, (void));
+#if defined(__CYGWIN__)
+int    _EXFUN(getpeereid, (int, uid_t *, gid_t *));
+#endif
 pid_t   _EXFUN(getpgid, (pid_t));
 pid_t   _EXFUN(getpgrp, (void ));
 pid_t   _EXFUN(getpid, (void ));
Index: src/newlib/libc/machine/cris/Makefile.am
diff -u /dev/null src/newlib/libc/machine/cris/Makefile.am:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/Makefile.am	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,21 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+
+noinst_LIBRARIES = lib.a
+
+# We also make a library with just the useful
+# machine-but-not-system-specific functions, usable as an add-on
+# by itself together with e.g. uclibc.
+toollib_LIBRARIES = libic.a
+
+lib_a_SOURCES = setjmp.c memcpy.c memset.c memmove.c libcdtor.c
+
+libic_a_SOURCES = setjmp.c memcpy.c memset.c memmove.c libcdtor.c
+tooldir = $(exec_prefix)/$(host_alias)
+toollibdir = $(tooldir)/lib$(MULTISUBDIR)
+
+ACLOCAL_AMFLAGS = -I ../../..
+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
Index: src/newlib/libc/machine/cris/Makefile.in
diff -u /dev/null src/newlib/libc/machine/cris/Makefile.in:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/Makefile.in	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,382 @@
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AR = @AR@
+AS = @AS@
+CC = @CC@
+CPP = @CPP@
+EXEEXT = @EXEEXT@
+LDFLAGS = @LDFLAGS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+aext = @aext@
+libm_machine_dir = @libm_machine_dir@
+machine_dir = @machine_dir@
+newlib_basedir = @newlib_basedir@
+oext = @oext@
+sys_dir = @sys_dir@
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+
+noinst_LIBRARIES = lib.a
+
+# We also make a library with just the useful
+# machine-but-not-system-specific functions, usable as an add-on
+# by itself together with e.g. uclibc.
+toollib_LIBRARIES = libic.a
+
+lib_a_SOURCES = setjmp.c memcpy.c memset.c memmove.c libcdtor.c
+
+libic_a_SOURCES = setjmp.c memcpy.c memset.c memmove.c libcdtor.c
+tooldir = $(exec_prefix)/$(host_alias)
+toollibdir = $(tooldir)/lib$(MULTISUBDIR)
+
+ACLOCAL_AMFLAGS = -I ../../..
+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
+CONFIG_CLEAN_FILES = 
+LIBRARIES =  $(noinst_LIBRARIES) $(toollib_LIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) 
+CPPFLAGS = @CPPFLAGS@
+LIBS = @LIBS@
+lib_a_LIBADD = 
+lib_a_OBJECTS =  setjmp.o memcpy.o memset.o memmove.o libcdtor.o
+libic_a_LIBADD = 
+libic_a_OBJECTS =  setjmp.o memcpy.o memset.o memmove.o libcdtor.o
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON =  Makefile.am Makefile.in aclocal.m4 configure configure.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+SOURCES = $(lib_a_SOURCES) $(libic_a_SOURCES)
+OBJECTS = $(lib_a_OBJECTS) $(libic_a_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  \
+		../../../acinclude.m4 ../../../aclocal.m4 \
+		../../../libtool.m4
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+mostlyclean-noinstLIBRARIES:
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
+
+mostlyclean-toollibLIBRARIES:
+
+clean-toollibLIBRARIES:
+	-test -z "$(toollib_LIBRARIES)" || rm -f $(toollib_LIBRARIES)
+
+distclean-toollibLIBRARIES:
+
+maintainer-clean-toollibLIBRARIES:
+
+install-toollibLIBRARIES: $(toollib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(toollibdir)
+	@list='$(toollib_LIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(toollibdir)/$$p"; \
+	    $(INSTALL_DATA) $$p $(DESTDIR)$(toollibdir)/$$p; \
+	  else :; fi; \
+	done
+	@$(POST_INSTALL)
+	@list='$(toollib_LIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo " $(RANLIB) $(DESTDIR)$(toollibdir)/$$p"; \
+	    $(RANLIB) $(DESTDIR)$(toollibdir)/$$p; \
+	  else :; fi; \
+	done
+
+uninstall-toollibLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	list='$(toollib_LIBRARIES)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(toollibdir)/$$p; \
+	done
+
+.c.o:
+	$(COMPILE) -c $<
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
+	-rm -f lib.a
+	$(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
+	$(RANLIB) lib.a
+
+libic.a: $(libic_a_OBJECTS) $(libic_a_DEPENDENCIES)
+	-rm -f libic.a
+	$(AR) cru libic.a $(libic_a_OBJECTS) $(libic_a_LIBADD)
+	$(RANLIB) libic.a
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	-rm -rf $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+	mkdir $(distdir)/=build
+	mkdir $(distdir)/=inst
+	dc_install_base=`cd $(distdir)/=inst && pwd`; \
+	cd $(distdir)/=build \
+	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist
+	-rm -rf $(distdir)
+	@banner="$(distdir).tar.gz is ready for distribution"; \
+	dashes=`echo "$$banner" | sed s/./=/g`; \
+	echo "$$dashes"; \
+	echo "$$banner"; \
+	echo "$$dashes"
+dist: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+dist-all: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+distdir: $(DISTFILES)
+	-rm -rf $(distdir)
+	mkdir $(distdir)
+	-chmod 777 $(distdir)
+	@for file in $(DISTFILES); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am:
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-info-am: 
+install-info: install-info-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-toollibLIBRARIES
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-toollibLIBRARIES
+uninstall: uninstall-am
+all-am: Makefile $(LIBRARIES)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(toollibdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-noinstLIBRARIES \
+		mostlyclean-toollibLIBRARIES mostlyclean-compile \
+		mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am:  clean-noinstLIBRARIES clean-toollibLIBRARIES clean-compile \
+		clean-tags clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am:  distclean-noinstLIBRARIES distclean-toollibLIBRARIES \
+		distclean-compile distclean-tags distclean-generic \
+		clean-am
+
+distclean: distclean-am
+	-rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-noinstLIBRARIES \
+		maintainer-clean-toollibLIBRARIES \
+		maintainer-clean-compile maintainer-clean-tags \
+		maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+	-rm -f config.status
+
+.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-toollibLIBRARIES distclean-toollibLIBRARIES \
+clean-toollibLIBRARIES maintainer-clean-toollibLIBRARIES \
+uninstall-toollibLIBRARIES install-toollibLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile tags \
+mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
+distdir info-am info dvi-am dvi check check-am installcheck-am \
+installcheck install-info-am install-info install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: src/newlib/libc/machine/cris/aclocal.m4
diff -u /dev/null src/newlib/libc/machine/cris/aclocal.m4:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/aclocal.m4	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,366 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+dnl This provides configure definitions used by all the newlib
+dnl configure.in files.
+
+dnl Basic newlib configury.  This calls basic introductory stuff,
+dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST.  It also runs
+dnl configure.host.  The only argument is the relative path to the top
+dnl newlib directory.
+
+AC_DEFUN(NEWLIB_CONFIGURE,
+[
+dnl Default to --enable-multilib
+AC_ARG_ENABLE(multilib,
+[  --enable-multilib         build many library versions (default)],
+[case "${enableval}" in
+  yes) multilib=yes ;;
+  no)  multilib=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
+ esac], [multilib=yes])dnl
+
+dnl Support --enable-target-optspace
+AC_ARG_ENABLE(target-optspace,
+[  --enable-target-optspace  optimize for space],
+[case "${enableval}" in
+  yes) target_optspace=yes ;;
+  no)  target_optspace=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
+ esac], [target_optspace=])dnl
+
+dnl Support --enable-malloc-debugging - currently only supported for Cygwin
+AC_ARG_ENABLE(malloc-debugging,
+[  --enable-malloc-debugging indicate malloc debugging requested],
+[case "${enableval}" in
+  yes) malloc_debugging=yes ;;
+  no)  malloc_debugging=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
+ esac], [malloc_debugging=])dnl
+
+dnl Support --enable-newlib-multithread
+AC_ARG_ENABLE(newlib-multithread,
+[  --enable-newlib-multithread        enable support for multiple threads],
+[case "${enableval}" in
+  yes) newlib_multithread=yes ;;
+  no)  newlib_multithread=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
+ esac], [newlib_multithread=yes])dnl
+
+dnl Support --enable-newlib-iconv
+AC_ARG_ENABLE(newlib-iconv,
+[  --enable-newlib-iconv     enable iconv library support],
+[if test "${newlib_iconv+set}" != set; then
+   case "${enableval}" in
+     yes) newlib_iconv=yes ;;
+     no)  newlib_iconv=no ;;
+     *)   AC_MSG_ERROR(bad value ${enableval} for newlib-iconv option) ;;
+   esac
+ fi], [newlib_iconv=${newlib_iconv}])dnl
+
+dnl Support --enable-newlib-elix-level
+AC_ARG_ENABLE(newlib-elix-level,
+[  --enable-newlib-elix-level         supply desired elix library level (1-4)],
+[case "${enableval}" in
+  0)   newlib_elix_level=0 ;;
+  1)   newlib_elix_level=1 ;;
+  2)   newlib_elix_level=2 ;;
+  3)   newlib_elix_level=3 ;;
+  4)   newlib_elix_level=4 ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;;
+ esac], [newlib_elix_level=0])dnl
+
+dnl Support --disable-newlib-io-float
+AC_ARG_ENABLE(newlib-io-float,
+[  --disable-newlib-io-float disable printf/scanf family float support],
+[case "${enableval}" in
+  yes) newlib_io_float=yes ;;
+  no)  newlib_io_float=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
+ esac], [newlib_io_float=yes])dnl
+
+dnl Support --disable-newlib-supplied-syscalls
+AC_ARG_ENABLE(newlib-supplied-syscalls,
+[  --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
+[case "${enableval}" in
+  yes) newlib_may_supply_syscalls=yes ;;
+  no)  newlib_may_supply_syscalls=no ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
+ esac], [newlib_may_supply_syscalls=yes])dnl
+
+AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes)
+
+dnl We may get other options which we don't document:
+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
+
+test -z "[$]{with_target_subdir}" && with_target_subdir=.
+
+if test "[$]{srcdir}" = "."; then
+  if test "[$]{with_target_subdir}" != "."; then
+    newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
+  else
+    newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
+  fi
+else
+  newlib_basedir="[$]{srcdir}/$1"
+fi
+AC_SUBST(newlib_basedir)
+
+AC_CANONICAL_SYSTEM
+
+AM_INIT_AUTOMAKE(newlib, 1.13.0)
+
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
+
+AC_CHECK_TOOL(AS, as)
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+
+AC_PROG_INSTALL
+
+AM_MAINTAINER_MODE
+
+# We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
+# at least currently, we never actually build a program, so we never
+# need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
+# fails, because we are probably configuring with a cross compiler
+# which can't create executables.  So we include AC_EXEEXT to keep
+# automake happy, but we don't execute it, since we don't care about
+# the result.
+if false; then
+  AC_EXEEXT
+fi
+
+. [$]{newlib_basedir}/configure.host
+
+newlib_cflags="[$]{newlib_cflags} -fno-builtin"
+
+NEWLIB_CFLAGS=${newlib_cflags}
+AC_SUBST(NEWLIB_CFLAGS)
+
+LDFLAGS=${ldflags}
+AC_SUBST(LDFLAGS)
+
+AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0)
+AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1)
+AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2)
+AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3)
+AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4)
+
+AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
+
+# Hard-code OBJEXT.  Normally it is set by AC_OBJEXT, but we
+# use oext, which is set in configure.host based on the target platform.
+OBJEXT=${oext}
+
+AC_SUBST(OBJEXT)
+AC_SUBST(oext)
+AC_SUBST(aext)
+
+AC_SUBST(libm_machine_dir)
+AC_SUBST(machine_dir)
+AC_SUBST(sys_dir)
+])
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+# Copyright 2002  Free Software Foundation, Inc.
+
+# This program 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.
+
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.4-p6])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "[$]2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Define a conditional.
+
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
+
Index: src/newlib/libc/machine/cris/configure
diff -u /dev/null src/newlib/libc/machine/cris/configure:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/configure	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,1880 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --enable-multilib         build many library versions (default)"
+ac_help="$ac_help
+  --enable-target-optspace  optimize for space"
+ac_help="$ac_help
+  --enable-malloc-debugging indicate malloc debugging requested"
+ac_help="$ac_help
+  --enable-newlib-multithread        enable support for multiple threads"
+ac_help="$ac_help
+  --enable-newlib-iconv     enable iconv library support"
+ac_help="$ac_help
+  --enable-newlib-elix-level         supply desired elix library level (1-4)"
+ac_help="$ac_help
+  --disable-newlib-io-float disable printf/scanf family float support"
+ac_help="$ac_help
+  --disable-newlib-supplied-syscalls disable newlib from supplying syscalls"
+ac_help="$ac_help
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=setjmp.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ac_aux_dir=
+for ac_dir in ../../../.. $srcdir/../../../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+am__api_version="1.4"
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:578: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:631: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:721: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 726 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_cygwin=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:754: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 759 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_mingw32=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+# Check whether --enable-multilib or --disable-multilib was given.
+if test "${enable_multilib+set}" = set; then
+  enableval="$enable_multilib"
+  case "${enableval}" in
+  yes) multilib=yes ;;
+  no)  multilib=no ;;
+  *)   { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;;
+ esac
+else
+  multilib=yes
+fi
+
+# Check whether --enable-target-optspace or --disable-target-optspace was given.
+if test "${enable_target_optspace+set}" = set; then
+  enableval="$enable_target_optspace"
+  case "${enableval}" in
+  yes) target_optspace=yes ;;
+  no)  target_optspace=no ;;
+  *)   { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;;
+ esac
+else
+  target_optspace=
+fi
+
+# Check whether --enable-malloc-debugging or --disable-malloc-debugging was given.
+if test "${enable_malloc_debugging+set}" = set; then
+  enableval="$enable_malloc_debugging"
+  case "${enableval}" in
+  yes) malloc_debugging=yes ;;
+  no)  malloc_debugging=no ;;
+  *)   { echo "configure: error: bad value ${enableval} for malloc-debugging option" 1>&2; exit 1; } ;;
+ esac
+else
+  malloc_debugging=
+fi
+
+# Check whether --enable-newlib-multithread or --disable-newlib-multithread was given.
+if test "${enable_newlib_multithread+set}" = set; then
+  enableval="$enable_newlib_multithread"
+  case "${enableval}" in
+  yes) newlib_multithread=yes ;;
+  no)  newlib_multithread=no ;;
+  *)   { echo "configure: error: bad value ${enableval} for newlib-multithread option" 1>&2; exit 1; } ;;
+ esac
+else
+  newlib_multithread=yes
+fi
+
+# Check whether --enable-newlib-iconv or --disable-newlib-iconv was given.
+if test "${enable_newlib_iconv+set}" = set; then
+  enableval="$enable_newlib_iconv"
+  if test "${newlib_iconv+set}" != set; then
+   case "${enableval}" in
+     yes) newlib_iconv=yes ;;
+     no)  newlib_iconv=no ;;
+     *)   { echo "configure: error: bad value ${enableval} for newlib-iconv option" 1>&2; exit 1; } ;;
+   esac
+ fi
+else
+  newlib_iconv=${newlib_iconv}
+fi
+
+# Check whether --enable-newlib-elix-level or --disable-newlib-elix-level was given.
+if test "${enable_newlib_elix_level+set}" = set; then
+  enableval="$enable_newlib_elix_level"
+  case "${enableval}" in
+  0)   newlib_elix_level=0 ;;
+  1)   newlib_elix_level=1 ;;
+  2)   newlib_elix_level=2 ;;
+  3)   newlib_elix_level=3 ;;
+  4)   newlib_elix_level=4 ;;
+  *)   { echo "configure: error: bad value ${enableval} for newlib-elix-level option" 1>&2; exit 1; } ;;
+ esac
+else
+  newlib_elix_level=0
+fi
+
+# Check whether --enable-newlib-io-float or --disable-newlib-io-float was given.
+if test "${enable_newlib_io_float+set}" = set; then
+  enableval="$enable_newlib_io_float"
+  case "${enableval}" in
+  yes) newlib_io_float=yes ;;
+  no)  newlib_io_float=no ;;
+  *)   { echo "configure: error: bad value ${enableval} for newlib-io-float option" 1>&2; exit 1; } ;;
+ esac
+else
+  newlib_io_float=yes
+fi
+
+# Check whether --enable-newlib-supplied-syscalls or --disable-newlib-supplied-syscalls was given.
+if test "${enable_newlib_supplied_syscalls+set}" = set; then
+  enableval="$enable_newlib_supplied_syscalls"
+  case "${enableval}" in
+  yes) newlib_may_supply_syscalls=yes ;;
+  no)  newlib_may_supply_syscalls=no ;;
+  *)   { echo "configure: error: bad value ${enableval} for newlib-supplied-syscalls option" 1>&2; exit 1; } ;;
+ esac
+else
+  newlib_may_supply_syscalls=yes
+fi
+
+
+
+if test x${newlib_may_supply_syscalls} = xyes; then
+  MAY_SUPPLY_SYSCALLS_TRUE=
+  MAY_SUPPLY_SYSCALLS_FALSE='#'
+else
+  MAY_SUPPLY_SYSCALLS_TRUE='#'
+  MAY_SUPPLY_SYSCALLS_FALSE=
+fi
+
+
+test -z "${with_target_subdir}" && with_target_subdir=.
+
+if test "${srcdir}" = "."; then
+  if test "${with_target_subdir}" != "."; then
+    newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
+  else
+    newlib_basedir="${srcdir}/${with_multisrctop}../../.."
+  fi
+else
+  newlib_basedir="${srcdir}/../../.."
+fi
+
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+#    same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+#    as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:936: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:957: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+  case $nonopt in
+  NONE) target_alias=$host_alias ;;
+  *) target_alias=$nonopt ;;
+  esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:975: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+
+
+PACKAGE=newlib
+
+VERSION=1.13.0
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6
+echo "configure:1018: checking for working aclocal-${am__api_version}" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal-${am__api_version}
+   echo "$ac_t""found" 1>&6
+else
+   ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:1031: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6
+echo "configure:1044: checking for working automake-${am__api_version}" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake-${am__api_version}
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:1057: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:1070: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+
+
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1095: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1125: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1174: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1198: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+
+# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1229: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AS="${ac_tool_prefix}as"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as"
+fi
+fi
+AS="$ac_cv_prog_AS"
+if test -n "$AS"; then
+  echo "$ac_t""$AS" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1261: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AR="${ac_tool_prefix}ar"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1293: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1325: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  RANLIB=":"
+fi
+fi
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1370: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1424: checking whether to enable maintainer-specific portions of Makefiles" >&5
+    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval="$enable_maintainer_mode"
+  USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+  
+
+if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+  MAINT=$MAINTAINER_MODE_TRUE
+  
+
+
+# We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
+# at least currently, we never actually build a program, so we never
+# need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
+# fails, because we are probably configuring with a cross compiler
+# which can't create executables.  So we include AC_EXEEXT to keep
+# automake happy, but we don't execute it, since we don't care about
+# the result.
+if false; then
+  
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1458: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
+else
+  rm -f conftest*
+  echo 'int main () { return 0; }' > conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for file in conftest.*; do
+      case $file in
+      *.c | *.o | *.obj) ;;
+      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+fi
+
+. ${newlib_basedir}/configure.host
+
+newlib_cflags="${newlib_cflags} -fno-builtin"
+
+NEWLIB_CFLAGS=${newlib_cflags}
+
+
+LDFLAGS=${ldflags}
+
+
+
+
+if test x${newlib_elix_level} = x0; then
+  ELIX_LEVEL_0_TRUE=
+  ELIX_LEVEL_0_FALSE='#'
+else
+  ELIX_LEVEL_0_TRUE='#'
+  ELIX_LEVEL_0_FALSE=
+fi
+
+
+if test x${newlib_elix_level} = x1; then
+  ELIX_LEVEL_1_TRUE=
+  ELIX_LEVEL_1_FALSE='#'
+else
+  ELIX_LEVEL_1_TRUE='#'
+  ELIX_LEVEL_1_FALSE=
+fi
+
+
+if test x${newlib_elix_level} = x2; then
+  ELIX_LEVEL_2_TRUE=
+  ELIX_LEVEL_2_FALSE='#'
+else
+  ELIX_LEVEL_2_TRUE='#'
+  ELIX_LEVEL_2_FALSE=
+fi
+
+
+if test x${newlib_elix_level} = x3; then
+  ELIX_LEVEL_3_TRUE=
+  ELIX_LEVEL_3_FALSE='#'
+else
+  ELIX_LEVEL_3_TRUE='#'
+  ELIX_LEVEL_3_FALSE=
+fi
+
+
+if test x${newlib_elix_level} = x4; then
+  ELIX_LEVEL_4_TRUE=
+  ELIX_LEVEL_4_FALSE='#'
+else
+  ELIX_LEVEL_4_TRUE='#'
+  ELIX_LEVEL_4_FALSE=
+fi
+
+
+
+if test x${use_libtool} = xyes; then
+  USE_LIBTOOL_TRUE=
+  USE_LIBTOOL_FALSE='#'
+else
+  USE_LIBTOOL_TRUE='#'
+  USE_LIBTOOL_FALSE=
+fi
+
+# Hard-code OBJEXT.  Normally it is set by AC_OBJEXT, but we
+# use oext, which is set in configure.host based on the target platform.
+OBJEXT=${oext}
+
+
+
+
+
+
+
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@MAY_SUPPLY_SYSCALLS_TRUE@%$MAY_SUPPLY_SYSCALLS_TRUE%g
+s%@MAY_SUPPLY_SYSCALLS_FALSE@%$MAY_SUPPLY_SYSCALLS_FALSE%g
+s%@newlib_basedir@%$newlib_basedir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@AS@%$AS%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g
+s%@ELIX_LEVEL_0_TRUE@%$ELIX_LEVEL_0_TRUE%g
+s%@ELIX_LEVEL_0_FALSE@%$ELIX_LEVEL_0_FALSE%g
+s%@ELIX_LEVEL_1_TRUE@%$ELIX_LEVEL_1_TRUE%g
+s%@ELIX_LEVEL_1_FALSE@%$ELIX_LEVEL_1_FALSE%g
+s%@ELIX_LEVEL_2_TRUE@%$ELIX_LEVEL_2_TRUE%g
+s%@ELIX_LEVEL_2_FALSE@%$ELIX_LEVEL_2_FALSE%g
+s%@ELIX_LEVEL_3_TRUE@%$ELIX_LEVEL_3_TRUE%g
+s%@ELIX_LEVEL_3_FALSE@%$ELIX_LEVEL_3_FALSE%g
+s%@ELIX_LEVEL_4_TRUE@%$ELIX_LEVEL_4_TRUE%g
+s%@ELIX_LEVEL_4_FALSE@%$ELIX_LEVEL_4_FALSE%g
+s%@USE_LIBTOOL_TRUE@%$USE_LIBTOOL_TRUE%g
+s%@USE_LIBTOOL_FALSE@%$USE_LIBTOOL_FALSE%g
+s%@OBJEXT@%$OBJEXT%g
+s%@oext@%$oext%g
+s%@aext@%$aext%g
+s%@libm_machine_dir@%$libm_machine_dir%g
+s%@machine_dir@%$machine_dir%g
+s%@sys_dir@%$sys_dir%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
Index: src/newlib/libc/machine/cris/configure.in
diff -u /dev/null src/newlib/libc/machine/cris/configure.in:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/configure.in	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,12 @@
+dnl This is the newlib/libc/machine/cris configure.in file.
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(setjmp.c)
+
+dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 
+AC_CONFIG_AUX_DIR(../../../..)
+
+NEWLIB_CONFIGURE(../../..)
+
+AC_OUTPUT(Makefile)
Index: src/newlib/libc/machine/cris/libcdtor.c
diff -u /dev/null src/newlib/libc/machine/cris/libcdtor.c:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/libcdtor.c	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,88 @@
+/* Call ctors and dtors from elinux a.out shared libraries.
+   Copyright (C) 1999, 2000, 2003, 2004, 2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+typedef void (*vfnp) (void);
+
+/* The guts of the _Libctors and _Libdtors is "optimized" away into
+   empty functions when the definition is visible as well.  Simplest
+   solution is to emit the definitions as asm.  We have no .previous
+   directive in a.out, so we rely on the fact that everything in this
+   file goes into the .text section.  */
+__asm__
+(
+ ".text\n\t.global .$global.lib.ctors\n.$global.lib.ctors:\n\t.dword 0"
+);
+__asm__
+(
+ ".text\n\t.global .$global.lib.dtors\n.$global.lib.dtors:\n\t.dword 0"
+);
+
+extern vfnp * const _Ctors asm(".$global.lib.ctors");
+extern vfnp * const _Dtors asm(".$global.lib.dtors");
+
+/* We better provide weak empty ctor and dtor lists, since they are not
+   created if the main program does not have ctor/dtors.  */
+
+static vfnp const defaultors[] = {0, 0};
+
+extern vfnp * __CTOR_LIST__ __attribute__ ((weak, alias ("defaultors")));
+extern vfnp * __DTOR_LIST__ __attribute__ ((weak, alias ("defaultors")));
+
+void
+_Libctors (void)
+{
+  const vfnp *firstor = _Ctors;
+  const vfnp *ctors;
+
+  /* Have to find the last ctor; they will run in opposite order as in
+     the table. */
+  if (firstor != 0 && *firstor != 0)
+    {
+      for (ctors = firstor; *ctors != 0; ctors++)
+	;
+
+      while (--ctors != firstor)
+	{
+	  (**ctors)();
+	}
+
+      (**ctors)();
+    }
+}
+
+void
+_Libdtors(void)
+{
+  const vfnp *dtors = _Dtors;
+
+  if (dtors)
+    while (*dtors != 0)
+      {
+	(**dtors++) ();
+      }
+}
Index: src/newlib/libc/machine/cris/memcpy.c
diff -u /dev/null src/newlib/libc/machine/cris/memcpy.c:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/memcpy.c	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,236 @@
+/* A memcpy for CRIS.
+   Copyright (C) 1994-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* FIXME: This file should really only be used for reference, as the
+   result is somewhat depending on gcc generating what we expect rather
+   than what we describe.  An assembly file should be used instead.  */
+
+#include <stddef.h>
+
+/* Break even between movem and move16 is really at 38.7 * 2, but
+   modulo 44, so up to the next multiple of 44, we use ordinary code.  */
+#define MEMCPY_BY_BLOCK_THRESHOLD (44 * 2)
+
+/* No name ambiguities in this file.  */
+__asm__ (".syntax no_register_prefix");
+
+void *
+memcpy(void *pdst, const void *psrc, size_t pn)
+{
+  /* Now we want the parameters put in special registers.
+     Make sure the compiler is able to make something useful of this.
+     As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
+
+     If gcc was allright, it really would need no temporaries, and no
+     stack space to save stuff on.  */
+
+  register void *return_dst __asm__ ("r10") = pdst;
+  register unsigned char *dst __asm__ ("r13") = pdst;
+  register unsigned const char *src __asm__ ("r11") = psrc;
+  register int n __asm__ ("r12") = pn;
+
+  /* When src is aligned but not dst, this makes a few extra needless
+     cycles.  I believe it would take as many to check that the
+     re-alignment was unnecessary.  */
+  if (((unsigned long) dst & 3) != 0
+      /* Don't align if we wouldn't copy more than a few bytes; so we
+	 don't have to check further for overflows.  */
+      && n >= 3)
+  {
+    if ((unsigned long) dst & 1)
+      {
+	n--;
+	*dst = *src;
+	src++;
+	dst++;
+      }
+
+    if ((unsigned long) dst & 2)
+      {
+	n -= 2;
+	*(short *) dst = *(short *) src;
+	src += 2;
+	dst += 2;
+      }
+  }
+
+  /* Decide which copying method to use.  */
+  if (n >= MEMCPY_BY_BLOCK_THRESHOLD)
+    {
+      /* It is not optimal to tell the compiler about clobbering any
+	 registers; that will move the saving/restoring of those registers
+	 to the function prologue/epilogue, and make non-movem sizes
+	 suboptimal.  */
+      __asm__ volatile
+	("\
+	 ;; GCC does promise correct register allocations, but let's	\n\
+	 ;; make sure it keeps its promises.				\n\
+	 .ifnc %0-%1-%2,$r13-$r11-$r12					\n\
+	 .error \"GCC reg alloc bug: %0-%1-%4 != $r13-$r12-$r11\"	\n\
+	 .endif								\n\
+									\n\
+	 ;; Save the registers we'll use in the movem process		\n\
+	 ;; on the stack.						\n\
+	 subq	11*4,sp							\n\
+	 movem	r10,[sp]						\n\
+									\n\
+	 ;; Now we've got this:						\n\
+	 ;; r11 - src							\n\
+	 ;; r13 - dst							\n\
+	 ;; r12 - n							\n\
+									\n\
+	 ;; Update n for the first loop.				\n\
+	 subq	 44,r12							\n\
+0:									\n\
+"
+#ifdef __arch_common_v10_v32
+	 /* Cater to branch offset difference between v32 and v10.  We
+	    assume the branch below has an 8-bit offset.  */
+"	 setf\n"
+#endif
+"	 movem	[r11+],r10						\n\
+	 subq	44,r12							\n\
+	 bge	 0b							\n\
+	 movem	r10,[r13+]						\n\
+									\n\
+	 ;; Compensate for last loop underflowing n.			\n\
+	 addq	44,r12							\n\
+									\n\
+	 ;; Restore registers from stack.				\n\
+	 movem [sp+],r10"
+
+	 /* Outputs.  */
+	 : "=r" (dst), "=r" (src), "=r" (n)
+
+	 /* Inputs.  */
+	 : "0" (dst), "1" (src), "2" (n));
+    }
+
+  while (n >= 16)
+    {
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+
+      n -= 16;
+    }
+
+  switch (n)
+    {
+    case 0:
+      break;
+
+    case 1:
+      *dst = *src;
+      break;
+
+    case 2:
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 3:
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+
+    case 4:
+      *(long *) dst = *(long *) src;
+      break;
+
+    case 5:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
+      break;
+
+    case 6:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 7:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+
+    case 8:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
+      break;
+
+    case 9:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
+      break;
+
+    case 10:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 11:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+
+    case 12:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
+      break;
+
+    case 13:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
+      break;
+
+    case 14:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 15:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+    }
+
+  return return_dst;
+}
Index: src/newlib/libc/machine/cris/memmove.c
diff -u /dev/null src/newlib/libc/machine/cris/memmove.c:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/memmove.c	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,257 @@
+/* A memmove for CRIS.
+   Copyright (C) 2000-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* FIXME: This file should really only be used for reference, as the
+   result is somewhat depending on gcc generating what we expect rather
+   than what we describe.  An assembly file should be used instead.
+
+   Even worse, we base it on memcpy, on the assumption that overlapping
+   moves are rare, and we will do no worse than the generic memmove.  */
+
+#include <stddef.h>
+
+/* Break even between movem and move16 is really at 38.7 * 2, but
+   modulo 44, so up to the next multiple of 44, we use ordinary code.  */
+#define MEMMOVE_BY_BLOCK_THRESHOLD (44 * 2)
+
+/* No name ambiguities in this file.  */
+__asm__ (".syntax no_register_prefix");
+
+void *
+memmove(void *pdst, const void *psrc, size_t pn)
+{
+  /* Now we want the parameters put in special registers.
+     Make sure the compiler is able to make something useful of this.
+     As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
+
+     If gcc was allright, it really would need no temporaries, and no
+     stack space to save stuff on.  */
+
+  register void *return_dst __asm__ ("r10") = pdst;
+  register unsigned char *dst __asm__ ("r13") = pdst;
+  register unsigned const char *src __asm__ ("r11") = psrc;
+  register int n __asm__ ("r12") = pn;
+
+  /* Check and handle overlap.  */
+  if (src < dst && dst < src + n)
+    {
+      /* Destructive overlap.  We could optimize this, but we don't (for
+	 the moment).  */
+      src += n;
+      dst += n;
+      while (n--)
+	{
+	  *--dst = *--src;
+	}
+
+      return return_dst;
+    }
+  /* Whew, no overlap.  Proceed as with memcpy.  We could call it instead
+     of having a copy here.  That would spoil some of the optimization, so
+     we take the trouble with having two copies.  */
+
+  /* When src is aligned but not dst, this makes a few extra needless
+     cycles.  I believe it would take as many to check that the
+     re-alignment was unnecessary.  */
+  if (((unsigned long) dst & 3) != 0
+      /* Don't align if we wouldn't copy more than a few bytes; so we
+	 don't have to check further for overflows.  */
+      && n >= 3)
+  {
+    if ((unsigned long) dst & 1)
+      {
+	n--;
+	*dst = *src;
+	src++;
+	dst++;
+      }
+
+    if ((unsigned long) dst & 2)
+      {
+	n -= 2;
+	*(short *) dst = *(short *) src;
+	src += 2;
+	dst += 2;
+      }
+  }
+
+  /* Decide which copying method to use.  */
+  if (n >= MEMMOVE_BY_BLOCK_THRESHOLD)
+    {
+      /* It is not optimal to tell the compiler about clobbering any
+	 registers; that will move the saving/restoring of those registers
+	 to the function prologue/epilogue, and make non-movem sizes
+	 suboptimal.  */
+      __asm__ volatile
+	("\
+	 ;; GCC does promise correct register allocations, but let's	\n\
+	 ;; make sure it keeps its promises.				\n\
+	 .ifnc %0-%1-%2,$r13-$r11-$r12					\n\
+	 .error \"GCC reg alloc bug: %0-%1-%4 != $r13-$r12-$r11\"	\n\
+	 .endif								\n\
+									\n\
+	 ;; Save the registers we'll use in the movem process		\n\
+	 ;; on the stack.						\n\
+	 subq	11*4,sp							\n\
+	 movem	r10,[sp]						\n\
+									\n\
+	 ;; Now we've got this:						\n\
+	 ;; r11 - src							\n\
+	 ;; r13 - dst							\n\
+	 ;; r12 - n							\n\
+									\n\
+	 ;; Update n for the first loop.				\n\
+	 subq	 44,r12							\n\
+0:									\n\
+"
+#ifdef __arch_common_v10_v32
+	 /* Cater to branch offset difference between v32 and v10.  We
+	    assume the branch below has an 8-bit offset.  */
+"	 setf\n"
+#endif
+"	 movem	[r11+],r10						\n\
+	 subq	44,r12							\n\
+	 bge	 0b							\n\
+	 movem	r10,[r13+]						\n\
+									\n\
+	 ;; Compensate for last loop underflowing n.			\n\
+	 addq	44,r12							\n\
+									\n\
+	 ;; Restore registers from stack.				\n\
+	 movem [sp+],r10"
+
+	 /* Outputs.  */
+	 : "=r" (dst), "=r" (src), "=r" (n)
+
+	 /* Inputs.  */
+	 : "0" (dst), "1" (src), "2" (n));
+    }
+
+  while (n >= 16)
+    {
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+
+      n -= 16;
+    }
+
+  switch (n)
+    {
+    case 0:
+      break;
+
+    case 1:
+      *dst = *src;
+      break;
+
+    case 2:
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 3:
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+
+    case 4:
+      *(long *) dst = *(long *) src;
+      break;
+
+    case 5:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
+      break;
+
+    case 6:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 7:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+
+    case 8:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
+      break;
+
+    case 9:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
+      break;
+
+    case 10:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 11:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+
+    case 12:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
+      break;
+
+    case 13:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
+      break;
+
+    case 14:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
+      break;
+
+    case 15:
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
+      break;
+    }
+
+  return return_dst;
+}
Index: src/newlib/libc/machine/cris/memset.c
diff -u /dev/null src/newlib/libc/machine/cris/memset.c:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/memset.c	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,259 @@
+/* A memset for CRIS.
+   Copyright (C) 1999-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* FIXME: This file should really only be used for reference, as the
+   result is somewhat depending on gcc generating what we expect rather
+   than what we describe.  An assembly file should be used instead.  */
+
+/* Note the multiple occurrence of the expression "12*4", including the
+   asm.  It is hard to get it into the asm in a good way.  Thus better to
+   expose the problem everywhere: no macro.  */
+
+/* Assuming one cycle per dword written or read (ok, not really true; the
+   world is not ideal), and one cycle per instruction, then 43+3*(n/48-1)
+   <= 24+24*(n/48-1) so n >= 45.7; n >= 0.9; we win on the first full
+   48-byte block to set.  */
+
+#define MEMSET_BY_BLOCK_THRESHOLD (1 * 48)
+
+/* No name ambiguities in this file.  */
+__asm__ (".syntax no_register_prefix");
+
+void *memset(void *pdst, int c, unsigned int plen)
+{
+  /* Now we want the parameters in special registers.  Make sure the
+     compiler does something usable with this.  */
+
+  register char *return_dst __asm__ ("r10") = pdst;
+  register int n __asm__ ("r12") = plen;
+  register int lc __asm__ ("r11") = c;
+
+  /* Most apps use memset sanely.  Memsetting about 3..4 bytes or less get
+     penalized here compared to the generic implementation.  */
+
+  /* This is fragile performancewise at best.  Check with newer GCC
+     releases, if they compile cascaded "x |= x << 8" to sane code.  */
+  __asm__("movu.b %0,r13						\n\
+	   lslq 8,r13							\n\
+	   move.b %0,r13						\n\
+	   move.d r13,%0						\n\
+	   lslq 16,r13							\n\
+	   or.d r13,%0"
+          : "=r" (lc)		/* Inputs.  */
+	  : "0" (lc)		/* Outputs.  */
+	  : "r13");		/* Trash.  */
+
+  {
+    register char *dst __asm__ ("r13") = pdst;
+
+    if (((unsigned long) pdst & 3) != 0
+	/* Oops! n = 0 must be a valid call, regardless of alignment.  */
+	&& n >= 3)
+      {
+	if ((unsigned long) dst & 1)
+	  {
+	    *dst = (char) lc;
+	    n--;
+	    dst++;
+	  }
+
+	if ((unsigned long) dst & 2)
+	  {
+	    *(short *) dst = lc;
+	    n -= 2;
+	    dst += 2;
+	  }
+      }
+
+    /* Decide which setting method to use.  */
+    if (n >= MEMSET_BY_BLOCK_THRESHOLD)
+      {
+	/* It is not optimal to tell the compiler about clobbering any
+	   registers; that will move the saving/restoring of those registers
+	   to the function prologue/epilogue, and make non-block sizes
+	   suboptimal.  */
+	__asm__ volatile
+	  ("\
+	   ;; GCC does promise correct register allocations, but let's	\n\
+	   ;; make sure it keeps its promises.				\n\
+	   .ifnc %0-%1-%4,$r13-$r12-$r11				\n\
+	   .error \"GCC reg alloc bug: %0-%1-%4 != $r13-$r12-$r11\"	\n\
+	   .endif							\n\
+									\n\
+	   ;; Save the registers we'll clobber in the movem process	\n\
+	   ;; on the stack.  Don't mention them to gcc, it will only be	\n\
+	   ;; upset.							\n\
+	   subq	   11*4,sp						\n\
+	   movem   r10,[sp]						\n\
+									\n\
+	   move.d  r11,r0						\n\
+	   move.d  r11,r1						\n\
+	   move.d  r11,r2						\n\
+	   move.d  r11,r3						\n\
+	   move.d  r11,r4						\n\
+	   move.d  r11,r5						\n\
+	   move.d  r11,r6						\n\
+	   move.d  r11,r7						\n\
+	   move.d  r11,r8						\n\
+	   move.d  r11,r9						\n\
+	   move.d  r11,r10						\n\
+									\n\
+	   ;; Now we've got this:					\n\
+	   ;; r13 - dst							\n\
+	   ;; r12 - n							\n\
+									\n\
+	   ;; Update n for the first loop				\n\
+	   subq	   12*4,r12						\n\
+0:									\n\
+"
+#ifdef __arch_common_v10_v32
+	   /* Cater to branch offset difference between v32 and v10.  We
+	      assume the branch below has an 8-bit offset.  */
+"	   setf\n"
+#endif
+"	   subq	  12*4,r12						\n\
+	   bge	   0b							\n\
+	   movem	r11,[r13+]					\n\
+									\n\
+	   ;; Compensate for last loop underflowing n.			\n\
+	   addq	  12*4,r12						\n\
+									\n\
+	   ;; Restore registers from stack.				\n\
+	   movem [sp+],r10"
+
+	   /* Outputs.	*/
+	   : "=r" (dst), "=r" (n)
+
+	   /* Inputs.  */
+	   : "0" (dst), "1" (n), "r" (lc));
+      }
+
+    /* An ad-hoc unroll, used for 4*12-1..16 bytes. */
+    while (n >= 16)
+      {
+	*(long *) dst = lc; dst += 4;
+	*(long *) dst = lc; dst += 4;
+	*(long *) dst = lc; dst += 4;
+	*(long *) dst = lc; dst += 4;
+	n -= 16;
+      }
+
+    switch (n)
+      {
+      case 0:
+        break;
+
+      case 1:
+        *dst = (char) lc;
+        break;
+
+      case 2:
+        *(short *) dst = (short) lc;
+        break;
+
+      case 3:
+        *(short *) dst = (short) lc; dst += 2;
+        *dst = (char) lc;
+        break;
+
+      case 4:
+        *(long *) dst = lc;
+        break;
+
+      case 5:
+        *(long *) dst = lc; dst += 4;
+        *dst = (char) lc;
+        break;
+
+      case 6:
+        *(long *) dst = lc; dst += 4;
+        *(short *) dst = (short) lc;
+        break;
+
+      case 7:
+        *(long *) dst = lc; dst += 4;
+        *(short *) dst = (short) lc; dst += 2;
+        *dst = (char) lc;
+        break;
+
+      case 8:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc;
+        break;
+
+      case 9:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *dst = (char) lc;
+        break;
+
+      case 10:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(short *) dst = (short) lc;
+        break;
+
+      case 11:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(short *) dst = (short) lc; dst += 2;
+        *dst = (char) lc;
+        break;
+
+      case 12:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc;
+        break;
+
+      case 13:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *dst = (char) lc;
+        break;
+
+      case 14:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(short *) dst = (short) lc;
+        break;
+
+      case 15:
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(long *) dst = lc; dst += 4;
+        *(short *) dst = (short) lc; dst += 2;
+        *dst = (char) lc;
+        break;
+      }
+  }
+
+  return return_dst;
+}
Index: src/newlib/libc/machine/cris/setjmp.c
diff -u /dev/null src/newlib/libc/machine/cris/setjmp.c:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/setjmp.c	Thu Jan 27 23:54:44 2005
@@ -0,0 +1,212 @@
+/* A setjmp.c for CRIS
+   Copyright (C) 1993-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* For benefit of CRIS v0..v3, we save and restore CCR to be able to
+   correctly handle DI/EI; otherwise there would be no reason to save it.
+   Note also that the "move x,ccr" does NOT affect
+   the DMA enable bits (E and D) of v0..v3.
+
+   We do not save mof; it is call-clobbered.  It also does not exist in
+   v0..v8; it should be safe to read or write to it there, but better not.
+
+   jmp_buf[0] - PC
+   jmp_buf[1] - SP (R14)
+   jmp_buf[2] - R13
+   jmp_buf[3] - R12
+   jmp_buf[4] - R11
+   jmp_buf[5] - R10
+   jmp_buf[6] - R9
+   jmp_buf[7] - R8
+   jmp_buf[8] - R7
+   jmp_buf[9] - R6
+   jmp_buf[10] - R5
+   jmp_buf[11] - R4
+   jmp_buf[12] - R3
+   jmp_buf[13] - R2
+   jmp_buf[14] - R1
+   jmp_buf[15] - R0
+   jmp_buf[16] - SRP
+   jmp_buf[17] - CCR
+   */
+
+#include <setjmp.h>
+
+int
+setjmp (jmp_buf buf)
+{
+  int ret;
+#if defined (__arch_common_v10_v32) || defined (__arch_v32)
+  /* No offsets in the compatibility mode.  Also, movem saves in
+     different order on v10 than on v32, so we use single move
+     instructions instead, this not being a speed-prioritized operation.
+     And we don't save CCR or CCS; since long unuseful.  */
+  __asm__ __volatile__
+    ("move.d %1,$r13							\n\
+      move 0f,$mof							\n\
+      move $mof,[$r13+]							\n\
+      move.d $sp,[$r13+]						\n\
+      clear.d [$r13+]							\n\
+      move.d $r12,[$r13+]						\n\
+      move.d $r11,[$r13+]						\n\
+      move.d $r10,[$r13+]						\n\
+      moveq 1,$r9							\n\
+      move.d $r9,[$r13+]						\n\
+      move.d $r8,[$r13+]						\n\
+      move.d $r7,[$r13+]						\n\
+      move.d $r6,[$r13+]						\n\
+      move.d $r5,[$r13+]						\n\
+      move.d $r4,[$r13+]						\n\
+      move.d $r3,[$r13+]						\n\
+      move.d $r2,[$r13+]						\n\
+      move.d $r1,[$r13+]						\n\
+      move.d $r0,[$r13+]						\n\
+      move $srp,[$r13+]							\n\
+      clear.d [$r13+]							\n\
+      clear.d $r9							\n\
+0:									\n\
+      move.d $r9,%0"
+
+     /* Output.  */
+     : "=&r" (ret)
+
+     /* Input.  */
+     : "r" (buf)
+
+     /* Clobber.  */
+     : "r9", "r13", "memory");
+#else /* not __arch_common_v10_v32 or __arch_v32 */
+#ifdef __PIC__
+  __asm__ __volatile__
+    ("moveq 1,$r9							\n\
+      movem $sp,[%1+1*4]						\n\
+      move.d $pc,$r9							\n\
+      addq 0f-.,$r9							\n\
+      move.d $r9,[%1]							\n\
+      move $srp,[%1+16*4]						\n\
+      move $ccr,[%1+17*4]						\n\
+      clear.d $r9							\n\
+0:									\n\
+      move.d $r9,%0"
+
+     /* Output.  */
+     : "=&r" (ret)
+
+     /* Input.  */
+     : "r" (buf)
+
+     /* Clobber.  */
+     : "r9", "memory");
+#else  /* not PIC */
+  __asm__ __volatile__
+    ("moveq 1,$r9							\n\
+      movem $sp,[%1+1*4]						\n\
+      move.d 0f,$r9							\n\
+      move.d $r9,[%1]							\n\
+      move $srp,[%1+16*4]						\n\
+      move $ccr,[%1+17*4]						\n\
+      clear.d $r9							\n\
+0:									\n\
+      move.d $r9,%0"
+
+     /* Output.  */
+     : "=&r" (ret)
+
+     /* Input.  */
+     : "r" (buf)
+
+     /* Clobber.  */
+     : "r9");
+#endif /* not PIC */
+#endif /* not __arch_common_v10_v32 or __arch_v32 */
+  return ret;
+}
+
+void
+longjmp(jmp_buf buf, int val)
+{
+#if defined (__arch_common_v10_v32) || defined (__arch_v32)
+  __asm__ __volatile__
+    ("cmpq 0,%1								\n\
+      beq 0f								\n\
+      move.d %0,$r13	; In delay-slot.				\n\
+      addq 6*4,$r13							\n\
+      move.d %1,[$r13]							\n\
+      subq 6*4,$r13							\n\
+0:\n"
+#ifdef __arch_common_v10_v32
+     /* Cater to branch offset difference between v32 and v10.  We
+	assume the branch above is 8-bit.  */
+"     setf\n"
+#endif
+"     move [$r13+],$mof							\n\
+      move.d [$r13+],$sp						\n\
+      addq 4,$r13							\n\
+      move.d [$r13+],$r12						\n\
+      move.d [$r13+],$r11						\n\
+      move.d [$r13+],$r10						\n\
+      move.d [$r13+],$r9						\n\
+      move.d [$r13+],$r8						\n\
+      move.d [$r13+],$r7						\n\
+      move.d [$r13+],$r6						\n\
+      move.d [$r13+],$r5						\n\
+      move.d [$r13+],$r4						\n\
+      move.d [$r13+],$r3						\n\
+      move.d [$r13+],$r2						\n\
+      move.d [$r13+],$r1						\n\
+      move.d [$r13+],$r0						\n\
+      move [$r13+],$srp							\n\
+      move $mof,$r13							\n\
+      jump $r13								\n\
+      setf"
+
+     /* No outputs.  */
+     :
+
+     /* Inputs.  */
+     : "r" (buf), "r" (val)
+     : "r13", "memory");
+
+#else /* not __arch_common_v10_v32 or __arch_v32 */
+  __asm__ __volatile__
+    ("move [%0+17*4],$ccr						\n\
+      move [%0+16*4],$srp						\n\
+      test.d %1								\n\
+      beq 0f								\n\
+      nop								\n\
+      move.d %1,[%0+6*4]	; Offset for r9.			\n\
+0:									\n\
+      movem [%0],$pc"
+
+     /* No outputs.  */
+     :
+
+     /* Inputs.  */
+     : "r" (buf), "r" (val)
+     : "memory");
+#endif /* not __arch_common_v10_v32 or __arch_v32 */
+}
Index: src/newlib/libc/machine/cris/include/pthread.h
diff -u /dev/null src/newlib/libc/machine/cris/include/pthread.h:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/include/pthread.h	Thu Jan 27 23:54:45 2005
@@ -0,0 +1,93 @@
+/* pthread.h dummy.
+   Copyright (C) 2001, 2004, 2005 Axis Communications AB.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* Simple fallback-include to enable thread-enabled exception support
+   for libgcc, but with posix-interface to a default-dummy, so a posix
+   library can optionally be linked in, which isn't possible if
+   gthr-single.h is used.  No other use is supported; *DO NOT* think
+   this gives you a valid pthread interface to use in your applications.  */
+
+#ifndef _PTHREAD_FAKE
+#define _PTHREAD_FAKE
+
+#ifdef __cplusplus
+extern "C" {
+# ifndef __THROW
+#  define __THROW throw ()
+# endif
+#else
+# ifndef __THROW
+#  define __THROW
+# endif
+#endif
+
+typedef int pthread_once_t;
+typedef unsigned int pthread_key_t;
+
+/* This must be layout-compatible with the linuxthreads type.  */
+typedef struct
+{
+  int a, b;
+  void *c;
+  int d;
+  struct { long int e; int f; } g;
+} pthread_mutex_t;
+
+/* This give bits equal to the linuxthreads initializer.  */
+#define PTHREAD_MUTEX_INITIALIZER \
+  {0, 0, 0, 0, {0, 0}}
+
+#define PTHREAD_ONCE_INIT 0
+
+/* This isn't the right prototype, but it let's us get away with not
+   defining a lot of datatypes.  */
+extern int pthread_create (void) __THROW;
+
+extern int pthread_once (pthread_once_t *, void (*) (void)) __THROW;
+
+extern int pthread_key_create (pthread_key_t *, void (*) (void *)) __THROW;
+
+extern int pthread_setspecific (pthread_key_t, const void *) __THROW;
+
+extern void *pthread_getspecific (pthread_key_t) __THROW;
+
+extern int pthread_mutex_lock (pthread_mutex_t *) __THROW;
+
+extern int pthread_key_delete (pthread_key_t) __THROW;
+
+extern int pthread_mutex_trylock (pthread_mutex_t *) __THROW;
+
+extern int pthread_mutex_unlock (pthread_mutex_t *) __THROW;
+
+#ifdef __cplusplus
+}
+#endif
+
+#undef __THROW
+
+#endif /* not _PTHREAD_FAKE */
Index: src/newlib/libc/machine/cris/sys/errno.h
diff -u /dev/null src/newlib/libc/machine/cris/sys/errno.h:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/sys/errno.h	Thu Jan 27 23:54:46 2005
@@ -0,0 +1,166 @@
+/* This file is to be kept in sync with newlib/libc/include/sys/errno.h
+   on which it is based, except values used or returned by syscalls must
+   be those of the Linux/CRIS kernel.  */
+
+/* errno is not a global variable, because that would make using it
+   non-reentrant.  Instead, its address is returned by the function
+   __errno.  */
+
+#ifndef _SYS_ERRNO_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define _SYS_ERRNO_H_
+
+#include <sys/reent.h>
+
+#ifndef _REENT_ONLY
+#define errno (*__errno())
+extern int *__errno _PARAMS ((void));
+#endif
+
+/* Please don't use these variables directly.
+   Use strerror instead. */
+extern _CONST char * _CONST _sys_errlist[];
+extern int _sys_nerr;
+
+#define __errno_r(ptr) ((ptr)->_errno)
+
+/* Adjusted to the linux asm/errno.h */
+#define	EPERM		 1	/* Operation not permitted */
+#define	ENOENT		 2	/* No such file or directory */
+#define	ESRCH		 3	/* No such process */
+#define	EINTR		 4	/* Interrupted system call */
+#define	EIO		 5	/* I/O error */
+#define	ENXIO		 6	/* No such device or address */
+#define	E2BIG		 7	/* Arg list too long */
+#define	ENOEXEC		 8	/* Exec format error */
+#define	EBADF		 9	/* Bad file number */
+#define	ECHILD		10	/* No child processes */
+#define	EAGAIN		11	/* Try again */
+#define	ENOMEM		12	/* Out of memory */
+#define	EACCES		13	/* Permission denied */
+#define	EFAULT		14	/* Bad address */
+#define	ENOTBLK		15	/* Block device required */
+#define	EBUSY		16	/* Device or resource busy */
+#define	EEXIST		17	/* File exists */
+#define	EXDEV		18	/* Cross-device link */
+#define	ENODEV		19	/* No such device */
+#define	ENOTDIR		20	/* Not a directory */
+#define	EISDIR		21	/* Is a directory */
+#define	EINVAL		22	/* Invalid argument */
+#define	ENFILE		23	/* File table overflow */
+#define	EMFILE		24	/* Too many open files */
+#define	ENOTTY		25	/* Not a typewriter */
+#define	ETXTBSY		26	/* Text file busy */
+#define	EFBIG		27	/* File too large */
+#define	ENOSPC		28	/* No space left on device */
+#define	ESPIPE		29	/* Illegal seek */
+#define	EROFS		30	/* Read-only file system */
+#define	EMLINK		31	/* Too many links */
+#define	EPIPE		32	/* Broken pipe */
+#define	EDOM		33	/* Math argument out of domain of func */
+#define	ERANGE		34	/* Math result not representable */
+#define	EDEADLK		35	/* Resource deadlock would occur */
+#define	ENAMETOOLONG	36	/* File name too long */
+#define	ENOLCK		37	/* No record locks available */
+#define	ENOSYS		38	/* Function not implemented */
+#define	ENOTEMPTY	39	/* Directory not empty */
+#define	ELOOP		40	/* Too many symbolic links encountered */
+#define	EWOULDBLOCK	EAGAIN	/* Operation would block */
+#define	ENOMSG		42	/* No message of desired type */
+#define	EIDRM		43	/* Identifier removed */
+#define	ECHRNG		44	/* Channel number out of range */
+#define	EL2NSYNC	45	/* Level 2 not synchronized */
+#define	EL3HLT		46	/* Level 3 halted */
+#define	EL3RST		47	/* Level 3 reset */
+#define	ELNRNG		48	/* Link number out of range */
+#define	EUNATCH		49	/* Protocol driver not attached */
+#define	ENOCSI		50	/* No CSI structure available */
+#define	EL2HLT		51	/* Level 2 halted */
+#define	EBADE		52	/* Invalid exchange */
+#define	EBADR		53	/* Invalid request descriptor */
+#define	EXFULL		54	/* Exchange full */
+#define	ENOANO		55	/* No anode */
+#define	EBADRQC		56	/* Invalid request code */
+#define	EBADSLT		57	/* Invalid slot */
+
+#define	EDEADLOCK	EDEADLK
+
+#define	EBFONT		59	/* Bad font file format */
+/* This is only used internally in newlib; not returned by the kernel.
+   EBFONT seems the closest match for a "bad file format" error.  */
+#define EFTYPE		EBFONT	/* Inappropriate file type or format */
+#define	ENOSTR		60	/* Device not a stream */
+#define	ENODATA		61	/* No data available */
+#define	ETIME		62	/* Timer expired */
+#define	ENOSR		63	/* Out of streams resources */
+#define	ENONET		64	/* Machine is not on the network */
+#define	ENOPKG		65	/* Package not installed */
+#define	EREMOTE		66	/* Object is remote */
+#define	ENOLINK		67	/* Link has been severed */
+#define	EADV		68	/* Advertise error */
+#define	ESRMNT		69	/* Srmount error */
+#define	ECOMM		70	/* Communication error on send */
+#define	EPROTO		71	/* Protocol error */
+#define	EMULTIHOP	72	/* Multihop attempted */
+#define	EDOTDOT		73	/* RFS specific error */
+#define	EBADMSG		74	/* Not a data message */
+#define	EOVERFLOW	75	/* Value too large for defined data type */
+#define	ENOTUNIQ	76	/* Name not unique on network */
+#define	EBADFD		77	/* File descriptor in bad state */
+#define	EREMCHG		78	/* Remote address changed */
+#define	ELIBACC		79	/* Can not access a needed shared library */
+#define	ELIBBAD		80	/* Accessing a corrupted shared library */
+#define	ELIBSCN		81	/* .lib section in a.out corrupted */
+#define	ELIBMAX		82	/* Attempting to link in too many shared libraries */
+#define	ELIBEXEC	83	/* Cannot exec a shared library directly */
+#define	EILSEQ		84	/* Illegal byte sequence */
+#define	ERESTART	85	/* Interrupted system call should be restarted */
+#define	ESTRPIPE	86	/* Streams pipe error */
+#define	EUSERS		87	/* Too many users */
+#define	ENOTSOCK	88	/* Socket operation on non-socket */
+#define	EDESTADDRREQ	89	/* Destination address required */
+#define	EMSGSIZE	90	/* Message too long */
+#define	EPROTOTYPE	91	/* Protocol wrong type for socket */
+#define	ENOPROTOOPT	92	/* Protocol not available */
+#define	EPROTONOSUPPORT	93	/* Protocol not supported */
+#define	ESOCKTNOSUPPORT	94	/* Socket type not supported */
+#define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
+#define	EPFNOSUPPORT	96	/* Protocol family not supported */
+#define	EAFNOSUPPORT	97	/* Address family not supported by protocol */
+#define	EADDRINUSE	98	/* Address already in use */
+#define	EADDRNOTAVAIL	99	/* Cannot assign requested address */
+#define	ENETDOWN	100	/* Network is down */
+#define	ENETUNREACH	101	/* Network is unreachable */
+#define	ENETRESET	102	/* Network dropped connection because of reset */
+#define	ECONNABORTED	103	/* Software caused connection abort */
+#define	ECONNRESET	104	/* Connection reset by peer */
+#define	ENOBUFS		105	/* No buffer space available */
+#define	EISCONN		106	/* Transport endpoint is already connected */
+#define	ENOTCONN	107	/* Transport endpoint is not connected */
+#define	ESHUTDOWN	108	/* Cannot send after transport endpoint shutdown */
+#define	ETOOMANYREFS	109	/* Too many references: cannot splice */
+#define	ETIMEDOUT	110	/* Connection timed out */
+#define	ECONNREFUSED	111	/* Connection refused */
+#define	EHOSTDOWN	112	/* Host is down */
+#define	EHOSTUNREACH	113	/* No route to host */
+#define	EALREADY	114	/* Operation already in progress */
+#define	EINPROGRESS	115	/* Operation now in progress */
+#define	ESTALE		116	/* Stale NFS file handle */
+#define	EUCLEAN		117	/* Structure needs cleaning */
+#define	ENOTNAM		118	/* Not a XENIX named type file */
+#define	ENAVAIL		119	/* No XENIX semaphores available */
+#define	EISNAM		120	/* Is a named type file */
+#define	EREMOTEIO	121	/* Remote I/O error */
+#define	EDQUOT		122	/* Quota exceeded */
+
+#define	ENOMEDIUM	123	/* No medium found */
+#define	EMEDIUMTYPE	124	/* Wrong medium type */
+
+#define __ELASTERROR 2000	/* Users can add values starting here */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _SYS_ERRNO_H */
Index: src/newlib/libc/machine/cris/sys/fcntl.h
diff -u /dev/null src/newlib/libc/machine/cris/sys/fcntl.h:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/sys/fcntl.h	Thu Jan 27 23:54:46 2005
@@ -0,0 +1,163 @@
+/* This file is to be kept in sync with newlib/libc/include/sys/fcntl.h,
+   on which it is based, except values used or returned by syscalls must
+   be those of the Linux/CRIS kernel.  */
+
+#ifndef	_FCNTL_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define	_FCNTL_
+#include <_ansi.h>
+#define	_FOPEN		(-1)	/* from sys/file.h, kernel use only */
+#define	_FREAD		0x0001	/* read enabled */
+#define	_FWRITE		0x0002	/* write enabled */
+#define	_FNDELAY	0x0800	/* non blocking I/O (4.2 style) */
+#define	_FAPPEND	0x0400	/* append (writes guaranteed at the end) */
+#define	_FMARK		0x0010	/* internal; mark during gc() */
+#define	_FDEFER		0x0020	/* internal; defer for next gc pass */
+#define	_FASYNC		0x2000	/* signal pgrp when data ready */
+#define	_FCREAT		0x0040	/* open with file create */
+#define	_FTRUNC		0x0200	/* open with truncation */
+#define	_FEXCL		0x0080	/* error on open if file exists */
+#define	_FNBIO	    _FNONBLOCK	/* non blocking I/O (sys5 style) */
+#define	_FSYNC		0x1000	/* do all writes synchronously */
+#define	_FNONBLOCK	0x0800	/* non blocking I/O (POSIX style) */
+#define	_FNOCTTY	0x0100	/* don't assign a ctty on this open */
+
+#define	O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
+
+/*
+ * Flag values for open(2) and fcntl(2)
+ * The kernel adds 1 to the open modes to turn it into some
+ * combination of FREAD and FWRITE.
+ */
+#define	O_RDONLY	0		/* +1 == FREAD */
+#define	O_WRONLY	1		/* +1 == FWRITE */
+#define	O_RDWR		2		/* +1 == FREAD|FWRITE */
+#define	O_APPEND	_FAPPEND
+#define	O_CREAT		_FCREAT
+#define	O_TRUNC		_FTRUNC
+#define	O_EXCL		_FEXCL
+/*	O_SYNC		_FSYNC		not posix, defined below */
+/*	O_NDELAY	_FNDELAY 	set in include/fcntl.h */
+/*	O_NDELAY	_FNBIO 		set in 5include/fcntl.h */
+#define	O_NONBLOCK	_FNONBLOCK
+#define	O_NOCTTY	_FNOCTTY
+
+#ifndef	_POSIX_SOURCE
+
+#define	O_SYNC		_FSYNC
+
+/*
+ * Flags that work for fcntl(fd, F_SETFL, FXXXX)
+ */
+#define	FAPPEND		_FAPPEND
+#define	FSYNC		_FSYNC
+#define	FASYNC		_FASYNC
+#define	FNBIO		_FNBIO
+#define	FNONBIO		_FNONBLOCK	/* XXX fix to be NONBLOCK everywhere */
+#define	FNDELAY		_FNDELAY
+
+/*
+ * Flags that are disallowed for fcntl's (FCNTLCANT);
+ * used for opens, internal state, or locking.
+ */
+#define	FREAD		_FREAD
+#define	FWRITE		_FWRITE
+#define	FMARK		_FMARK
+#define	FDEFER		_FDEFER
+#define	FSHLOCK		_FSHLOCK
+#define	FEXLOCK		_FEXLOCK
+
+/*
+ * The rest of the flags, used only for opens
+ */
+#define	FOPEN		_FOPEN
+#define	FCREAT		_FCREAT
+#define	FTRUNC		_FTRUNC
+#define	FEXCL		_FEXCL
+#define	FNOCTTY		_FNOCTTY
+
+#endif	/* !_POSIX_SOURCE */
+
+/* XXX close on exec request; must match UF_EXCLOSE in user.h */
+#define	FD_CLOEXEC	1	/* posix */
+
+/* fcntl(2) requests */
+#define F_DUPFD		0	/* dup */
+#define F_GETFD		1	/* get f_flags */
+#define F_SETFD		2	/* set f_flags */
+#define F_GETFL		3	/* more flags (cloexec) */
+#define F_SETFL		4
+#define F_GETLK		5
+#define F_SETLK		6
+#define F_SETLKW	7
+
+#define F_SETOWN	8	/*  for sockets. */
+#define F_GETOWN	9	/*  for sockets. */
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK		0
+#define F_WRLCK		1
+#define F_UNLCK		2
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK		4	/* or 3 */
+#define F_SHLCK		8	/* or 4 */
+
+/* operations for bsd flock(), also used by the kernel implementation */
+#define LOCK_SH		1	/* shared lock */
+#define LOCK_EX		2	/* exclusive lock */
+#define LOCK_NB		4	/* or'd with one of the above to prevent
+				   blocking */
+#define LOCK_UN		8	/* remove lock */
+
+/* file segment locking set data type - information passed to system by user */
+struct flock {
+	short	l_type;		/* F_RDLCK, F_WRLCK, or F_UNLCK */
+	short	l_whence;	/* flag to choose starting offset */
+	long	l_start;	/* relative offset, in bytes */
+	long	l_len;		/* length, in bytes; 0 means lock to EOF */
+	short	l_pid;		/* returned with F_GETLK */
+	short	l_xxx;		/* reserved for future use */
+};
+
+#ifndef	_POSIX_SOURCE
+/* extended file segment locking set data type */
+struct eflock {
+	short	l_type;		/* F_RDLCK, F_WRLCK, or F_UNLCK */
+	short	l_whence;	/* flag to choose starting offset */
+	long	l_start;	/* relative offset, in bytes */
+	long	l_len;		/* length, in bytes; 0 means lock to EOF */
+	short	l_pid;		/* returned with F_GETLK */
+	short	l_xxx;		/* reserved for future use */
+	long	l_rpid;		/* Remote process id wanting this lock */
+	long	l_rsys;		/* Remote system id wanting this lock */
+};
+#endif	/* !_POSIX_SOURCE */
+
+
+#include <sys/types.h>
+#include <sys/stat.h>		/* sigh. for the mode bits for open/creat */
+
+extern int open _PARAMS ((const char *, int, ...));
+extern int creat _PARAMS ((const char *, mode_t));
+extern int fcntl _PARAMS ((int, int, ...));
+
+/* Provide _<systemcall> prototypes for functions provided by some versions
+   of newlib.  */
+#ifdef _COMPILING_NEWLIB
+extern int _open _PARAMS ((const char *, int, ...));
+extern int _fcntl _PARAMS ((int, int, ...));
+#ifdef __LARGE64_FILES
+extern int _open64 _PARAMS ((const char *, int, ...));
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif	/* !_FCNTL_ */
Index: src/newlib/libc/machine/cris/sys/signal.h
diff -u /dev/null src/newlib/libc/machine/cris/sys/signal.h:1.1
--- /dev/null	Thu May 12 14:25:18 2005
+++ src/newlib/libc/machine/cris/sys/signal.h	Thu Jan 27 23:54:46 2005
@@ -0,0 +1,89 @@
+/* This file is to be kept in sync (well, reasonably so, it's quite
+   different) with newlib/libc/include/sys/signal.h on which it is
+   based, except values used or returned by syscalls must be those of
+   the Linux/CRIS kernel.  */
+
+/* sys/signal.h */
+
+#ifndef _SYS_SIGNAL_H
+#define _SYS_SIGNAL_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "_ansi.h"
+
+typedef unsigned long sigset_t;
+
+/* Adjusted to linux, has unused sa_restorer field and unsigned long
+   sa_flags; relatively unimportant though.  */
+/* Type of a signal handler.  */
+typedef void (*__sighandler_t)(int);
+
+/* The type used in newlib sources.  */
+typedef __sighandler_t _sig_func_ptr;
+
+struct sigaction {
+	__sighandler_t sa_handler;
+	sigset_t sa_mask;
+	unsigned long sa_flags;
+	void (*sa_restorer)(void);
+};
+
+/* Adjusted to glibc; other values.  */
+#define SA_NOCLDSTOP 1	/* only value supported now for sa_flags */
+#define SIG_SETMASK 2	/* set mask with sigprocmask() */
+#define SIG_BLOCK 0	/* set of signals to block */
+#define SIG_UNBLOCK 1	/* set of signals to, well, unblock */
+
+/* These depend upon the type of sigset_t, which right now
+   is always a long.. They're in the POSIX namespace, but
+   are not ANSI. */
+#define sigaddset(what,sig) (*(what) |= (1<<(sig)))
+#define sigemptyset(what)   (*(what) = 0)
+
+int sigprocmask (int __how, const sigset_t *__a, sigset_t *__b);
+
+#define SIGHUP		 1
+#define SIGINT		 2
+#define SIGQUIT		 3
+#define SIGILL		 4
+#define SIGTRAP		 5
+#define SIGABRT		 6
+#define SIGIOT		 6
+#define SIGBUS		 7
+#define SIGFPE		 8
+#define SIGKILL		 9
+#define SIGUSR1		10
+#define SIGSEGV		11
+#define SIGUSR2		12
+#define SIGPIPE		13
+#define SIGALRM		14
+#define SIGTERM		15
+#define SIGSTKFLT	16
+#define SIGCHLD		17
+#define SIGCONT		18
+#define SIGSTOP		19
+#define SIGTSTP		20
+#define SIGTTIN		21
+#define SIGTTOU		22
+#define SIGURG		23
+#define SIGXCPU		24
+#define SIGXFSZ		25
+#define SIGVTALRM	26
+#define SIGPROF		27
+#define SIGWINCH	28
+#define SIGIO		29
+#define SIGPOLL		SIGIO
+#define SIGPWR		30
+#define	NSIG 31
+
+#ifdef __cplusplus
+}
+#endif
+#ifndef _SIGNAL_H_
+/* Some applications take advantage of the fact that <sys/signal.h>
+ * and <signal.h> are equivalent in glibc.  Allow for that here.  */
+#include <signal.h>
+#endif
+#endif /* _SYS_SIGNAL_H */
Index: src/newlib/libc/machine/powerpc/vfprintf.c
diff -u src/newlib/libc/machine/powerpc/vfprintf.c:1.9 src/newlib/libc/machine/powerpc/vfprintf.c:1.11
--- src/newlib/libc/machine/powerpc/vfprintf.c:1.9	Wed May 26 00:19:14 2004
+++ src/newlib/libc/machine/powerpc/vfprintf.c	Tue Feb  8 01:33:16 2005
@@ -135,7 +135,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /*static char *sccsid = "from: @(#)vfprintf.c	5.50 (Berkeley) 12/16/92";*/
-static char *rcsid = "$Id: vfprintf.c,v 1.9 2004/05/26 00:19:14 jjohnstn Exp $";
+static char *rcsid = "$Id: vfprintf.c,v 1.11 2005/02/08 01:33:16 jjohnstn Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -239,7 +239,6 @@
 	unsigned char buf[BUFSIZ];
 
 	/* copy the important variables */
-	fake._data = fp->_data;
 	fake._flags = fp->_flags & ~__SNBF;
 	fake._file = fp->_file;
 	fake._cookie = fp->_cookie;
@@ -322,8 +321,8 @@
 	_CONST char *fmt0 _AND
 	va_list ap)
 {
-  CHECK_INIT (fp);
-  return _VFPRINTF_R (fp->_data, fp, fmt0, ap);
+  CHECK_INIT (_REENT);
+  return _VFPRINTF_R (_REENT, fp, fmt0, ap);
 }
 
 int 
Index: src/newlib/libc/machine/powerpc/vfscanf.c
diff -u src/newlib/libc/machine/powerpc/vfscanf.c:1.14 src/newlib/libc/machine/powerpc/vfscanf.c:1.15
--- src/newlib/libc/machine/powerpc/vfscanf.c:1.14	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/machine/powerpc/vfscanf.c	Tue Feb  8 01:33:16 2005
@@ -224,8 +224,8 @@
     _CONST char *fmt _AND 
     va_list ap)
 {
-  CHECK_INIT(fp);
-  return __svfscanf_r (fp->_data, fp, fmt, ap);
+  CHECK_INIT(_REENT);
+  return __svfscanf_r (_REENT, fp, fmt, ap);
 }
 
 int
Index: src/newlib/libc/misc/Makefile.am
diff -u src/newlib/libc/misc/Makefile.am:1.2 src/newlib/libc/misc/Makefile.am:1.3
--- src/newlib/libc/misc/Makefile.am:1.2	Thu Dec 13 23:49:54 2001
+++ src/newlib/libc/misc/Makefile.am	Fri Jan  7 18:04:38 2005
@@ -4,7 +4,7 @@
 
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
-LIB_SOURCES = dprintf.c unctrl.c ffs.c
+LIB_SOURCES = dprintf.c unctrl.c ffs.c init.c
 
 libmisc_la_LDFLAGS = -Xcompiler -nostdlib
 
Index: src/newlib/libc/misc/Makefile.in
diff -u src/newlib/libc/misc/Makefile.in:1.8 src/newlib/libc/misc/Makefile.in:1.9
--- src/newlib/libc/misc/Makefile.in:1.8	Tue Jan 27 23:26:23 2004
+++ src/newlib/libc/misc/Makefile.in	Fri Jan  7 18:04:39 2005
@@ -110,7 +110,7 @@
 
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
-LIB_SOURCES = dprintf.c unctrl.c ffs.c
+LIB_SOURCES = dprintf.c unctrl.c ffs.c init.c
 
 libmisc_la_LDFLAGS = -Xcompiler -nostdlib
 
@@ -140,11 +140,12 @@
 LIBS = @LIBS@
 lib_a_LIBADD = 
 @USE_LIBTOOL_FALSE@lib_a_OBJECTS =  dprintf.$(OBJEXT) unctrl.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@ffs.$(OBJEXT)
+@USE_LIBTOOL_FALSE@ffs.$(OBJEXT) init.$(OBJEXT)
 LTLIBRARIES =  $(noinst_LTLIBRARIES)
 
 libmisc_la_LIBADD = 
-@USE_LIBTOOL_TRUE@libmisc_la_OBJECTS =  dprintf.lo unctrl.lo ffs.lo
+@USE_LIBTOOL_TRUE@libmisc_la_OBJECTS =  dprintf.lo unctrl.lo ffs.lo \
+@USE_LIBTOOL_TRUE@init.lo
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
Index: src/newlib/libc/misc/init.c
diff -u /dev/null src/newlib/libc/misc/init.c:1.1
--- /dev/null	Thu May 12 14:25:29 2005
+++ src/newlib/libc/misc/init.c	Fri Jan  7 18:04:39 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004 CodeSourcery, LLC
+ *
+ * Permission to use, copy, modify, and distribute this file
+ * for any purpose is hereby granted without fee, provided that
+ * the above copyright notice and this notice appears in all
+ * copies.
+ *
+ * This file is distributed WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/* Handle ELF .{pre_init,init,fini}_array sections.  */
+#include <sys/types.h>
+
+#ifdef HAVE_INITFINI_ARRAY
+
+/* These magic symbols are provided by the linker.  */
+extern void (*__preinit_array_start []) (void) __attribute__((weak));
+extern void (*__preinit_array_end []) (void) __attribute__((weak));
+extern void (*__init_array_start []) (void) __attribute__((weak));
+extern void (*__init_array_end []) (void) __attribute__((weak));
+extern void (*__fini_array_start []) (void) __attribute__((weak));
+extern void (*__fini_array_end []) (void) __attribute__((weak));
+
+extern void _init (void);
+extern void _fini (void);
+
+/* Iterate over all the init routines.  */
+void
+__libc_init_array (void)
+{
+  size_t count;
+  size_t i;
+
+  count = __preinit_array_end - __preinit_array_start;
+  for (i = 0; i < count; i++)
+    __preinit_array_start[i] ();
+
+  _init ();
+
+  count = __init_array_end - __init_array_start;
+  for (i = 0; i < count; i++)
+    __init_array_start[i] ();
+}
+
+/* Run all the cleanup routines.  */
+void
+__libc_fini_array (void)
+{
+  size_t count;
+  size_t i;
+  
+  count = __fini_array_end - __fini_array_start;
+  for (i = 0; i < count; i++)
+    __fini_array_start[i] ();
+
+  _fini ();
+}
+#endif
Index: src/newlib/libc/stdio/clearerr.c
diff -u src/newlib/libc/stdio/clearerr.c:1.3 src/newlib/libc/stdio/clearerr.c:1.4
--- src/newlib/libc/stdio/clearerr.c:1.3	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/clearerr.c	Tue Feb  8 01:33:16 2005
@@ -54,12 +54,17 @@
 
 #include <_ansi.h>
 #include <stdio.h>
+#include "local.h"
+
+/* A subroutine version of the macro clearerr.  */
+
 #undef	clearerr
 
 _VOID
 _DEFUN(clearerr, (fp),
        FILE * fp)
 {
+  CHECK_INIT(_REENT);
   _flockfile (fp);
   __sclearerr (fp);
   _funlockfile (fp);
Index: src/newlib/libc/stdio/fclose.c
diff -u src/newlib/libc/stdio/fclose.c:1.9 src/newlib/libc/stdio/fclose.c:1.10
--- src/newlib/libc/stdio/fclose.c:1.9	Fri Jun 11 20:37:10 2004
+++ src/newlib/libc/stdio/fclose.c	Tue Feb  8 01:33:16 2005
@@ -76,10 +76,10 @@
 
   __sfp_lock_acquire ();
 
+  CHECK_INIT (rptr);
+
   _flockfile (fp);
   
-  CHECK_INIT (fp);
-
   if (fp->_flags == 0)		/* not open! */
     {
       _funlockfile (fp);
Index: src/newlib/libc/stdio/feof.c
diff -u src/newlib/libc/stdio/feof.c:1.3 src/newlib/libc/stdio/feof.c:1.4
--- src/newlib/libc/stdio/feof.c:1.3	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/feof.c	Tue Feb  8 01:33:16 2005
@@ -46,6 +46,9 @@
 */
 
 #include <stdio.h>
+#include "local.h"
+
+/* A subroutine version of the macro feof.  */
 
 #undef feof
 
@@ -54,6 +57,7 @@
        FILE * fp)
 {
   int result;
+  CHECK_INIT(_REENT);
   _flockfile (fp);
   result = __sfeof (fp);
   _funlockfile (fp);
Index: src/newlib/libc/stdio/ferror.c
diff -u src/newlib/libc/stdio/ferror.c:1.3 src/newlib/libc/stdio/ferror.c:1.4
--- src/newlib/libc/stdio/ferror.c:1.3	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/ferror.c	Tue Feb  8 01:33:16 2005
@@ -55,6 +55,7 @@
 
 #include <_ansi.h>
 #include <stdio.h>
+#include "local.h"
 
 /* A subroutine version of the macro ferror.  */
 
@@ -65,6 +66,7 @@
        FILE * fp)
 {
   int result;
+  CHECK_INIT(_REENT);
   _flockfile (fp);
   result = __sferror (fp);
   _funlockfile (fp);
Index: src/newlib/libc/stdio/fflush.c
diff -u src/newlib/libc/stdio/fflush.c:1.4 src/newlib/libc/stdio/fflush.c:1.5
--- src/newlib/libc/stdio/fflush.c:1.4	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/fflush.c	Tue Feb  8 01:33:16 2005
@@ -67,9 +67,9 @@
   if (fp == NULL)
     return _fwalk (_GLOBAL_REENT, fflush);
 
-  _flockfile (fp);
+  CHECK_INIT (_REENT);
 
-  CHECK_INIT (fp);
+  _flockfile (fp);
 
   t = fp->_flags;
   if ((t & __SWR) == 0 || (p = fp->_bf._base) == NULL)
Index: src/newlib/libc/stdio/fgetc.c
diff -u src/newlib/libc/stdio/fgetc.c:1.3 src/newlib/libc/stdio/fgetc.c:1.4
--- src/newlib/libc/stdio/fgetc.c:1.3	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/fgetc.c	Tue Feb  8 01:33:16 2005
@@ -55,12 +55,14 @@
 
 #include <_ansi.h>
 #include <stdio.h>
+#include "local.h"
 
 int
 _DEFUN(fgetc, (fp),
        FILE * fp)
 {
   int result;
+  CHECK_INIT(_REENT);
   _flockfile (fp);
   result = __sgetc (fp);
   _funlockfile (fp);
Index: src/newlib/libc/stdio/fgetpos.c
diff -u src/newlib/libc/stdio/fgetpos.c:1.5 src/newlib/libc/stdio/fgetpos.c:1.6
--- src/newlib/libc/stdio/fgetpos.c:1.5	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/fgetpos.c	Tue Feb  8 01:33:16 2005
@@ -81,15 +81,12 @@
        FILE * fp           _AND
        _fpos_t * pos)
 {
-  _flockfile (fp);
   *pos = _ftell_r (ptr, fp);
 
   if (*pos != -1)
     {
-      _funlockfile (fp);
       return 0;
     }
-  _funlockfile (fp);
   return 1;
 }
 
Index: src/newlib/libc/stdio/fgets.c
diff -u src/newlib/libc/stdio/fgets.c:1.4 src/newlib/libc/stdio/fgets.c:1.5
--- src/newlib/libc/stdio/fgets.c:1.4	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/fgets.c	Tue Feb  8 01:33:16 2005
@@ -80,6 +80,8 @@
 
   s = buf;
 
+  CHECK_INIT(_REENT);
+
   _flockfile (fp);
 #ifdef __SCLE
   if (fp->_flags & __SCLE)
Index: src/newlib/libc/stdio/fileno.c
diff -u src/newlib/libc/stdio/fileno.c:1.3 src/newlib/libc/stdio/fileno.c:1.4
--- src/newlib/libc/stdio/fileno.c:1.3	Fri Apr 23 20:01:54 2004
+++ src/newlib/libc/stdio/fileno.c	Tue Feb  8 01:33:16 2005
@@ -54,8 +54,8 @@
        FILE * f)
 {
   int result;
+  CHECK_INIT (_REENT);
   _flockfile (f);
-  CHECK_INIT (f);
   result = __sfileno (f);
   _funlockfile (f);
   return result;
Index: src/newlib/libc/stdio/findfp.c
diff -u src/newlib/libc/stdio/findfp.c:1.15 src/newlib/libc/stdio/findfp.c:1.16
--- src/newlib/libc/stdio/findfp.c:1.15	Fri Jun 11 20:37:10 2004
+++ src/newlib/libc/stdio/findfp.c	Tue Feb  8 01:05:50 2005
@@ -163,6 +163,14 @@
 _DEFUN(__sinit, (s),
        struct _reent *s)
 {
+  __sinit_lock_acquire ();
+
+  if (s->__sdidinit)
+    {
+      __sinit_lock_release ();
+      return;
+    }
+
   /* make sure we clean up on exit */
   s->__cleanup = _cleanup_r;	/* conservative */
   s->__sdidinit = 1;
@@ -192,11 +200,13 @@
 
   std (s->_stderr, __SWR | __SNBF, 2, s);
 
+  __sinit_lock_release ();
 }
 
 #ifndef __SINGLE_THREAD__
 
 __LOCK_INIT_RECURSIVE(static, __sfp_lock);
+__LOCK_INIT_RECURSIVE(static, __sinit_lock);
 
 _VOID
 _DEFUN_VOID(__sfp_lock_acquire)
@@ -210,6 +220,18 @@
   __lock_release_recursive (__sfp_lock); 
 }
 
+_VOID
+_DEFUN_VOID(__sinit_lock_acquire)
+{
+  __lock_acquire_recursive (__sinit_lock); 
+}
+
+_VOID
+_DEFUN_VOID(__sinit_lock_release)
+{
+  __lock_release_recursive (__sinit_lock); 
+}
+
 /* Walkable file locking routine.  */
 static int
 _DEFUN(__fp_lock, (ptr),
Index: src/newlib/libc/stdio/fputc.c
diff -u src/newlib/libc/stdio/fputc.c:1.3 src/newlib/libc/stdio/fputc.c:1.4
--- src/newlib/libc/stdio/fputc.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/fputc.c	Tue Feb  8 01:33:16 2005
@@ -59,6 +59,7 @@
 
 #include <_ansi.h>
 #include <stdio.h>
+#include "local.h"
 
 int
 _DEFUN(fputc, (ch, file),
@@ -66,6 +67,7 @@
        FILE * file)
 {
   int result;
+  CHECK_INIT(_REENT);
    _flockfile (file);
   result = putc (ch, file);
   _funlockfile (file);
Index: src/newlib/libc/stdio/fputs.c
diff -u src/newlib/libc/stdio/fputs.c:1.3 src/newlib/libc/stdio/fputs.c:1.4
--- src/newlib/libc/stdio/fputs.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/fputs.c	Tue Feb  8 01:33:16 2005
@@ -51,6 +51,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "fvwrite.h"
+#include "local.h"
 
 /*
  * Write the given string to the given file.
@@ -69,6 +70,9 @@
   iov.iov_len = uio.uio_resid = strlen (s);
   uio.uio_iov = &iov;
   uio.uio_iovcnt = 1;
+
+  CHECK_INIT(_REENT);
+
   _flockfile (fp);
   result = __sfvwrite (fp, &uio);
   _funlockfile (fp);
Index: src/newlib/libc/stdio/fread.c
diff -u src/newlib/libc/stdio/fread.c:1.9 src/newlib/libc/stdio/fread.c:1.10
--- src/newlib/libc/stdio/fread.c:1.9	Mon Dec 13 19:42:16 2004
+++ src/newlib/libc/stdio/fread.c	Tue Feb  8 01:33:16 2005
@@ -125,6 +125,8 @@
   if ((resid = count * size) == 0)
     return 0;
 
+  CHECK_INIT(_REENT);
+
   _flockfile (fp);
   if (fp->_r < 0)
     fp->_r = 0;
Index: src/newlib/libc/stdio/freopen.c
diff -u src/newlib/libc/stdio/freopen.c:1.11 src/newlib/libc/stdio/freopen.c:1.12
--- src/newlib/libc/stdio/freopen.c:1.11	Fri Jun 11 20:37:10 2004
+++ src/newlib/libc/stdio/freopen.c	Tue Feb  8 01:33:16 2005
@@ -91,9 +91,9 @@
 
   __sfp_lock_acquire ();
 
-  _flockfile (fp);
+  CHECK_INIT (ptr);
 
-  CHECK_INIT (fp);
+  _flockfile (fp);
 
   if ((flags = __sflags (ptr, mode, &oflags)) == 0)
     {
Index: src/newlib/libc/stdio/fseek.c
diff -u src/newlib/libc/stdio/fseek.c:1.10 src/newlib/libc/stdio/fseek.c:1.11
--- src/newlib/libc/stdio/fseek.c:1.10	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/fseek.c	Tue Feb  8 01:33:16 2005
@@ -129,11 +129,11 @@
   struct stat st;
   int havepos;
 
-  _flockfile (fp);
-
   /* Make sure stdio is set up.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (ptr);
+
+  _flockfile (fp);
 
   /* If we've been doing some writing, and we're in append mode
      then we don't really know where the filepos is.  */
Index: src/newlib/libc/stdio/ftell.c
diff -u src/newlib/libc/stdio/ftell.c:1.7 src/newlib/libc/stdio/ftell.c:1.9
--- src/newlib/libc/stdio/ftell.c:1.7	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/ftell.c	Tue Feb  8 01:33:16 2005
@@ -105,11 +105,11 @@
 {
   _fpos_t pos;
 
-  _flockfile (fp);
-
   /* Ensure stdio is set up.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (ptr);
+
+  _flockfile (fp);
 
   if (fp->_seek == NULL)
     {
@@ -143,7 +143,7 @@
       if (HASUB (fp))
 	pos -= fp->_ur;
     }
-  else if (fp->_flags & __SWR && fp->_p != NULL)
+  else if ((fp->_flags & __SWR) && fp->_p != NULL)
     {
       /*
        * Writing.  Any buffered characters cause the
Index: src/newlib/libc/stdio/fwrite.c
diff -u src/newlib/libc/stdio/fwrite.c:1.3 src/newlib/libc/stdio/fwrite.c:1.4
--- src/newlib/libc/stdio/fwrite.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/fwrite.c	Tue Feb  8 01:33:16 2005
@@ -99,6 +99,8 @@
    * generally slow and since this occurs whenever size==0.
    */
 
+  CHECK_INIT(_REENT);
+
   _flockfile (fp);
   if (__sfvwrite (fp, &uio) == 0)
     {
Index: src/newlib/libc/stdio/getc.c
diff -u src/newlib/libc/stdio/getc.c:1.3 src/newlib/libc/stdio/getc.c:1.4
--- src/newlib/libc/stdio/getc.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/getc.c	Tue Feb  8 01:33:16 2005
@@ -64,6 +64,7 @@
 
 #include <_ansi.h>
 #include <stdio.h>
+#include "local.h"
 
 /*
  * A subroutine version of the macro getc.
@@ -76,8 +77,8 @@
        register FILE *fp)
 {
   int result;
+  CHECK_INIT (_REENT);
   _flockfile (fp);
-  /* CHECK_INIT is called (eventually) by __srefill.  */
   result = __sgetc (fp);
   _funlockfile (fp);
   return result;
Index: src/newlib/libc/stdio/getchar.c
diff -u src/newlib/libc/stdio/getchar.c:1.3 src/newlib/libc/stdio/getchar.c:1.4
--- src/newlib/libc/stdio/getchar.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/getchar.c	Tue Feb  8 01:33:16 2005
@@ -82,7 +82,7 @@
 _DEFUN(_getchar_r, (f),
        struct _reent *f)
 {
-  _REENT_SMALL_CHECK_INIT (_stdin_r (f));
+  _REENT_SMALL_CHECK_INIT (f);
   return getc (_stdin_r (f));
 }
 
Index: src/newlib/libc/stdio/getdelim.c
diff -u src/newlib/libc/stdio/getdelim.c:1.3 src/newlib/libc/stdio/getdelim.c:1.4
--- src/newlib/libc/stdio/getdelim.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/getdelim.c	Tue Feb  8 01:33:17 2005
@@ -79,9 +79,9 @@
       *n = DEFAULT_LINE_SIZE;
     }
 
-  _flockfile (fp);
+  CHECK_INIT (_REENT);
 
-  CHECK_INIT (fp);
+  _flockfile (fp);
 
   numbytes = *n;
   ptr = buf;
Index: src/newlib/libc/stdio/iprintf.c
diff -u src/newlib/libc/stdio/iprintf.c:1.6 src/newlib/libc/stdio/iprintf.c:1.7
--- src/newlib/libc/stdio/iprintf.c:1.6	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/stdio/iprintf.c	Tue Feb  8 01:33:17 2005
@@ -40,7 +40,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdout_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
@@ -67,7 +67,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
Index: src/newlib/libc/stdio/iscanf.c
diff -u src/newlib/libc/stdio/iscanf.c:1.1 src/newlib/libc/stdio/iscanf.c:1.2
--- src/newlib/libc/stdio/iscanf.c:1.1	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/stdio/iscanf.c	Tue Feb  8 01:33:17 2005
@@ -39,7 +39,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdin_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
@@ -65,7 +65,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdin_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
Index: src/newlib/libc/stdio/local.h
diff -u src/newlib/libc/stdio/local.h:1.14 src/newlib/libc/stdio/local.h:1.16
--- src/newlib/libc/stdio/local.h:1.14	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/stdio/local.h	Tue Feb  8 01:33:17 2005
@@ -49,11 +49,11 @@
 
 /* Called by the main entry point fns to ensure stdio has been initialized.  */
 
-#define CHECK_INIT(fp) \
+#define CHECK_INIT(ptr) \
   do						\
     {						\
-      if (_REENT && !_REENT->__sdidinit)	\
-	__sinit (_REENT);			\
+      if ((ptr) && !(ptr)->__sdidinit)		\
+	__sinit (ptr);				\
     }						\
   while (0)
 
@@ -95,7 +95,11 @@
 #ifdef __SINGLE_THREAD__
 #define __sfp_lock_acquire()
 #define __sfp_lock_release()
+#define __sinit_lock_acquire()
+#define __sinit_lock_release()
 #else
 _VOID _EXFUN(__sfp_lock_acquire,(_VOID));
 _VOID _EXFUN(__sfp_lock_release,(_VOID));
+_VOID _EXFUN(__sinit_lock_acquire,(_VOID));
+_VOID _EXFUN(__sinit_lock_release,(_VOID));
 #endif
Index: src/newlib/libc/stdio/perror.c
diff -u src/newlib/libc/stdio/perror.c:1.3 src/newlib/libc/stdio/perror.c:1.4
--- src/newlib/libc/stdio/perror.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/perror.c	Tue Feb  8 01:33:17 2005
@@ -74,7 +74,7 @@
 {
   char *error;
 
-  _REENT_SMALL_CHECK_INIT (_stderr_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   if (s != NULL && *s != '\0')
     {
       fputs (s, _stderr_r (ptr));
Index: src/newlib/libc/stdio/printf.c
diff -u src/newlib/libc/stdio/printf.c:1.4 src/newlib/libc/stdio/printf.c:1.5
--- src/newlib/libc/stdio/printf.c:1.4	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/printf.c	Tue Feb  8 01:33:17 2005
@@ -39,7 +39,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
@@ -65,7 +65,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdout_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
Index: src/newlib/libc/stdio/putc.c
diff -u src/newlib/libc/stdio/putc.c:1.3 src/newlib/libc/stdio/putc.c:1.4
--- src/newlib/libc/stdio/putc.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/putc.c	Tue Feb  8 01:33:17 2005
@@ -67,6 +67,7 @@
 
 #include <_ansi.h>
 #include <stdio.h>
+#include "local.h"
 
 /*
  * A subroutine version of the macro putc.
@@ -80,8 +81,8 @@
        register FILE *fp)
 {
   int result;
+  CHECK_INIT (_REENT);
   _flockfile (fp);
-  /* CHECK_INIT is (eventually) called by __swbuf.  */
   result = __sputc (c, fp);
   _funlockfile (fp);
   return result;
Index: src/newlib/libc/stdio/putchar.c
diff -u src/newlib/libc/stdio/putchar.c:1.5 src/newlib/libc/stdio/putchar.c:1.6
--- src/newlib/libc/stdio/putchar.c:1.5	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/putchar.c	Tue Feb  8 01:33:17 2005
@@ -80,7 +80,7 @@
        struct _reent *ptr _AND
        int c)
 {
-  _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   return putc (c, _stdout_r (ptr));
 }
 
Index: src/newlib/libc/stdio/puts.c
diff -u src/newlib/libc/stdio/puts.c:1.3 src/newlib/libc/stdio/puts.c:1.4
--- src/newlib/libc/stdio/puts.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/puts.c	Tue Feb  8 01:33:17 2005
@@ -90,7 +90,7 @@
   uio.uio_iov = &iov[0];
   uio.uio_iovcnt = 2;
 
-  _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   return (__sfvwrite (_stdout_r (ptr), &uio) ? EOF : '\n');
 }
 
Index: src/newlib/libc/stdio/refill.c
diff -u src/newlib/libc/stdio/refill.c:1.5 src/newlib/libc/stdio/refill.c:1.6
--- src/newlib/libc/stdio/refill.c:1.5	Wed Nov 17 17:02:10 2004
+++ src/newlib/libc/stdio/refill.c	Tue Feb  8 01:33:17 2005
@@ -41,7 +41,7 @@
 {
   /* make sure stdio is set up */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (_REENT);
 
   fp->_r = 0;			/* largely a convenience for callers */
 
Index: src/newlib/libc/stdio/scanf.c
diff -u src/newlib/libc/stdio/scanf.c:1.5 src/newlib/libc/stdio/scanf.c:1.6
--- src/newlib/libc/stdio/scanf.c:1.5	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/scanf.c	Tue Feb  8 01:33:17 2005
@@ -39,7 +39,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdin_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
@@ -65,7 +65,7 @@
   int ret;
   va_list ap;
 
-  _REENT_SMALL_CHECK_INIT (_stdin_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
Index: src/newlib/libc/stdio/setvbuf.c
diff -u src/newlib/libc/stdio/setvbuf.c:1.4 src/newlib/libc/stdio/setvbuf.c:1.5
--- src/newlib/libc/stdio/setvbuf.c:1.4	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/setvbuf.c	Tue Feb  8 01:33:17 2005
@@ -104,9 +104,9 @@
 {
   int ret = 0;
 
-  _flockfile (fp);
+  CHECK_INIT (_REENT);
 
-  CHECK_INIT (fp);
+  _flockfile (fp);
 
   /*
    * Verify arguments.  The `int' limit on `size' is due to this
Index: src/newlib/libc/stdio/ungetc.c
diff -u src/newlib/libc/stdio/ungetc.c:1.5 src/newlib/libc/stdio/ungetc.c:1.6
--- src/newlib/libc/stdio/ungetc.c:1.5	Mon May  3 17:27:56 2004
+++ src/newlib/libc/stdio/ungetc.c	Tue Feb  8 01:33:17 2005
@@ -77,14 +77,14 @@
   if (c == EOF)
     return (EOF);
 
-  _flockfile (fp);
-  
   /* Ensure stdio has been initialized.
      ??? Might be able to remove this as some other stdio routine should
      have already been called to get the char we are un-getting.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (rptr);
 
+  _flockfile (fp);
+  
   /* After ungetc, we won't be at eof anymore */
   fp->_flags &= ~__SEOF;
 
Index: src/newlib/libc/stdio/vfprintf.c
diff -u src/newlib/libc/stdio/vfprintf.c:1.37 src/newlib/libc/stdio/vfprintf.c:1.39
--- src/newlib/libc/stdio/vfprintf.c:1.37	Fri Jun 11 20:37:10 2004
+++ src/newlib/libc/stdio/vfprintf.c	Mon Mar 21 22:34:35 2005
@@ -157,6 +157,7 @@
  *
  * This code is large and complicated...
  */
+#include <newlib.h>
 
 #ifdef INTEGER_ONLY
 #define VFPRINTF vfiprintf
@@ -176,8 +177,6 @@
 
 #include <_ansi.h>
 #include <reent.h>
-#include <newlib.h>
-#include <reent.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -533,8 +532,8 @@
 	    (u_long)GET_ARG (N, ap, u_int))
 #endif
 
+	CHECK_INIT (data);
 	_flockfile (fp);
-	CHECK_INIT (fp);
 
 	/* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
 	if (cantwrite (fp)) {
Index: src/newlib/libc/stdio/vfscanf.c
diff -u src/newlib/libc/stdio/vfscanf.c:1.26 src/newlib/libc/stdio/vfscanf.c:1.30
--- src/newlib/libc/stdio/vfscanf.c:1.26	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/stdio/vfscanf.c	Thu Apr 28 18:26:08 2005
@@ -135,6 +135,7 @@
 #endif
 
 #ifdef FLOATING_POINT
+#include <math.h>
 #include <float.h>
 
 /* Currently a test is made to see if long double processing is warranted.
@@ -230,7 +231,7 @@
        _CONST char *fmt _AND 
        va_list ap)
 {
-  CHECK_INIT(fp);
+  CHECK_INIT(_REENT);
   return __SVFSCANF_R (_REENT, fp, fmt, ap);
 }
 
@@ -252,6 +253,7 @@
        _CONST char *fmt    _AND 
        va_list ap)
 {
+  CHECK_INIT(data);
   return __SVFSCANF_R (data, fp, fmt, ap);
 }
 
@@ -985,6 +987,7 @@
 	  long zeroes, exp_adjust;
 	  char *exp_start = NULL;
 	  unsigned width_left = 0;
+	  int nancount = 0;
 #ifdef hardway
 	  if (width == 0 || width > sizeof (buf) - 1)
 #else
@@ -1007,7 +1010,6 @@
 	       */
 	      switch (c)
 		{
-
 		case '0':
 		  if (flags & NDIGITS)
 		    {
@@ -1030,8 +1032,12 @@
 		case '7':
 		case '8':
 		case '9':
-		  flags &= ~(SIGNOK | NDIGITS);
-		  goto fok;
+		  if (nancount == 0)
+		    {
+		      flags &= ~(SIGNOK | NDIGITS);
+		      goto fok;
+		    }
+		  break;
 
 		case '+':
 		case '-':
@@ -1041,6 +1047,30 @@
 		      goto fok;
 		    }
 		  break;
+		case 'n':
+		case 'N':
+	          if (nancount == 0
+		      && (flags & (SIGNOK | NDIGITS | DPTOK | EXPOK)) ==
+		      	          (SIGNOK | NDIGITS | DPTOK | EXPOK))
+		    {
+		      flags &= ~(SIGNOK | DPTOK | EXPOK | NDIGITS);
+		      nancount = 1;
+		      goto fok;
+		    }
+		  else if (nancount == 2)
+		    {
+		      nancount = 3;
+		      goto fok;
+		    }
+		  break;
+		case 'a':
+		case 'A':
+		  if (nancount == 1)
+		    {
+		      nancount = 2;
+		      goto fok;
+		    }
+		  break;
 		case '.':
 		  if (flags & DPTOK)
 		    {
@@ -1082,7 +1112,24 @@
 	    }
 	  if (zeroes)
 	    flags &= ~NDIGITS;
-	  /*
+          /* We may have a 'N' or possibly even a 'Na' as the start of 'NaN', 
+	     only to run out of chars before it was complete (or having 
+	     encountered a non- matching char).  So check here if we have an 
+	     outstanding nancount, and if so put back the chars we did 
+	     swallow and treat as a failed match. */
+          if (nancount && nancount != 3)
+            {
+              /* Ok... what are we supposed to do in the event that the
+              __srefill call above was triggered in the middle of the partial
+              'NaN' and so we can't put it all back? */
+              while (nancount-- && (p > buf))
+                {
+                  ungetc (*(u_char *)--p, fp);
+                  --nread;
+                }
+              goto match_failure;
+            }
+          /*
 	   * If no digits, might be missing exponent digits
 	   * (just give back the exponent) or might be missing
 	   * regular digits, but had sign and/or decimal point.
@@ -1094,7 +1141,7 @@
 		  /* no digits at all */
 		  while (p > buf)
                     {
-		      ungetc (*(u_char *)-- p, fp);
+		      ungetc (*(u_char *)--p, fp);
                       --nread;
                     }
 		  goto match_failure;
@@ -1163,7 +1210,10 @@
 	      else
 		{
 		  flp = va_arg (ap, float *);
-		  *flp = res;
+		  if (isnan (res))
+		    *flp = nanf (NULL);
+		  else
+		    *flp = res;
 		}
 	      nassigned++;
 	    }
Index: src/newlib/libc/stdio/viprintf.c
diff -u src/newlib/libc/stdio/viprintf.c:1.1 src/newlib/libc/stdio/viprintf.c:1.2
--- src/newlib/libc/stdio/viprintf.c:1.1	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/stdio/viprintf.c	Tue Feb  8 01:33:17 2005
@@ -145,7 +145,7 @@
        _CONST char *fmt _AND
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdout_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
   return _vfiprintf_r (_REENT, _stdout_r (_REENT), fmt, ap);
 }
 
@@ -157,6 +157,6 @@
        _CONST char *fmt   _AND
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   return _vfiprintf_r (ptr, _stdout_r (ptr), fmt, ap);
 }
Index: src/newlib/libc/stdio/viscanf.c
diff -u src/newlib/libc/stdio/viscanf.c:1.1 src/newlib/libc/stdio/viscanf.c:1.2
--- src/newlib/libc/stdio/viscanf.c:1.1	Wed Nov 24 00:45:41 2004
+++ src/newlib/libc/stdio/viscanf.c	Tue Feb  8 01:33:17 2005
@@ -121,7 +121,7 @@
        _CONST char *fmt _AND 
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdin_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
   return __svfiscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
 }
 
@@ -133,7 +133,7 @@
        _CONST char *fmt   _AND 
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdin_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   return __svfiscanf_r (ptr, _stdin_r (ptr), fmt, ap);
 }
 
Index: src/newlib/libc/stdio/vprintf.c
diff -u src/newlib/libc/stdio/vprintf.c:1.5 src/newlib/libc/stdio/vprintf.c:1.6
--- src/newlib/libc/stdio/vprintf.c:1.5	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/vprintf.c	Tue Feb  8 01:33:17 2005
@@ -33,7 +33,7 @@
        _CONST char *fmt _AND
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdout_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
   return _vfprintf_r (_REENT, _stdout_r (_REENT), fmt, ap);
 }
 
@@ -45,6 +45,6 @@
        _CONST char *fmt   _AND
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   return _vfprintf_r (ptr, _stdout_r (ptr), fmt, ap);
 }
Index: src/newlib/libc/stdio/vscanf.c
diff -u src/newlib/libc/stdio/vscanf.c:1.3 src/newlib/libc/stdio/vscanf.c:1.4
--- src/newlib/libc/stdio/vscanf.c:1.3	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/vscanf.c	Tue Feb  8 01:33:17 2005
@@ -34,7 +34,7 @@
        _CONST char *fmt _AND 
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdin_r (_REENT));
+  _REENT_SMALL_CHECK_INIT (_REENT);
   return __svfscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
 }
 
@@ -46,7 +46,7 @@
        _CONST char *fmt   _AND 
        va_list ap)
 {
-  _REENT_SMALL_CHECK_INIT (_stdin_r (ptr));
+  _REENT_SMALL_CHECK_INIT (ptr);
   return __svfscanf_r (ptr, _stdin_r (ptr), fmt, ap);
 }
 
Index: src/newlib/libc/stdio/wbuf.c
diff -u src/newlib/libc/stdio/wbuf.c:1.2 src/newlib/libc/stdio/wbuf.c:1.3
--- src/newlib/libc/stdio/wbuf.c:1.2	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/wbuf.c	Tue Feb  8 01:33:17 2005
@@ -40,7 +40,7 @@
 
   /* Ensure stdio has been initialized.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (_REENT);
 
   /*
    * In case we cannot write, or longjmp takes us out early,
Index: src/newlib/libc/stdio/wsetup.c
diff -u src/newlib/libc/stdio/wsetup.c:1.2 src/newlib/libc/stdio/wsetup.c:1.3
--- src/newlib/libc/stdio/wsetup.c:1.2	Fri Apr 23 20:01:55 2004
+++ src/newlib/libc/stdio/wsetup.c	Tue Feb  8 01:33:17 2005
@@ -34,7 +34,7 @@
 {
   /* Make sure stdio is set up.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (_REENT);
 
   /*
    * If we are not writing, we had better be reading and writing.
Index: src/newlib/libc/stdio64/fgetpos64.c
diff -u src/newlib/libc/stdio64/fgetpos64.c:1.3 src/newlib/libc/stdio64/fgetpos64.c:1.4
--- src/newlib/libc/stdio64/fgetpos64.c:1.3	Fri Aug 22 18:52:25 2003
+++ src/newlib/libc/stdio64/fgetpos64.c	Tue Feb  8 01:33:17 2005
@@ -60,15 +60,12 @@
 	FILE * fp _AND
 	_fpos64_t * pos)
 {
-  _flockfile(fp);
   *pos = (_fpos64_t)_ftello64_r (ptr, fp);
 
   if (*pos != -1)
     {
-      _funlockfile(fp);
       return 0;
     }
-  _funlockfile(fp);
   return 1;
 }
 
Index: src/newlib/libc/stdio64/freopen64.c
diff -u src/newlib/libc/stdio64/freopen64.c:1.6 src/newlib/libc/stdio64/freopen64.c:1.7
--- src/newlib/libc/stdio64/freopen64.c:1.6	Thu Sep 16 21:18:50 2004
+++ src/newlib/libc/stdio64/freopen64.c	Tue Feb  8 01:33:17 2005
@@ -91,9 +91,9 @@
 
   __sfp_lock_acquire ();
 
-  _flockfile(fp);
+  CHECK_INIT (ptr);
 
-  CHECK_INIT (fp);
+  _flockfile(fp);
 
   if ((flags = __sflags (ptr, mode, &oflags)) == 0)
     {
Index: src/newlib/libc/stdio64/fseeko64.c
diff -u src/newlib/libc/stdio64/fseeko64.c:1.5 src/newlib/libc/stdio64/fseeko64.c:1.6
--- src/newlib/libc/stdio64/fseeko64.c:1.5	Tue Aug 26 18:09:43 2003
+++ src/newlib/libc/stdio64/fseeko64.c	Tue Feb  8 01:33:17 2005
@@ -111,11 +111,11 @@
   struct stat64 st;
   int havepos;
 
-  _flockfile(fp);
-
   /* Make sure stdio is set up.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (ptr);
+
+  _flockfile(fp);
 
   curoff = fp->_offset;
 
Index: src/newlib/libc/stdio64/ftello64.c
diff -u src/newlib/libc/stdio64/ftello64.c:1.3 src/newlib/libc/stdio64/ftello64.c:1.4
--- src/newlib/libc/stdio64/ftello64.c:1.3	Fri Aug 22 18:52:25 2003
+++ src/newlib/libc/stdio64/ftello64.c	Tue Feb  8 01:33:17 2005
@@ -91,11 +91,11 @@
 {
   _fpos64_t pos;
 
-  _flockfile(fp);
-
   /* Ensure stdio is set up.  */
 
-  CHECK_INIT (fp);
+  CHECK_INIT (ptr);
+
+  _flockfile(fp);
 
   if (fp->_seek64 == NULL)
     {
Index: src/newlib/libc/stdlib/mallocr.c
diff -u src/newlib/libc/stdlib/mallocr.c:1.12 src/newlib/libc/stdlib/mallocr.c:1.13
--- src/newlib/libc/stdlib/mallocr.c:1.12	Tue Aug 19 18:09:54 2003
+++ src/newlib/libc/stdlib/mallocr.c	Tue Feb  8 01:33:17 2005
@@ -3484,7 +3484,7 @@
   MALLOC_UNLOCK;
 
 #ifdef INTERNAL_NEWLIB
-  _REENT_SMALL_CHECK_INIT(_stderr_r (reent_ptr));
+  _REENT_SMALL_CHECK_INIT(reent_ptr);
   fp = _stderr_r(reent_ptr);
 #define fprintf fiprintf
 #else
Index: src/newlib/libc/stdlib/mstats.c
diff -u src/newlib/libc/stdlib/mstats.c:1.4 src/newlib/libc/stdlib/mstats.c:1.5
--- src/newlib/libc/stdlib/mstats.c:1.4	Fri Sep  5 00:13:15 2003
+++ src/newlib/libc/stdlib/mstats.c	Tue Feb  8 01:33:19 2005
@@ -140,7 +140,7 @@
 	struct _reent *ptr _AND
 	char *s)
 {
-  _REENT_SMALL_CHECK_INIT(_stderr_r (ptr));
+  _REENT_SMALL_CHECK_INIT(ptr);
   fiprintf (_stderr_r (ptr), "Memory allocation statistics %s\n", s);
   _malloc_stats_r (ptr);
 }
Index: src/newlib/libc/stdlib/setenv_r.c
diff -u src/newlib/libc/stdlib/setenv_r.c:1.5 src/newlib/libc/stdlib/setenv_r.c:1.6
--- src/newlib/libc/stdlib/setenv_r.c:1.5	Wed Apr 17 21:23:30 2002
+++ src/newlib/libc/stdlib/setenv_r.c	Thu Jan 20 17:31:04 2005
@@ -122,7 +122,7 @@
   ENV_UNLOCK;
 
   /* if we are setting the TZ environment variable, update timezone info */
-  if (strcmp (name, "TZ") == 0)
+  if (strncmp ((*p_environ)[offset], "TZ=", 3) == 0)
     tzset ();
 
   return 0;
Index: src/newlib/libc/stdlib/strtod.c
diff -u src/newlib/libc/stdlib/strtod.c:1.4 src/newlib/libc/stdlib/strtod.c:1.6
--- src/newlib/libc/stdlib/strtod.c:1.4	Fri Dec  6 18:58:51 2002
+++ src/newlib/libc/stdlib/strtod.c	Fri Apr  1 09:54:19 2005
@@ -111,15 +111,16 @@
   int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, e1, esign, i, j,
     k, nd, nd0, nf, nz, nz0, sign;
   long e;
-  _CONST char *s, *s0, *s1;
+  _CONST char *s, *s0, *s1, *s2;
   double aadj, aadj1, adj;
   long L;
   unsigned long z;
   __ULong y;
   union double_union rv, rv0;
+  int nanflag;
 
   _Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
-  sign = nz0 = nz = 0;
+  sign = nz0 = nz = nanflag = 0;
   rv.d = 0.;
   for (s = s00;; s++)
     switch (*s)
@@ -145,7 +146,23 @@
 	goto break2;
       }
 break2:
-  if (*s == '0')
+  if (*s == 'n' || *s == 'N')
+    {
+      ++s; 
+      if (*s == 'a' || *s == 'A')
+        {
+          ++s;
+          if (*s == 'n' || *s == 'N')
+            {
+              nanflag = 1;
+              ++s;
+              goto ret;
+            }
+        }
+      s = s00;
+      goto ret;
+    }
+  else if (*s == '0')
     {
       nz0 = 1;
       while (*++s == '0');
@@ -205,7 +222,7 @@
 	  s = s00;
 	  goto ret;
 	}
-      s00 = s;
+      s2 = s;
       esign = 0;
       switch (c = *++s)
 	{
@@ -236,7 +253,7 @@
 	    e = 0;
 	}
       else
-	s = s00;
+	s = s2;
     }
   if (!nd)
     {
@@ -708,7 +725,10 @@
 ret:
   if (se)
     *se = (char *) s;
-  return sign ? -rv.d : rv.d;
+
+  if (nanflag)
+    return nan (NULL);
+  return (sign && (s != s00)) ? -rv.d : rv.d;
 }
 
 #ifndef NO_REENT
@@ -725,7 +745,10 @@
 	_CONST char *s00 _AND
 	char **se)
 {
-  return (float)_strtod_r (_REENT, s00, se);
+  double retval = _strtod_r (_REENT, s00, se);
+  if (isnan (retval))
+    return nanf (NULL);
+  return (float)retval;
 }
 
 #endif
Index: src/newlib/libc/string/memcmp.c
diff -u src/newlib/libc/string/memcmp.c:1.1.1.1 src/newlib/libc/string/memcmp.c:1.2
--- src/newlib/libc/string/memcmp.c:1.1.1.1	Thu Feb 17 19:39:48 2000
+++ src/newlib/libc/string/memcmp.c	Sun Mar  6 20:40:05 2005
@@ -95,8 +95,8 @@
 
       /* check m mod LBLOCKSIZE remaining characters */
 
-      s1 = (char*)a1;
-      s2 = (char*)a2;
+      s1 = (unsigned char*)a1;
+      s2 = (unsigned char*)a2;
     }
 
   while (n--)
Index: src/newlib/libc/sys/arc/syscalls.c
diff -u src/newlib/libc/sys/arc/syscalls.c:1.1 src/newlib/libc/sys/arc/syscalls.c:1.2
--- src/newlib/libc/sys/arc/syscalls.c:1.1	Fri Jan 19 01:25:13 2001
+++ src/newlib/libc/sys/arc/syscalls.c	Tue Mar 22 23:45:43 2005
@@ -15,7 +15,7 @@
 
   SYSCALL (SYS_read, rc, err, fd, buf, nbytes);
   if (err)
-    errno = err;
+    __errno_r (r) = err;
   return rc;
 }
 
@@ -27,7 +27,7 @@
 
   SYSCALL (SYS_write, rc, err, fd, buf, nbytes);
   if (err)
-    errno = err;
+    __errno_r (r) = err;
   return rc;
 }
 
@@ -48,7 +48,8 @@
 #endif
 
   SYSCALL (SYS_open, rc, err, buf, flags, mode);
-  errno = err;
+  if (err)
+    __errno_r (r) = err;
   return rc;
 }
 
@@ -59,7 +60,7 @@
 
   SYSCALL (SYS_close, rc, err, fd, 0, 0);
   if (err)
-    errno = err;
+    __errno_r (r) = err;
   return rc;
 }
 
@@ -71,7 +72,7 @@
 
   SYSCALL (SYS_lseek, rc, err, fd, offset, whence);
   if (err)
-    errno = err;
+    __errno_r (r) = err;
   return rc;
 }
 
@@ -82,7 +83,7 @@
 
   SYSCALL (SYS_fstat, rc, err, fd, buf, 0);
   if (err)
-    errno = err;
+    __errno_r (r) = err;
   return rc;
 }
 
@@ -125,6 +126,6 @@
 
   SYSCALL (SYS_kill, rc, err, pid, sig, 0);
   if (err)
-    errno = err;
+    __errno_r (r) = err;
   return rc;
 }
Index: src/newlib/libc/sys/arm/crt0.S
diff -u src/newlib/libc/sys/arm/crt0.S:1.9 src/newlib/libc/sys/arm/crt0.S:1.10
--- src/newlib/libc/sys/arm/crt0.S:1.9	Fri Nov 26 16:42:10 2004
+++ src/newlib/libc/sys/arm/crt0.S	Fri Jan  7 18:04:39 2005
@@ -1,3 +1,4 @@
+#include "newlib.h"
 #include "swi.h"
 
 /* ANSI concatenation macros.  */
@@ -10,6 +11,11 @@
 #error __USER_LABEL_PREFIX is not defined
 #endif
 
+#ifdef HAVE_INITFINI_ARRAY
+#define _init	__libc_init_array
+#define _fini	__libc_fini_array
+#endif
+
 /* .text is used instead of .section .text so it works with arm-aout too.  */
 	.text
 	.code 32
Index: src/newlib/libc/sys/arm/syscalls.c
diff -u src/newlib/libc/sys/arm/syscalls.c:1.9 src/newlib/libc/sys/arm/syscalls.c:1.10
--- src/newlib/libc/sys/arm/syscalls.c:1.9	Tue Jan  6 19:27:21 2004
+++ src/newlib/libc/sys/arm/syscalls.c	Tue Feb  8 01:33:19 2005
@@ -55,20 +55,17 @@
 
 /* following is copied from libc/stdio/local.h to check std streams */
 extern void   _EXFUN(__sinit,(struct _reent *));
-#define CHECK_INIT(fp) \
-  do                                    \
-    {                                   \
-      if ((fp)->_data == 0)             \
-        (fp)->_data = _REENT;           \
-      if (!(fp)->_data->__sdidinit)     \
-        __sinit ((fp)->_data);          \
-    }                                   \
+#define CHECK_INIT(ptr) \
+  do						\
+    {						\
+      if ((ptr) && !(ptr)->__sdidinit)		\
+	__sinit (ptr);				\
+    }						\
   while (0)
 
 /* Adjust our internal handles to stay away from std* handles.  */
 #define FILE_HANDLE_OFFSET (0x20)
 
-static int std_files_checked;
 static int monitor_stdin;
 static int monitor_stdout;
 static int monitor_stderr;
@@ -119,13 +116,8 @@
 static int
 remap_handle (int fh)
 {
-  if (!std_files_checked)
-    {
-       CHECK_INIT(stdin);
-       CHECK_INIT(stdout);
-       CHECK_INIT(stderr);
-       std_files_checked = 1;
-    }
+  CHECK_INIT(_REENT);
+
   if (fh == STDIN_FILENO)
     return monitor_stdin;
   if (fh == STDOUT_FILENO)
Index: src/newlib/libc/sys/arm/sys/param.h
diff -u /dev/null src/newlib/libc/sys/arm/sys/param.h:1.4
--- /dev/null	Thu May 12 14:25:38 2005
+++ src/newlib/libc/sys/arm/sys/param.h	Wed Feb  2 19:00:30 2005
@@ -0,0 +1,19 @@
+/* ARM configuration file; HZ is 100 rather than the default 60 */
+
+#ifndef _SYS_PARAM_H
+# define _SYS_PARAM_H
+
+# define HZ (100)
+# define NOFILE	(60)
+# define PATHSIZE (1024)
+
+#define BIG_ENDIAN      4321
+#define LITTLE_ENDIAN   1234
+
+#ifdef __ARMEB__
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+#endif
Index: src/newlib/libc/sys/linux/inode.c
diff -u src/newlib/libc/sys/linux/inode.c:1.9 src/newlib/libc/sys/linux/inode.c:1.10
--- src/newlib/libc/sys/linux/inode.c:1.9	Mon Aug 26 18:56:08 2002
+++ src/newlib/libc/sys/linux/inode.c	Thu Apr  7 23:40:42 2005
@@ -35,6 +35,7 @@
 _syscall2(int,chmod,const char *,path,mode_t,mode)
 _syscall3(int,chown,const char *,path,uid_t,owner,gid_t,group)
 _syscall2(int,fchmod,int,filedes,mode_t,mode)
+_syscall3(int,lchown,const char *,path,uid_t,owner,gid_t,group)
 _syscall2(int,lstat,const char *,file_name,struct stat *,buf)
 _syscall3(int,readlink,const char *,path,char *,buf,size_t,bufsiz)
 _syscall2(int,symlink,const char *,oldpath,const char *,newpath)
Index: src/newlib/libc/sys/linux/include/time.h
diff -u src/newlib/libc/sys/linux/include/time.h:1.3 src/newlib/libc/sys/linux/include/time.h:1.5
--- src/newlib/libc/sys/linux/include/time.h:1.3	Tue Sep  3 19:40:36 2002
+++ src/newlib/libc/sys/linux/include/time.h	Fri Feb 25 22:31:20 2005
@@ -84,6 +84,26 @@
 _VOID      _EXFUN(tzset,	(_VOID));
 _VOID      _EXFUN(_tzset_r,	(struct _reent *));
 
+typedef struct __tzrule_struct
+{
+  char ch;
+  int m;
+  int n;
+  int d;
+  int s;
+  time_t change;
+  long offset; /* Match type of _timezone. */
+} __tzrule_type;
+
+typedef struct __tzinfo_struct
+{
+  int __tznorth;
+  int __tzyear;
+  __tzrule_type __tzrule[2];
+} __tzinfo_type;
+
+__tzinfo_type *_EXFUN (__gettzinfo, (_VOID));
+
 /* getdate functions */
 
 #ifndef _REENT_ONLY
@@ -106,7 +126,7 @@
 int		_EXFUN(getdate_r, (const char *, struct tm *));
 
 /* defines for the opengroup specifications Derived from Issue 1 of the SVID.  */
-extern __IMPORT time_t _timezone;
+extern __IMPORT long _timezone;
 extern __IMPORT int _daylight;
 extern __IMPORT char *_tzname[2];
 
Index: src/newlib/libc/sys/linux/sys/string.h
diff -u /dev/null src/newlib/libc/sys/linux/sys/string.h:1.1
--- /dev/null	Thu May 12 14:25:57 2005
+++ src/newlib/libc/sys/linux/sys/string.h	Mon Jan 24 18:46:09 2005
@@ -0,0 +1,8 @@
+#ifndef _SYS_STRING_H
+#define _SYS_STRING_H
+
+#ifndef __STRICT_ANSI__
+char    *_EXFUN(strsignal, (int __signo));
+#endif
+
+#endif /* _SYS_STRING_H */
Index: src/newlib/libc/sys/rtems/include/inttypes.h
diff -u /dev/null src/newlib/libc/sys/rtems/include/inttypes.h:1.1
--- /dev/null	Thu May 12 14:25:58 2005
+++ src/newlib/libc/sys/rtems/include/inttypes.h	Sun Mar  6 20:51:38 2005
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2004, 2005 by
+ * Ralf Corsepius, Ulm/Germany. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+/**
+ *  @file  inttypes.h
+ */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H
+
+#include <stdint.h>
+
+#define __STRINGIFY(a) #a
+
+/* 8-bit types */
+#define __PRI8(x) __STRINGIFY(x)
+#define __SCN8(x) __STRINGIFY(hh##x)
+
+
+#define PRId8		__PRI8(d)
+#define PRIi8		__PRI8(i)
+#define PRIo8		__PRI8(o)
+#define PRIu8		__PRI8(u)
+#define PRIx8		__PRI8(x)
+#define PRIX8		__PRI8(X)
+
+#define SCNd8		__SCN8(d)
+#define SCNi8		__SCN8(i)
+#define SCNo8		__SCN8(o)
+#define SCNu8		__SCN8(u)
+#define SCNx8		__SCN8(x)
+
+
+#define PRIdLEAST8	__PRI8(d)
+#define PRIiLEAST8	__PRI8(i)
+#define PRIoLEAST8	__PRI8(o)
+#define PRIuLEAST8	__PRI8(u)
+#define PRIxLEAST8	__PRI8(x)
+#define PRIXLEAST8	__PRI8(X)
+
+#define SCNdLEAST8	__SCN8(d)
+#define SCNiLEAST8	__SCN8(i)
+#define SCNoLEAST8	__SCN8(o)
+#define SCNuLEAST8	__SCN8(u)
+#define SCNxLEAST8	__SCN8(x)
+
+
+#define PRIdFAST8	__PRI8(d)
+#define PRIiFAST8	__PRI8(i)
+#define PRIoFAST8	__PRI8(o)
+#define PRIuFAST8	__PRI8(u)
+#define PRIxFAST8	__PRI8(x)
+#define PRIXFAST8	__PRI8(X)
+
+#define SCNdFAST8	__SCN8(d)
+#define SCNiFAST8	__SCN8(i)
+#define SCNoFAST8	__SCN8(o)
+#define SCNuFAST8	__SCN8(u)
+#define SCNxFAST8	__SCN8(x)
+
+/* 16-bit types */
+#define __PRI16(x) __STRINGIFY(x)
+#define __SCN16(x) __STRINGIFY(h##x)
+
+
+#define PRId16		__PRI16(d)
+#define PRIi16		__PRI16(i)
+#define PRIo16		__PRI16(o)
+#define PRIu16		__PRI16(u)
+#define PRIx16		__PRI16(x)
+#define PRIX16		__PRI16(X)
+
+#define SCNd16		__SCN16(d)
+#define SCNi16		__SCN16(i)
+#define SCNo16		__SCN16(o)
+#define SCNu16		__SCN16(u)
+#define SCNx16		__SCN16(x)
+
+
+#define PRIdLEAST16	__PRI16(d)
+#define PRIiLEAST16	__PRI16(i)
+#define PRIoLEAST16	__PRI16(o)
+#define PRIuLEAST16	__PRI16(u)
+#define PRIxLEAST16	__PRI16(x)
+#define PRIXLEAST16	__PRI16(X)
+
+#define SCNdLEAST16	__SCN16(d)
+#define SCNiLEAST16	__SCN16(i)
+#define SCNoLEAST16	__SCN16(o)
+#define SCNuLEAST16	__SCN16(u)
+#define SCNxLEAST16	__SCN16(x)
+
+
+#define PRIdFAST16	__PRI16(d)
+#define PRIiFAST16	__PRI16(i)
+#define PRIoFAST16	__PRI16(o)
+#define PRIuFAST16	__PRI16(u)
+#define PRIxFAST16	__PRI16(x)
+#define PRIXFAST16	__PRI16(X)
+
+#define SCNdFAST16	__SCN16(d)
+#define SCNiFAST16	__SCN16(i)
+#define SCNoFAST16	__SCN16(o)
+#define SCNuFAST16	__SCN16(u)
+#define SCNxFAST16	__SCN16(x)
+
+/* 32-bit types */
+#if defined(__have_long32)
+#define __PRI32(x) __STRINGIFY(l##x)
+#define __SCN32(x) __STRINGIFY(l##x)
+#else
+#define __PRI32(x) __STRINGIFY(x)
+#define __SCN32(x) __STRINGIFY(x)
+#endif
+
+#define PRId32		__PRI32(d)
+#define PRIi32		__PRI32(i)
+#define PRIo32		__PRI32(o)
+#define PRIu32		__PRI32(u)
+#define PRIx32		__PRI32(x)
+#define PRIX32		__PRI32(X)
+
+#define SCNd32		__SCN32(d)
+#define SCNi32		__SCN32(i)
+#define SCNo32		__SCN32(o)
+#define SCNu32		__SCN32(u)
+#define SCNx32		__SCN32(x)
+
+
+#define PRIdLEAST32	__PRI32(d)
+#define PRIiLEAST32	__PRI32(i)
+#define PRIoLEAST32	__PRI32(o)
+#define PRIuLEAST32	__PRI32(u)
+#define PRIxLEAST32	__PRI32(x)
+#define PRIXLEAST32	__PRI32(X)
+
+#define SCNdLEAST32	__SCN32(d)
+#define SCNiLEAST32	__SCN32(i)
+#define SCNoLEAST32	__SCN32(o)
+#define SCNuLEAST32	__SCN32(u)
+#define SCNxLEAST32	__SCN32(x)
+
+
+#define PRIdFAST32	__PRI32(d)
+#define PRIiFAST32	__PRI32(i)
+#define PRIoFAST32	__PRI32(o)
+#define PRIuFAST32	__PRI32(u)
+#define PRIxFAST32	__PRI32(x)
+#define PRIXFAST32	__PRI32(X)
+
+#define SCNdFAST32	__SCN32(d)
+#define SCNiFAST32	__SCN32(i)
+#define SCNoFAST32	__SCN32(o)
+#define SCNuFAST32	__SCN32(u)
+#define SCNxFAST32	__SCN32(x)
+
+
+/* 64-bit types */
+#if defined(__have_longlong64)
+#define __PRI64(x) __STRINGIFY(ll##x)
+#define __SCN64(x) __STRINGIFY(ll##x)
+#elif defined(__have_long64)
+#define __PRI64(x) __STRINGIFY(l##x)
+#define __SCN64(x) __STRINGIFY(l##x)
+#else
+#define __PRI64(x) __STRINGIFY(x)
+#define __SCN64(x) __STRINGIFY(x)
+#endif
+
+#define PRId64		__PRI64(d)
+#define PRIi64		__PRI64(i)
+#define PRIo64		__PRI64(o)
+#define PRIu64		__PRI64(u)
+#define PRIx64		__PRI64(x)
+#define PRIX64		__PRI64(X)
+
+#define SCNd64		__SCN64(d)
+#define SCNi64		__SCN64(i)
+#define SCNo64		__SCN64(o)
+#define SCNu64		__SCN64(u)
+#define SCNx64		__SCN64(x)
+
+#if __int64_t_defined
+#define PRIdLEAST64	__PRI64(d)
+#define PRIiLEAST64	__PRI64(i)
+#define PRIoLEAST64	__PRI64(o)
+#define PRIuLEAST64	__PRI64(u)
+#define PRIxLEAST64	__PRI64(x)
+#define PRIXLEAST64	__PRI64(X)
+
+#define SCNdLEAST64	__SCN64(d)
+#define SCNiLEAST64	__SCN64(i)
+#define SCNoLEAST64	__SCN64(o)
+#define SCNuLEAST64	__SCN64(u)
+#define SCNxLEAST64	__SCN64(x)
+
+
+#define PRIdFAST64	__PRI64(d)
+#define PRIiFAST64	__PRI64(i)
+#define PRIoFAST64	__PRI64(o)
+#define PRIuFAST64	__PRI64(u)
+#define PRIxFAST64	__PRI64(x)
+#define PRIXFAST64	__PRI64(X)
+
+#define SCNdFAST64	__SCN64(d)
+#define SCNiFAST64	__SCN64(i)
+#define SCNoFAST64	__SCN64(o)
+#define SCNuFAST64	__SCN64(u)
+#define SCNxFAST64	__SCN64(x)
+#endif
+
+/* max-bit types */
+#if defined(__have_longlong64)
+#define __PRIMAX(x) __STRINGIFY(ll##x)
+#define __SCNMAX(x) __STRINGIFY(ll##x)
+#elif defined(__have_long64)
+#define __PRIMAX(x) __STRINGIFY(l##x)
+#define __SCNMAX(x) __STRINGIFY(l##x)
+#else
+#define __PRIMAX(x) __STRINGIFY(x)
+#define __SCNMAX(x) __STRINGIFY(x)
+#endif
+
+#define PRIdMAX		__PRIMAX(d)
+#define PRIiMAX		__PRIMAX(i)
+#define PRIoMAX		__PRIMAX(o)
+#define PRIuMAX		__PRIMAX(u)
+#define PRIxMAX		__PRIMAX(x)
+#define PRIXMAX		__PRIMAX(X)
+
+#define SCNdMAX		__SCNMAX(d)
+#define SCNiMAX		__SCNMAX(i)
+#define SCNoMAX		__SCNMAX(o)
+#define SCNuMAX		__SCNMAX(u)
+#define SCNxMAX		__SCNMAX(x)
+
+/* ptr types */
+#if defined(__have_longlong64)
+#define __PRIPTR(x) __STRINGIFY(ll##x)
+#define __SCNPTR(x) __STRINGIFY(ll##x)
+#elif defined(__have_long64)
+#define __PRIPTR(x) __STRINGIFY(l##x)
+#define __SCNPTR(x) __STRINGIFY(l##x)
+#else
+#define __PRIPTR(x) __STRINGIFY(x)
+#define __SCNPTR(x) __STRINGIFY(x)
+#endif
+
+#define PRIdPTR		__PRIPTR(d)
+#define PRIiPTR		__PRIPTR(i)
+#define PRIoPTR		__PRIPTR(o)
+#define PRIuPTR		__PRIPTR(u)
+#define PRIxPTR		__PRIPTR(x)
+#define PRIXPTR		__PRIPTR(X)
+
+#define SCNdPTR		__SCNPTR(d)
+#define SCNiPTR		__SCNPTR(i)
+#define SCNoPTR		__SCNPTR(o)
+#define SCNuPTR		__SCNPTR(u)
+#define SCNxPTR		__SCNPTR(x)
+
+
+typedef struct {
+  intmax_t	quot;
+  intmax_t	rem;
+} imaxdiv_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern intmax_t  imaxabs(intmax_t j);
+extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denomer);
+extern intmax_t  strtoimax(const char *__restrict, char **__restrict, int);
+extern uintmax_t strtoumax(const char *__restrict, char **__restrict, int);
+extern intmax_t  wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int);
+extern uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: src/newlib/libc/sys/rtems/include/stdint.h
diff -u /dev/null src/newlib/libc/sys/rtems/include/stdint.h:1.1
--- /dev/null	Thu May 12 14:25:59 2005
+++ src/newlib/libc/sys/rtems/include/stdint.h	Sun Mar  6 20:51:38 2005
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 2004, 2005 by
+ * Ralf Corsepius, Ulm/Germany. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+/*
+ * @todo - Add fast<N>_t types.
+ * @todo - Add support for wint_t types.
+ */
+
+#ifndef _STDINT_H
+#define _STDINT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && (__GNUC__ >= 3 ) \
+  && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ) 
+#define __EXP(x) __##x##__
+#else
+#define __EXP(x) x
+#include <limits.h>
+#endif
+
+#if __EXP(SCHAR_MAX) == 0x7f
+typedef signed char int8_t ;
+typedef unsigned char uint8_t ;
+#define __int8_t_defined 1
+#endif
+
+#if __int8_t_defined
+typedef signed char int_least8_t;
+typedef unsigned char uint_least8_t;
+#define __int_least8_t_defined 1
+#endif
+
+#if __EXP(SHRT_MAX) == 0x7fff
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+#define __int16_t_defined 1
+#elif __EXP(INT_MAX) == 0x7fff
+typedef signed int int16_t;
+typedef unsigned int uint16_t;
+#define __int16_t_defined 1
+#elif __EXP(SCHAR_MAX) == 0x7fff
+typedef signed char int16_t;
+typedef unsigned char uint16_t;
+#define __int16_t_defined 1
+#endif
+
+#if __int16_t_defined
+typedef int16_t   	int_least16_t;
+typedef uint16_t 	uint_least16_t;
+#define __int_least16_t_defined 1
+
+#ifndef __int_least8_t_defined
+typedef int16_t	   	int_least8_t;
+typedef uint16_t  	uint_least8_t;
+#define __int_least8_t_defined 1
+#endif
+#endif
+
+#if __EXP(INT_MAX) == 0x7fffffffL
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+#define __int32_t_defined 1
+#elif __EXP(LONG_MAX) == 0x7fffffffL
+typedef signed long int32_t;
+typedef unsigned long uint32_t;
+#define __int32_t_defined 1
+#define __have_long32 1
+#elif __EXP(SHRT_MAX) == 0x7fffffffL
+typedef signed short int32_t;
+typedef unsigned short uint32_t;
+#define __int32_t_defined 1
+#elif __EXP(SCHAR_MAX) == 0x7fffffffL
+typedef signed char int32_t;
+typedef unsigned char uint32_t;
+#define __int32_t_defined 1
+#endif
+
+#if __int32_t_defined
+typedef int32_t   	int_least32_t;
+typedef uint32_t 	uint_least32_t;
+#define __int_least32_t_defined 1
+
+#ifndef __int_least8_t_defined
+typedef int32_t	   	int_least8_t;
+typedef uint32_t  	uint_least8_t;
+#define __int_least8_t_defined 1
+#endif
+
+#ifndef __int_least16_t_defined
+typedef int32_t	   	int_least16_t;
+typedef uint32_t  	uint_least16_t;
+#define __int_least16_t_defined 1
+#endif
+#endif
+
+#if __EXP(LONG_MAX) > 0x7fffffff
+typedef signed long int64_t;
+typedef unsigned long uint64_t;
+#define __int64_t_defined 1
+#define __have_long64 1
+#elif  defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+#define __int64_t_defined 1
+#define __have_longlong64 1
+#elif  defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+#define __int64_t_defined 1
+#define __have_longlong64 1
+#elif  __EXP(INT_MAX) > 0x7fffffff
+typedef signed int int64_t;
+typedef unsigned int uint64_t;
+#define __int64_t_defined 1
+#endif
+
+#if __int64_t_defined
+typedef int64_t   	int_least64_t;
+typedef uint64_t 	uint_least64_t;
+#define __int_least64_t_defined 1
+
+#ifndef __int_least8_t_defined
+typedef int64_t	   	int_least8_t;
+typedef uint64_t  	uint_least8_t;
+#define __int_least8_t_defined 1
+#endif
+
+#ifndef __int_least16_t_defined
+typedef int64_t	   	int_least16_t;
+typedef uint64_t  	uint_least16_t;
+#define __int_least16_t_defined 1
+#endif
+
+#ifndef __int_least32_t_defined
+typedef int64_t	   	int_least32_t;
+typedef uint64_t  	uint_least32_t;
+#define __int_least32_t_defined 1
+#endif
+#endif
+
+#if __have_longlong64
+typedef signed long long intmax_t;
+typedef unsigned long long uintmax_t;
+#else
+typedef signed long intmax_t;
+typedef unsigned long uintmax_t;
+#endif
+
+/*
+ * GCC doesn't provide an propriate macro for [u]intptr_t
+ * For now, use __PTRDIFF_TYPE__
+ */
+#if defined(__PTRDIFF_TYPE__)
+typedef signed __PTRDIFF_TYPE__ intptr_t;
+typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
+#else
+/*
+ * Fallback to hardcoded values, 
+ * should be valid on cpu's with 32bit int/32bit void*
+ */
+typedef signed long intptr_t;
+typedef unsigned long uintptr_t;
+#endif
+
+/* Limits of Specified-Width Integer Types */
+
+#if __int8_t_defined
+#define INT8_MIN 	-128
+#define INT8_MAX 	 127
+#define UINT8_MAX 	 255
+#endif
+
+#if __int_least8_t_defined
+#define INTLEAST8_MIN 	-128
+#define INTLEAST8_MAX 	 127
+#define UINTLEAST8_MAX 	 255
+#else
+#error required type int_least8_t missing
+#endif
+
+#if __int16_t_defined
+#define INT16_MIN 	-32768
+#define INT16_MAX 	 32767
+#define UINT16_MAX 	 65535
+#endif
+
+#if __int_least16_t_defined
+#define INTLEAST16_MIN 	-32768
+#define INTLEAST16_MAX 	 32767
+#define UINTLEAST16_MAX  65535
+#else
+#error required type int_least16_t missing
+#endif
+
+#if __int32_t_defined
+#define INT32_MIN 	-2147483648
+#define INT32_MAX 	 2147483647
+#define UINT32_MAX       4294967295
+#endif
+
+#if __int_least32_t_defined
+#define INTLEAST32_MIN 	-2147483648
+#define INTLEAST32_MAX 	 2147483647
+#define UINTLEAST32_MAX  4294967295
+#else
+#error required type int_least32_t missing
+#endif
+
+#if __int64_t_defined
+#define INT64_MIN 	-9223372036854775808
+#define INT64_MAX 	 9223372036854775807
+#define UINT64_MAX 	18446744073709551615
+#endif
+
+#if __int_least64_t_defined
+#define INTLEAST64_MIN 	-9223372036854775808
+#define INTLEAST64_MAX 	 9223372036854775807
+#define UINTLEAST64_MAX 18446744073709551615
+#endif
+
+/* This must match size_t in stddef.h, currently long unsigned int */
+#define SIZE_MIN (-__EXP(LONG_MAX) - 1L)
+#define SIZE_MAX __EXP(LONG_MAX)
+
+/* This must match sig_atomic_t in <signal.h> (currently int) */
+#define SIG_ATOMIC_MIN (-__EXP(INT_MAX) - 1)
+#define SIG_ATOMIC_MAX __EXP(INT_MAX)
+
+/* This must match ptrdiff_t  in <stddef.h> (currently long int) */
+#define PTRDIFF_MIN (-__EXP(LONG_MAX) - 1L)
+#define PTHDIFF_MAX __EXT(LONG_MAX)
+
+#undef __EXP
+
+/** Macros for minimum-width integer constant expressions */
+#define INT8_C(x)	x
+#define UINT8_C(x)	x##U
+
+#define INT16_C(x)	x
+#define UINT16_C(x)	x##U
+
+#if __have_long32
+#define INT32_C(x)	x##L
+#define UINT32_C(x)	x##UL
+#else
+#define INT32_C(x)	x
+#define UINT32_C(x)	x##U
+#endif
+
+#if __int64_t_defined
+#if __have_longlong64
+#define INT64_C(x)	x##LL
+#define UINT64_C(x)	x##ULL
+#else
+#define INT64_C(x)	x##L
+#define UINT64_C(x)	x##UL
+#endif
+#endif
+
+/** Macros for greatest-width integer constant expression */
+#if __have_longlong64
+#define INTMAX_C(x)	x##LL
+#define UINTMAX_C(x)	x##ULL
+#else
+#define INTMAX_C(x)	x##L
+#define UINTMAX_C(x)	x##UL
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _STDINT_H */
Index: src/newlib/libc/time/Makefile.am
diff -u src/newlib/libc/time/Makefile.am:1.4 src/newlib/libc/time/Makefile.am:1.5
--- src/newlib/libc/time/Makefile.am:1.4	Wed Apr 17 21:23:31 2002
+++ src/newlib/libc/time/Makefile.am	Wed Feb 23 19:08:57 2005
@@ -11,6 +11,7 @@
 	ctime.c		\
 	ctime_r.c	\
 	difftime.c	\
+	gettzinfo.c	\
 	gmtime.c	\
 	gmtime_r.c	\
 	lcltime.c	\
Index: src/newlib/libc/time/Makefile.in
diff -u src/newlib/libc/time/Makefile.in:1.10 src/newlib/libc/time/Makefile.in:1.11
--- src/newlib/libc/time/Makefile.in:1.10	Tue Jan 27 23:26:26 2004
+++ src/newlib/libc/time/Makefile.in	Wed Feb 23 19:08:58 2005
@@ -110,7 +110,7 @@
 
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
-LIB_SOURCES =  	asctime.c		asctime_r.c		clock.c			ctime.c			ctime_r.c		difftime.c		gmtime.c		gmtime_r.c		lcltime.c		lcltime_r.c		mktime.c		mktm_r.c		strftime.c  		strptime.c		time.c			tzlock.c		tzset.c			tzset_r.c
+LIB_SOURCES =  	asctime.c		asctime_r.c		clock.c			ctime.c			ctime_r.c		difftime.c		gettzinfo.c		gmtime.c		gmtime_r.c		lcltime.c		lcltime_r.c		mktime.c		mktm_r.c		strftime.c  		strptime.c		time.c			tzlock.c		tzset.c			tzset_r.c
 
 
 libtime_la_LDFLAGS = -Xcompiler -nostdlib
@@ -144,19 +144,20 @@
 @USE_LIBTOOL_FALSE@lib_a_OBJECTS =  asctime.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@asctime_r.$(OBJEXT) clock.$(OBJEXT) ctime.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@ctime_r.$(OBJEXT) difftime.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@gmtime.$(OBJEXT) gmtime_r.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@lcltime.$(OBJEXT) lcltime_r.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@mktime.$(OBJEXT) mktm_r.$(OBJEXT) strftime.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@gettzinfo.$(OBJEXT) gmtime.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@gmtime_r.$(OBJEXT) lcltime.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@lcltime_r.$(OBJEXT) mktime.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@mktm_r.$(OBJEXT) strftime.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@strptime.$(OBJEXT) time.$(OBJEXT) tzlock.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@tzset.$(OBJEXT) tzset_r.$(OBJEXT)
 LTLIBRARIES =  $(noinst_LTLIBRARIES)
 
 libtime_la_LIBADD = 
 @USE_LIBTOOL_TRUE@libtime_la_OBJECTS =  asctime.lo asctime_r.lo clock.lo \
-@USE_LIBTOOL_TRUE@ctime.lo ctime_r.lo difftime.lo gmtime.lo gmtime_r.lo \
-@USE_LIBTOOL_TRUE@lcltime.lo lcltime_r.lo mktime.lo mktm_r.lo \
-@USE_LIBTOOL_TRUE@strftime.lo strptime.lo time.lo tzlock.lo tzset.lo \
-@USE_LIBTOOL_TRUE@tzset_r.lo
+@USE_LIBTOOL_TRUE@ctime.lo ctime_r.lo difftime.lo gettzinfo.lo \
+@USE_LIBTOOL_TRUE@gmtime.lo gmtime_r.lo lcltime.lo lcltime_r.lo \
+@USE_LIBTOOL_TRUE@mktime.lo mktm_r.lo strftime.lo strptime.lo time.lo \
+@USE_LIBTOOL_TRUE@tzlock.lo tzset.lo tzset_r.lo
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
Index: src/newlib/libc/time/gettzinfo.c
diff -u /dev/null src/newlib/libc/time/gettzinfo.c:1.2
--- /dev/null	Thu May 12 14:26:03 2005
+++ src/newlib/libc/time/gettzinfo.c	Fri Feb 25 22:31:21 2005
@@ -0,0 +1,15 @@
+#include <sys/types.h>
+#include <local.h>
+
+/* Shared timezone information for libc/time functions.  */
+static __tzinfo_type tzinfo = {1, 0,
+    { {'J', 0, 0, 0, 0, (time_t)0, 0L },
+      {'J', 0, 0, 0, 0, (time_t)0, 0L } 
+    } 
+};
+
+__tzinfo_type *
+__gettzinfo (void)
+{
+  return &tzinfo;
+}
Index: src/newlib/libc/time/local.h
diff -u src/newlib/libc/time/local.h:1.1 src/newlib/libc/time/local.h:1.2
--- src/newlib/libc/time/local.h:1.1	Wed Apr 17 21:23:31 2002
+++ src/newlib/libc/time/local.h	Wed Feb 23 19:08:58 2005
@@ -19,24 +19,6 @@
 
 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
 
-extern time_t __tzstart_std;
-extern time_t __tzstart_dst;
-extern int __tznorth;
-extern int __tzyear;
-
-typedef struct __tzrule_struct
-{
-  char ch;
-  int m;
-  int n;
-  int d;
-  int s;
-  time_t change;
-  int offset;
-} __tzrule_type;
-
-extern __tzrule_type __tzrule[2];
-
 struct tm * _EXFUN (_mktm_r, (_CONST time_t *, struct tm *, int __is_gmtime));
 int         _EXFUN (__tzcalc_limits, (int __year));
 
Index: src/newlib/libc/time/mktime.c
diff -u src/newlib/libc/time/mktime.c:1.3 src/newlib/libc/time/mktime.c:1.5
--- src/newlib/libc/time/mktime.c:1.3	Wed Apr 17 21:23:31 2002
+++ src/newlib/libc/time/mktime.c	Fri Feb 25 22:31:21 2005
@@ -158,6 +158,7 @@
   time_t tim = 0;
   long days = 0;
   int year, isdst;
+  __tzinfo_type *tz = __gettzinfo ();
 
   /* validate structure */
   validate_structure (tim_p);
@@ -206,27 +207,34 @@
   if (_daylight)
     {
       int y = tim_p->tm_year + YEAR_BASE;
-      if (y == __tzyear || __tzcalc_limits (y))
+      if (y == tz->__tzyear || __tzcalc_limits (y))
 	{
 	  /* calculate start of dst in dst local time and 
 	     start of std in both std local time and dst local time */
-          time_t startdst_dst = __tzrule[0].change - __tzrule[1].offset;
-	  time_t startstd_dst = __tzrule[1].change - __tzrule[1].offset;
-	  time_t startstd_std = __tzrule[1].change - __tzrule[0].offset;
+          time_t startdst_dst = tz->__tzrule[0].change
+	    - (time_t) tz->__tzrule[1].offset;
+	  time_t startstd_dst = tz->__tzrule[1].change
+	    - (time_t) tz->__tzrule[1].offset;
+	  time_t startstd_std = tz->__tzrule[1].change
+	    - (time_t) tz->__tzrule[0].offset;
 	  /* if the time is in the overlap between dst and std local times */
 	  if (tim >= startstd_std && tim < startstd_dst)
 	    ; /* we let user decide or leave as -1 */
           else
 	    {
-	      isdst = (__tznorth
+	      isdst = (tz->__tznorth
 		       ? (tim >= startdst_dst && tim < startstd_std)
 		       : (tim >= startdst_dst || tim < startstd_std));
 	      /* if user committed and was wrong, perform correction */
 	      if ((isdst ^ tim_p->tm_isdst) == 1)
 		{
 		  /* we either subtract or add the difference between
-		     time zone offsets, depending on which way the user got it wrong */
-		  int diff = __tzrule[0].offset - __tzrule[1].offset;
+		     time zone offsets, depending on which way the user got it
+		     wrong. The diff is typically one hour, or 3600 seconds,
+		     and should fit in a 16-bit int, even though offset
+		     is a long to accomodate 12 hours. */
+		  int diff = (int) (tz->__tzrule[0].offset
+				    - tz->__tzrule[1].offset);
 		  if (!isdst)
 		    diff = -diff;
 		  tim_p->tm_sec += diff;
@@ -239,9 +247,9 @@
 
   /* add appropriate offset to put time in gmt format */
   if (isdst == 1)
-    tim += __tzrule[1].offset;
+    tim += (time_t) tz->__tzrule[1].offset;
   else /* otherwise assume std time */
-    tim += __tzrule[0].offset;
+    tim += (time_t) tz->__tzrule[0].offset;
 
   /* reset isdst flag to what we have calculated */
   tim_p->tm_isdst = isdst;
Index: src/newlib/libc/time/mktm_r.c
diff -u src/newlib/libc/time/mktm_r.c:1.2 src/newlib/libc/time/mktm_r.c:1.4
--- src/newlib/libc/time/mktm_r.c:1.2	Wed Dec  8 17:54:38 2004
+++ src/newlib/libc/time/mktm_r.c	Fri Feb 25 22:31:21 2005
@@ -32,10 +32,10 @@
 {
   long days, rem;
   time_t lcltime;
-  int i;
   int y;
   int yleap;
   _CONST int *ip;
+   __tzinfo_type *tz = __gettzinfo ();
 
   /* base decision about std/dst time on current time */
   lcltime = *tim_p;
@@ -95,29 +95,33 @@
 
   if (!is_gmtime)
     {
-      int offset;
+      long offset;
       int hours, mins, secs;
 
       TZ_LOCK;
       if (_daylight)
 	{
-	  if (y == __tzyear || __tzcalc_limits (y))
-	    res->tm_isdst = (__tznorth 
-			     ? (*tim_p >= __tzrule[0].change && *tim_p < __tzrule[1].change)
-			     : (*tim_p >= __tzrule[0].change || *tim_p < __tzrule[1].change));
+	  if (y == tz->__tzyear || __tzcalc_limits (y))
+	    res->tm_isdst = (tz->__tznorth 
+			     ? (*tim_p >= tz->__tzrule[0].change 
+				&& *tim_p < tz->__tzrule[1].change)
+			     : (*tim_p >= tz->__tzrule[0].change 
+				|| *tim_p < tz->__tzrule[1].change));
 	  else
 	    res->tm_isdst = -1;
 	}
       else
 	res->tm_isdst = 0;
 
-      offset = (res->tm_isdst == 1 ? __tzrule[1].offset : __tzrule[0].offset);
+      offset = (res->tm_isdst == 1 
+		  ? tz->__tzrule[1].offset 
+		  : tz->__tzrule[0].offset);
 
-      hours = offset / SECSPERHOUR;
+      hours = (int) (offset / SECSPERHOUR);
       offset = offset % SECSPERHOUR;
       
-      mins = offset / SECSPERMIN;
-      secs = offset % SECSPERMIN;
+      mins = (int) (offset / SECSPERMIN);
+      secs = (int) (offset % SECSPERMIN);
 
       res->tm_sec -= secs;
       res->tm_min -= mins;
@@ -197,11 +201,12 @@
 {
   int days, year_days, years;
   int i, j;
+  __tzinfo_type *tz = __gettzinfo ();
 
   if (year < EPOCH_YEAR)
     return 0;
 
-  __tzyear = year;
+  tz->__tzyear = year;
 
   years = (year - EPOCH_YEAR);
 
@@ -211,10 +216,11 @@
   
   for (i = 0; i < 2; ++i)
     {
-      if (__tzrule[i].ch == 'J')
-	days = year_days + __tzrule[i].d + (isleap(year) && __tzrule[i].d >= 60);
-      else if (__tzrule[i].ch == 'D')
-	days = year_days + __tzrule[i].d;
+      if (tz->__tzrule[i].ch == 'J')
+	days = year_days + tz->__tzrule[i].d + 
+		(isleap(year) && tz->__tzrule[i].d >= 60);
+      else if (tz->__tzrule[i].ch == 'D')
+	days = year_days + tz->__tzrule[i].d;
       else
 	{
 	  int yleap = isleap(year);
@@ -223,15 +229,15 @@
 
 	  days = year_days;
 
-	  for (j = 1; j < __tzrule[i].m; ++j)
+	  for (j = 1; j < tz->__tzrule[i].m; ++j)
 	    days += ip[j-1];
 
 	  m_wday = (EPOCH_WDAY + days) % DAYSPERWEEK;
 	  
-	  wday_diff = __tzrule[i].d - m_wday;
+	  wday_diff = tz->__tzrule[i].d - m_wday;
 	  if (wday_diff < 0)
 	    wday_diff += DAYSPERWEEK;
-	  m_day = (__tzrule[i].n - 1) * DAYSPERWEEK + wday_diff;
+	  m_day = (tz->__tzrule[i].n - 1) * DAYSPERWEEK + wday_diff;
 
 	  while (m_day >= ip[j-1])
 	    m_day -= DAYSPERWEEK;
@@ -240,10 +246,11 @@
 	}
 
       /* store the change-over time in GMT form by adding offset */
-      __tzrule[i].change = days * SECSPERDAY + __tzrule[i].s + __tzrule[i].offset;
+      tz->__tzrule[i].change = days * SECSPERDAY + 
+	      			tz->__tzrule[i].s + tz->__tzrule[i].offset;
     }
 
-  __tznorth = (__tzrule[0].change < __tzrule[1].change);
+  tz->__tznorth = (tz->__tzrule[0].change < tz->__tzrule[1].change);
 
   return 1;
 }
Index: src/newlib/libc/time/strftime.c
diff -u src/newlib/libc/time/strftime.c:1.5 src/newlib/libc/time/strftime.c:1.10
--- src/newlib/libc/time/strftime.c:1.5	Wed Jan 15 18:52:02 2003
+++ src/newlib/libc/time/strftime.c	Fri Feb 25 22:31:21 2005
@@ -1,6 +1,7 @@
 /*
  * strftime.c
  * Original Author:	G. Haley
+ * Additions from:	Eric Blake
  *
  * Places characters into the array pointed to by s as controlled by the string
  * pointed to by format. If the total number of resulting characters including
@@ -32,95 +33,195 @@
 
 DESCRIPTION
 <<strftime>> converts a <<struct tm>> representation of the time (at
-<[timp]>) into a string, starting at <[s]> and occupying no more than
-<[maxsize]> characters.
+<[timp]>) into a null-terminated string, starting at <[s]> and occupying
+no more than <[maxsize]> characters.
 
 You control the format of the output using the string at <[format]>.
 <<*<[format]>>> can contain two kinds of specifications: text to be
 copied literally into the formatted string, and time conversion
-specifications.  Time conversion specifications are two-character
-sequences beginning with `<<%>>' (use `<<%%>>' to include a percent
-sign in the output).  Each defined conversion specification selects a
-field of calendar time data from <<*<[timp]>>>, and converts it to a
-string in one of the following ways:
+specifications.  Time conversion specifications are two- and
+three-character sequences beginning with `<<%>>' (use `<<%%>>' to
+include a percent sign in the output).  Each defined conversion
+specification selects only the specified field(s) of calendar time
+data from <<*<[timp]>>>, and converts it to a string in one of the
+following ways:
 
 o+
 o %a
-An abbreviation for the day of the week.
+A three-letter abbreviation for the day of the week. [tm_wday]
 
 o %A
-The full name for the day of the week.
+The full name for the day of the week, one of `<<Sunday>>',
+`<<Monday>>', `<<Tuesday>>', `<<Wednesday>>', `<<Thursday>>',
+`<<Friday>>', or `<<Saturday>>'. [tm_wday]
 
 o %b
-An abbreviation for the month name.
+A three-letter abbreviation for the month name. [tm_mon]
 
 o %B
-The full name of the month.
+The full name of the month, one of `<<January>>', `<<February>>',
+`<<March>>', `<<April>>', `<<May>>', `<<June>>', `<<July>>',
+`<<August>>', `<<September>>', `<<October>>', `<<November>>',
+`<<December>>'. [tm_mon]
 
 o %c
 A string representing the complete date and time, in the form
-. Mon Apr 01 13:13:13 1992
+`<<"%a %b %e %H:%M:%S %Y">>' (example "Mon Apr 01 13:13:13
+1992"). [tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year, tm_wday]
 
+o %C
+The century, that is, the year divided by 100 then truncated.  For
+4-digit years, the result is zero-padded and exactly two characters;
+but for other years, there may a negative sign or more digits.  In
+this way, `<<%C%y>>' is equivalent to `<<%Y>>'. [tm_year]
+ 
 o %d
-The day of the month, formatted with two digits.
+The day of the month, formatted with two digits (from `<<01>>' to
+`<<31>>'). [tm_mday]
+
+o %D
+A string representing the date, in the form `<<"%m/%d/%y">>'.
+[tm_mday, tm_mon, tm_year]
 
 o %e
-The day of the month, formatted with leading space if single digit.
+The day of the month, formatted with leading space if single digit
+(from `<<1>>' to `<<31>>'). [tm_mday]
+
+o %E<<x>>
+In some locales, the E modifier selects alternative representations of
+certain modifiers <<x>>.  But in the "C" locale supported by newlib,
+it is ignored, and treated as %<<x>>.
+
+o %F
+A string representing the ISO 8601:2000 date format, in the form
+`<<"%Y-%m-%d">>'. [tm_mday, tm_mon, tm_year]
+
+o %g
+The last two digits of the week-based year, see specifier %G (from
+`<<00>>' to `<<99>>'). [tm_year, tm_wday, tm_yday]
+
+o %G
+The week-based year. In the ISO 8601:2000 calendar, week 1 of the year
+includes January 4th, and begin on Mondays. Therefore, if January 1st,
+2nd, or 3rd falls on a Sunday, that day and earlier belong to the last
+week of the previous year; and if December 29th, 30th, or 31st falls
+on Monday, that day and later belong to week 1 of the next year.  For
+consistency with %Y, it always has at least four characters. 
+Example: "%G" for Saturday 2nd January 1999 gives "1998", and for
+Tuesday 30th December 1997 gives "1998". [tm_year, tm_wday, tm_yday]
+
+o %h
+A three-letter abbreviation for the month name (synonym for
+"%b"). [tm_mon]
 
 o %H
-The hour (on a 24-hour clock), formatted with two digits.
+The hour (on a 24-hour clock), formatted with two digits (from
+`<<00>>' to `<<23>>'). [tm_hour]
 
 o %I
-The hour (on a 12-hour clock), formatted with two digits.
+The hour (on a 12-hour clock), formatted with two digits (from
+`<<01>>' to `<<12>>'). [tm_hour]
 
 o %j
 The count of days in the year, formatted with three digits
-(from `<<001>>' to `<<366>>').
+(from `<<001>>' to `<<366>>'). [tm_yday]
+
+o %k
+The hour (on a 24-hour clock), formatted with leading space if single
+digit (from `<<0>>' to `<<23>>'). Non-POSIX extension. [tm_hour]
+
+o %l
+The hour (on a 12-hour clock), formatted with leading space if single
+digit (from `<<1>>' to `<<12>>'). Non-POSIX extension. [tm_hour]
 
 o %m
-The month number, formatted with two digits.
+The month number, formatted with two digits (from `<<01>>' to `<<12>>').
+[tm_mon]
 
 o %M
-The minute, formatted with two digits.
+The minute, formatted with two digits (from `<<00>>' to `<<59>>'). [tm_min]
+
+o %n
+A newline character (`<<\n>>').
+
+o %O<<x>>
+In some locales, the O modifier selects alternative digit characters
+for certain modifiers <<x>>.  But in the "C" locale supported by newlib, it
+is ignored, and treated as %<<x>>.
 
 o %p
-Either `<<AM>>' or `<<PM>>' as appropriate.
+Either `<<AM>>' or `<<PM>>' as appropriate. [tm_hour]
+
+o %r
+The 12-hour time, to the second.  Equivalent to "%I:%M:%S %p". [tm_sec,
+tm_min, tm_hour]
+
+o %R
+The 24-hour time, to the minute.  Equivalent to "%H:%M". [tm_min, tm_hour]
 
 o %S
-The second, formatted with two digits.
+The second, formatted with two digits (from `<<00>>' to `<<60>>').  The
+value 60 accounts for the occasional leap second. [tm_sec]
+
+o %t
+A tab character (`<<\t>>').
+
+o %T
+The 24-hour time, to the second.  Equivalent to "%H:%M:%S". [tm_sec,
+tm_min, tm_hour]
+
+o %u
+The weekday as a number, 1-based from Monday (from `<<1>>' to
+`<<7>>'). [tm_wday]
 
 o %U
-The week number, formatted with two digits (from `<<00>>' to `<<53>>';
-week number 1 is taken as beginning with the first Sunday in a year).
-See also <<%W>>.
+The week number, where weeks start on Sunday, week 1 contains the first
+Sunday in a year, and earlier days are in week 0.  Formatted with two
+digits (from `<<00>>' to `<<53>>').  See also <<%W>>. [tm_wday, tm_yday]
+
+o %V
+The week number, where weeks start on Monday, week 1 contains January 4th,
+and earlier days are in the previous year.  Formatted with two digits
+(from `<<01>>' to `<<53>>').  See also <<%G>>. [tm_year, tm_wday, tm_yday]
 
 o %w
-A single digit representing the day of the week: Sunday is day <<0>>.
+The weekday as a number, 0-based from Sunday (from `<<0>>' to `<<6>>').
+[tm_wday]
 
 o %W
-Another version of the week number: like `<<%U>>', but counting week 1
-as beginning with the first Monday in a year.
+The week number, where weeks start on Monday, week 1 contains the first
+Monday in a year, and earlier days are in week 0.  Formatted with two
+digits (from `<<00>>' to `<<53>>'). [tm_wday, tm_yday]
 
-o
 o %x
-A string representing the complete date, in a format like
-. Mon Apr 01 1992
+A string representing the complete date, equivalent to "%m/%d/%y".
+[tm_mon, tm_mday, tm_year]
 
 o %X
 A string representing the full time of day (hours, minutes, and
-seconds), in a format like
-. 13:13:13
+seconds), equivalent to "%H:%M:%S". [tm_sec, tm_min, tm_hour]
 
 o %y
-The last two digits of the year.
+The last two digits of the year (from `<<00>>' to `<<99>>'). [tm_year]
 
 o %Y
-The full year, formatted with four digits to include the century.
+The full year, equivalent to <<%C%y>>.  It will always have at least four
+characters, but may have more.  The year is accurate even when tm_year
+added to the offset of 1900 overflows an int. [tm_year]
+
+o %z
+The offset from UTC.  The format consists of a sign (negative is west of
+Greewich), two characters for hour, then two characters for minutes
+(-hhmm or +hhmm).  If tm_isdst is negative, the offset is unknown and no
+output is generated; if it is zero, the offset is the standard offset for
+the current time zone; and if it is positive, the offset is the daylight
+savings offset for the current timezone. The offset is determined from
+the TZ environment variable, as if by calling tzset(). [tm_isdst]
 
 o %Z
-The time zone name.  If tm_isdst is -1, no output is generated.
-Otherwise, the time zone name based on the TZ environment variable
-is used.
+The time zone name.  If tm_isdst is negative, no output is generated.
+Otherwise, the time zone name is based on the TZ environment variable,
+as if by calling tzset(). [tm_isdst]
 
 o %%
 A single character, `<<%>>'.
@@ -137,7 +238,12 @@
 PORTABILITY
 ANSI C requires <<strftime>>, but does not specify the contents of
 <<*<[s]>>> when the formatted string would require more than
-<[maxsize]> characters.
+<[maxsize]> characters.  Unrecognized specifiers and fields of
+<<timp>> that are out of range cause undefined results.  Since some
+formats expand to 0 bytes, it is wise to set <<*<[s]>>> to a nonzero
+value beforehand to distinguish between failure and an empty string.
+This implementation does not support <<s>> being NULL, nor overlapping
+<<s>> and <<format>>.
 
 <<strftime>> requires no supporting OS subroutines.
 */
@@ -145,6 +251,8 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <time.h>
+#include <string.h>
+#include <stdlib.h>
 #include "local.h"
 
 static _CONST int dname_len[7] =
@@ -162,6 +270,53 @@
  "May", "June", "July", "August", "September", "October", "November",
  "December"};
 
+/* Using the tm_year, tm_wday, and tm_yday components of TIM_P, return
+   -1, 0, or 1 as the adjustment to add to the year for the ISO week
+   numbering used in "%g%G%V", avoiding overflow.  */
+static int
+_DEFUN (iso_year_adjust, (tim_p),
+	_CONST struct tm *tim_p)
+{
+  /* Account for fact that tm_year==0 is year 1900.  */
+  int leap = isleap (tim_p->tm_year + (YEAR_BASE
+				       - (tim_p->tm_year < 0 ? 0 : 2000)));
+
+  /* Pack the yday, wday, and leap year into a single int since there are so
+     many disparate cases.  */
+#define PACK(yd, wd, lp) (((yd) << 4) + (wd << 1) + (lp))
+  switch (PACK (tim_p->tm_yday, tim_p->tm_wday, leap))
+    {
+    case PACK (0, 5, 0): /* Jan 1 is Fri, not leap.  */
+    case PACK (0, 6, 0): /* Jan 1 is Sat, not leap.  */
+    case PACK (0, 0, 0): /* Jan 1 is Sun, not leap.  */
+    case PACK (0, 5, 1): /* Jan 1 is Fri, leap year.  */
+    case PACK (0, 6, 1): /* Jan 1 is Sat, leap year.  */
+    case PACK (0, 0, 1): /* Jan 1 is Sun, leap year.  */
+    case PACK (1, 6, 0): /* Jan 2 is Sat, not leap.  */
+    case PACK (1, 0, 0): /* Jan 2 is Sun, not leap.  */
+    case PACK (1, 6, 1): /* Jan 2 is Sat, leap year.  */
+    case PACK (1, 0, 1): /* Jan 2 is Sun, leap year.  */
+    case PACK (2, 0, 0): /* Jan 3 is Sun, not leap.  */
+    case PACK (2, 0, 1): /* Jan 3 is Sun, leap year.  */
+      return -1; /* Belongs to last week of previous year.  */
+    case PACK (362, 1, 0): /* Dec 29 is Mon, not leap.  */
+    case PACK (363, 1, 1): /* Dec 29 is Mon, leap year.  */
+    case PACK (363, 1, 0): /* Dec 30 is Mon, not leap.  */
+    case PACK (363, 2, 0): /* Dec 30 is Tue, not leap.  */
+    case PACK (364, 1, 1): /* Dec 30 is Mon, leap year.  */
+    case PACK (364, 2, 1): /* Dec 30 is Tue, leap year.  */
+    case PACK (364, 1, 0): /* Dec 31 is Mon, not leap.  */
+    case PACK (364, 2, 0): /* Dec 31 is Tue, not leap.  */
+    case PACK (364, 3, 0): /* Dec 31 is Wed, not leap.  */
+    case PACK (365, 1, 1): /* Dec 31 is Mon, leap year.  */
+    case PACK (365, 2, 1): /* Dec 31 is Tue, leap year.  */
+    case PACK (365, 3, 1): /* Dec 31 is Wed, leap year.  */
+      return 1; /* Belongs to first week of next year.  */
+    }
+  return 0; /* Belongs to specified year.  */
+#undef PACK
+}
+
 size_t
 _DEFUN (strftime, (s, maxsize, format, tim_p),
 	char *s _AND
@@ -186,6 +341,9 @@
 	break;
 
       format++;
+      if (*format == 'E' || *format == 'O')
+	format++;
+
       switch (*format)
 	{
 	case 'a':
@@ -230,52 +388,141 @@
 	    }
 	  break;
 	case 'c':
-	  if (count < maxsize - 24)
-	    {
-	      for (i = 0; i < 3; i++)
-		s[count++] =
-		  dname[tim_p->tm_wday][i];
-	      s[count++] = ' ';
-	      for (i = 0; i < 3; i++)
-		s[count++] =
-		  mname[tim_p->tm_mon][i];
-
-	      sprintf (&s[count],
-		       " %.2d %2.2d:%2.2d:%2.2d %.4d",
-		       tim_p->tm_mday, tim_p->tm_hour,
-		       tim_p->tm_min,
-		       tim_p->tm_sec, 1900 +
-		       tim_p->tm_year);
-	      count += 17;
-	    }
-	  else
-	    return 0;
+	  {
+	    /* Length is not known because of %C%y, so recurse. */
+	    size_t adjust = strftime (&s[count], maxsize - count,
+				      "%a %b %e %H:%M:%S %C%y", tim_p);
+	    if (adjust > 0)
+	      count += adjust;
+	    else
+	      return 0;
+	  }
+	  break;
+	case 'C':
+	  {
+	    /* Examples of (tm_year + YEAR_BASE) that show how %Y == %C%y
+	       with 32-bit int.
+	       %Y		%C		%y
+	       2147485547	21474855	47
+	       10000		100		00
+	       9999		99		99
+	       0999		09		99
+	       0099		00		99
+	       0001		00		01
+	       0000		00		00
+	       -001		-0		01
+	       -099		-0		99
+	       -999		-9		99
+	       -1000		-10		00
+	       -10000		-100		00
+	       -2147481748	-21474817	48
+
+	       Be careful of both overflow and sign adjustment due to the
+	       asymmetric range of years.
+	    */
+	    int neg = tim_p->tm_year < -YEAR_BASE;
+	    int century = tim_p->tm_year >= 0
+	      ? tim_p->tm_year / 100 + YEAR_BASE / 100
+	      : abs (tim_p->tm_year + YEAR_BASE) / 100;
+            count += snprintf (&s[count], maxsize - count, "%s%.*d",
+                               neg ? "-" : "", 2 - neg, century);
+            if (count >= maxsize)
+              return 0;
+	  }
 	  break;
 	case 'd':
+	case 'e':
 	  if (count < maxsize - 2)
 	    {
-	      sprintf (&s[count], "%.2d",
+	      sprintf (&s[count], *format == 'd' ? "%.2d" : "%2d",
 		       tim_p->tm_mday);
 	      count += 2;
 	    }
 	  else
 	    return 0;
 	  break;
-	case 'e':
-	  if (count < maxsize - 2)
+	case 'D':
+	case 'x':
+	  /* %m/%d/%y */
+	  if (count < maxsize - 8)
 	    {
-	      sprintf (&s[count], "%2d",
-		       tim_p->tm_mday);
-	      count += 2;
+	      sprintf (&s[count], "%.2d/%.2d/%.2d",
+		       tim_p->tm_mon + 1, tim_p->tm_mday,
+		       tim_p->tm_year >= 0 ? tim_p->tm_year % 100
+		       : abs (tim_p->tm_year + YEAR_BASE) % 100);
+	      count += 8;
 	    }
 	  else
 	    return 0;
 	  break;
+        case 'F':
+	  {
+	    /* Length is not known because of %C%y, so recurse. */
+	    size_t adjust = strftime (&s[count], maxsize - count,
+				      "%C%y-%m-%d", tim_p);
+	    if (adjust > 0)
+	      count += adjust;
+	    else
+	      return 0;
+	  }
+          break;
+        case 'g':
+	  if (count < maxsize - 2)
+	    {
+	      /* Be careful of both overflow and negative years, thanks to
+		 the asymmetric range of years.  */
+	      int adjust = iso_year_adjust (tim_p);
+	      int year = tim_p->tm_year >= 0 ? tim_p->tm_year % 100
+		: abs (tim_p->tm_year + YEAR_BASE) % 100;
+	      if (adjust < 0 && tim_p->tm_year <= -YEAR_BASE)
+		adjust = 1;
+	      else if (adjust > 0 && tim_p->tm_year < -YEAR_BASE)
+		adjust = -1;
+	      sprintf (&s[count], "%.2d",
+		       ((year + adjust) % 100 + 100) % 100);
+	      count += 2;
+	    }
+	  else
+	    return 0;
+          break;
+        case 'G':
+	  {
+	    /* See the comments for 'C' and 'Y'; this is a variable length
+	       field.  Although there is no requirement for a minimum number
+	       of digits, we use 4 for consistency with 'Y'.  */
+	    int neg = tim_p->tm_year < -YEAR_BASE;
+	    int adjust = iso_year_adjust (tim_p);
+	    int century = tim_p->tm_year >= 0
+	      ? tim_p->tm_year / 100 + YEAR_BASE / 100
+	      : abs (tim_p->tm_year + YEAR_BASE) / 100;
+	    int year = tim_p->tm_year >= 0 ? tim_p->tm_year % 100
+	      : abs (tim_p->tm_year + YEAR_BASE) % 100;
+	    if (adjust < 0 && tim_p->tm_year <= -YEAR_BASE)
+	      neg = adjust = 1;
+	    else if (adjust > 0 && neg)
+	      adjust = -1;
+	    year += adjust;
+	    if (year == -1)
+	      {
+		year = 99;
+		--century;
+	      }
+	    else if (year == 100)
+	      {
+		year = 0;
+		++century;
+	      }
+            count += snprintf (&s[count], maxsize - count, "%s%.*d%.2d",
+                               neg ? "-" : "", 2 - neg, century, year);
+            if (count >= maxsize)
+              return 0;
+	  }
+          break;
 	case 'H':
 	case 'k':
 	  if (count < maxsize - 2)
 	    {
-	      sprintf (&s[count], *format == 'k' ? "%2d" : "%2.2d",
+	      sprintf (&s[count], *format == 'k' ? "%2d" : "%.2d",
 		       tim_p->tm_hour);
 	      count += 2;
 	    }
@@ -294,7 +541,7 @@
 		}
 	      else
 		{
-		  sprintf (&s[count], (*format == 'I') ? "%.2d" : "%2d",
+		  sprintf (&s[count], *format == 'I' ? "%.2d" : "%2d",
 			   tim_p->tm_hour % 12);
 		  count += 2;
 		}
@@ -325,13 +572,19 @@
 	case 'M':
 	  if (count < maxsize - 2)
 	    {
-	      sprintf (&s[count], "%2.2d",
+	      sprintf (&s[count], "%.2d",
 		       tim_p->tm_min);
 	      count += 2;
 	    }
 	  else
 	    return 0;
 	  break;
+	case 'n':
+	  if (count < maxsize - 1)
+	    s[count++] = '\n';
+	  else
+	    return 0;
+	  break;
 	case 'p':
 	  if (count < maxsize - 2)
 	    {
@@ -345,113 +598,192 @@
 	  else
 	    return 0;
 	  break;
-	case 'S':
-	  if (count < maxsize - 2)
+	case 'r':
+	  if (count < maxsize - 11)
 	    {
-	      sprintf (&s[count], "%2.2d",
+	      if (tim_p->tm_hour == 0 ||
+		  tim_p->tm_hour == 12)
+		{
+		  s[count++] = '1';
+		  s[count++] = '2';
+		}
+	      else
+		{
+		  sprintf (&s[count], "%.2d", tim_p->tm_hour % 12);
+		  count += 2;
+		}
+	      s[count++] = ':';
+	      sprintf (&s[count], "%.2d",
+		       tim_p->tm_min);
+	      count += 2;
+	      s[count++] = ':';
+	      sprintf (&s[count], "%.2d",
 		       tim_p->tm_sec);
 	      count += 2;
+	      s[count++] = ' ';
+	      if (tim_p->tm_hour < 12)
+		s[count++] = 'A';
+	      else
+		s[count++] = 'P';
+
+	      s[count++] = 'M';
 	    }
 	  else
 	    return 0;
 	  break;
-	case 'U':
+        case 'R':
+          if (count < maxsize - 5)
+            {
+              sprintf (&s[count], "%.2d:%.2d", tim_p->tm_hour, tim_p->tm_min);
+              count += 5;
+            }
+          else
+            return 0;
+          break;
+	case 'S':
 	  if (count < maxsize - 2)
 	    {
-	      sprintf (&s[count], "%2.2d",
-		       (tim_p->tm_yday + 7 -
-			tim_p->tm_wday) / 7);
+	      sprintf (&s[count], "%.2d",
+		       tim_p->tm_sec);
 	      count += 2;
 	    }
 	  else
 	    return 0;
 	  break;
-	case 'w':
+	case 't':
 	  if (count < maxsize - 1)
-	    {
-	      sprintf (&s[count], "%1.1d",
-		       tim_p->tm_wday);
-	      count++;
-	    }
+	    s[count++] = '\t';
 	  else
 	    return 0;
 	  break;
-	case 'W':
+        case 'T':
+        case 'X':
+          if (count < maxsize - 8)
+            {
+              sprintf (&s[count], "%.2d:%.2d:%.2d", tim_p->tm_hour,
+                       tim_p->tm_min, tim_p->tm_sec);
+              count += 8;
+            }
+          else
+            return 0;
+          break;
+        case 'u':
+          if (count < maxsize - 1)
+            {
+              if (tim_p->tm_wday == 0)
+                s[count++] = '7';
+              else
+                s[count++] = '0' + tim_p->tm_wday;
+            }
+          else
+            return 0;
+          break;
+	case 'U':
 	  if (count < maxsize - 2)
 	    {
-	      int wday = (tim_p->tm_wday) ? tim_p->tm_wday - 1 : 6;
-	      sprintf (&s[count], "%2.2d",
+	      sprintf (&s[count], "%.2d",
 		       (tim_p->tm_yday + 7 -
-			wday) / 7);
+			tim_p->tm_wday) / 7);
 	      count += 2;
 	    }
 	  else
 	    return 0;
 	  break;
-	case 'x':
-	  if (count < maxsize - 15)
+        case 'V':
+	  if (count < maxsize - 2)
 	    {
-	      for (i = 0; i < 3; i++)
-		s[count++] =
-		  dname[tim_p->tm_wday][i];
-	      s[count++] = ' ';
-	      for (i = 0; i < 3; i++)
-		s[count++] =
-		  mname[tim_p->tm_mon][i];
-
-	      sprintf (&s[count],
-		       " %.2d %.4d", tim_p->tm_mday,
-		       1900 + tim_p->tm_year);
-	      count += 8;
+	      int adjust = iso_year_adjust (tim_p);
+	      int wday = (tim_p->tm_wday) ? tim_p->tm_wday - 1 : 6;
+	      int week = (tim_p->tm_yday + 10 - wday) / 7;
+	      if (adjust > 0)
+		week = 1;
+	      else if (adjust < 0)
+		/* Previous year has 53 weeks if current year starts on
+		   Fri, and also if current year starts on Sat and
+		   previous year was leap year.  */
+		week = 52 + (4 >= (wday - tim_p->tm_yday
+				   - isleap (tim_p->tm_year
+					     + (YEAR_BASE - 1
+						- (tim_p->tm_year < 0
+						   ? 0 : 2000)))));
+	      sprintf (&s[count], "%.2d", week);
+	      count += 2;
 	    }
 	  else
 	    return 0;
-	  break;
-	case 'X':
-	  if (count < maxsize - 8)
-	    {
-	      sprintf (&s[count],
-		       "%2.2d:%2.2d:%2.2d",
-		       tim_p->tm_hour, tim_p->tm_min,
-		       tim_p->tm_sec);
-	      count += 8;
-	    }
+          break;
+	case 'w':
+	  if (count < maxsize - 1)
+            s[count++] = '0' + tim_p->tm_wday;
 	  else
 	    return 0;
 	  break;
-	case 'y':
+	case 'W':
 	  if (count < maxsize - 2)
 	    {
-	      /* The year could be greater than 100, so we need the value
-		 modulo 100.  The year could be negative, so we need to
-		 correct for a possible negative remainder.  */
-	      sprintf (&s[count], "%2.2d",
-		       (tim_p->tm_year % 100 + 100) % 100);
+	      int wday = (tim_p->tm_wday) ? tim_p->tm_wday - 1 : 6;
+	      sprintf (&s[count], "%.2d",
+		       (tim_p->tm_yday + 7 - wday) / 7);
 	      count += 2;
 	    }
 	  else
 	    return 0;
 	  break;
-	case 'Y':
-	  if (count < maxsize - 4)
+	case 'y':
+	  if (count < maxsize - 2)
 	    {
-	      sprintf (&s[count], "%.4d",
-		       1900 + tim_p->tm_year);
-	      count += 4;
+	      /* Be careful of both overflow and negative years, thanks to
+		 the asymmetric range of years.  */
+	      int year = tim_p->tm_year >= 0 ? tim_p->tm_year % 100
+		: abs (tim_p->tm_year + YEAR_BASE) % 100;
+	      sprintf (&s[count], "%.2d", year);
+	      count += 2;
 	    }
 	  else
 	    return 0;
 	  break;
+	case 'Y':
+	  {
+	    /* Length is not known because of %C%y, so recurse. */
+	    size_t adjust = strftime (&s[count], maxsize - count,
+				      "%C%y", tim_p);
+	    if (adjust > 0)
+	      count += adjust;
+	    else
+	      return 0;
+	  }
+	  break;
+        case 'z':
+          if (tim_p->tm_isdst >= 0)
+            {
+	      if (count < maxsize - 5)
+		{
+		  long offset;
+		  __tzinfo_type *tz = __gettzinfo ();
+		  TZ_LOCK;
+		  /* The sign of this is exactly opposite the envvar TZ.  We
+		     could directly use the global _timezone for tm_isdst==0,
+		     but have to use __tzrule for daylight savings.  */
+		  offset = -tz->__tzrule[tim_p->tm_isdst > 0].offset;
+		  TZ_UNLOCK;
+		  sprintf (&s[count], "%+03ld%.2ld", offset / SECSPERHOUR,
+			   labs (offset / SECSPERMIN) % 60L);
+		  count += 5;
+		}
+	      else
+		return 0;
+            }
+          break;
 	case 'Z':
 	  if (tim_p->tm_isdst >= 0)
 	    {
 	      int size;
 	      TZ_LOCK;
-	      size = strlen(_tzname[tim_p->tm_isdst]);
+	      size = strlen(_tzname[tim_p->tm_isdst > 0]);
 	      for (i = 0; i < size; i++)
 		{
 		  if (count < maxsize - 1)
-		    s[count++] = _tzname[tim_p->tm_isdst][i];
+		    s[count++] = _tzname[tim_p->tm_isdst > 0][i];
 		  else
 		    {
 		      TZ_UNLOCK;
@@ -473,7 +805,8 @@
       else
 	break;
     }
-  s[count] = '\0';
+  if (maxsize)
+    s[count] = '\0';
 
   return count;
 }
Index: src/newlib/libc/time/time.tex
diff -u src/newlib/libc/time/time.tex:1.3 src/newlib/libc/time/time.tex:1.4
--- src/newlib/libc/time/time.tex:1.3	Thu Sep 16 21:14:45 2004
+++ src/newlib/libc/time/time.tex	Wed Feb 16 21:15:37 2005
@@ -18,28 +18,28 @@
 
 @table @code
 @item tm_sec
-Seconds.
+Seconds, between 0 and 60 inclusive (60 allows for leap seconds).
 
 @item tm_min
-Minutes.
+Minutes, between 0 and 59 inclusive.
 
 @item tm_hour
-Hours.
+Hours, between 0 and 23 inclusive.
 
 @item tm_mday
-Day.
+Day of the month, between 1 and 31 inclusive.
 
 @item tm_mon
-Month.
+Month, between 0 (January) and 11 (December).
 
 @item tm_year
-Year (since 1900).
+Year (since 1900), can be negative for earlier years.
 
 @item tm_wday
-Day of week: the number of days since Sunday.
+Day of week, between 0 (Sunday) and 6 (Saturday).
 
 @item tm_yday
-Number of days elapsed since last January 1.
+Number of days elapsed since last January 1, between 0 and 365 inclusive.
 
 @item tm_isdst
 Daylight Savings Time flag: positive means DST in effect, zero means DST
Index: src/newlib/libc/time/tzset_r.c
diff -u src/newlib/libc/time/tzset_r.c:1.5 src/newlib/libc/time/tzset_r.c:1.7
--- src/newlib/libc/time/tzset_r.c:1.5	Thu Dec  9 21:36:48 2004
+++ src/newlib/libc/time/tzset_r.c	Wed Feb 23 19:08:58 2005
@@ -12,16 +12,9 @@
 static char *prev_tzenv = NULL;
 
 /* default to GMT */
-char *_tzname[2] = {"GMT" "GMT"};
+char *_tzname[2] = {"GMT", "GMT"};
 int _daylight = 0;
-time_t _timezone = (time_t)0;
-
-int __tzyear = 0;
-
-int __tznorth = 1;
-
-__tzrule_type __tzrule[2] = { {'J', 0, 0, 0, 0, (time_t)0, 0 }, 
-			      {'J', 0, 0, 0, 0, (time_t)0, 0 } };
+long _timezone = 0;
 
 _VOID
 _DEFUN (_tzset_r, (reent_ptr),
@@ -31,11 +24,12 @@
   unsigned short hh, mm, ss, m, w, d;
   int sign, n;
   int i, ch;
+  __tzinfo_type *tz = __gettzinfo ();
 
   if ((tzenv = _getenv_r (reent_ptr, "TZ")) == NULL)
       {
 	TZ_LOCK;
-	_timezone = (time_t)0;
+	_timezone = 0;
 	_daylight = 0;
 	_tzname[0] = "GMT";
 	_tzname[1] = "GMT";
@@ -86,7 +80,7 @@
       return;
     }
   
-  __tzrule[0].offset = sign * (ss + SECSPERMIN * mm + SECSPERHOUR * hh);
+  tz->__tzrule[0].offset = sign * (ss + SECSPERMIN * mm + SECSPERHOUR * hh);
   _tzname[0] = __tzname_std;
   tzenv += n;
   
@@ -116,9 +110,9 @@
   ss = 0;
   
   if (sscanf (tzenv, "%hu%n:%hu%n:%hu%n", &hh, &n, &mm, &n, &ss, &n) <= 0)
-    __tzrule[1].offset = __tzrule[0].offset - 3600;
+    tz->__tzrule[1].offset = tz->__tzrule[0].offset - 3600;
   else
-    __tzrule[1].offset = sign * (ss + SECSPERMIN * mm + SECSPERHOUR * hh);
+    tz->__tzrule[1].offset = sign * (ss + SECSPERMIN * mm + SECSPERHOUR * hh);
 
   tzenv += n;
 
@@ -136,10 +130,10 @@
 	      return;
 	    }
 	  
-	  __tzrule[i].ch = 'M';
-	  __tzrule[i].m = m;
-	  __tzrule[i].n = w;
-	  __tzrule[i].d = d;
+	  tz->__tzrule[i].ch = 'M';
+	  tz->__tzrule[i].m = m;
+	  tz->__tzrule[i].n = w;
+	  tz->__tzrule[i].d = d;
 	  
 	  tzenv += n;
 	}
@@ -161,23 +155,23 @@
 	    {
 	      if (i == 0)
 		{
-		  __tzrule[0].ch = 'M';
-		  __tzrule[0].m = 4;
-		  __tzrule[0].n = 1;
-		  __tzrule[0].d = 0;
+		  tz->__tzrule[0].ch = 'M';
+		  tz->__tzrule[0].m = 4;
+		  tz->__tzrule[0].n = 1;
+		  tz->__tzrule[0].d = 0;
 		}
 	      else
 		{
-		  __tzrule[1].ch = 'M';
-		  __tzrule[1].m = 10;
-		  __tzrule[1].n = 5;
-		  __tzrule[1].d = 0;
+		  tz->__tzrule[1].ch = 'M';
+		  tz->__tzrule[1].m = 10;
+		  tz->__tzrule[1].n = 5;
+		  tz->__tzrule[1].d = 0;
 		}
 	    }
 	  else
 	    {
-	      __tzrule[i].ch = ch;
-	      __tzrule[i].d = d;
+	      tz->__tzrule[i].ch = ch;
+	      tz->__tzrule[i].d = d;
 	    }
 	  
 	  tzenv = end;
@@ -192,14 +186,14 @@
       if (*tzenv == '/')
 	sscanf (tzenv, "/%hu%n:%hu%n:%hu%n", &hh, &n, &mm, &n, &ss, &n);
 
-      __tzrule[i].s = ss + SECSPERMIN * mm + SECSPERHOUR  * hh;
+      tz->__tzrule[i].s = ss + SECSPERMIN * mm + SECSPERHOUR  * hh;
       
       tzenv += n;
     }
 
-  __tzcalc_limits (__tzyear);
-  _timezone = (time_t)(__tzrule[0].offset);  
-  _daylight = __tzrule[0].offset != __tzrule[1].offset;
+  __tzcalc_limits (tz->__tzyear);
+  _timezone = tz->__tzrule[0].offset;  
+  _daylight = tz->__tzrule[0].offset != tz->__tzrule[1].offset;
 
   TZ_UNLOCK;
 }
Index: src/newlib/libc/unix/Makefile.am
diff -u src/newlib/libc/unix/Makefile.am:1.4 src/newlib/libc/unix/Makefile.am:1.6
--- src/newlib/libc/unix/Makefile.am:1.4	Mon Aug 26 18:56:09 2002
+++ src/newlib/libc/unix/Makefile.am	Fri Apr  8 20:48:39 2005
@@ -15,6 +15,8 @@
 	ttyname.$(oext)
 
 ELIX_4_OBJS = \
+	basename.$(oext)	\
+	dirname.$(oext)		\
 	getlogin.$(oext)	\
 	getpass.$(oext) 	\
 	getpwent.$(oext) 	\
@@ -29,12 +31,10 @@
 if ELIX_LEVEL_3
 LIB_OBJS = $(ELIX_2_OBJS)
 else
-if ELIX_LEVEL_4
 LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_4_OBJS)
 endif
 endif
 endif
-endif
 
 libunix_la_LDFLAGS = -Xcompiler -nostdlib
 
Index: src/newlib/libc/unix/Makefile.in
diff -u src/newlib/libc/unix/Makefile.in:1.10 src/newlib/libc/unix/Makefile.in:1.12
--- src/newlib/libc/unix/Makefile.in:1.10	Tue Jan 27 23:26:26 2004
+++ src/newlib/libc/unix/Makefile.in	Fri Apr  8 20:48:39 2005
@@ -116,12 +116,12 @@
 ELIX_2_OBJS =  	ttyname.$(oext)
 
 
-ELIX_4_OBJS =  	getlogin.$(oext)		getpass.$(oext) 		getpwent.$(oext) 		getut.$(oext)
+ELIX_4_OBJS =  	basename.$(oext)		dirname.$(oext)			getlogin.$(oext)		getpass.$(oext) 		getpwent.$(oext) 		getut.$(oext)
 
 @ELIX_LEVEL_1_TRUE@LIB_OBJS = 
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@LIB_OBJS = $(ELIX_2_OBJS)
 @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@LIB_OBJS = $(ELIX_2_OBJS)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_TRUE@LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_4_OBJS)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_4_OBJS)
 
 libunix_la_LDFLAGS = -Xcompiler -nostdlib
 
Index: src/newlib/libc/unix/basename.c
diff -u /dev/null src/newlib/libc/unix/basename.c:1.1
--- /dev/null	Thu May 12 14:26:03 2005
+++ src/newlib/libc/unix/basename.c	Fri Apr  8 20:48:39 2005
@@ -0,0 +1,25 @@
+/* Copyright 2005 Shaun Jackman
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <libgen.h>
+#include <string.h>
+
+char* 
+_DEFUN (basename, (path),
+	char *path)
+{
+	char *p;
+	if( path == NULL || *path == '\0' )
+		return ".";
+	p = path + strlen(path) - 1;
+	while( *p == '/' ) {
+		if( p == path )
+			return path;
+		*p-- = '\0';
+	}
+	while( p >= path && *p != '/' )
+		p--;
+	return p + 1;
+}
Index: src/newlib/libc/unix/dirname.c
diff -u /dev/null src/newlib/libc/unix/dirname.c:1.1
--- /dev/null	Thu May 12 14:26:03 2005
+++ src/newlib/libc/unix/dirname.c	Fri Apr  8 20:48:39 2005
@@ -0,0 +1,28 @@
+/* Copyright 2005 Shaun Jackman
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <libgen.h>
+#include <string.h>
+
+char *
+_DEFUN (dirname, (path),
+	char *path)
+{
+	char *p;
+	if( path == NULL || *path == '\0' )
+		return ".";
+	p = path + strlen(path) - 1;
+	while( *p == '/' ) {
+		if( p == path )
+			return path;
+		*p-- = '\0';
+	}
+	while( p >= path && *p != '/' )
+		p--;
+	return
+		p < path ? "." :
+		p == path ? "/" :
+		(*p = '\0', path);
+}
Index: src/newlib/libm/common/fdlibm.h
diff -u src/newlib/libm/common/fdlibm.h:1.5 src/newlib/libm/common/fdlibm.h:1.6
--- src/newlib/libm/common/fdlibm.h:1.5	Thu Jun 27 22:48:05 2002
+++ src/newlib/libm/common/fdlibm.h	Fri Feb 25 22:38:46 2005
@@ -71,13 +71,13 @@
 #define FLT_UWORD_IS_FINITE(x) ((x)<0x7f800000L)
 #define FLT_UWORD_IS_NAN(x) ((x)>0x7f800000L)
 #define FLT_UWORD_IS_INFINITE(x) ((x)==0x7f800000L)
-#define FLT_UWORD_MAX 0x7f7fffff
+#define FLT_UWORD_MAX 0x7f7fffffL
 #define FLT_UWORD_EXP_MAX 0x43000000
 #define FLT_UWORD_LOG_MAX 0x42b17217
 #define FLT_UWORD_LOG_2MAX 0x42b2d4fc
 #define HUGE ((float)3.40282346638528860e+38)
 #endif
-#define FLT_UWORD_HALF_MAX (FLT_UWORD_MAX-(1<<23))
+#define FLT_UWORD_HALF_MAX (FLT_UWORD_MAX-(1L<<23))
 #define FLT_LARGEST_EXP (FLT_UWORD_MAX>>23)
 
 /* Many routines check for zero and subnormal numbers.  Such things depend
Index: src/newlib/libm/common/s_fpclassify.c
diff -u src/newlib/libm/common/s_fpclassify.c:1.2 src/newlib/libm/common/s_fpclassify.c:1.3
--- src/newlib/libm/common/s_fpclassify.c:1.2	Fri Jun 27 20:12:01 2003
+++ src/newlib/libm/common/s_fpclassify.c	Thu Feb 24 18:50:06 2005
@@ -9,7 +9,7 @@
 int
 __fpclassifyf (float x)
 {
-  unsigned int w;
+  __uint32_t w;
 
   GET_FLOAT_WORD(w,x);
   
@@ -30,7 +30,7 @@
 int
 __fpclassifyd (double x)
 {
-  unsigned int msw, lsw;
+  __uint32_t msw, lsw;
 
   EXTRACT_WORDS(msw,lsw,x);
 
Index: src/newlib/libm/common/sf_round.c
diff -u src/newlib/libm/common/sf_round.c:1.1 src/newlib/libm/common/sf_round.c:1.3
--- src/newlib/libm/common/sf_round.c:1.1	Fri Jun  7 21:59:56 2002
+++ src/newlib/libm/common/sf_round.c	Thu Feb 24 19:02:35 2005
@@ -19,7 +19,7 @@
 #endif
 {
   int signbit;
-  int w;
+  __uint32_t w;
   /* Most significant word, least significant word. */
   int exponent_less_127;
 
@@ -29,7 +29,7 @@
   signbit = w & 0x80000000;
 
   /* Extract exponent field. */
-  exponent_less_127 = ((w & 0x7f800000) >> 23) - 127;
+  exponent_less_127 = (int)((w & 0x7f800000) >> 23) - 127;
 
   if (exponent_less_127 < 23)
     {
Index: src/newlib/testsuite/include/check.h
diff -u src/newlib/testsuite/include/check.h:1.3 src/newlib/testsuite/include/check.h:1.4
--- src/newlib/testsuite/include/check.h:1.3	Tue May 25 20:52:21 2004
+++ src/newlib/testsuite/include/check.h	Thu Jan 27 20:25:54 2005
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 
 #define CHECK(a) { \
   if (!(a)) \
Index: src/newlib/testsuite/newlib.string/memmove1.c
diff -u /dev/null src/newlib/testsuite/newlib.string/memmove1.c:1.1
--- /dev/null	Thu May 12 14:26:09 2005
+++ src/newlib/testsuite/newlib.string/memmove1.c	Thu Jan 27 20:52:42 2005
@@ -0,0 +1,184 @@
+/* A minor test-program for memmove.
+   Copyright (C) 2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* Test moves of 0..MAX bytes; overlapping-src-higher,
+   overlapping-src-lower and non-overlapping.  The overlap varies with
+   1..N where N is the size moved.  This means an order of MAX**2
+   iterations.  The size of an octet may seem appropriate for MAX and
+   makes an upper limit for simple testing.  For the CRIS simulator,
+   making this 256 added 90s to the test-run (2GHz P4) while 64 (4s) was
+   enough to spot the bugs that had crept in, hence the number chosen.  */
+#define MAX 64
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define TOO_MANY_ERRORS 11
+int errors = 0;
+
+#define DEBUGP					\
+ if (errors == TOO_MANY_ERRORS)			\
+   printf ("Further errors omitted\n");		\
+ else if (errors < TOO_MANY_ERRORS)		\
+   printf
+
+/* A safe target-independent memmove.  */
+
+void
+mymemmove (unsigned char *dest, unsigned char *src, size_t n)
+{
+  size_t i;
+
+  if ((src <= dest && src + n <= dest)
+      || src >= dest)
+    while (n-- > 0)
+      *dest++ = *src++;
+  else
+    {
+      dest += n;
+      src += n;
+      while (n-- > 0)
+	*--dest = *--src;
+    }
+}
+
+/* It's either the noinline attribute or forcing the test framework to
+   pass -fno-builtin-memmove.  */
+void
+xmemmove (unsigned char *dest, unsigned char *src, size_t n)
+     __attribute__ ((__noinline__));
+
+void
+xmemmove (unsigned char *dest, unsigned char *src, size_t n)
+{
+  void *retp;
+  retp = memmove (dest, src, n);
+
+  if (retp != dest)
+    {
+      errors++;
+      DEBUGP ("memmove of n bytes returned %p instead of dest=%p\n",
+	      retp, dest);
+    }
+}
+
+
+/* Fill the array with something we can associate with a position, but
+   not exactly the same as the position index.  */
+
+void
+fill (unsigned char dest[MAX*3])
+{
+  size_t i;
+  for (i = 0; i < MAX*3; i++)
+    dest[i] = (10 + i) % MAX;
+}
+
+int
+main (void)
+{
+  size_t i;
+  int errors = 0;
+
+  /* Leave some room before and after the area tested, so we can detect
+     overwrites of up to N bytes, N being the amount tested.  If you
+     want to test using valgrind, make these malloced instead.  */
+  unsigned char from_test[MAX*3];
+  unsigned char to_test[MAX*3];
+  unsigned char from_known[MAX*3];
+  unsigned char to_known[MAX*3];
+
+  /* Non-overlap.  */
+  for (i = 0; i < MAX; i++)
+    {
+      /* Do the memmove first before setting the known array, so we know
+         it didn't change any of the known array.  */
+      fill (from_test);
+      fill (to_test);
+      xmemmove (to_test + MAX, 1 + from_test + MAX, i);
+
+      fill (from_known);
+      fill (to_known);
+      mymemmove (to_known + MAX, 1 + from_known + MAX, i);
+
+      if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
+	{
+	  errors++;
+	  DEBUGP ("memmove failed non-overlap test for %d bytes\n", i);
+	}
+    }
+
+  /* Overlap-from-before.  */
+  for (i = 0; i < MAX; i++)
+    {
+      size_t j;
+      for (j = 0; j < i; j++)
+	{
+	  fill (to_test);
+	  xmemmove (to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
+
+	  fill (to_known);
+	  mymemmove (to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
+
+	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
+	    {
+	      errors++;
+	      DEBUGP ("memmove failed for %d bytes,"
+		      " with src %d bytes before dest\n",
+		      i, j);
+	    }
+	}
+    }
+
+  /* Overlap-from-after.  */
+  for (i = 0; i < MAX; i++)
+    {
+      size_t j;
+      for (j = 0; j < i; j++)
+	{
+	  fill (to_test);
+	  xmemmove (to_test + MAX, to_test + MAX + j, i);
+
+	  fill (to_known);
+	  mymemmove (to_known + MAX, to_known + MAX + j, i);
+
+	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
+	    {
+	      errors++;
+	      DEBUGP ("memmove failed when moving %d bytes,"
+		      " with src %d bytes after dest\n",
+		      i, j);
+	    }
+	}
+    }
+
+  if (errors != 0)
+    abort ();
+  exit (0);
+}
Index: src/libgloss/ChangeLog
diff -u src/libgloss/ChangeLog:1.96 src/libgloss/ChangeLog:1.112
--- src/libgloss/ChangeLog:1.96	Fri Nov 26 16:43:35 2004
+++ src/libgloss/ChangeLog	Thu May  5 23:15:53 2005
@@ -1,6 +1,99 @@
+2005-05-05  Tobias Anderberg  <tobias.anderberg@axis.com>
+
+        * arm/syscalls.c (get_errno): Fix output register constraint.
+
+2005-05-05  J"orn Rennecke <joern.rennecke@st.com>
+
+        * rs6000/sim-getrusage.S: New file, broken out of:
+        (simulator.S).
+        * rs6000/Makefile.in (SIM_OBJS): Add sim-getrusage.o.
+        (sim-getrusage.o): New rule.
+
+2005-04-28  Shaun Jackman  <sjackman@gmail.com>
+
+	* libgloss/syscalls.c (get_errno): Add an output register constraint.
+
+2005-04-19  Eric Christopher  <echristo@redhat.com>
+
+	* mips/regs.S: Sign extend constants for mips64 and unify
+        address handling.
+
+2005-04-12  Shaun Jackman  <sjackman@gmail.com>
+
+	* libgloss/arm/Makefile.in (RDPMON_BSP): librdpmon.a was empty due 
+	to a typo. Fixed.
+	(RDIMON_BSP): Ditto.
+
+2005-04-12  Richard Sandiford  <rsandifo@redhat.com>
+
+	* mips/array.ld, mips/cfe.ld, mips/dve.ld, mips/idt32.ld,
+	* mips/idt64.ld, mips/idtecoff.ld, mips/idt.ld,
+	* mips/jmr3904app-java.ld, mips/jmr3904app.ld,
+	* mips/jmr3904dram-java.ld, mips/jmr3904dram.ld, mips/lsi.ld,
+	* mips/nullmon.ld, mips/pmon.ld: Keep .init and .fini.
+
+2005-02-08  Antony King  <antony.king@st.com>
+
+	* arm/syscalls.c: Change CHECK_INIT to pass reentrant struct
+	instead of file pointer.
+
+2005-02-01  Hans-Peter Nilsson  <hp@axis.com>
+
+	* cris/Makefile.in (ALL_INSTALL_FILES): New macro.
+	(ALL_INSTALL_FILES_NEWLIB_COPY): New macro.
+	(all): Use ALL_INSTALL_FILES instead of its contents.  Add
+	ALL_INSTALL_FILES_NEWLIB_COPY.
+	($(objroot)/newlib/%, $(objroot)/newlib/libnosys.a): New rules
+
+2005-01-27  Hans-Peter Nilsson  <hp@axis.com>
+
+        * configure.in: Support cris-*-* and crisv32-*-*.
+        * libnosys/configure.in: Ditto.
+	* configure, libnosys/configure: Regenerate.
+	* cris: New directory.
+	* cris/crt0.S, cris/crtn.c, cris/gensyscalls, cris/linunistd.h,
+	cris/outbyte.c, cris/configure.in, cris/crti.c, cris/lcrt0.c,
+	cris/Makefile.in, cris/setup.S, cris/configure: New files.
+
+2005-01-21  Hans-Peter Nilsson  <hp@axis.com>
+
+	* libnosys/warning.h (stub_warning): Remove "warning: " prefix.
+
+2005-01-18  Hans-Peter Nilsson  <hp@axis.com>
+
+	* libnosys/warning.h (link_warning) [HAVE_GNU_LD and HAVE_ELF]:
+	Prefix symbol in section name with __SYMBOL_PREFIX.  Do not use
+	__make_section_unallocated.  Mark magic variable as used.
+
+2005-01-18  Hans-Peter Nilsson  <hp@axis.com>
+
+	* libnosys/configure.in (libc_cv_asm_previous_directive): Set
+	cache-id variable.
+	(libc_cv_asm_popsection_directive): Ditto.
+	(libc_cv_section_attributes): Ditto.
+	(libc_symbol_prefix): Rename from libc_dollar_prefix.  Check for
+	"_" as well, and set __SYMBOL_PREFIX accordingly.
+	* libnosys/configure: Regenerate.
+
+2005-01-18  Hans-Peter Nilsson  <hp@axis.com>
+
+	* libnosys/Makefile.in (LD, AS): Correct obsoleted suffix: Say
+	as-new and ld-new, not as.new and ld.new.
+
+2005-01-14  Hans-Peter Nilsson  <hp@axis.com>
+                                                                                
+        * libnosys/warning.h (__make_section_unallocated)
+        [HAVE_ASM_PREVIOUS_DIRECTIVE, HAVE_ASM_POPSECTION_DIRECTIVE]: Use "\n"
+        instead of ";" to delimit assembly lines.
+                                                                                
+2005-01-07  Paul Brook  <paul@codesourcery.com>
+                                                                                
+	* arm/crt0.S: Call __libc_{init,fini}_array instead of
+	_init/_fini if they exist.
+
 2004-11-26  Paul Brook  <paul@codesourcery.com>
                                                                                 
-        * libc/sys/arm/crt0.S (_start): Add .cantunwind annotation.
+        * arm/crt0.S (_start): Add .cantunwind annotation.
                                                                                 
 2004-10-28  Nick Clifton  <nickc@redhat.com>
 
Index: src/libgloss/configure
diff -u src/libgloss/configure:1.10 src/libgloss/configure:1.11
--- src/libgloss/configure:1.10	Thu Oct 28 08:18:18 2004
+++ src/libgloss/configure	Thu Jan 27 22:57:26 2005
@@ -774,6 +774,9 @@
   mn10300-*-*)
 	configdirs="${configdirs} mn10300 testsuite"
 	;;
+  cris-*-* | crisv32-*-*)
+	configdirs="${configdirs} cris testsuite"
+	;;
   crx-*-*)
 	configdirs="${configdirs} crx"
 	;;
@@ -826,7 +829,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:830: checking for $ac_word" >&5
+echo "configure:833: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -856,7 +859,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:860: checking for $ac_word" >&5
+echo "configure:863: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -905,7 +908,7 @@
 fi
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:909: checking whether we are using GNU C" >&5
+echo "configure:912: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -914,7 +917,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -929,7 +932,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:933: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:936: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -961,7 +964,7 @@
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:965: checking for $ac_word" >&5
+echo "configure:968: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -995,7 +998,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:999: checking for $ac_word" >&5
+echo "configure:1002: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1096,34 +1099,15 @@
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section.  Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*([^)]*)\)[ 	]*\(.*\),-D\1=\2,g
-t quote
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ 	`~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output.  A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
 
 
 # Without the "./", some shells look in PATH for config.status.
Index: src/libgloss/configure.in
diff -u src/libgloss/configure.in:1.10 src/libgloss/configure.in:1.11
--- src/libgloss/configure.in:1.10	Thu Oct 28 08:18:18 2004
+++ src/libgloss/configure.in	Thu Jan 27 22:57:26 2005
@@ -85,6 +85,9 @@
   mn10300-*-*)
 	configdirs="${configdirs} mn10300 testsuite"
 	;;
+  cris-*-* | crisv32-*-*)
+	configdirs="${configdirs} cris testsuite"
+	;;
   crx-*-*)
 	configdirs="${configdirs} crx"
 	;;
Index: src/libgloss/arm/Makefile.in
diff -u src/libgloss/arm/Makefile.in:1.5 src/libgloss/arm/Makefile.in:1.6
--- src/libgloss/arm/Makefile.in:1.5	Mon Jun 28 22:42:19 2004
+++ src/libgloss/arm/Makefile.in	Wed Apr 13 00:01:40 2005
@@ -116,11 +116,11 @@
 	$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
 
 $(RDPMON_BSP): $(RDPMON_OBJS)
-	${AR} ${ARFLAGS} $@ $(IDTOBJS)
+	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
 $(RDIMON_BSP): $(RDIMON_OBJS)
-	${AR} ${ARFLAGS} $@ $(IDTOBJS)
+	${AR} ${ARFLAGS} $@ $^
 	${RANLIB} $@
 
 clean mostlyclean:
Index: src/libgloss/arm/crt0.S
diff -u src/libgloss/arm/crt0.S:1.2 src/libgloss/arm/crt0.S:1.3
--- src/libgloss/arm/crt0.S:1.2	Fri Nov 26 16:43:35 2004
+++ src/libgloss/arm/crt0.S	Fri Jan  7 18:01:26 2005
@@ -1,3 +1,4 @@
+#include "newlib.h"
 #include "swi.h"
 
 /* ANSI concatenation macros.  */
@@ -10,6 +11,11 @@
 #error __USER_LABEL_PREFIX is not defined
 #endif
 
+#ifdef HAVE_INITFINI_ARRAY
+#define _init	__libc_init_array
+#define _fini	__libc_fini_array
+#endif
+
 /* .text is used instead of .section .text so it works with arm-aout too.  */
 	.text
 	.code 32
Index: src/libgloss/arm/syscalls.c
diff -u src/libgloss/arm/syscalls.c:1.1 src/libgloss/arm/syscalls.c:1.4
--- src/libgloss/arm/syscalls.c:1.1	Wed Jun  9 19:06:50 2004
+++ src/libgloss/arm/syscalls.c	Thu May  5 23:15:53 2005
@@ -55,20 +55,17 @@
 
 /* following is copied from libc/stdio/local.h to check std streams */
 extern void   _EXFUN(__sinit,(struct _reent *));
-#define CHECK_INIT(fp) \
-  do                                    \
-    {                                   \
-      if ((fp)->_data == 0)             \
-        (fp)->_data = _REENT;           \
-      if (!(fp)->_data->__sdidinit)     \
-        __sinit ((fp)->_data);          \
-    }                                   \
+#define CHECK_INIT(ptr) \
+  do						\
+    {						\
+      if ((ptr) && !(ptr)->__sdidinit)		\
+	__sinit (ptr);				\
+    }						\
   while (0)
 
 /* Adjust our internal handles to stay away from std* handles.  */
 #define FILE_HANDLE_OFFSET (0x20)
 
-static int std_files_checked;
 static int monitor_stdin;
 static int monitor_stdout;
 static int monitor_stderr;
@@ -119,13 +116,8 @@
 static int
 remap_handle (int fh)
 {
-  if (!std_files_checked)
-    {
-       CHECK_INIT(stdin);
-       CHECK_INIT(stdout);
-       CHECK_INIT(stderr);
-       std_files_checked = 1;
-    }
+  CHECK_INIT(_REENT);
+
   if (fh == STDIN_FILENO)
     return monitor_stdin;
   if (fh == STDOUT_FILENO)
@@ -187,7 +179,9 @@
 #ifdef ARM_RDI_MONITOR
   return do_AngelSWI (AngelSWI_Reason_Errno, NULL);
 #else
-  asm ("swi %a0" :: "i" (SWI_GetErrno));
+  register r0 asm("r0");
+  asm ("swi %a1" : "=r"(r0) : "i" (SWI_GetErrno));
+  return r0;
 #endif
 }
 
Index: src/libgloss/cris/Makefile.in
diff -u /dev/null src/libgloss/cris/Makefile.in:1.2
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/Makefile.in	Tue Feb  1 21:22:33 2005
@@ -0,0 +1,277 @@
+#
+# libgloss Makefile.in for CRIS.  Copied and modified from mcore long ago.
+#
+
+DESTDIR =
+VPATH = @srcdir@
+srcdir = @srcdir@
+objdir = .
+srcroot = $(srcdir)/../..
+objroot = $(objdir)/../..
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+host_alias = @host_alias@
+target_alias = @target_alias@
+
+bindir = @bindir@
+libdir = @libdir@
+tooldir = $(exec_prefix)/$(target_alias)
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+# Multilib support variables.
+# TOP is used instead of MULTI{BUILD,SRC}TOP.
+MULTIDIRS =
+MULTISUBDIR =
+
+SHELL =	/bin/sh
+
+CC = @CC@
+
+AS = @AS@
+AR = @AR@
+LD = @LD@
+RANLIB = @RANLIB@
+
+OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
+	then echo ${objroot}/../binutils/objdump ; \
+	else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
+OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
+	then echo ${objroot}/../binutils/objcopy ; \
+	else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
+
+CFLAGS		= -g
+SCRIPTS		=
+
+OBJS = outbyte.o
+
+# Beware: GNU make construct used (shell call).  Since GCC at the time
+# of this writing requires GNU make >= 3.79.1, this should pose no
+# problem.
+SYSCALL_CFILES := $(shell sed -ne 's/^cat > \([^ ]*\).*/\1/p' < $(srcdir)/gensyscalls)
+
+# Here is all of the simulator stuff.
+# Actually, now it's just the GNU/Linux stuff, as that's also the
+# simulator ABI.  The name of the library is different, though.
+SIM_SCRIPTS	=
+SIM_LDFLAGS	=
+SIM_BSP		= libsyssim.a
+SIM_CRT0	= $(LIN_CRT0)
+SIM_OBJS	= $(LIN_OBJS)
+SIM_TEST	= sim-test
+SIM_INSTALL	= install-sim
+
+# Here is all of the GNU/Linux stuff.  At present we don't build newlib
+# and libgloss for cris*-linux-gnu*, but it's nice to keep that as an
+# option.
+LIN_PREFIX	=
+LIN_LDFLAGS	=
+LIN_BSP		= libsyslinux.a
+LIN_CRT0	= lcrt0.o
+LIN_EXTRA	= crti.o crtn.o crt1.o
+LIN_OBJS	= close.o execve.o exit.o fcntl.o fork.o fstat.o getpid.o \
+ gettod.o isatty.o kill.o link.o lseek.o open.o read.o \
+ rename.o sbrk.o stat.o times.o unlink.o wait.o write.o ${OBJS}
+LIN_SCRIPTS	=
+LIN_TEST	=
+LIN_INSTALL	= install-lin
+
+# In (over)due time, here will be all stuff necessary for a development
+# board.
+BSP_PREFIX	=
+BSP_LDFLAGS	=
+BSP_BSP		= libbsp.a
+BSP_CRT0	= crt0.o
+BSP_OBJS	= ${OBJS} setup.o
+BSP_SCRIPTS	=
+BSP_TEST	=
+BSP_INSTALL	= install-bsp
+
+ALL_INSTALL_FILES = \
+ ${SIM_CRT0} ${SIM_EXTRA} ${SIM_BSP} \
+ ${LIN_CRT0} ${LIN_EXTRA} ${LIN_BSP} \
+ ${BSP_CRT0} ${BSP_EXTRA} ${BSP_BSP}
+
+ALL_INSTALL_FILES_NEWLIB_COPY = \
+ $(sort ${ALL_INSTALL_FILES:%=$(objroot)/newlib/%}) $(objroot)/newlib/libnosys.a
+
+# Host specific makefile fragment comes in here.
+@host_makefile_frag@
+
+# Need to augment the definition from host_makefile_frag above.
+INCLUDES += -I$(srcdir)
+
+all: ${ALL_INSTALL_FILES} ${ALL_INSTALL_FILES_NEWLIB_COPY} libnosys.a
+
+#
+# Here's where we build the board support packages for each target.
+#
+${SIM_BSP}: ${SIM_OBJS}
+	${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS}
+	${RANLIB} ${SIM_BSP}
+
+${BSP_BSP}: ${BSP_OBJS}
+	${AR} ${ARFLAGS} ${BSP_BSP} ${BSP_OBJS}
+	${RANLIB} ${BSP_BSP}
+
+${LIN_BSP}: ${LIN_OBJS}
+	${AR} ${ARFLAGS} ${LIN_BSP} ${LIN_OBJS}
+	${RANLIB} ${LIN_BSP}
+
+# We need a link to libnosys.a in this directory, since this is the
+# directory used when test-compiling for configuration for other parts and
+# when running the testsuite.  By using a symbolic link, it does not
+# matter whether libnosys.a is built yet when the rule is executed.
+libnosys.a:
+	ln -s ../libnosys/libnosys.a
+
+# Toplevel build rules for various other libraries have gcc -B options
+# applied so the newlib build directory is reached, but not the target
+# libgloss directory (whose name is unknown to the toplevel configury
+# anyway).  Configury tests that check for a successful link therefore
+# fail; they can't find crt0.o and non-libc.a+libm.a libraries.  We copy
+# over all files we would install to the neighboring newlib directory.
+# Only the default crt0.o and libraries are needed, but we do them all for
+# completeness.  They're however installed from here, not from the newlib
+# build directory.
+$(objroot)/newlib/%: %
+	cp -p $^ $@
+
+# This rule, being more specific, overrides the pattern rule above.
+$(objroot)/newlib/libnosys.a:
+	ln -s ../libgloss/libnosys/libnosys.a $(objroot)/newlib
+
+#
+# Build a test program for each target board. Just trying to get
+# it to link is a good test, so we ignore all the errors for now.
+#
+#
+# Here's where we build the test programs for each target.
+#
+.PHONY: test
+test:	${SIM_TEST} ${BSP_TEST}
+
+sim-test:	sim-test.x sim-test.dis
+
+sim-test.x:	test.o ${SIM_CRT0} ${SIM_BSP}
+	${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
+	${SIM_CRT0} test.o \
+	-o sim-test.x ${LIBS_FOR_TARGET} -lc ${SIM_BSP}
+
+sim-test.dis:	sim-test.x
+	${OBJDUMP} -d sim-test.x > sim-test.dis
+
+
+test.o: ${srcdir}/m68k/test.c
+
+# Debug usage.
+.c.S:
+	${CC} ${CFLAGS_FOR_TARGET} $(INCLUDES) $(CFLAGS) -c $<
+
+# Caveat: for the -melinux multilib in cris-axis-aout, crt0.o is the
+# same as lcrt0.o, while elsewhere (other cris-axis-aout multilib and
+# cris-axis-elf) it's crt0.c compiled.
+crt0.o: lcrt0.o crt0.S
+	case "${MULTISUBDIR}" in \
+          */elinux) \
+	   cp -p $< $@; st=$$?;; \
+          *) \
+           case "$?" in \
+            *crt0.S) \
+	     $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -xassembler-with-cpp -c $(srcdir)/crt0.S;; \
+            *) touch $@;; \
+            esac; \
+	   st=$$?;; \
+	esac; exit $$st
+
+crt1.o: lcrt0.o
+	cp -p $< $@
+
+clean mostlyclean:
+	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(BSP_BSP) $(LIN_BSP) libnosys.a
+
+distclean maintainer-clean realclean: clean
+	rm -f Makefile config.status *~
+
+.PHONY: install info install-info clean-info
+install: ${SIM_INSTALL} ${BSP_INSTALL} ${LIN_INSTALL}
+
+# Note that bsp and elinux objects are exclusive: do not overlap
+# installed files.
+install-bsp:
+	case "${MULTISUBDIR}" in \
+          */elinux) ;; \
+	  *) set -e; \
+	     for x in ${BSP_CRT0} ${BSP_BSP} ${BSP_SCRIPTS}; do \
+		${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
+	     done;; \
+	esac
+
+install-sim:
+	set -e; \
+	for x in ${SIM_CRT0} ${SIM_BSP} ${SIM_SCRIPTS}; do \
+	  ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
+	done
+
+install-lin:
+	case "${MULTISUBDIR}" in \
+          */elinux) \
+	    ${INSTALL_DATA} ${LIN_CRT0} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/crt0.o; \
+	    set -e; \
+	    for x in ${LIN_BSP} ${LIN_SCRIPTS}; do \
+	      ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
+	    done;; \
+          *) \
+	    set -e; \
+	    for x in ${LIN_BSP} ${LIN_SCRIPTS} ${LIN_EXTRA}; do \
+	      ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; \
+	    done;; \
+	esac
+
+doc:
+info:
+install-info:
+clean-info:
+
+Makefile: Makefile.in config.status @host_makefile_frag_path@
+	$(SHELL) config.status
+
+config.status: configure
+	$(SHELL) config.status --recheck
+
+$(SYSCALL_CFILES): syscalls.stamp
+
+syscalls.stamp: gensyscalls
+	$(SHELL) $(srcdir)/gensyscalls
+	touch $@
+
+# Dependencies that could and should be auto-generated.
+close.o: close.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+execve.o: execve.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+exit.o: exit.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+fork.o: fork.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+fstat.o: fstat.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+fcntl.o: fcntl.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+getpid.o: getpid.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+gettod.o: gettod.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+isatty.o: isatty.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+kill.o: kill.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+link.o: link.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+lseek.o: lseek.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+open.o: open.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+read.o: read.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+rename.o: rename.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+sbrk.o: sbrk.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+stat.o: stat.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+times.o: times.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+unlink.o: unlink.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+wait.o: wait.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+write.o: write.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+lcrt0.o: lcrt0.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
+setup.o: setup.S
+crti.o: crti.c
+crtn.o: crtn.c
Index: src/libgloss/cris/configure
diff -u /dev/null src/libgloss/cris/configure:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/configure	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,1203 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=Makefile.in
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+if test "${enable_shared}" = "yes" ; then
+    echo "Shared libraries not supported for cross compiling, ignored"
+fi
+
+if test "$srcdir" = "." ; then
+  if test "${with_target_subdir}" != "." ; then
+    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
+  else
+    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
+  fi
+else
+  libgloss_topdir="${srcdir}/../.."
+fi
+ac_aux_dir=
+for ac_dir in $libgloss_topdir $srcdir/$libgloss_topdir; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $libgloss_topdir $srcdir/$libgloss_topdir" 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+#    same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+#    as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:587: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:608: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+  case $nonopt in
+  NONE) target_alias=$host_alias ;;
+  *) target_alias=$nonopt ;;
+  esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:626: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:680: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:744: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:774: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:823: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:847: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+AS=${AS-as}
+
+AR=${AR-ar}
+
+LD=${LD-ld}
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:883: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+host_makefile_frag=${srcdir}/../config/default.mh
+
+host_makefile_frag_path=$host_makefile_frag
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@CC@%$CC%g
+s%@AS@%$AS%g
+s%@AR@%$AR%g
+s%@LD@%$LD%g
+s%@RANLIB@%$RANLIB%g
+s%@host_makefile_frag_path@%$host_makefile_frag_path%g
+/@host_makefile_frag@/r $host_makefile_frag
+s%@host_makefile_frag@%%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+srcdir=${srcdir}
+target=${target}
+ac_configure_args="${ac_configure_args} --enable-multilib"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+libgloss_topdir=${libgloss_topdir}
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+. ${libgloss_topdir}/config-ml.in
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
Index: src/libgloss/cris/configure.in
diff -u /dev/null src/libgloss/cris/configure.in:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/configure.in	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,90 @@
+dnl This file is based on ../mcore/configure.in
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.5)dnl
+AC_INIT(Makefile.in)
+
+if test "${enable_shared}" = "yes" ; then
+    echo "Shared libraries not supported for cross compiling, ignored"
+fi
+
+if test "$srcdir" = "." ; then
+  if test "${with_target_subdir}" != "." ; then
+    libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
+  else
+    libgloss_topdir="${srcdir}/${with_multisrctop}../.."
+  fi
+else
+  libgloss_topdir="${srcdir}/../.."
+fi
+AC_CONFIG_AUX_DIR($libgloss_topdir)
+
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+
+AC_PROG_INSTALL
+
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
+AS=${AS-as}
+AC_SUBST(AS)
+AR=${AR-ar}
+AC_SUBST(AR)
+LD=${LD-ld}
+AC_SUBST(LD)
+AC_PROG_RANLIB
+
+host_makefile_frag=${srcdir}/../config/default.mh
+
+dnl We have to assign the same value to other variables because autoconf
+dnl doesn't provide a mechanism to substitute a replacement keyword with
+dnl arbitrary data or pathnames.
+dnl
+host_makefile_frag_path=$host_makefile_frag
+AC_SUBST(host_makefile_frag_path)
+AC_SUBST_FILE(host_makefile_frag)
+
+AC_OUTPUT(Makefile,
+. ${libgloss_topdir}/config-ml.in,
+srcdir=${srcdir}
+target=${target}
+ac_configure_args="${ac_configure_args} --enable-multilib"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+libgloss_topdir=${libgloss_topdir}
+)
Index: src/libgloss/cris/crt0.S
diff -u /dev/null src/libgloss/cris/crt0.S:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/crt0.S	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,83 @@
+/* Generic simplistic start-up-stub for CRIS/CRISv32.
+   Copyright (C) 1993-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+#undef cris
+#undef L
+#ifdef __NO_UNDERSCORES__
+#define L(x) x
+#else
+#define L(x) _ ## x
+#endif
+
+; Rudimentary v0..v32-compatible startup stub.
+
+#ifdef __ELF__
+ .section .startup,"ax"
+#endif
+ .global __start
+ nop
+__start:
+ ba 0f
+ nop
+
+ .rept 256 - 2
+ .dword _.int
+ .endr
+
+_.int:
+#ifdef __arch_common_v10_v32
+ ; This is just to allow the multilib to compile without
+ ; hackery: the "common" subset doesn't recognize
+ ; interrupt-return insns.
+#elif __CRIS_arch_version >= 32
+ rete
+ rfe
+#else
+ reti
+ nop
+#endif
+
+0:
+ move.d __setup,$r9
+ jsr $r9
+ nop
+#ifdef __ELF__
+ jsr L(_init)
+ nop
+ move.d L(_fini),$r10
+ jsr L(atexit)
+ nop
+#endif
+ jsr L(main)
+ nop
+ jsr L(exit)
+ nop
+0:
+ nop
+ ba 0b
+ nop
Index: src/libgloss/cris/crti.c
diff -u /dev/null src/libgloss/cris/crti.c:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/crti.c	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,77 @@
+/* Executable and DSO init/fini start for cris*-axis-linux-gnu and simulators
+   Copyright (C) 2000, 2001, 2004, 2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+#ifdef __ELF__
+__asm__ (".syntax no_register_prefix");
+
+__asm__ (".section .init\n"
+#ifdef __NO_UNDERSCORES__
+         " .globl _init\n"
+         "_init:\n"
+#else /* not __NO_UNDERSCORES__ */
+         " .globl __init\n"
+         "__init:\n"
+#endif /* not __NO_UNDERSCORES__ */
+         "\tsubq 4,sp\n"
+	 "\tmove srp,[sp]\n"
+#ifdef __PIC__
+         "\tsubq 4,sp\n"
+	 "\tmove.d r0,[sp]\n"
+#if __CRIS_arch_version >= 32
+	 "\tlapc _GLOBAL_OFFSET_TABLE_,$r0\n"
+#else /* not __CRIS_arch_version >= 32 */
+	 "\tmove.d $pc,$r0\n"
+	 "\tsub.d .:GOTOFF,$r0\n"
+#endif /* not __CRIS_arch_version >= 32 */
+#endif /* __PIC__ */
+
+         "\t.section .fini\n"
+#ifdef __NO_UNDERSCORES__
+         " .globl _fini\n"
+         "_fini:\n"
+#else /* not __NO_UNDERSCORES__ */
+         " .globl __fini\n"
+         "__fini:\n"
+#endif /* not __NO_UNDERSCORES__ */
+         "\tsubq 4,sp\n"
+	 "\tmove srp,[sp]\n"
+#ifdef __PIC__
+         "\tsubq 4,sp\n"
+	 "\tmove.d r0,[sp]\n"
+#if __CRIS_arch_version >= 32
+	 "\tlapc _GLOBAL_OFFSET_TABLE_,$r0\n"
+#else /* not __CRIS_arch_version >= 32 */
+	 "\tmove.d $pc,$r0\n"
+	 "\tsub.d .:GOTOFF,$r0\n"
+#endif /* not __CRIS_arch_version >= 32 */
+#endif /* __PIC__ */
+);
+
+#else /* not __ELF__ */
+extern int Dummy;
+#endif /* not __ELF__ */
Index: src/libgloss/cris/crtn.c
diff -u /dev/null src/libgloss/cris/crtn.c:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/crtn.c	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,51 @@
+/* Executable and DSO init/fini end for cris*-axis-linux-gnu and simulators
+   Copyright (C) 2000, 2001, 2004, 2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+#ifdef __ELF__
+
+__asm__ (".syntax no_register_prefix");
+
+__asm__ (".section .init\n"
+#ifdef __PIC__
+	 "\tmove.d [sp+],r0\n"
+#endif
+         "\tmove.d [sp+],r9\n"
+         "\tjump r9\n"
+         "\tnop\n"
+
+         "\t.section .fini\n"
+#ifdef __PIC__
+	 "\tmove.d [sp+],r0\n"
+#endif
+         "\tmove.d [sp+],r9\n"
+         "\tjump r9\n"
+         "\tnop\n");
+
+#else
+extern int Dummy;
+#endif
Index: src/libgloss/cris/gensyscalls
diff -u /dev/null src/libgloss/cris/gensyscalls:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/gensyscalls	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,252 @@
+#! /bin/sh
+#  Copyright (C) 2005 Axis Communications.
+#  All rights reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#
+#  2. Neither the name of Axis Communications nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+#  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+#  COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+#  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+#  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+#  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+#  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+#  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+#  POSSIBILITY OF SUCH DAMAGE.
+
+# To avoid an abundance of copyright/license messages for boilerplate
+# code, we instead generate them from this file.  Generating the
+# function code could also be done automatically, but at the cost of
+# slightly more intricate build machinery and/or scattered syscall
+# information.  Beware that the cat-lines must match the sed regexp
+# "^cat > \([^ ]*\).*".
+
+lu='/* -*- buffer-read-only: t -*-
+   THIS FILE IS AUTOMATICALLY GENERATED
+   FROM "'$0'".  */
+#include "linunistd.h"
+#define R(x) return (x); }
+'
+lui="$lu int"
+r=") { R (_Sys_"
+
+cat > close.c <<EOF
+$lui _close (int fd${r}close (fd))
+EOF
+cat > execve.c <<EOF
+$lui _execve (char *path, char **argv, char **env${r}execve (path, argv, env))
+EOF
+cat > exit.c <<EOF
+$lu void _exit (int val) { _Sys_exit (val); /* Appease GCC: */ while (1) ; }
+EOF
+cat > fcntl.c <<EOF
+$lui _fcntl (int fd, int cmd, long arg${r}fcntl (fd, cmd, arg))
+EOF
+cat > fork.c <<EOF
+$lui _fork (void${r}fork ())
+EOF
+cat > fstat.c <<EOF
+$lu#include <string.h>
+#include <sys/stat.h>
+int
+_fstat (int fd, struct stat *buf)
+{
+  struct new_stat ks;
+  int retval = _Sys_fstat (fd, &ks);
+
+  /* Blank before filling it in.  */
+  memset (buf, 0, sizeof (*buf));
+
+  /* We have to translate from the linux struct new_stat.
+     It seems we don't have to translate the contents, though.  */
+  buf->st_dev = ks.st_dev;
+  buf->st_ino = ks.st_ino;
+  buf->st_mode = ks.st_mode;
+  buf->st_nlink = ks.st_nlink;
+  buf->st_uid = ks.st_uid;
+  buf->st_gid = ks.st_gid;
+  buf->st_rdev = ks.st_rdev;
+  buf->st_size = ks.st_size;
+  buf->st_blksize = ks.st_blksize;
+  buf->st_blocks = ks.st_blocks;
+  buf->st_atime = ks.st_atime;
+  buf->st_mtime = ks.st_mtime;
+  buf->st_ctime = ks.st_ctime;
+  R (retval)
+EOF
+cat > getpid.c <<EOF
+$lui _getpid (void${r}getpid ())
+EOF
+cat > gettod.c <<EOF
+$lu#include <sys/time.h>
+#include <sys/times.h>
+int
+_gettimeofday (struct timeval *tp, struct timezone *tzp
+${r}gettimeofday (tp, tzp))
+EOF
+cat > isatty.c <<EOF
+$lu
+typedef unsigned int tcflag_t;
+typedef unsigned char cc_t;
+#define NCCS 19
+
+struct termios {
+	tcflag_t c_iflag;		/* input mode flags */
+	tcflag_t c_oflag;		/* output mode flags */
+	tcflag_t c_cflag;		/* control mode flags */
+	tcflag_t c_lflag;		/* local mode flags */
+	cc_t c_line;			/* line discipline */
+	cc_t c_cc[NCCS];		/* control characters */
+};
+
+/* From asm-etrax100/ioctls.h: beware of updates.  */
+#define TCGETS          0x5401
+
+/* Note that this name does not have a prepended underscore.  */
+int
+isatty (int fd)
+{
+  struct termios dummy;
+  int save_errno = errno;
+  int ret = _Sys_ioctl (fd, TCGETS, (unsigned long) &dummy);
+  errno = save_errno;
+  R (ret == 0)
+EOF
+cat > kill.c <<EOF
+$lui _kill (int pid, int sig${r}kill (pid, sig))
+EOF
+cat > link.c <<EOF
+$lui _link (const char *old, const char *new${r}link (old, new))
+EOF
+cat > lseek.c <<EOF
+$lui _lseek (int fd, int offset, int whence${r}lseek (fd, offset, whence))
+EOF
+cat > open.c <<EOF
+$lui _open (const char *fnam, int flags, int mode${r}open (fnam, flags, mode))
+EOF
+cat > read.c <<EOF
+$lui _read (int fd, char *buf, int nbytes${r}read (fd, buf, nbytes))
+EOF
+cat > rename.c <<EOF
+$lui _rename (const char *old, const char *new${r}rename (old, new))
+EOF
+cat > sbrk.c <<EOF
+$lu
+/* From asm-etrax100/mman.h: beware of updates.  */
+#define PROT_READ	0x1		/* page can be read */
+#define PROT_WRITE	0x2		/* page can be written */
+#define MAP_ANONYMOUS	0x20		/* don't use a file */
+char *
+_sbrk (int d)
+{
+  static long last_alloc = 0;
+
+  /* FIXME: Things are a whole lot different than elinux.  */
+#ifdef __elinux__
+
+  /* We can't promise linear memory from a predetermined location.
+     We're NO_MM.  We're paria.  We have to rely on tweaks and unclean
+     behavior.  We abuse the fact that the malloc function in newlib
+     accepts nonlinear chunks in return to its sbrk calls (with a minor
+     patch).  */
+
+  /* We use an "old" type mmap, which takes a pointer to a vector of 6
+     longs where the parameters are stored.  */
+  long buffer[6];
+
+  /* We can't return memory.  Well we could, but we would have to keep a
+     list of previous allocations.  FIXME:  Seems reasonable to do that
+     later.  */
+  if (d < 0)
+    return (char *) last_alloc;
+
+  buffer[3] = MAP_ANONYMOUS;    /* Not associated with a file.  */
+  buffer[4] = -1;               /* No file.  */
+  buffer[0] = 0;                /* Address 0: let mmap pick one.  */
+  buffer[1] = d;                /* Length.  */
+  buffer[2] = (PROT_READ | PROT_WRITE); /* Protection flags.  */
+  buffer[5] = 0;                /* Offset into file.  */
+
+  last_alloc = _Sys_mmap (buffer);
+
+  return (char *) last_alloc;
+
+#else /* not __elinux__ */
+
+  long prev_brk;
+
+  if (last_alloc == 0)
+  {
+    last_alloc = _Sys_brk (0);
+
+    if (last_alloc < 0)
+      return (char *) -1;
+  }
+
+  prev_brk = last_alloc;
+
+  if (_Sys_brk (last_alloc + d) < last_alloc + d)
+    return (char *) -1;
+
+  last_alloc += d;
+
+  return (char *) prev_brk;
+#endif
+}
+EOF
+cat > stat.c <<EOF
+$lu#include <string.h>
+#include <sys/stat.h>
+int
+_stat (const char *path, struct stat *buf)
+{
+  struct new_stat ks;
+  int retval = _Sys_stat (path, &ks);
+
+  /* Blank before filling it in.  */
+  memset (buf, 0, sizeof (*buf));
+
+  /* We have to translate from the linux struct new_stat.
+     It seems we don't have to translate the contents, though.  */
+  buf->st_dev = ks.st_dev;
+  buf->st_ino = ks.st_ino;
+  buf->st_mode = ks.st_mode;
+  buf->st_nlink = ks.st_nlink;
+  buf->st_uid = ks.st_uid;
+  buf->st_gid = ks.st_gid;
+  buf->st_rdev = ks.st_rdev;
+  buf->st_size = ks.st_size;
+  buf->st_blksize = ks.st_blksize;
+  buf->st_blocks = ks.st_blocks;
+  buf->st_atime = ks.st_atime;
+  buf->st_mtime = ks.st_mtime;
+  buf->st_ctime = ks.st_ctime;
+  R (retval)
+EOF
+cat > times.c <<EOF
+$lu#include <sys/times.h>
+clock_t
+_times (struct tms * tp${r}times (tp))
+EOF
+cat > unlink.c <<EOF
+$lui _unlink (const char *f${r}unlink (f))
+EOF
+cat > wait.c <<EOF
+$lui _wait (int *status${r}wait4 (_getpid(), status, 0, 0))
+EOF
+cat > write.c <<EOF
+$lui _write (int fd, char *buf, int nbytes${r}write (fd, buf, nbytes))
+EOF
+exit 0
Index: src/libgloss/cris/lcrt0.c
diff -u /dev/null src/libgloss/cris/lcrt0.c:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/lcrt0.c	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,128 @@
+/* Support for cris*-axis-linux-gnu and src/sim/cris simulator.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+#include "linunistd.h"
+
+extern void exit (int) __attribute ((__noreturn__));
+
+__asm__ (".syntax no_register_prefix");
+
+#ifdef __ELF__
+/* This simulator magic for an earlier simulator was supposed to be
+   found two bytes before _start.  Let's keep it for sake of
+   compatibility.  Trying to emit them with an ordinary const char[]
+   and attribute section makes gcc barf; it doesn't like having the
+   same section attribute for both code and data.
+   The code is supposed to cause a crash if someone jumps to 0.  */
+__asm__
+ (
+  " .section .startup,\"ax\",@progbits\n"
+  " .byte 55,55\n"
+  " move.d 0xbadacce5,r9\n"
+  " clear.d [r9]\n"
+  " setf\n"
+  " setf\n"
+  " .previous");
+#endif
+
+__asm__
+ (
+#ifdef __AOUT__
+  " .text\n\t"
+#elif defined (__ELF__)
+  " .section .startup,\"ax\",@progbits\n"
+#endif
+  " .global __start\n"
+  "__start:\n"
+  /* SP must be set up by the simulator or the system.  */
+
+  /* Find ARGC, ARGV and ENV.  */
+  /* ARGC.  */
+  " move.d [sp],r10\n"
+
+  /* ARGV.  */
+  " move.d sp,r11\n"
+  " addq 4,r11\n"
+
+  /* ENVP.  */
+  " move.d sp,r12\n"
+  " addi r10.d,r12\n"
+  " addq 8,r12\n"
+
+  /* Terminate R9 and R6; we don't have a "console_print_etrax" or system
+     call function.  */
+  " clear.d r9\n"
+  " clear.d r6\n"
+  " move.d __start1,r13\n"
+  " jump r13\n"
+  " setf\n"
+#ifndef __AOUT__
+  /* We rely on a.out not being in .data here.  Quite fragile, but
+     covered by e.g. running the GCC test-suite for cris-unknown-aout. */
+  " .previous"
+#endif
+  );
+
+extern void _Libctors (void);
+extern void _Libdtors (void);
+
+extern void __init__start (void) __attribute ((weak));
+extern void __aout__ctors (void) __attribute ((weak));
+
+static void start1 () __asm__ ("__start1") __attribute ((__used__));
+static void
+start1 (int argc, char **argv, char **env)
+{
+#ifdef __ELF__
+  /* For ELF systems, we call _init and register _fini with atexit.  */
+  {
+    extern void _init (void);
+    extern void _fini (void);
+    _init ();
+    if (atexit (_fini) != 0)
+      exit (-1);
+  }
+#else
+  /* Constructors which may get here through the ELF .init section, when
+     linking ELF and producing a.out.  */
+  if (__init__start)
+    __init__start ();
+
+  if (__aout__ctors)
+    __aout__ctors ();
+
+  /* Call constructors in shared libraries. */
+  _Libctors ();
+
+  if (atexit (_Libdtors) != 0)
+    exit (-1);
+#endif
+
+  /* Call the user program.  */
+  exit (main (argc, argv, env));
+}
Index: src/libgloss/cris/linunistd.h
diff -u /dev/null src/libgloss/cris/linunistd.h:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/linunistd.h	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,423 @@
+/* Support for syscalls for cris*-axis-linux-gnu and simulators
+   Copyright (C) 1998-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* Derived from asm-etrax100/unistd.h with minor modifications to fit as
+   LOSS for newlib.  */
+
+#ifndef _ASM_ELINUX_UNISTD_H_
+#define _ASM_ELINUX_UNISTD_H_
+
+/* Our callers might want to use link_warning, so provide it from here.  */
+#include "../libnosys/config.h"
+#include "libnosys/warning.h"
+
+#include <errno.h>
+#undef errno
+extern int errno;
+
+/*
+ * This file contains the system call numbers, and stub macros for libc.
+ */
+
+#define __NR_setup		  0	/* used only by init, to get system going */
+#define __NR_exit		  1
+#define __NR_fork		  2
+#define __NR_read		  3
+#define __NR_write		  4
+#define __NR_open		  5
+#define __NR_close		  6
+#define __NR_waitpid		  7
+#define __NR_creat		  8
+#define __NR_link		  9
+#define __NR_unlink		 10
+#define __NR_execve		 11
+#define __NR_chdir		 12
+#define __NR_time		 13
+#define __NR_mknod		 14
+#define __NR_chmod		 15
+#define __NR_chown		 16
+#define __NR_break		 17
+#define __NR_oldstat		 18
+#define __NR_lseek		 19
+#define __NR_getpid		 20
+#define __NR_mount		 21
+#define __NR_umount		 22
+#define __NR_setuid		 23
+#define __NR_getuid		 24
+#define __NR_stime		 25
+#define __NR_ptrace		 26
+#define __NR_alarm		 27
+#define __NR_oldfstat		 28
+#define __NR_pause		 29
+#define __NR_utime		 30
+#define __NR_stty		 31
+#define __NR_gtty		 32
+#define __NR_access		 33
+#define __NR_nice		 34
+#define __NR_ftime		 35
+#define __NR_sync		 36
+#define __NR_kill		 37
+#define __NR_rename		 38
+#define __NR_mkdir		 39
+#define __NR_rmdir		 40
+#define __NR_dup		 41
+#define __NR_pipe		 42
+#define __NR_times		 43
+#define __NR_prof		 44
+#define __NR_brk		 45
+#define __NR_setgid		 46
+#define __NR_getgid		 47
+#define __NR_signal		 48
+#define __NR_geteuid		 49
+#define __NR_getegid		 50
+#define __NR_acct		 51
+#define __NR_phys		 52
+#define __NR_lock		 53
+#define __NR_ioctl		 54
+#define __NR_fcntl		 55
+#define __NR_mpx		 56
+#define __NR_setpgid		 57
+#define __NR_ulimit		 58
+#define __NR_oldolduname	 59
+#define __NR_umask		 60
+#define __NR_chroot		 61
+#define __NR_ustat		 62
+#define __NR_dup2		 63
+#define __NR_getppid		 64
+#define __NR_getpgrp		 65
+#define __NR_setsid		 66
+#define __NR_sigaction		 67
+#define __NR_sgetmask		 68
+#define __NR_ssetmask		 69
+#define __NR_setreuid		 70
+#define __NR_setregid		 71
+#define __NR_sigsuspend		 72
+#define __NR_sigpending		 73
+#define __NR_sethostname	 74
+#define __NR_setrlimit		 75
+#define __NR_getrlimit		 76
+#define __NR_getrusage		 77
+#define __NR_gettimeofday	 78
+#define __NR_settimeofday	 79
+#define __NR_getgroups		 80
+#define __NR_setgroups		 81
+#define __NR_select		 82
+#define __NR_symlink		 83
+#define __NR_oldlstat		 84
+#define __NR_readlink		 85
+#define __NR_uselib		 86
+#define __NR_swapon		 87
+#define __NR_reboot		 88
+#define __NR_readdir		 89
+#define __NR_mmap		 90
+#define __NR_munmap		 91
+#define __NR_truncate		 92
+#define __NR_ftruncate		 93
+#define __NR_fchmod		 94
+#define __NR_fchown		 95
+#define __NR_getpriority	 96
+#define __NR_setpriority	 97
+#define __NR_profil		 98
+#define __NR_statfs		 99
+#define __NR_fstatfs		100
+#define __NR_ioperm		101
+#define __NR_socketcall		102
+#define __NR_syslog		103
+#define __NR_setitimer		104
+#define __NR_getitimer		105
+#define __NR_stat		106
+#define __NR_lstat		107
+#define __NR_fstat		108
+#define __NR_olduname		109
+#define __NR_iopl		110
+#define __NR_vhangup		111
+#define __NR_idle		112
+#define __NR_vm86		113
+#define __NR_wait4		114
+#define __NR_swapoff		115
+#define __NR_sysinfo		116
+#define __NR_ipc		117
+#define __NR_fsync		118
+#define __NR_sigreturn		119
+#define __NR_clone		120
+#define __NR_setdomainname	121
+#define __NR_uname		122
+#define __NR_modify_ldt		123
+#define __NR_adjtimex		124
+#define __NR_mprotect		125
+#define __NR_sigprocmask	126
+#define __NR_create_module	127
+#define __NR_init_module	128
+#define __NR_delete_module	129
+#define __NR_get_kernel_syms	130
+#define __NR_quotactl		131
+#define __NR_getpgid		132
+#define __NR_fchdir		133
+#define __NR_bdflush		134
+#define __NR_sysfs		135
+#define __NR_personality	136
+#define __NR_afs_syscall	137 /* Syscall for Andrew File System */
+#define __NR_setfsuid		138
+#define __NR_setfsgid		139
+#define __NR__llseek		140
+#define __NR_getdents		141
+#define __NR__newselect		142
+#define __NR_flock		143
+#define __NR_msync		144
+#define __NR_readv		145
+#define __NR_writev		146
+#define __NR_getsid		147
+#define __NR_fdatasync		148
+#define __NR__sysctl		149
+#define __NR_mlock		150
+#define __NR_munlock		151
+#define __NR_mlockall		152
+#define __NR_munlockall		153
+#define __NR_sched_setparam		154
+#define __NR_sched_getparam		155
+#define __NR_sched_setscheduler		156
+#define __NR_sched_getscheduler		157
+#define __NR_sched_yield		158
+#define __NR_sched_get_priority_max	159
+#define __NR_sched_get_priority_min	160
+#define __NR_sched_rr_get_interval	161
+#define __NR_nanosleep		162
+#define __NR_mremap		163
+
+#define __NR_mmap2		192
+
+#define PASTE(x,y) x##y
+#define XSTR(x) # x
+#define STR(x) XSTR (x)
+
+#ifdef __elinux__
+# define CRIS_SYSCALL "jir .$System.call"
+# define CALLNO_REG r1
+# define ARG5_REG r0
+# define MOVE_ARG5 "move.d"
+# define COLON_ARG5_CLOBBER : "r0"
+#else
+# define CRIS_SYSCALL "break 13"
+# define CALLNO_REG r9
+# define ARG5_REG srp
+# define MOVE_ARG5 "move"
+# define COLON_ARG5_CLOBBER
+#endif
+
+/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
+#define _syscall0(type,name) \
+type PASTE(_Sys_,name) (void) \
+{ \
+  register long __a __asm__ ("r10"); \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_)); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define _syscall1(type,name,type1,arg1) \
+type PASTE(_Sys_,name) (type1 arg1) \
+{ \
+  register long __a __asm__ ("r10") = (long) arg1; \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_), "0" (__a)); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type PASTE(_Sys_,name) (type1 arg1,type2 arg2) \
+{ \
+  register long __a __asm__ ("r10") = (long) arg1; \
+  register long __b __asm__ ("r11") = (long) arg2; \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_), "0" (__a), "r" (__b)); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type PASTE(_Sys_,name) (type1 arg1,type2 arg2,type3 arg3) \
+{ \
+  register long __a __asm__ ("r10") = (long) arg1; \
+  register long __b __asm__ ("r11") = (long) arg2; \
+  register long __c __asm__ ("r12") = (long) arg3; \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_), "0" (__a), "r" (__b), "r" (__c)); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type PASTE(_Sys_,name) (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+  register long __a __asm__ ("r10") = (long) arg1; \
+  register long __b __asm__ ("r11") = (long) arg2; \
+  register long __c __asm__ ("r12") = (long) arg3; \
+  register long __d __asm__ ("r13") = (long) arg4; \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_), "0" (__a), "r" (__b), \
+			  "r" (__c), "r" (__d)); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
+	  type5,arg5) \
+type PASTE(_Sys_,name) (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+{ \
+  register long __a __asm__ ("r10") = (long) arg1; \
+  register long __b __asm__ ("r11") = (long) arg2; \
+  register long __c __asm__ ("r12") = (long) arg3; \
+  register long __d __asm__ ("r13") = (long) arg4; \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (MOVE_ARG5 " %6,$" STR (ARG5_REG) "\n\t" \
+			CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_), "0" (__a), "r" (__b), \
+			  "r" (__c), "r" (__d), "g" (arg5) \
+			COLON_ARG5_CLOBBER); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
+	  type5,arg5,type6,arg6) \
+type PASTE(_Sys_,name) (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6) \
+{ \
+  register long __a __asm__ ("r10") = (long) arg1; \
+  register long __b __asm__ ("r11") = (long) arg2; \
+  register long __c __asm__ ("r12") = (long) arg3; \
+  register long __d __asm__ ("r13") = (long) arg4; \
+  register long __n_ __asm__ (STR (CALLNO_REG)) = (__NR_##name); \
+  __asm__ __volatile__ (MOVE_ARG5 " %6,$" STR (ARG5_REG) "\n\t" \
+			"move %7,$mof\n\t" \
+			CRIS_SYSCALL \
+			: "=r" (__a) \
+			: "r" (__n_), "0" (__a), "r" (__b), \
+			  "r" (__c), "r" (__d), "g" (arg5), "g" (arg6) \
+			COLON_ARG5_CLOBBER); \
+  if (__a >= 0) \
+     return (type) __a; \
+  errno = -__a; \
+  return -1; \
+}
+
+#define __NR__exit __NR_exit
+static inline _syscall0(int,idle)
+static inline _syscall0(int,fork)
+static inline _syscall2(int,clone,unsigned long,flags,char *,esp)
+static inline _syscall0(int,pause)
+static inline _syscall0(int,setup)
+static inline _syscall0(int,sync)
+static inline _syscall3(int,write,int,fd,const char *,buf,unsigned,count)
+static inline _syscall1(int,dup,int,fd)
+static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
+static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
+static inline _syscall1(int,close,int,fd)
+static inline _syscall1(int,_exit,int,exitcode)
+static inline _syscall1(int,exit,int,exitcode)
+static inline _syscall3(int,waitpid,int,pid,int *,wait_stat,int,options)
+static inline _syscall3(int,read,int,fd,char *,buf,unsigned,count)
+static inline _syscall2(int,socketcall,int,call,unsigned long *,args)
+static inline _syscall3(int,ioctl,unsigned int,fd,unsigned int,cmd,unsigned long,arg)
+static inline _syscall3(int,fcntl,unsigned int,fd,unsigned int,cmd,unsigned long,arg)
+static inline _syscall5(int,mount,const char *,a,const char *,b,const char *,c,unsigned long,rwflag,const void *,data)
+static inline _syscall2(int,rename,const char *,a,const char*,b)
+
+#ifndef __elinux__
+/* Make sure these are only used where they are supported.  */
+static inline _syscall6(int,mmap2,unsigned long, addr, unsigned long, len,
+			unsigned long, prot, unsigned long, flags,
+			unsigned long, fd, unsigned long, pgoff)
+static inline _syscall1(long,brk,long,addr)
+#endif
+
+/* This structure is ripped from asm-etrax100/stat.h: beware of updates.  */
+struct new_stat {
+	unsigned short st_dev;
+	unsigned short __pad1;
+	unsigned long st_ino;
+	unsigned short st_mode;
+	unsigned short st_nlink;
+	unsigned short st_uid;
+	unsigned short st_gid;
+	unsigned short st_rdev;
+	unsigned short __pad2;
+	unsigned long  st_size;
+	unsigned long  st_blksize;
+	unsigned long  st_blocks;
+	unsigned long  st_atime;
+	unsigned long  __unused1;
+	unsigned long  st_mtime;
+	unsigned long  __unused2;
+	unsigned long  st_ctime;
+	unsigned long  __unused3;
+	unsigned long  __unused4;
+	unsigned long  __unused5;
+};
+
+static inline _syscall2(int,stat,const char *,path,struct new_stat *,statbuf)
+static inline _syscall2(int,fstat,int,fd,struct new_stat *,statbuf)
+static inline _syscall0(int,getpid)
+static inline _syscall2(int,kill,int,pid,int,sig)
+static inline _syscall3(int,lseek,int,fd,int,offset,int,whence)
+struct tms;
+static inline _syscall1(long,times,struct tms *,tbuf)
+static inline _syscall1(long,mmap,long *, buf)
+struct timeval;
+struct timezone;
+static inline _syscall2(int,gettimeofday,struct timeval *,tp,
+                        struct timezone *, tzp)
+static inline _syscall2(int,link,const char *,old,const char *,new)
+static inline _syscall1(int,unlink,const char *, f)
+struct rusage;
+static inline _syscall4(int,wait4,int,pid,int *,sa,int,op,struct rusage *,ru)
+#endif /* _ASM_ELINUX_UNISTD_H_ */
Index: src/libgloss/cris/outbyte.c
diff -u /dev/null src/libgloss/cris/outbyte.c:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/outbyte.c	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,9 @@
+/* Low-level kind-of-support for CRIS.  Mostly used as a placeholder
+   function.  Too small and obvious to warrant a copyright notice.  */
+
+#include <stdio.h>
+void
+outbyte (int ch)
+{
+  write (1, &ch, 1);
+}
Index: src/libgloss/cris/setup.S
diff -u /dev/null src/libgloss/cris/setup.S:1.1
--- /dev/null	Thu May 12 14:26:10 2005
+++ src/libgloss/cris/setup.S	Thu Jan 27 22:57:32 2005
@@ -0,0 +1,44 @@
+/* Support for standalone CRIS/CRISv32 code.
+   Copyright (C) 2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+ .text
+ .global __setup
+__setup:
+ /* Make sure to save SRP.  */
+#ifdef __arch_common_v10_v32
+ /* Can't do anything if we don't know for which arch.  This file is
+    then only a placeholder.  Oh, and we can't use the "ret" insn in
+    "common" code.  */
+#else
+ /* Code missing:
+    - Initialize RAM circuits.
+    - Initialize serial output and input.
+    - Set stack-pointer.  */
+ ret
+ nop
+#endif
Index: src/libgloss/libnosys/Makefile.in
diff -u src/libgloss/libnosys/Makefile.in:1.4 src/libgloss/libnosys/Makefile.in:1.5
--- src/libgloss/libnosys/Makefile.in:1.4	Mon Jun 28 22:42:20 2004
+++ src/libgloss/libnosys/Makefile.in	Tue Jan 18 19:00:26 2005
@@ -44,15 +44,15 @@
 CC = @CC@
 
 #AS = @AS@
-AS = `if [ -f ${objroot}/../gas/as.new ] ; \
-	then echo ${objroot}/../gas/as.new ; \
+AS = `if [ -f ${objroot}/../gas/as-new ] ; \
+	then echo ${objroot}/../gas/as-new ; \
 	else echo as ; fi`
 
 AR = @AR@
 
 #LD = @LD@
-LD = `if [ -f ${objroot}/../ld/ld.new ] ; \
-	then echo ${objroot}/../ld/ld.new ; \
+LD = `if [ -f ${objroot}/../ld/ld-new ] ; \
+	then echo ${objroot}/../ld/ld-new ; \
 	else echo ld ; fi`
 
 RANLIB = @RANLIB@
Index: src/libgloss/libnosys/configure
diff -u src/libgloss/libnosys/configure:1.4 src/libgloss/libnosys/configure:1.6
--- src/libgloss/libnosys/configure:1.4	Fri Oct 25 19:05:34 2002
+++ src/libgloss/libnosys/configure	Thu Jan 27 22:57:32 2005
@@ -755,6 +755,8 @@
 	;;
   strongarm-*-*)
 	;;
+  cris-*-* | crisv32-*-*)
+	;;
   d10v*)
 	;;
   h8300*-*-*)
@@ -807,15 +809,17 @@
 
 
         echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:811: checking for .previous assembler directive" >&5
+echo "configure:813: checking for .previous assembler directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-          cat > conftest.s <<EOF
+          libc_cv_asm_previous_directive=no
+        cat > conftest.s <<EOF
 .section foo_section
 .previous
 EOF
-        if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+        if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+          libc_cv_asm_previous_directive=yes
           cat >> confdefs.h <<\EOF
 #define HAVE_ASM_PREVIOUS_DIRECTIVE 1
 EOF
@@ -827,15 +831,17 @@
 echo "$ac_t""$libc_cv_asm_previous_directive" 1>&6
 
         echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:831: checking for .popsection assembler directive" >&5
+echo "configure:835: checking for .popsection assembler directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-          cat > conftest.s <<EOF
+          libc_cv_asm_popsection_directive=no
+        cat > conftest.s <<EOF
 .pushsection foo_section
 .popsection
 EOF
-        if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+        if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+          libc_cv_asm_popsection_directive=yes
           cat >> confdefs.h <<\EOF
 #define HAVE_ASM_POPSECTION_DIRECTIVE 1
 EOF
@@ -847,15 +853,17 @@
 echo "$ac_t""$libc_cv_asm_popsection_directive" 1>&6
 
         echo $ac_n "checking for section attributes""... $ac_c" 1>&6
-echo "configure:851: checking for section attributes" >&5
+echo "configure:857: checking for section attributes" >&5
 if eval "test \"`echo '$''{'libc_cv_section_attributes'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-          cat > conftest.c <<EOF
+          libc_cv_section_attributes=no
+        cat > conftest.c <<EOF
 int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
 int main() {}
 EOF
-        if { ac_try='${CC-cc} -c $CFLAGS conftest.c 1>&5'; { (eval echo configure:859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+        if { ac_try='${CC-cc} -c $CFLAGS conftest.c 1>&5'; { (eval echo configure:866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+          libc_cv_section_attributes=yes
           cat >> confdefs.h <<\EOF
 #define HAVE_SECTION_ATTRIBUTES 1
 EOF
@@ -868,27 +876,31 @@
         ;;
 esac
 
-echo $ac_n "checking for function prefix""... $ac_c" 1>&6
-echo "configure:873: checking for function prefix" >&5
-if eval "test \"`echo '$''{'libc_dollar_prefix'+set}'`\" = set"; then
+echo $ac_n "checking for symbol prefix""... $ac_c" 1>&6
+echo "configure:881: checking for symbol prefix" >&5
+if eval "test \"`echo '$''{'libc_symbol_prefix'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<\EOF
 foo () { }
 EOF
-if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null'; { (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+libc_symbol_prefix=none
+if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null'; { (eval echo configure:889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
 then
-  libc_dollar_prefix=yes
+  libc_symbol_prefix='$'
 else
-  libc_dollar_prefix=no
+  if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null'; { (eval echo configure:893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+  then
+    libc_symbol_prefix=_
+  fi
 fi
 rm -f conftest* 
 fi
 
-echo "$ac_t""$libc_dollar_prefix" 1>&6
-if test $libc_dollar_prefix = yes ; then
-  cat >> confdefs.h <<\EOF
-#define __SYMBOL_PREFIX "$"
+echo "$ac_t""$libc_symbol_prefix" 1>&6
+if test $libc_symbol_prefix != none; then
+  cat >> confdefs.h <<EOF
+#define __SYMBOL_PREFIX "$libc_symbol_prefix"
 EOF
 
 else
@@ -901,7 +913,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:905: checking for $ac_word" >&5
+echo "configure:917: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -931,7 +943,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:935: checking for $ac_word" >&5
+echo "configure:947: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -980,7 +992,7 @@
 fi
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:984: checking whether we are using GNU C" >&5
+echo "configure:996: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -989,7 +1001,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1004,7 +1016,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1008: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1020: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1040,7 +1052,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1044: checking for $ac_word" >&5
+echo "configure:1056: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
Index: src/libgloss/libnosys/configure.in
diff -u src/libgloss/libnosys/configure.in:1.3 src/libgloss/libnosys/configure.in:1.5
--- src/libgloss/libnosys/configure.in:1.3	Sat May 11 20:48:04 2002
+++ src/libgloss/libnosys/configure.in	Thu Jan 27 22:57:32 2005
@@ -89,6 +89,8 @@
 	;;
   strongarm-*-*)
 	;;
+  cris-*-* | crisv32-*-*)
+	;;
   d10v*)
 	;;
   h8300*-*-*)
@@ -137,53 +139,63 @@
 
         AC_CACHE_CHECK(for .previous assembler directive,
                          libc_cv_asm_previous_directive, [dnl
+        libc_cv_asm_previous_directive=no
         cat > conftest.s <<EOF
 .section foo_section
 .previous
 EOF
         if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
+          libc_cv_asm_previous_directive=yes
           AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
         fi
         rm -f conftest*])
 
         AC_CACHE_CHECK(for .popsection assembler directive,
                          libc_cv_asm_popsection_directive, [dnl
+        libc_cv_asm_popsection_directive=no
         cat > conftest.s <<EOF
 .pushsection foo_section
 .popsection
 EOF
         if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
+          libc_cv_asm_popsection_directive=yes
           AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
         fi
         rm -f conftest*])
 
         AC_CACHE_CHECK(for section attributes,
                          libc_cv_section_attributes, [dnl
+        libc_cv_section_attributes=no
         cat > conftest.c <<EOF
 int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
 int main() {}
 EOF
         if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then
+          libc_cv_section_attributes=yes
           AC_DEFINE(HAVE_SECTION_ATTRIBUTES)
         fi
         rm -f conftest*])
         ;;
 esac
 
-AC_CACHE_CHECK(for function prefix, libc_dollar_prefix, [dnl
+AC_CACHE_CHECK(for symbol prefix, libc_symbol_prefix, [dnl
 cat > conftest.c <<\EOF
 foo () { }
 EOF
 dnl
+libc_symbol_prefix=none
 if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
 then
-  libc_dollar_prefix=yes
+  libc_symbol_prefix='$'
 else
-  libc_dollar_prefix=no
+  if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]);
+  then
+    libc_symbol_prefix=_
+  fi
 fi
 rm -f conftest* ])
-if test $libc_dollar_prefix = yes ; then
-  AC_DEFINE(__SYMBOL_PREFIX, "$")
+if test $libc_symbol_prefix != none; then
+  AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_symbol_prefix")
 else
   AC_DEFINE(__SYMBOL_PREFIX, "")
 fi
Index: src/libgloss/libnosys/warning.h
diff -u src/libgloss/libnosys/warning.h:1.2 src/libgloss/libnosys/warning.h:1.5
--- src/libgloss/libnosys/warning.h:1.2	Sat May 11 20:48:04 2002
+++ src/libgloss/libnosys/warning.h	Fri Jan 21 21:55:07 2005
@@ -7,19 +7,19 @@
 /* We want the .gnu.warning.SYMBOL section to be unallocated.  */
 #  ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
 #   define __make_section_unallocated(section_string)   \
-  asm(".section " section_string "; .previous");
+  asm(".section " section_string "\n .previous");
 #  elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
 #   define __make_section_unallocated(section_string)   \
-  asm(".pushsection " section_string "; .popsection");
+  asm(".pushsection " section_string "\n .popsection");
 #  else
 #   define __make_section_unallocated(section_string)
 #  endif
 
 #  ifdef HAVE_SECTION_ATTRIBUTES
 #   define link_warning(symbol, msg)                     \
-  __make_section_unallocated (".gnu.warning." #symbol)  \
   static const char __evoke_link_warning_##symbol[]     \
-    __attribute__ ((section (".gnu.warning." #symbol))) = msg;
+    __attribute__ ((section (".gnu.warning." __SYMBOL_PREFIX #symbol), \
+		   __used__)) = msg;
 #  else
 #   define link_warning(symbol, msg)
 #  endif
@@ -35,9 +35,10 @@
 # define link_warning(symbol, msg)
 #endif
 
-/* A canned warning for sysdeps/stub functions.  */
+/* A canned warning for sysdeps/stub functions.
+   The GNU linker prepends a "warning: " string.  */
 #define stub_warning(name) \
   link_warning (name, \
-                "warning: " #name " is not implemented and will always fail")
+                #name " is not implemented and will always fail")
 
 #endif /* __WARNING_H__ */
Index: src/libgloss/mips/array.ld
diff -u src/libgloss/mips/array.ld:1.3 src/libgloss/mips/array.ld:1.4
--- src/libgloss/mips/array.ld:1.3	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/array.ld	Tue Apr 12 08:06:40 2005
@@ -84,7 +84,7 @@
   . = 0x80020000;
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -94,7 +94,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/cfe.ld
diff -u src/libgloss/mips/cfe.ld:1.4 src/libgloss/mips/cfe.ld:1.5
--- src/libgloss/mips/cfe.ld:1.4	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/cfe.ld	Tue Apr 12 08:06:40 2005
@@ -41,10 +41,10 @@
     *(.mips16.call.*)
   }
   .init : {
-    *(.init)
+    KEEP (*(.init))
   }
   .fini : {
-    *(.fini)
+    KEEP (*(.fini))
   }
   .rel.sdata : {
     PROVIDE (__runtime_reloc_start = .);
Index: src/libgloss/mips/dve.ld
diff -u src/libgloss/mips/dve.ld:1.4 src/libgloss/mips/dve.ld:1.5
--- src/libgloss/mips/dve.ld:1.4	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/dve.ld	Tue Apr 12 08:06:40 2005
@@ -33,7 +33,7 @@
   . = 0xA0040000;
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -43,7 +43,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/idt.ld
diff -u src/libgloss/mips/idt.ld:1.5 src/libgloss/mips/idt.ld:1.6
--- src/libgloss/mips/idt.ld:1.5	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/idt.ld	Tue Apr 12 08:06:40 2005
@@ -42,10 +42,10 @@
     *(.mips16.call.*)
   }
   .init : {
-    *(.init)
+    KEEP (*(.init))
   }
   .fini : {
-    *(.fini)
+    KEEP (*(.fini))
   }
   .rel.sdata : {
     PROVIDE (__runtime_reloc_start = .);
Index: src/libgloss/mips/idt32.ld
diff -u src/libgloss/mips/idt32.ld:1.3 src/libgloss/mips/idt32.ld:1.4
--- src/libgloss/mips/idt32.ld:1.3	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/idt32.ld	Tue Apr 12 08:06:40 2005
@@ -43,10 +43,10 @@
     *(.mips16.call.*)
   }
   .init : {
-    *(.init)
+    KEEP (*(.init))
   }
   .fini : {
-    *(.fini)
+    KEEP (*(.fini))
   }
   .rel.sdata : {
     PROVIDE (__runtime_reloc_start = .);
Index: src/libgloss/mips/idt64.ld
diff -u src/libgloss/mips/idt64.ld:1.3 src/libgloss/mips/idt64.ld:1.4
--- src/libgloss/mips/idt64.ld:1.3	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/idt64.ld	Tue Apr 12 08:06:40 2005
@@ -43,10 +43,10 @@
     *(.mips16.call.*)
   }
   .init : {
-    *(.init)
+    KEEP (*(.init))
   }
   .fini : {
-    *(.fini)
+    KEEP (*(.fini))
   }
   .rel.sdata : {
     PROVIDE (__runtime_reloc_start = .);
Index: src/libgloss/mips/idtecoff.ld
diff -u src/libgloss/mips/idtecoff.ld:1.2 src/libgloss/mips/idtecoff.ld:1.3
--- src/libgloss/mips/idtecoff.ld:1.2	Fri Jul 12 15:37:04 2002
+++ src/libgloss/mips/idtecoff.ld	Tue Apr 12 08:06:40 2005
@@ -35,7 +35,7 @@
   . = 0xA0020000;
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -45,7 +45,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/jmr3904app-java.ld
diff -u src/libgloss/mips/jmr3904app-java.ld:1.3 src/libgloss/mips/jmr3904app-java.ld:1.4
--- src/libgloss/mips/jmr3904app-java.ld:1.3	Thu Aug  1 20:21:23 2002
+++ src/libgloss/mips/jmr3904app-java.ld	Tue Apr 12 08:06:40 2005
@@ -35,7 +35,7 @@
       /* It fits the Cygmon ROMS */
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -45,7 +45,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/jmr3904app.ld
diff -u src/libgloss/mips/jmr3904app.ld:1.4 src/libgloss/mips/jmr3904app.ld:1.5
--- src/libgloss/mips/jmr3904app.ld:1.4	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/jmr3904app.ld	Tue Apr 12 08:06:40 2005
@@ -32,7 +32,7 @@
       /* It fits the Cygmon ROMS */
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -42,7 +42,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/jmr3904dram-java.ld
diff -u src/libgloss/mips/jmr3904dram-java.ld:1.3 src/libgloss/mips/jmr3904dram-java.ld:1.4
--- src/libgloss/mips/jmr3904dram-java.ld:1.3	Thu Aug  1 20:21:23 2002
+++ src/libgloss/mips/jmr3904dram-java.ld	Tue Apr 12 08:06:40 2005
@@ -37,7 +37,7 @@
       /* It fits the Cygmon ROMS */
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -47,7 +47,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/jmr3904dram.ld
diff -u src/libgloss/mips/jmr3904dram.ld:1.3 src/libgloss/mips/jmr3904dram.ld:1.4
--- src/libgloss/mips/jmr3904dram.ld:1.3	Thu Aug  1 20:21:23 2002
+++ src/libgloss/mips/jmr3904dram.ld	Tue Apr 12 08:06:40 2005
@@ -34,7 +34,7 @@
       /* It fits the Cygmon ROMS */
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -44,7 +44,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/lsi.ld
diff -u src/libgloss/mips/lsi.ld:1.4 src/libgloss/mips/lsi.ld:1.5
--- src/libgloss/mips/lsi.ld:1.4	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/lsi.ld	Tue Apr 12 08:06:40 2005
@@ -34,7 +34,7 @@
   . = 0xA0020000;
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -42,7 +42,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/nullmon.ld
diff -u src/libgloss/mips/nullmon.ld:1.4 src/libgloss/mips/nullmon.ld:1.5
--- src/libgloss/mips/nullmon.ld:1.4	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/nullmon.ld	Tue Apr 12 08:06:40 2005
@@ -34,7 +34,7 @@
   . = 0xA0020000;
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -44,7 +44,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/pmon.ld
diff -u src/libgloss/mips/pmon.ld:1.4 src/libgloss/mips/pmon.ld:1.5
--- src/libgloss/mips/pmon.ld:1.4	Wed May  5 12:16:31 2004
+++ src/libgloss/mips/pmon.ld	Tue Apr 12 08:06:40 2005
@@ -34,7 +34,7 @@
   . = 0xA0020000;
   .text : {
      _ftext = . ;
-    *(.init)
+    KEEP (*(.init))
      eprol  =  .;
     *(.text)
     *(.text.*)
@@ -44,7 +44,7 @@
     PROVIDE (__runtime_reloc_start = .);
     *(.rel.sdata)
     PROVIDE (__runtime_reloc_stop = .);
-    *(.fini)
+    KEEP (*(.fini))
      etext  =  .;
      _etext  =  .;
   }
Index: src/libgloss/mips/regs.S
diff -u src/libgloss/mips/regs.S:1.3 src/libgloss/mips/regs.S:1.4
--- src/libgloss/mips/regs.S:1.3	Sat Apr  3 01:02:51 2004
+++ src/libgloss/mips/regs.S	Tue Apr 19 18:03:18 2005
@@ -53,15 +53,16 @@
 #define fp1	$f1
 
 /* Useful memory constants: */
-#define K0BASE		0x80000000
 #ifndef __mips64
+#define K0BASE          0x80000000
 #define K1BASE		0xA0000000
 #define K0BASE_ADDR	((char *)K0BASE)
 #define K1BASE_ADDR	((char *)K1BASE)
 #else
-#define K1BASE		0xFFFFFFFFA0000000LL
+#define K0BASE          0xFFFFFFFF80000000
+#define K1BASE		0xFFFFFFFFA0000000
 #define K0BASE_ADDR	((char *)0xFFFFFFFF80000000LL)
-#define K1BASE_ADDR	((char *)K1BASE)
+#define K1BASE_ADDR	((char *)0xFFFFFFFFA0000000LL)
 #endif
 
 #define PHYS_TO_K1(a)   ((unsigned)(a) | K1BASE)
Index: src/libgloss/rs6000/Makefile.in
diff -u src/libgloss/rs6000/Makefile.in:1.2 src/libgloss/rs6000/Makefile.in:1.3
--- src/libgloss/rs6000/Makefile.in:1.2	Mon Jun 28 22:42:21 2004
+++ src/libgloss/rs6000/Makefile.in	Thu May  5 23:07:08 2005
@@ -68,7 +68,7 @@
 SIM_LDFLAGS	=
 SIM_BSP		= libsim.a
 SIM_CRT0	= sim-crt0.o
-SIM_OBJS	= sim-print.o sim-inbyte.o sim-sbrk.o sim-abort.o sim-errno.o simulator.o
+SIM_OBJS	= sim-print.o sim-inbyte.o sim-sbrk.o sim-abort.o sim-errno.o simulator.o sim-getrusage.o
 SIM_TEST	= sim-test
 SIM_INSTALL	= install-sim
 
@@ -270,6 +270,7 @@
 crt0.o: crt0.S
 
 simulator.o: simulator.S
+sim-getrusage.o: sim-getrusage.S
 sim-crt0.o: sim-crt0.S
 mount.o: mount.S
 
Index: src/libgloss/rs6000/sim-getrusage.S
diff -u /dev/null src/libgloss/rs6000/sim-getrusage.S:1.1
--- /dev/null	Thu May 12 14:26:15 2005
+++ src/libgloss/rs6000/sim-getrusage.S	Thu May  5 23:07:08 2005
@@ -0,0 +1,25 @@
+/*
+ * sim-getrusage.S -- PowerPC simulator getrusage call.
+ *
+ * Copyright (c) 1995, 2000, 2001 Cygnus Support
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "ppc-asm.h"
+
+FUNC_START(getrusage)
+	li	r0,117
+	sc
+	bns+	0f
+	b	FUNC_NAME(_cerror)
+0:	blr
+FUNC_END(getrusage)
Index: src/libgloss/rs6000/simulator.S
diff -u src/libgloss/rs6000/simulator.S:1.4 src/libgloss/rs6000/simulator.S:1.5
--- src/libgloss/rs6000/simulator.S:1.4	Mon Jul 22 19:26:25 2002
+++ src/libgloss/rs6000/simulator.S	Thu May  5 23:07:08 2005
@@ -87,14 +87,6 @@
 0:	blr
 FUNC_END(gettimeofday)
 
-FUNC_START(getrusage)
-	li	r0,117
-	sc
-	bns+	0f
-	b	FUNC_NAME(_cerror)
-0:	blr
-FUNC_END(getrusage)
-
 FUNC_START(lseek)
 	li	r0,199
 	sc
Index: src/ChangeLog
diff -u src/ChangeLog:1.549 src/ChangeLog:1.575
--- src/ChangeLog:1.549	Thu Dec 16 19:51:27 2004
+++ src/ChangeLog	Thu May  5 01:36:31 2005
@@ -1,3 +1,204 @@
+2005-05-04  Mike Stump  <mrs@apple.com>
+
+	* configure.in: Always pass --target to target configures as
+	otherwise rebuilds that do --recheck will fail.
+	* confiugure: Rebuilt.
+
+2005-05-04  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Rename from
+	STAGE_HOST_EXPORTS.
+	(configure, all): Add bootstrap support.
+	(Host modules, target modules): Pass post-stage1 flags and exports.
+	(Top-level bootstrap): Remove bootstrap rules, expanded elsewhere.
+	* Makefile.in: Regenerate.
+
+2005-04-29  Paolo Bonzini  <bonzini@gnu.org>
+
+	Sync from gcc:
+
+	2005-04-22  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+        * config.sub: Update from master copy.
+
+	2005-04-19  Hans-Peter Nilsson  <hp@axis.com>
+
+        * configure.in <crisv32-*-*, cris-*-*>: New local variable
+        libgcj_ex_libffi.  Have specific match for *-*-linux*.  Separate
+        matches for "*-*-aout" and "*-*-elf".  Don't disable libffi for
+        "*-*-elf" and "*-*-linux*".
+        * configure: Regenerate.
+
+2005-04-06  Paolo Bonzini  <bonzini@gnu.org>
+
+        * Makefile.tpl (BUILD_CONFIGARGS): Include --with-build-subdir.
+	(TARGET_CONFIGARGS): Include --with-target-subdir.
+	(configure, all): New macros.  Use them throughout.
+
+2005-04-05  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl: Sync with gcc.
+	* Makefile.in: Regenerate.
+
+2005-03-30  J"orn Rennecke <joern.rennecke@st.com>
+
+	* config/mh-mingw32: Delete.
+	* configure.in: Don't use it.
+	* configure: Regenerate.
+
+2005-03-31  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.def (bfd, opcodes, libstdc++-v3, libmudflap): Set lib_path.
+	* Makefile.tpl (SET_LIB_PATH, REALLY_SET_LIB_PATH): Remove.
+	(HOST_EXPORTS, STAGE_HOST_EXPORTS, TARGET_EXPORTS): Set $(RPATH_ENVVAR).
+	(HOST_LIB_PATH): Generate from Makefile.def.
+	(TARGET_LIB_PATH): Likewise.
+	(Old bootstrap targets): Include TARGET_LIB_PATH into RPATH_ENVVAR.
+	* Makefile.in: Regenerate.
+	* configure.in (set_lib_path, SET_LIB_PATH, SET_GCC_LIB_PATH): Remove.
+	(RPATH_ENVVAR): Include Darwin case.
+	* configure: Regenerate.
+
+2005-03-25  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure.in (RPATH_ENVVAR): Set to DYLD_LIBRARY_PATH on Darwin.
+	* configure: Regenerate.
+
+2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+
+	* Makefile.def: Remove libstdcxx_incdir, libsubdir, gxx_include_dir,
+	gcc_version, and gcc_version_trigger from set of flags to pass.
+	* Makefile.tpl: Remove definitions of above variables.
+	(config.status): Remove dependency on $(gcc_version_trigger).
+	* Makefile.in: Regenerate.
+	* configure.in: Do not reference config/gcc-version.m4 nor
+	config/gxx-include-dir.m4.  Do not invoke TL_AC_GCC_VERSION nor
+	TL_AC_GXX_INCLUDE_DIR.  Do not set gcc_version_trigger.
+	* configure: Regenerate.
+
+2005-03-16  Manfred Hollstein  <manfred.h@gmx.net>
+	    Andrew Pinski <pinskia@physics.uc.edu>
+
+	* Makefile.tpl (check-[+module+]): Fix shell statement inside if ... fi.
+	* Makefile.in: Regenerate.
+
+2005-03-01  Alexandre Oliva  <aoliva@redhat.com>
+
+	PR libgcj/20160
+	* ltmain.sh: Avoid creating archives with components that have
+	duplicate basenames.
+
+2005-02-28  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	PR bootstrap/20250
+	* Makefile.tpl (HOST target installs): Fix copy and pasto, use install
+	instead of check.
+	* Makefile.in: Regenerate.
+
+2005-02-28  Paolo Bonzini  <bonzini@gnu.org>
+
+	Sync from gcc.
+
+	2005-02-28  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR bootstrap/17383
+	* Makefile.def (target_modules): Remove "stage", now unnecessary.
+	* Makefile.tpl (HOST_SUBDIR): New substitution.
+	(STAGE_HOST_EXPORTS, EXPECT, HOST_LIB_PATH, USUAL_AR_FOR_TARGET,
+	USUAL_AS_FOR_TARGET, USUAL_DLLTOOL_FOR_TARGET, USUAL_GCC_FOR_TARGET,
+	USUAL_LD_FOR_TARGET, USUAL_NM_FOR_TARGET, USUAL_OBJDUMP_FOR_TARGET,
+	USUAL_RANLIB_FOR_TARGET, USUAL_WINDRES_FOR_TARGET): Use it.
+	(Host modules, Bootstrapped modules): Use it.
+	(Build modules, Target modules): Do not create symlink trees,
+	always configure out-of-srcdir.
+	(distclean): Try removing $(host_subdir) with rm before using rm -rf.
+	* configure.in (FLAGS_FOR_TARGET, CC_FOR_TARGET, GCJ_FOR_TARGET,
+	GFORTRAN_FOR_TARGET, CXX_FOR_TARGET, RAW_CXX_FOR_TARGET): Use
+	$(HOST_SUBDIR).  Create a symlink for host_subdir.
+
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+
+	Merged from libada-gnattools-branch:
+	2004-11-28  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+	* Makefile.def: Add gnattools as a module, depending on target-libada.
+	* Makefile.in: Regenerate.
+	* configure.in: Include gnattools in host_tools; disable it if ada
+	is disabled.
+	* configure: Regenerate.
+
+2005-02-23  Nick Clifton  <nickc@redhat.com>
+
+	* configure: Regenerate.
+
+2005-02-22  Paul Schlie  <schlie@comcast.net>
+
+	* configure.in: Allow darwin targeted ports to build tk, itcl and
+	libgui.
+
+2005-02-21  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+	PR libgcj/10353
+	* configure.in (noconfigdirs) <sparc-*-solaris2.[0-6]>: Add libgcj.
+	* configure: Regenerate.
+
+2005-02-08  Andrew Cagney  <cagney@gnu.org>
+
+	* MAINTAINERS: Delete reference to dejagnu/ and mmalloc/ from the
+	gdb/ section.  Update GDB's URL.
+
+2005-01-31  Andrew Cagney  <cagney@gnu.org>
+
+	* gettext.m4: Only set ENABLE_NLS when gettext is present.
+
+2005-01-29  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure.in (noconfigdirs) <crisv32-*-*>: Match like cris-*-*.
+	<crisv32-*-*, cris-*-*>: Only disable target-newlib and
+	target-libgloss when not *-*-elf and *-*-aout.
+	* configure: Regenerate.
+
+2005-01-27  Andrew Cagney  <cagney@gnu.org>
+
+	* gettext.m4: Don't use NONE as a default for CATOBJEXT.
+
+2005-01-24  Andrew Cagney  <cagney@gnu.org>
+
+	* gettext.m4: Only fall back to ../intl/ when it's present.
+
+2005-01-17  Kelley Cook  <kcook@gcc.gnu.org>
+
+	* install-sh, config.sub: Import from upstream.
+
+2005-01-17  Kelley Cook  <kcook@gcc.gnu.org>
+
+	PR bootstrap/18222
+	* Makefile.def: Pass CPPFLAGS_FOR_TARGET.
+	* Makefile.tpl: Define target CPPFLAGS on CPPFLAGS_FOR_TARGET.
+	* Makefile.in: Regenerate.
+
+2005-01-03  Paolo Bonzini  <bonzini@gnu.org>
+
+	Revert 2004-12-28 Makefile changes, a better fix will be
+	applied to mainline and src after GCC 4.0 branches.
+
+2004-12-28  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR bootstrap/17383
+
+	* Makefile.def (target_modules): Remove stage parameter,
+	it is always true now.
+	* Makefile.tpl (configure-build-[+module+],
+	configure-target-[+module+]): Always build symlink tree
+	for the directory and for include.  BUILD_SUBDIR and
+	TARGET_SUBDIR cannot be . anymore.
+	* Makefile.in: Regenerate.
+
+2004-12-25  David Edelsohn  <edelsohn@gnu.org>
+
+	Revert 2004-12-08 Makefile changes.
+
 2004-12-16  Andrew Stubbs  <andrew.stubbs@st.com>
 
 	* configure.in (sh64-*-*): Reenable gprof.
@@ -39,7 +240,7 @@
 	* Makefile.tpl (clean-target-libgcc): Add stmp-dirs to list
 	of things to remove.
 	* Makefile.in: Regenerate.
-	
+
 2004-12-02  Richard Sandiford  <rsandifo@redhat.com>
 
 	* configure.in: Clear gcc_version_trigger if the file doesn't exist.
@@ -130,7 +331,7 @@
 
 	* src-release (do-djunpack, do-md5sum): Install the generated file
 	directly into the proto-toplev/ directory.
-	
+
 2004-10-19  Andrew Cagney  <cagney@gnu.org>
 
 	* src-release (GDB_SUPPORT_DIRS): Remove utils and intl.
@@ -162,7 +363,7 @@
 2004-09-30  Tomer Levi  <Tomer.Levi@nsc.com>
 
 	* configure.in: Enable target-libgloss for crx-*-*.
-        * configure: Regenerate.
+	* configure: Regenerate.
 
 2004-09-24  Michael Roth  <mroth@nessie.de>
 
@@ -204,7 +405,7 @@
 	* configure: Regenerate.
 
 2004-09-09  Daniel Berlin  <dberlin@dberlin.org>
-	
+
 	* Makefile.def: Remove libbanshee.
 	* Makefile.tpl: Ditto.
 	* configure.in: Ditto.
@@ -220,7 +421,7 @@
 	* config.sub: Import latest version from master repository.
 	* config.guess: Likewise.
 	This includes these changes:
-	
+
 	2004-08-27  Hans-Peter Nilsson  <hp@axis.com>
 
 	* config.sub: Handle crisv32, alias etraxfs.
@@ -307,7 +508,7 @@
 	* config.sub: Add support for National Semiconductor CRX target.
 
 2004-09-03  Jan Beulich  <jbeulich@novell.com>
- 
+
 	* configure.in: Remove target-libstdc++-v3 from noconfigdirs for
 	*-*-netware, but add target-libmudflap.
 	Consolidate *-*-netware targets (of which really only i?86 exists)
@@ -333,8 +534,8 @@
 	* Makefile.in: Move BOOT_CFLAGS above host makefile fragment include.
 	* configure.in: add test for powerpc-*-darwin* to specify makefile frag
 	* configure: regenerate
-	* config/mh-ppc-darwin: create file, override BOOT_CFLAGS for 
-        -mdynamic-no-pic
+	* config/mh-ppc-darwin: create file, override BOOT_CFLAGS for
+	-mdynamic-no-pic
 
 2004-08-31  Paolo Bonzini  <bonzini@gnu.org>
 
Index: src/MAINTAINERS
diff -u src/MAINTAINERS:1.28 src/MAINTAINERS:1.29
--- src/MAINTAINERS:1.28	Thu Dec  9 21:59:14 2004
+++ src/MAINTAINERS	Tue Feb  8 22:37:35 2005
@@ -39,10 +39,10 @@
 depcomp
         Send bug reports and patches to bug-automake@gnu.org.
 
-gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/
-	gdb: http://sources.redhat.com/gdb/
+gdb/; readline/; sim/; GDB's part of include/
+	GDB: http://www.gnu.org/software/gdb/
 	Patches to gdb-patches@sources.redhat.com.
-	See also gdb/MAINTAINERS, sim/MAINTAINERS, mmalloc/MAINTAINERS.
+	See also gdb/MAINTAINERS and sim/MAINTAINERS.
 
 include/
 	See binutils/, gdb/, sid/, gcc/, libiberty/ etc.
Index: src/Makefile.def
diff -u src/Makefile.def:1.40 src/Makefile.def:1.47
--- src/Makefile.def:1.40	Wed Dec  8 20:29:57 2004
+++ src/Makefile.def	Wed Mar 30 08:39:09 2005
@@ -37,8 +37,8 @@
 host_modules= { module= autoconf; };
 host_modules= { module= automake; };
 host_modules= { module= bash; };
-host_modules= { module= bfd; bootstrap=true; };
-host_modules= { module= opcodes; bootstrap=true; };
+host_modules= { module= bfd; lib_path=.; bootstrap=true; };
+host_modules= { module= opcodes; lib_path=.; bootstrap=true; };
 host_modules= { module= binutils; bootstrap=true; };
 host_modules= { module= bison; no_check_cross= true; };
 host_modules= { module= byacc; no_check_cross= true; };
@@ -111,13 +111,14 @@
                 missing=distclean;
                 missing=maintainer-clean; };
 host_modules= { module= utils; no_check=true; };
+host_modules= { module= gnattools; };
 
-target_modules = { module= libstdc++-v3; raw_cxx=true; };
-target_modules = { module= libmudflap; };
+target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; };
+target_modules = { module= libmudflap; lib_path=.libs; };
 target_modules = { module= newlib; };
 target_modules = { module= libgfortran; };
 target_modules = { module= libobjc; };
-target_modules = { module= libtermcap; no_check=true; stage=true;
+target_modules = { module= libtermcap; no_check=true;
                    missing=mostlyclean;
                    missing=clean;
                    missing=distclean;
@@ -129,7 +130,7 @@
 target_modules = { module= examples; no_check=true; no_install=true; };
 target_modules = { module= libffi; };
 target_modules = { module= libjava; raw_cxx=true; };
-target_modules = { module= zlib; stage=true; };
+target_modules = { module= zlib; };
 target_modules = { module= boehm-gc; };
 target_modules = { module= qthreads; };
 target_modules = { module= rda; };
@@ -171,8 +172,6 @@
 flags_to_pass = { flag= libdir ; };
 flags_to_pass = { flag= libexecdir ; };
 flags_to_pass = { flag= lispdir ; };
-flags_to_pass = { flag= libstdcxx_incdir ; };
-flags_to_pass = { flag= libsubdir ; };
 flags_to_pass = { flag= localstatedir ; };
 flags_to_pass = { flag= mandir ; };
 flags_to_pass = { flag= oldincludedir ; };
@@ -182,9 +181,6 @@
 flags_to_pass = { flag= sysconfdir ; };
 flags_to_pass = { flag= tooldir ; };
 flags_to_pass = { flag= build_tooldir ; };
-flags_to_pass = { flag= gxx_include_dir ; };
-flags_to_pass = { flag= gcc_version ; };
-flags_to_pass = { flag= gcc_version_trigger ; };
 flags_to_pass = { flag= target_alias ; };
 
 // Build tools
@@ -218,6 +214,7 @@
 flags_to_pass = { flag= AS_FOR_TARGET ; };
 flags_to_pass = { flag= CC_FOR_TARGET ; };
 flags_to_pass = { flag= CFLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= CPPFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= CXX_FOR_TARGET ; };
 flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
@@ -227,7 +224,6 @@
 flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= NM_FOR_TARGET ; };
-flags_to_pass = { flag= PICFLAG_FOR_TARGET ; };
 flags_to_pass = { flag= RANLIB_FOR_TARGET ; };
 flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
 
@@ -273,6 +269,8 @@
 
 dependencies = { module=all-fixincludes; on=all-libiberty; };
 
+dependencies = { module=all-gnattools; on=all-target-libada; };
+
 // Host modules specific to gdb.
 dependencies = { module=configure-gdb; on=configure-itcl; };
 dependencies = { module=configure-gdb; on=configure-tcl; };
Index: src/Makefile.in
diff -u src/Makefile.in:1.198 src/Makefile.in:1.210
--- src/Makefile.in:1.198	Wed Dec  8 20:29:58 2004
+++ src/Makefile.in	Wed May  4 15:42:05 2005
@@ -72,45 +72,25 @@
 # Miscellaneous non-standard autoconf-set variables
 # -------------------------------------------------
 
-# The file containing GCC's version number.
-gcc_version_trigger = @gcc_version_trigger@
-gcc_version = @gcc_version@
-
 # The gcc driver likes to know the arguments it was configured with.
 TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
 
-gxx_include_dir = @gxx_include_dir@
-libstdcxx_incdir = @libstdcxx_incdir@
-
 tooldir = @tooldir@
 build_tooldir = @build_tooldir@
 
-# Directory in which the compiler finds executables, libraries, etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
 GDB_NLM_DEPS = 
 
 # This is the name of the environment variable used for the path to
 # the libraries.
 RPATH_ENVVAR = @RPATH_ENVVAR@
 
-# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
-# was used.
-SET_LIB_PATH = @SET_LIB_PATH@
-
-# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
-# Some platforms don't like blank entries, so we remove duplicate,
-# leading and trailing colons.
-REALLY_SET_LIB_PATH = \
-  @SET_GCC_LIB_PATH@ \
-  $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-
 # This is the list of directories to be built for the build system.
 BUILD_CONFIGDIRS = libiberty
 # Build programs are put under this directory.
 BUILD_SUBDIR = @build_subdir@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the build system.
-BUILD_CONFIGARGS = @build_configargs@
+BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
 
 # This is the list of variables to export in the environment when
 # configuring any subdirectory.  It must also be exported whenever
@@ -149,6 +129,9 @@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the host system.
 HOST_CONFIGARGS = @host_configargs@
+# Host programs are put under this directory, which is . except if building
+# with srcdir=..
+HOST_SUBDIR = @host_subdir@
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the host system.
 HOST_EXPORTS = \
@@ -172,14 +155,18 @@
 	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
 	GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
 	GMPINC="$(HOST_GMPINC)"; export GMPINC; \
-	SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-	@SET_GCC_LIB_PATH@
+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 # Similar, for later GCC stages.
-STAGE_HOST_EXPORTS = \
+POSTSTAGE1_HOST_EXPORTS = \
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
 	$(HOST_EXPORTS) \
-	CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
+	CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
+	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
+	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
+	  $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
+	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
+	  -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
@@ -188,7 +175,7 @@
 TARGET_SUBDIR = @target_subdir@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the target.
-TARGET_CONFIGARGS = @target_configargs@
+TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the host system.
 BASE_TARGET_EXPORTS = \
@@ -198,7 +185,7 @@
 	CC="$(CC_FOR_TARGET)"; export CC; \
 	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+	CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
 	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
 	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
 	GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
@@ -208,8 +195,7 @@
 	NM="$(NM_FOR_TARGET)"; export NM; \
 	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
 	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
-	SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-	@SET_GCC_LIB_PATH@
+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 RAW_CXX_TARGET_EXPORTS = \
 	$(BASE_TARGET_EXPORTS) \
@@ -302,8 +288,9 @@
 # (Default to avoid splitting info files by setting the threshold high.)
 MAKEINFOFLAGS = --split-size=5000000
 
-EXPECT = `if [ -f $$r/expect/expect ] ; \
-	then echo $$r/expect/expect ; \
+# FIXME: expect may become a build tool?
+EXPECT = `if [ -f $$r/$(HOST_SUBDIR)/expect/expect ] ; \
+	then echo $$r/$(HOST_SUBDIR)/expect/expect ; \
 	else echo expect ; fi`
 
 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
@@ -314,10 +301,6 @@
 # Programs producing files for the HOST machine
 # ---------------------------------------------
 
-# This is the list of directories that may be needed in RPATH_ENVVAR
-# so that programs built for the host machine work.
-HOST_LIB_PATH = $$r/bfd:$$r/opcodes
-
 AS = @AS@
 
 AR = @AR@
@@ -348,17 +331,13 @@
 # Programs producing files for the TARGET machine
 # -----------------------------------------------
 
-# This is the list of directories that may be needed in RPATH_ENVVAR
-# so that prorgams built for the target machine work.
-TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs
-
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 
 AR_FOR_TARGET=@AR_FOR_TARGET@
 CONFIGURED_AR_FOR_TARGET=@CONFIGURED_AR_FOR_TARGET@
 USUAL_AR_FOR_TARGET = ` \
-  if [ -f $$r/binutils/ar ] ; then \
-    echo $$r/binutils/ar ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/ar ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/ar ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(AR); \
@@ -370,9 +349,9 @@
 AS_FOR_TARGET=@AS_FOR_TARGET@
 CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@
 USUAL_AS_FOR_TARGET = ` \
-  if [ -f $$r/gas/as-new ] ; then \
-    echo $$r/gas/as-new ; \
-  elif [ -f $$r/gcc/xgcc ]; then \
+  if [ -f $$r/$(HOST_SUBDIR)/gas/as-new ] ; then \
+    echo $$r/$(HOST_SUBDIR)/gas/as-new ; \
+  elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=as ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
@@ -393,7 +372,8 @@
 # build libgcc2.a.  We define it here so that it can itself be
 # overridden on the command line.
 GCC_FOR_TARGET=@GCC_FOR_TARGET@
-USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
+USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) \
+  $$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/ $(FLAGS_FOR_TARGET)
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 
 CXX_FOR_TARGET = @CXX_FOR_TARGET@
@@ -406,8 +386,8 @@
 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
 CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@
 USUAL_DLLTOOL_FOR_TARGET = ` \
-  if [ -f $$r/binutils/dlltool ] ; then \
-    echo $$r/binutils/dlltool ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/dlltool ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/dlltool ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(DLLTOOL); \
@@ -422,9 +402,9 @@
 LD_FOR_TARGET=@LD_FOR_TARGET@
 CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@
 USUAL_LD_FOR_TARGET = ` \
-  if [ -f $$r/ld/ld-new ] ; then \
-    echo $$r/ld/ld-new ; \
-  elif [ -f $$r/gcc/xgcc ]; then \
+  if [ -f $$r/$(HOST_SUBDIR)/ld/ld-new ] ; then \
+    echo $$r/$(HOST_SUBDIR)/ld/ld-new ; \
+  elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=ld ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
@@ -439,9 +419,9 @@
 NM_FOR_TARGET=@NM_FOR_TARGET@
 CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
 USUAL_NM_FOR_TARGET = ` \
-  if [ -f $$r/binutils/nm-new ] ; then \
-    echo $$r/binutils/nm-new ; \
-  elif [ -f $$r/gcc/xgcc ]; then \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/nm-new ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/nm-new ; \
+  elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=nm ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
@@ -454,8 +434,8 @@
 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
 CONFIGURED_RANLIB_FOR_TARGET=@CONFIGURED_RANLIB_FOR_TARGET@
 USUAL_RANLIB_FOR_TARGET = ` \
-  if [ -f $$r/binutils/ranlib ] ; then \
-    echo $$r/binutils/ranlib ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/ranlib ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/ranlib ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       if [ x'$(RANLIB)' != x ]; then \
@@ -471,8 +451,8 @@
 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
 CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@
 USUAL_WINDRES_FOR_TARGET = ` \
-  if [ -f $$r/binutils/windres ] ; then \
-    echo $$r/binutils/windres ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/windres ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/windres ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(WINDRES); \
@@ -498,6 +478,41 @@
 @host_makefile_frag@
 ###
 
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that prorgams built for the target machine work.
+TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(HOST_LIB_PATH_gcc)
+
+@if target-libstdc++-v3
+TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/.libs:
+@endif target-libstdc++-v3
+
+@if target-libmudflap
+TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs:
+@endif target-libmudflap
+
+
+
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that programs built for the host machine work.
+HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes)
+
+# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
+@if gcc
+HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
+@endif gcc
+
+
+@if bfd
+HOST_LIB_PATH_bfd = \
+  $$r/$(HOST_SUBDIR)/bfd/.:$$r/$(HOST_SUBDIR)/prev-bfd/.:
+@endif bfd
+
+@if opcodes
+HOST_LIB_PATH_opcodes = \
+  $$r/$(HOST_SUBDIR)/opcodes/.:$$r/$(HOST_SUBDIR)/prev-opcodes/.:
+@endif opcodes
+
+
 # Flags to pass down to all sub-makes.
 BASE_FLAGS_TO_PASS = \
 	"DESTDIR=$(DESTDIR)" \
@@ -511,8 +526,6 @@
 	"libdir=$(libdir)" \
 	"libexecdir=$(libexecdir)" \
 	"lispdir=$(lispdir)" \
-	"libstdcxx_incdir=$(libstdcxx_incdir)" \
-	"libsubdir=$(libsubdir)" \
 	"localstatedir=$(localstatedir)" \
 	"mandir=$(mandir)" \
 	"oldincludedir=$(oldincludedir)" \
@@ -522,9 +535,6 @@
 	"sysconfdir=$(sysconfdir)" \
 	"tooldir=$(tooldir)" \
 	"build_tooldir=$(build_tooldir)" \
-	"gxx_include_dir=$(gxx_include_dir)" \
-	"gcc_version=$(gcc_version)" \
-	"gcc_version_trigger=$(gcc_version_trigger)" \
 	"target_alias=$(target_alias)" \
 	"BISON=$(BISON)" \
 	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
@@ -552,6 +562,7 @@
 	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
 	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
 	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+	"CPPFLAGS_FOR_TARGET=$(CPPFLAGS_FOR_TARGET)" \
 	"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
 	"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
 	"DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
@@ -561,7 +572,6 @@
 	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
 	"LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
 	"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
-	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
 	"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
 	"WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
 	"CONFIG_SHELL=$(SHELL)" \
@@ -588,7 +598,6 @@
 	'DLLTOOL=$(DLLTOOL)' \
 	'LD=$(LD)' \
 	'NM=$(NM)' \
-	'PICFLAG=$(PICFLAG)' \
 	'RANLIB=$(RANLIB)' \
 	'WINDRES=$(WINDRES)'
 
@@ -621,7 +630,6 @@
 	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
 	'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
 	'NM=$$(NM_FOR_TARGET)' \
-	'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
 	'RANLIB=$$(RANLIB_FOR_TARGET)' \
 	'WINDRES=$$(WINDRES_FOR_TARGET)'
 
@@ -717,7 +725,8 @@
     maybe-configure-guile \
     maybe-configure-tk \
     maybe-configure-libtermcap \
-    maybe-configure-utils
+    maybe-configure-utils \
+    maybe-configure-gnattools
 .PHONY: configure-target
 configure-target:  \
     maybe-configure-target-libstdc++-v3 \
@@ -819,7 +828,8 @@
     maybe-all-guile \
     maybe-all-tk \
     maybe-all-libtermcap \
-    maybe-all-utils
+    maybe-all-utils \
+    maybe-all-gnattools
 .PHONY: all-target
 all-target:  \
     maybe-all-target-libstdc++-v3 \
@@ -916,7 +926,8 @@
     maybe-info-guile \
     maybe-info-tk \
     maybe-info-libtermcap \
-    maybe-info-utils
+    maybe-info-utils \
+    maybe-info-gnattools
 
 .PHONY: info-target
 info-target:  \
@@ -1009,7 +1020,8 @@
     maybe-dvi-guile \
     maybe-dvi-tk \
     maybe-dvi-libtermcap \
-    maybe-dvi-utils
+    maybe-dvi-utils \
+    maybe-dvi-gnattools
 
 .PHONY: dvi-target
 dvi-target:  \
@@ -1102,7 +1114,8 @@
     maybe-html-guile \
     maybe-html-tk \
     maybe-html-libtermcap \
-    maybe-html-utils
+    maybe-html-utils \
+    maybe-html-gnattools
 
 .PHONY: html-target
 html-target:  \
@@ -1195,7 +1208,8 @@
     maybe-TAGS-guile \
     maybe-TAGS-tk \
     maybe-TAGS-libtermcap \
-    maybe-TAGS-utils
+    maybe-TAGS-utils \
+    maybe-TAGS-gnattools
 
 .PHONY: TAGS-target
 TAGS-target:  \
@@ -1288,7 +1302,8 @@
     maybe-install-info-guile \
     maybe-install-info-tk \
     maybe-install-info-libtermcap \
-    maybe-install-info-utils
+    maybe-install-info-utils \
+    maybe-install-info-gnattools
 
 .PHONY: install-info-target
 install-info-target:  \
@@ -1381,7 +1396,8 @@
     maybe-installcheck-guile \
     maybe-installcheck-tk \
     maybe-installcheck-libtermcap \
-    maybe-installcheck-utils
+    maybe-installcheck-utils \
+    maybe-installcheck-gnattools
 
 .PHONY: installcheck-target
 installcheck-target:  \
@@ -1474,7 +1490,8 @@
     maybe-mostlyclean-guile \
     maybe-mostlyclean-tk \
     maybe-mostlyclean-libtermcap \
-    maybe-mostlyclean-utils
+    maybe-mostlyclean-utils \
+    maybe-mostlyclean-gnattools
 
 .PHONY: mostlyclean-target
 mostlyclean-target:  \
@@ -1567,7 +1584,8 @@
     maybe-clean-guile \
     maybe-clean-tk \
     maybe-clean-libtermcap \
-    maybe-clean-utils
+    maybe-clean-utils \
+    maybe-clean-gnattools
 
 .PHONY: clean-target
 clean-target:  \
@@ -1660,7 +1678,8 @@
     maybe-distclean-guile \
     maybe-distclean-tk \
     maybe-distclean-libtermcap \
-    maybe-distclean-utils
+    maybe-distclean-utils \
+    maybe-distclean-gnattools
 
 .PHONY: distclean-target
 distclean-target:  \
@@ -1753,7 +1772,8 @@
     maybe-maintainer-clean-guile \
     maybe-maintainer-clean-tk \
     maybe-maintainer-clean-libtermcap \
-    maybe-maintainer-clean-utils
+    maybe-maintainer-clean-utils \
+    maybe-maintainer-clean-gnattools
 
 .PHONY: maintainer-clean-target
 maintainer-clean-target:  \
@@ -1807,6 +1827,9 @@
 	  rm -rf $(TARGET_SUBDIR); \
 	else true; fi
 	-rm -rf $(BUILD_SUBDIR)
+	-if [ "$(HOST_SUBDIR)" != "." ]; then \
+	  rm -rf $(HOST_SUBDIR); \
+	else true; fi
 	-rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
 	-rm -f texinfo/doc/Makefile texinfo/po/POTFILES
 	-rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
@@ -1906,6 +1929,7 @@
     maybe-check-tk \
     maybe-check-libtermcap \
     maybe-check-utils \
+    maybe-check-gnattools \
     maybe-check-target-libstdc++-v3 \
     maybe-check-target-libmudflap \
     maybe-check-target-newlib \
@@ -2017,7 +2041,8 @@
     maybe-install-guile \
     maybe-install-tk \
     maybe-install-libtermcap \
-    maybe-install-utils
+    maybe-install-utils \
+    maybe-install-gnattools
 
 .PHONY: install-host
 install-host:  \
@@ -2086,7 +2111,8 @@
     maybe-install-guile \
     maybe-install-tk \
     maybe-install-libtermcap \
-    maybe-install-utils
+    maybe-install-utils \
+    maybe-install-gnattools
 
 .PHONY: install-target
 install-target:  \
@@ -2116,7 +2142,6 @@
 install.all: install-no-fixedincludes
 	@if [ -f ./gcc/Makefile ] ; then \
 		r=`${PWD_COMMAND}` ; export r ; \
-		$(SET_LIB_PATH) \
 		$(HOST_EXPORTS) \
 		(cd ./gcc && \
 		$(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
@@ -2160,15 +2185,24 @@
 # built are.
 TAGS: do-TAGS
 
+# ------------------------------------
+# Macros for configure and all targets
+# ------------------------------------
+
+
+
+
+
 # --------------------------------------
 # Modules which run on the build machine
 # --------------------------------------
 
+
 .PHONY: configure-build-libiberty maybe-configure-build-libiberty
 maybe-configure-build-libiberty:
 @if build-libiberty
 maybe-configure-build-libiberty: configure-build-libiberty
-configure-build-libiberty:
+configure-build-libiberty: 
 	@test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libiberty ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2177,45 +2211,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/libiberty; \
 	cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/libiberty"; \
-	  libsrcdir="$$s/libiberty"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-libiberty
 
+
+
+
+
 .PHONY: all-build-libiberty maybe-all-build-libiberty
 maybe-all-build-libiberty:
 @if build-libiberty
@@ -2226,14 +2237,18 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/libiberty && \
-	  $(MAKE)  $(TARGET-build-libiberty))
+	  $(MAKE)   $(TARGET-build-libiberty))
 @endif build-libiberty
 
+
+
+
+
 .PHONY: configure-build-bison maybe-configure-build-bison
 maybe-configure-build-bison:
 @if build-bison
 maybe-configure-build-bison: configure-build-bison
-configure-build-bison:
+configure-build-bison: 
 	@test ! -f $(BUILD_SUBDIR)/bison/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/bison ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2242,45 +2257,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/bison; \
 	cd "$(BUILD_SUBDIR)/bison" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/bison "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/bison"; \
-	  libsrcdir="$$s/bison"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/bison/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bison"; \
+	libsrcdir="$$s/bison"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-bison
 
+
+
+
+
 .PHONY: all-build-bison maybe-all-build-bison
 maybe-all-build-bison:
 @if build-bison
@@ -2291,14 +2283,18 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/bison && \
-	  $(MAKE)  $(TARGET-build-bison))
+	  $(MAKE)   $(TARGET-build-bison))
 @endif build-bison
 
+
+
+
+
 .PHONY: configure-build-byacc maybe-configure-build-byacc
 maybe-configure-build-byacc:
 @if build-byacc
 maybe-configure-build-byacc: configure-build-byacc
-configure-build-byacc:
+configure-build-byacc: 
 	@test ! -f $(BUILD_SUBDIR)/byacc/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/byacc ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2307,45 +2303,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/byacc; \
 	cd "$(BUILD_SUBDIR)/byacc" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/byacc "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/byacc"; \
-	  libsrcdir="$$s/byacc"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/byacc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/byacc"; \
+	libsrcdir="$$s/byacc"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-byacc
 
+
+
+
+
 .PHONY: all-build-byacc maybe-all-build-byacc
 maybe-all-build-byacc:
 @if build-byacc
@@ -2356,14 +2329,18 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/byacc && \
-	  $(MAKE)  $(TARGET-build-byacc))
+	  $(MAKE)   $(TARGET-build-byacc))
 @endif build-byacc
 
+
+
+
+
 .PHONY: configure-build-flex maybe-configure-build-flex
 maybe-configure-build-flex:
 @if build-flex
 maybe-configure-build-flex: configure-build-flex
-configure-build-flex:
+configure-build-flex: 
 	@test ! -f $(BUILD_SUBDIR)/flex/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/flex ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2372,45 +2349,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/flex; \
 	cd "$(BUILD_SUBDIR)/flex" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/flex "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/flex"; \
-	  libsrcdir="$$s/flex"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/flex/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/flex"; \
+	libsrcdir="$$s/flex"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-flex
 
+
+
+
+
 .PHONY: all-build-flex maybe-all-build-flex
 maybe-all-build-flex:
 @if build-flex
@@ -2421,14 +2375,18 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/flex && \
-	  $(MAKE)  $(TARGET-build-flex))
+	  $(MAKE)   $(TARGET-build-flex))
 @endif build-flex
 
+
+
+
+
 .PHONY: configure-build-m4 maybe-configure-build-m4
 maybe-configure-build-m4:
 @if build-m4
 maybe-configure-build-m4: configure-build-m4
-configure-build-m4:
+configure-build-m4: 
 	@test ! -f $(BUILD_SUBDIR)/m4/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/m4 ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2437,45 +2395,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/m4; \
 	cd "$(BUILD_SUBDIR)/m4" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/m4 "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/m4"; \
-	  libsrcdir="$$s/m4"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/m4/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/m4"; \
+	libsrcdir="$$s/m4"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-m4
 
+
+
+
+
 .PHONY: all-build-m4 maybe-all-build-m4
 maybe-all-build-m4:
 @if build-m4
@@ -2486,14 +2421,18 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/m4 && \
-	  $(MAKE)  $(TARGET-build-m4))
+	  $(MAKE)   $(TARGET-build-m4))
 @endif build-m4
 
+
+
+
+
 .PHONY: configure-build-texinfo maybe-configure-build-texinfo
 maybe-configure-build-texinfo:
 @if build-texinfo
 maybe-configure-build-texinfo: configure-build-texinfo
-configure-build-texinfo:
+configure-build-texinfo: 
 	@test ! -f $(BUILD_SUBDIR)/texinfo/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/texinfo ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2502,45 +2441,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/texinfo; \
 	cd "$(BUILD_SUBDIR)/texinfo" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/texinfo "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/texinfo"; \
-	  libsrcdir="$$s/texinfo"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/texinfo/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/texinfo"; \
+	libsrcdir="$$s/texinfo"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-texinfo
 
+
+
+
+
 .PHONY: all-build-texinfo maybe-all-build-texinfo
 maybe-all-build-texinfo:
 @if build-texinfo
@@ -2551,14 +2467,18 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/texinfo && \
-	  $(MAKE)  $(TARGET-build-texinfo))
+	  $(MAKE)   $(TARGET-build-texinfo))
 @endif build-texinfo
 
+
+
+
+
 .PHONY: configure-build-fixincludes maybe-configure-build-fixincludes
 maybe-configure-build-fixincludes:
 @if build-fixincludes
 maybe-configure-build-fixincludes: configure-build-fixincludes
-configure-build-fixincludes:
+configure-build-fixincludes: 
 	@test ! -f $(BUILD_SUBDIR)/fixincludes/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/fixincludes ; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -2567,45 +2487,22 @@
 	echo Configuring in $(BUILD_SUBDIR)/fixincludes; \
 	cd "$(BUILD_SUBDIR)/fixincludes" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/fixincludes "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/fixincludes"; \
-	  libsrcdir="$$s/fixincludes"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(BUILD_SUBDIR)/fixincludes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/fixincludes"; \
+	libsrcdir="$$s/fixincludes"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  $(BUILD_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif build-fixincludes
 
+
+
+
+
 .PHONY: all-build-fixincludes maybe-all-build-fixincludes
 maybe-all-build-fixincludes:
 @if build-fixincludes
@@ -2616,42 +2513,46 @@
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(BUILD_EXPORTS) \
 	(cd $(BUILD_SUBDIR)/fixincludes && \
-	  $(MAKE)  $(TARGET-build-fixincludes))
+	  $(MAKE)   $(TARGET-build-fixincludes))
 @endif build-fixincludes
 
 
+
+
+
 # --------------------------------------
 # Modules which run on the host machine
 # --------------------------------------
 
+
 .PHONY: configure-ash maybe-configure-ash
 maybe-configure-ash:
 @if ash
 maybe-configure-ash: configure-ash
-configure-ash:
-	@test ! -f ash/Makefile || exit 0; \
-	[ -d ash ] || mkdir ash; \
+configure-ash: 
+	@test ! -f $(HOST_SUBDIR)/ash/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ash ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in ash; \
-	cd ash || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ash"; \
-	    libsrcdir="$$s/ash";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ash"; \
-	    libsrcdir="$$s/ash";; \
+	echo Configuring in $(HOST_SUBDIR)/ash; \
+	cd "$(HOST_SUBDIR)/ash" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ash/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/ash"; \
+	libsrcdir="$$s/ash"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif ash
 
+
+
+
+
 .PHONY: all-ash maybe-all-ash
 maybe-all-ash:
 @if ash
@@ -2660,12 +2561,14 @@
 all-ash: configure-ash
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd ash && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-ash))
+	(cd $(HOST_SUBDIR)/ash && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-ash))
 @endif ash
 
+
+
+
 .PHONY: check-ash maybe-check-ash
 maybe-check-ash:
 @if ash
@@ -2674,9 +2577,9 @@
 check-ash:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd ash && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/ash && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif ash
 
@@ -2688,9 +2591,9 @@
 install-ash: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd ash && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/ash && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif ash
 
@@ -2706,13 +2609,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2732,13 +2634,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2758,13 +2659,12 @@
 	@[ -f ./ash/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 html in ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2784,13 +2684,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2811,13 +2710,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2837,13 +2735,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2862,13 +2759,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2887,13 +2783,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2912,13 +2807,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2937,13 +2831,12 @@
 	@[ -f ./ash/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 ash" ; \
-	(cd ash && \
+	(cd $(HOST_SUBDIR)/ash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -2954,34 +2847,35 @@
 @endif ash
 
 
+
 .PHONY: configure-autoconf maybe-configure-autoconf
 maybe-configure-autoconf:
 @if autoconf
 maybe-configure-autoconf: configure-autoconf
-configure-autoconf:
-	@test ! -f autoconf/Makefile || exit 0; \
-	[ -d autoconf ] || mkdir autoconf; \
+configure-autoconf: 
+	@test ! -f $(HOST_SUBDIR)/autoconf/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/autoconf ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in autoconf; \
-	cd autoconf || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/autoconf"; \
-	    libsrcdir="$$s/autoconf";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/autoconf"; \
-	    libsrcdir="$$s/autoconf";; \
+	echo Configuring in $(HOST_SUBDIR)/autoconf; \
+	cd "$(HOST_SUBDIR)/autoconf" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/autoconf/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/autoconf"; \
+	libsrcdir="$$s/autoconf"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif autoconf
 
+
+
+
+
 .PHONY: all-autoconf maybe-all-autoconf
 maybe-all-autoconf:
 @if autoconf
@@ -2990,12 +2884,14 @@
 all-autoconf: configure-autoconf
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-autoconf))
+	(cd $(HOST_SUBDIR)/autoconf && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-autoconf))
 @endif autoconf
 
+
+
+
 .PHONY: check-autoconf maybe-check-autoconf
 maybe-check-autoconf:
 @if autoconf
@@ -3004,9 +2900,9 @@
 check-autoconf:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/autoconf && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif autoconf
 
@@ -3018,9 +2914,9 @@
 install-autoconf: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/autoconf && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif autoconf
 
@@ -3036,13 +2932,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3062,13 +2957,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3088,13 +2982,12 @@
 	@[ -f ./autoconf/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 html in autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3114,13 +3007,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3141,13 +3033,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3167,13 +3058,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3192,13 +3082,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3217,13 +3106,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3242,13 +3130,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3267,13 +3154,12 @@
 	@[ -f ./autoconf/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 autoconf" ; \
-	(cd autoconf && \
+	(cd $(HOST_SUBDIR)/autoconf && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3284,34 +3170,35 @@
 @endif autoconf
 
 
+
 .PHONY: configure-automake maybe-configure-automake
 maybe-configure-automake:
 @if automake
 maybe-configure-automake: configure-automake
-configure-automake:
-	@test ! -f automake/Makefile || exit 0; \
-	[ -d automake ] || mkdir automake; \
+configure-automake: 
+	@test ! -f $(HOST_SUBDIR)/automake/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/automake ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in automake; \
-	cd automake || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/automake"; \
-	    libsrcdir="$$s/automake";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/automake"; \
-	    libsrcdir="$$s/automake";; \
+	echo Configuring in $(HOST_SUBDIR)/automake; \
+	cd "$(HOST_SUBDIR)/automake" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/automake/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/automake"; \
+	libsrcdir="$$s/automake"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif automake
 
+
+
+
+
 .PHONY: all-automake maybe-all-automake
 maybe-all-automake:
 @if automake
@@ -3320,12 +3207,14 @@
 all-automake: configure-automake
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd automake && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-automake))
+	(cd $(HOST_SUBDIR)/automake && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-automake))
 @endif automake
 
+
+
+
 .PHONY: check-automake maybe-check-automake
 maybe-check-automake:
 @if automake
@@ -3334,9 +3223,9 @@
 check-automake:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd automake && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/automake && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif automake
 
@@ -3348,9 +3237,9 @@
 install-automake: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd automake && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/automake && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif automake
 
@@ -3366,13 +3255,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3392,13 +3280,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3418,13 +3305,12 @@
 	@[ -f ./automake/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 html in automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3444,13 +3330,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3471,13 +3356,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3497,13 +3381,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3522,13 +3405,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3547,13 +3429,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3572,13 +3453,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3597,13 +3477,12 @@
 	@[ -f ./automake/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 automake" ; \
-	(cd automake && \
+	(cd $(HOST_SUBDIR)/automake && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3614,34 +3493,35 @@
 @endif automake
 
 
+
 .PHONY: configure-bash maybe-configure-bash
 maybe-configure-bash:
 @if bash
 maybe-configure-bash: configure-bash
-configure-bash:
-	@test ! -f bash/Makefile || exit 0; \
-	[ -d bash ] || mkdir bash; \
+configure-bash: 
+	@test ! -f $(HOST_SUBDIR)/bash/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bash ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in bash; \
-	cd bash || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bash"; \
-	    libsrcdir="$$s/bash";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bash"; \
-	    libsrcdir="$$s/bash";; \
+	echo Configuring in $(HOST_SUBDIR)/bash; \
+	cd "$(HOST_SUBDIR)/bash" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bash/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/bash"; \
+	libsrcdir="$$s/bash"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif bash
 
+
+
+
+
 .PHONY: all-bash maybe-all-bash
 maybe-all-bash:
 @if bash
@@ -3650,12 +3530,14 @@
 all-bash: configure-bash
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bash && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-bash))
+	(cd $(HOST_SUBDIR)/bash && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-bash))
 @endif bash
 
+
+
+
 .PHONY: check-bash maybe-check-bash
 maybe-check-bash:
 @if bash
@@ -3664,9 +3546,9 @@
 check-bash:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bash && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/bash && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif bash
 
@@ -3678,9 +3560,9 @@
 install-bash: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bash && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/bash && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif bash
 
@@ -3696,13 +3578,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3722,13 +3603,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3748,13 +3628,12 @@
 	@[ -f ./bash/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 html in bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3774,13 +3653,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3801,13 +3679,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3827,13 +3704,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3852,13 +3728,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3877,13 +3752,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3902,13 +3776,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3927,13 +3800,12 @@
 	@[ -f ./bash/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 bash" ; \
-	(cd bash && \
+	(cd $(HOST_SUBDIR)/bash && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -3944,123 +3816,449 @@
 @endif bash
 
 
+
 .PHONY: configure-bfd maybe-configure-bfd
 maybe-configure-bfd:
 @if bfd
 maybe-configure-bfd: configure-bfd
-configure-bfd:
+configure-bfd: 
 	@test -f stage_last && exit 0; \
-	test ! -f bfd/Makefile || exit 0; \
-	[ -d bfd ] || mkdir bfd; \
+	test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in bfd; \
-	cd bfd || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/bfd; \
+	cd "$(HOST_SUBDIR)/bfd" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif bfd
 
-.PHONY: all-bfd maybe-all-bfd
-maybe-all-bfd:
-@if bfd
-TARGET-bfd=all
-maybe-all-bfd: all-bfd
-all-bfd: configure-bfd
-	@test -f stage_last && exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
-	$(HOST_EXPORTS) \
-	(cd bfd && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-bfd))
-@endif bfd
 
-.PHONY: check-bfd maybe-check-bfd
-maybe-check-bfd:
-@if bfd
-maybe-check-bfd: check-bfd
 
-check-bfd:
-	@r=`${PWD_COMMAND}`; export r; \
+.PHONY: configure-stage1-bfd maybe-configure-stage1-bfd
+maybe-configure-stage1-bfd:
+@if bfd-bootstrap
+maybe-configure-stage1-bfd: configure-stage1-bfd
+configure-stage1-bfd: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bfd && $(MAKE) $(FLAGS_TO_PASS) check)
-
-@endif bfd
-
-.PHONY: install-bfd maybe-install-bfd
-maybe-install-bfd:
-@if bfd
-maybe-install-bfd: install-bfd
+	echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif bfd-bootstrap
 
-install-bfd: installdirs
-	@r=`${PWD_COMMAND}`; export r; \
+.PHONY: configure-stage2-bfd maybe-configure-stage2-bfd
+maybe-configure-stage2-bfd:
+@if bfd-bootstrap
+maybe-configure-stage2-bfd: configure-stage2-bfd
+configure-stage2-bfd: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bfd && $(MAKE) $(FLAGS_TO_PASS) install)
-
-@endif bfd
-
-# Other targets (info, dvi, etc.)
-
-.PHONY: maybe-info-bfd info-bfd
-maybe-info-bfd:
-@if bfd
-maybe-info-bfd: info-bfd
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif bfd-bootstrap
 
-info-bfd: \
-    configure-bfd 
-	@[ -f ./bfd/Makefile ] || exit 0; \
+.PHONY: configure-stage3-bfd maybe-configure-stage3-bfd
+maybe-configure-stage3-bfd:
+@if bfd-bootstrap
+maybe-configure-stage3-bfd: configure-stage3-bfd
+configure-stage3-bfd: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/bfd/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 bfd" ; \
-	(cd bfd && \
-	  $(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 bfd
-
-.PHONY: maybe-dvi-bfd dvi-bfd
-maybe-dvi-bfd:
-@if bfd
-maybe-dvi-bfd: dvi-bfd
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif bfd-bootstrap
 
-dvi-bfd: \
-    configure-bfd 
-	@[ -f ./bfd/Makefile ] || exit 0; \
+.PHONY: configure-stage4-bfd maybe-configure-stage4-bfd
+maybe-configure-stage4-bfd:
+@if bfd-bootstrap
+maybe-configure-stage4-bfd: configure-stage4-bfd
+configure-stage4-bfd: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/bfd/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|"`; \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif bfd-bootstrap
+
+.PHONY: configure-stageprofile-bfd maybe-configure-stageprofile-bfd
+maybe-configure-stageprofile-bfd:
+@if bfd-bootstrap
+maybe-configure-stageprofile-bfd: configure-stageprofile-bfd
+configure-stageprofile-bfd: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif bfd-bootstrap
+
+.PHONY: configure-stagefeedback-bfd maybe-configure-stagefeedback-bfd
+maybe-configure-stagefeedback-bfd:
+@if bfd-bootstrap
+maybe-configure-stagefeedback-bfd: configure-stagefeedback-bfd
+configure-stagefeedback-bfd: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/bfd"; \
+	libsrcdir="$$s/bfd"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif bfd-bootstrap
+
+
+
+
+
+.PHONY: all-bfd maybe-all-bfd
+maybe-all-bfd:
+@if bfd
+TARGET-bfd=all
+maybe-all-bfd: all-bfd
+all-bfd: configure-bfd
+	@test -f stage_last && exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/bfd && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-bfd))
+@endif bfd
+
+
+
+.PHONY: all-stage1-bfd maybe-all-stage1-bfd
+.PHONY: clean-stage1-bfd maybe-clean-stage1-bfd
+maybe-all-stage1-bfd:
+maybe-clean-stage1-bfd:
+@if bfd-bootstrap
+maybe-all-stage1-bfd: all-stage1-bfd
+all-stage1: all-stage1-bfd
+all-stage1-bfd: configure-stage1-bfd
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-bfd: clean-stage1-bfd
+clean-stage1: clean-stage1-bfd
+clean-stage1-bfd:
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif bfd-bootstrap
+
+
+.PHONY: all-stage2-bfd maybe-all-stage2-bfd
+.PHONY: clean-stage2-bfd maybe-clean-stage2-bfd
+maybe-all-stage2-bfd:
+maybe-clean-stage2-bfd:
+@if bfd-bootstrap
+maybe-all-stage2-bfd: all-stage2-bfd
+all-stage2: all-stage2-bfd
+all-stage2-bfd: configure-stage2-bfd
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-bfd: clean-stage2-bfd
+clean-stage2: clean-stage2-bfd
+clean-stage2-bfd:
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif bfd-bootstrap
+
+
+.PHONY: all-stage3-bfd maybe-all-stage3-bfd
+.PHONY: clean-stage3-bfd maybe-clean-stage3-bfd
+maybe-all-stage3-bfd:
+maybe-clean-stage3-bfd:
+@if bfd-bootstrap
+maybe-all-stage3-bfd: all-stage3-bfd
+all-stage3: all-stage3-bfd
+all-stage3-bfd: configure-stage3-bfd
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-bfd: clean-stage3-bfd
+clean-stage3: clean-stage3-bfd
+clean-stage3-bfd:
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif bfd-bootstrap
+
+
+.PHONY: all-stage4-bfd maybe-all-stage4-bfd
+.PHONY: clean-stage4-bfd maybe-clean-stage4-bfd
+maybe-all-stage4-bfd:
+maybe-clean-stage4-bfd:
+@if bfd-bootstrap
+maybe-all-stage4-bfd: all-stage4-bfd
+all-stage4: all-stage4-bfd
+all-stage4-bfd: configure-stage4-bfd
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-bfd: clean-stage4-bfd
+clean-stage4: clean-stage4-bfd
+clean-stage4-bfd:
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif bfd-bootstrap
+
+
+.PHONY: all-stageprofile-bfd maybe-all-stageprofile-bfd
+.PHONY: clean-stageprofile-bfd maybe-clean-stageprofile-bfd
+maybe-all-stageprofile-bfd:
+maybe-clean-stageprofile-bfd:
+@if bfd-bootstrap
+maybe-all-stageprofile-bfd: all-stageprofile-bfd
+all-stageprofile: all-stageprofile-bfd
+all-stageprofile-bfd: configure-stageprofile-bfd
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-bfd: clean-stageprofile-bfd
+clean-stageprofile: clean-stageprofile-bfd
+clean-stageprofile-bfd:
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif bfd-bootstrap
+
+
+.PHONY: all-stagefeedback-bfd maybe-all-stagefeedback-bfd
+.PHONY: clean-stagefeedback-bfd maybe-clean-stagefeedback-bfd
+maybe-all-stagefeedback-bfd:
+maybe-clean-stagefeedback-bfd:
+@if bfd-bootstrap
+maybe-all-stagefeedback-bfd: all-stagefeedback-bfd
+all-stagefeedback: all-stagefeedback-bfd
+all-stagefeedback-bfd: configure-stagefeedback-bfd
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd
+clean-stagefeedback: clean-stagefeedback-bfd
+clean-stagefeedback-bfd:
+	@[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif bfd-bootstrap
+
+
+
+
+
+.PHONY: check-bfd maybe-check-bfd
+maybe-check-bfd:
+@if bfd
+maybe-check-bfd: check-bfd
+
+check-bfd:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/bfd && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif bfd
+
+.PHONY: install-bfd maybe-install-bfd
+maybe-install-bfd:
+@if bfd
+maybe-install-bfd: install-bfd
+
+install-bfd: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/bfd && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
+
+@endif bfd
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-bfd info-bfd
+maybe-info-bfd:
+@if bfd
+maybe-info-bfd: info-bfd
+
+info-bfd: \
+    configure-bfd 
+	@[ -f ./bfd/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in bfd" ; \
+	(cd $(HOST_SUBDIR)/bfd && \
+	  $(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 bfd
+
+.PHONY: maybe-dvi-bfd dvi-bfd
+maybe-dvi-bfd:
+@if bfd
+maybe-dvi-bfd: dvi-bfd
+
+dvi-bfd: \
+    configure-bfd 
+	@[ -f ./bfd/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4080,13 +4278,12 @@
 	@[ -f ./bfd/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 html in bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4106,13 +4303,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4133,13 +4329,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4159,13 +4354,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4184,13 +4378,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4209,13 +4402,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4234,13 +4426,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4259,13 +4450,12 @@
 	@[ -f ./bfd/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 bfd" ; \
-	(cd bfd && \
+	(cd $(HOST_SUBDIR)/bfd && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4276,50 +4466,378 @@
 @endif bfd
 
 
+
 .PHONY: configure-opcodes maybe-configure-opcodes
 maybe-configure-opcodes:
 @if opcodes
 maybe-configure-opcodes: configure-opcodes
-configure-opcodes:
+configure-opcodes: 
 	@test -f stage_last && exit 0; \
-	test ! -f opcodes/Makefile || exit 0; \
-	[ -d opcodes ] || mkdir opcodes; \
+	test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in opcodes; \
-	cd opcodes || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/opcodes; \
+	cd "$(HOST_SUBDIR)/opcodes" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif opcodes
 
-.PHONY: all-opcodes maybe-all-opcodes
-maybe-all-opcodes:
-@if opcodes
-TARGET-opcodes=all
-maybe-all-opcodes: all-opcodes
-all-opcodes: configure-opcodes
-	@test -f stage_last && exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
+
+
+.PHONY: configure-stage1-opcodes maybe-configure-stage1-opcodes
+maybe-configure-stage1-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stage1-opcodes: configure-stage1-opcodes
+configure-stage1-opcodes: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif opcodes-bootstrap
+
+.PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes
+maybe-configure-stage2-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stage2-opcodes: configure-stage2-opcodes
+configure-stage2-opcodes: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif opcodes-bootstrap
+
+.PHONY: configure-stage3-opcodes maybe-configure-stage3-opcodes
+maybe-configure-stage3-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stage3-opcodes: configure-stage3-opcodes
+configure-stage3-opcodes: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif opcodes-bootstrap
+
+.PHONY: configure-stage4-opcodes maybe-configure-stage4-opcodes
+maybe-configure-stage4-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stage4-opcodes: configure-stage4-opcodes
+configure-stage4-opcodes: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif opcodes-bootstrap
+
+.PHONY: configure-stageprofile-opcodes maybe-configure-stageprofile-opcodes
+maybe-configure-stageprofile-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stageprofile-opcodes: configure-stageprofile-opcodes
+configure-stageprofile-opcodes: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif opcodes-bootstrap
+
+.PHONY: configure-stagefeedback-opcodes maybe-configure-stagefeedback-opcodes
+maybe-configure-stagefeedback-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stagefeedback-opcodes: configure-stagefeedback-opcodes
+configure-stagefeedback-opcodes: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/opcodes"; \
+	libsrcdir="$$s/opcodes"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif opcodes-bootstrap
+
+
+
+
+
+.PHONY: all-opcodes maybe-all-opcodes
+maybe-all-opcodes:
+@if opcodes
+TARGET-opcodes=all
+maybe-all-opcodes: all-opcodes
+all-opcodes: configure-opcodes
+	@test -f stage_last && exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-opcodes))
+	(cd $(HOST_SUBDIR)/opcodes && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-opcodes))
 @endif opcodes
 
+
+
+.PHONY: all-stage1-opcodes maybe-all-stage1-opcodes
+.PHONY: clean-stage1-opcodes maybe-clean-stage1-opcodes
+maybe-all-stage1-opcodes:
+maybe-clean-stage1-opcodes:
+@if opcodes-bootstrap
+maybe-all-stage1-opcodes: all-stage1-opcodes
+all-stage1: all-stage1-opcodes
+all-stage1-opcodes: configure-stage1-opcodes
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-opcodes: clean-stage1-opcodes
+clean-stage1: clean-stage1-opcodes
+clean-stage1-opcodes:
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif opcodes-bootstrap
+
+
+.PHONY: all-stage2-opcodes maybe-all-stage2-opcodes
+.PHONY: clean-stage2-opcodes maybe-clean-stage2-opcodes
+maybe-all-stage2-opcodes:
+maybe-clean-stage2-opcodes:
+@if opcodes-bootstrap
+maybe-all-stage2-opcodes: all-stage2-opcodes
+all-stage2: all-stage2-opcodes
+all-stage2-opcodes: configure-stage2-opcodes
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-opcodes: clean-stage2-opcodes
+clean-stage2: clean-stage2-opcodes
+clean-stage2-opcodes:
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif opcodes-bootstrap
+
+
+.PHONY: all-stage3-opcodes maybe-all-stage3-opcodes
+.PHONY: clean-stage3-opcodes maybe-clean-stage3-opcodes
+maybe-all-stage3-opcodes:
+maybe-clean-stage3-opcodes:
+@if opcodes-bootstrap
+maybe-all-stage3-opcodes: all-stage3-opcodes
+all-stage3: all-stage3-opcodes
+all-stage3-opcodes: configure-stage3-opcodes
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-opcodes: clean-stage3-opcodes
+clean-stage3: clean-stage3-opcodes
+clean-stage3-opcodes:
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif opcodes-bootstrap
+
+
+.PHONY: all-stage4-opcodes maybe-all-stage4-opcodes
+.PHONY: clean-stage4-opcodes maybe-clean-stage4-opcodes
+maybe-all-stage4-opcodes:
+maybe-clean-stage4-opcodes:
+@if opcodes-bootstrap
+maybe-all-stage4-opcodes: all-stage4-opcodes
+all-stage4: all-stage4-opcodes
+all-stage4-opcodes: configure-stage4-opcodes
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-opcodes: clean-stage4-opcodes
+clean-stage4: clean-stage4-opcodes
+clean-stage4-opcodes:
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif opcodes-bootstrap
+
+
+.PHONY: all-stageprofile-opcodes maybe-all-stageprofile-opcodes
+.PHONY: clean-stageprofile-opcodes maybe-clean-stageprofile-opcodes
+maybe-all-stageprofile-opcodes:
+maybe-clean-stageprofile-opcodes:
+@if opcodes-bootstrap
+maybe-all-stageprofile-opcodes: all-stageprofile-opcodes
+all-stageprofile: all-stageprofile-opcodes
+all-stageprofile-opcodes: configure-stageprofile-opcodes
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes
+clean-stageprofile: clean-stageprofile-opcodes
+clean-stageprofile-opcodes:
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif opcodes-bootstrap
+
+
+.PHONY: all-stagefeedback-opcodes maybe-all-stagefeedback-opcodes
+.PHONY: clean-stagefeedback-opcodes maybe-clean-stagefeedback-opcodes
+maybe-all-stagefeedback-opcodes:
+maybe-clean-stagefeedback-opcodes:
+@if opcodes-bootstrap
+maybe-all-stagefeedback-opcodes: all-stagefeedback-opcodes
+all-stagefeedback: all-stagefeedback-opcodes
+all-stagefeedback-opcodes: configure-stagefeedback-opcodes
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes
+clean-stagefeedback: clean-stagefeedback-opcodes
+clean-stagefeedback-opcodes:
+	@[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif opcodes-bootstrap
+
+
+
+
+
 .PHONY: check-opcodes maybe-check-opcodes
 maybe-check-opcodes:
 @if opcodes
@@ -4328,9 +4846,9 @@
 check-opcodes:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/opcodes && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif opcodes
 
@@ -4342,9 +4860,9 @@
 install-opcodes: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/opcodes && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif opcodes
 
@@ -4360,13 +4878,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4386,13 +4903,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4412,13 +4928,12 @@
 	@[ -f ./opcodes/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 html in opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4438,13 +4953,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4465,13 +4979,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4491,13 +5004,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4516,13 +5028,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4541,13 +5052,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4566,13 +5076,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4591,13 +5100,12 @@
 	@[ -f ./opcodes/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 opcodes" ; \
-	(cd opcodes && \
+	(cd $(HOST_SUBDIR)/opcodes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4608,61 +5116,389 @@
 @endif opcodes
 
 
+
 .PHONY: configure-binutils maybe-configure-binutils
 maybe-configure-binutils:
 @if binutils
 maybe-configure-binutils: configure-binutils
-configure-binutils:
+configure-binutils: 
 	@test -f stage_last && exit 0; \
-	test ! -f binutils/Makefile || exit 0; \
-	[ -d binutils ] || mkdir binutils; \
+	test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in binutils; \
-	cd binutils || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/binutils; \
+	cd "$(HOST_SUBDIR)/binutils" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif binutils
 
-.PHONY: all-binutils maybe-all-binutils
-maybe-all-binutils:
-@if binutils
-TARGET-binutils=all
-maybe-all-binutils: all-binutils
-all-binutils: configure-binutils
-	@test -f stage_last && exit 0; \
+
+
+.PHONY: configure-stage1-binutils maybe-configure-stage1-binutils
+maybe-configure-stage1-binutils:
+@if binutils-bootstrap
+maybe-configure-stage1-binutils: configure-stage1-binutils
+configure-stage1-binutils: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd binutils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-binutils))
-@endif binutils
-
-.PHONY: check-binutils maybe-check-binutils
-maybe-check-binutils:
-@if binutils
-maybe-check-binutils: check-binutils
+	echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif binutils-bootstrap
+
+.PHONY: configure-stage2-binutils maybe-configure-stage2-binutils
+maybe-configure-stage2-binutils:
+@if binutils-bootstrap
+maybe-configure-stage2-binutils: configure-stage2-binutils
+configure-stage2-binutils: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif binutils-bootstrap
+
+.PHONY: configure-stage3-binutils maybe-configure-stage3-binutils
+maybe-configure-stage3-binutils:
+@if binutils-bootstrap
+maybe-configure-stage3-binutils: configure-stage3-binutils
+configure-stage3-binutils: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif binutils-bootstrap
+
+.PHONY: configure-stage4-binutils maybe-configure-stage4-binutils
+maybe-configure-stage4-binutils:
+@if binutils-bootstrap
+maybe-configure-stage4-binutils: configure-stage4-binutils
+configure-stage4-binutils: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif binutils-bootstrap
+
+.PHONY: configure-stageprofile-binutils maybe-configure-stageprofile-binutils
+maybe-configure-stageprofile-binutils:
+@if binutils-bootstrap
+maybe-configure-stageprofile-binutils: configure-stageprofile-binutils
+configure-stageprofile-binutils: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif binutils-bootstrap
+
+.PHONY: configure-stagefeedback-binutils maybe-configure-stagefeedback-binutils
+maybe-configure-stagefeedback-binutils:
+@if binutils-bootstrap
+maybe-configure-stagefeedback-binutils: configure-stagefeedback-binutils
+configure-stagefeedback-binutils: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/binutils"; \
+	libsrcdir="$$s/binutils"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif binutils-bootstrap
+
+
+
+
+
+.PHONY: all-binutils maybe-all-binutils
+maybe-all-binutils:
+@if binutils
+TARGET-binutils=all
+maybe-all-binutils: all-binutils
+all-binutils: configure-binutils
+	@test -f stage_last && exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/binutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-binutils))
+@endif binutils
+
+
+
+.PHONY: all-stage1-binutils maybe-all-stage1-binutils
+.PHONY: clean-stage1-binutils maybe-clean-stage1-binutils
+maybe-all-stage1-binutils:
+maybe-clean-stage1-binutils:
+@if binutils-bootstrap
+maybe-all-stage1-binutils: all-stage1-binutils
+all-stage1: all-stage1-binutils
+all-stage1-binutils: configure-stage1-binutils
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-binutils: clean-stage1-binutils
+clean-stage1: clean-stage1-binutils
+clean-stage1-binutils:
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif binutils-bootstrap
+
+
+.PHONY: all-stage2-binutils maybe-all-stage2-binutils
+.PHONY: clean-stage2-binutils maybe-clean-stage2-binutils
+maybe-all-stage2-binutils:
+maybe-clean-stage2-binutils:
+@if binutils-bootstrap
+maybe-all-stage2-binutils: all-stage2-binutils
+all-stage2: all-stage2-binutils
+all-stage2-binutils: configure-stage2-binutils
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-binutils: clean-stage2-binutils
+clean-stage2: clean-stage2-binutils
+clean-stage2-binutils:
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif binutils-bootstrap
+
+
+.PHONY: all-stage3-binutils maybe-all-stage3-binutils
+.PHONY: clean-stage3-binutils maybe-clean-stage3-binutils
+maybe-all-stage3-binutils:
+maybe-clean-stage3-binutils:
+@if binutils-bootstrap
+maybe-all-stage3-binutils: all-stage3-binutils
+all-stage3: all-stage3-binutils
+all-stage3-binutils: configure-stage3-binutils
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-binutils: clean-stage3-binutils
+clean-stage3: clean-stage3-binutils
+clean-stage3-binutils:
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif binutils-bootstrap
+
+
+.PHONY: all-stage4-binutils maybe-all-stage4-binutils
+.PHONY: clean-stage4-binutils maybe-clean-stage4-binutils
+maybe-all-stage4-binutils:
+maybe-clean-stage4-binutils:
+@if binutils-bootstrap
+maybe-all-stage4-binutils: all-stage4-binutils
+all-stage4: all-stage4-binutils
+all-stage4-binutils: configure-stage4-binutils
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-binutils: clean-stage4-binutils
+clean-stage4: clean-stage4-binutils
+clean-stage4-binutils:
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif binutils-bootstrap
+
+
+.PHONY: all-stageprofile-binutils maybe-all-stageprofile-binutils
+.PHONY: clean-stageprofile-binutils maybe-clean-stageprofile-binutils
+maybe-all-stageprofile-binutils:
+maybe-clean-stageprofile-binutils:
+@if binutils-bootstrap
+maybe-all-stageprofile-binutils: all-stageprofile-binutils
+all-stageprofile: all-stageprofile-binutils
+all-stageprofile-binutils: configure-stageprofile-binutils
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-binutils: clean-stageprofile-binutils
+clean-stageprofile: clean-stageprofile-binutils
+clean-stageprofile-binutils:
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif binutils-bootstrap
+
+
+.PHONY: all-stagefeedback-binutils maybe-all-stagefeedback-binutils
+.PHONY: clean-stagefeedback-binutils maybe-clean-stagefeedback-binutils
+maybe-all-stagefeedback-binutils:
+maybe-clean-stagefeedback-binutils:
+@if binutils-bootstrap
+maybe-all-stagefeedback-binutils: all-stagefeedback-binutils
+all-stagefeedback: all-stagefeedback-binutils
+all-stagefeedback-binutils: configure-stagefeedback-binutils
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils
+clean-stagefeedback: clean-stagefeedback-binutils
+clean-stagefeedback-binutils:
+	@[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif binutils-bootstrap
+
+
+
+
+
+.PHONY: check-binutils maybe-check-binutils
+maybe-check-binutils:
+@if binutils
+maybe-check-binutils: check-binutils
 
 check-binutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd binutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/binutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif binutils
 
@@ -4674,9 +5510,9 @@
 install-binutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd binutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/binutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif binutils
 
@@ -4692,13 +5528,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4718,13 +5553,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4744,13 +5578,12 @@
 	@[ -f ./binutils/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 html in binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4770,13 +5603,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4797,13 +5629,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4823,13 +5654,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4848,13 +5678,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4873,13 +5702,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4898,13 +5726,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4923,13 +5750,12 @@
 	@[ -f ./binutils/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 binutils" ; \
-	(cd binutils && \
+	(cd $(HOST_SUBDIR)/binutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -4940,34 +5766,35 @@
 @endif binutils
 
 
+
 .PHONY: configure-bison maybe-configure-bison
 maybe-configure-bison:
 @if bison
 maybe-configure-bison: configure-bison
-configure-bison:
-	@test ! -f bison/Makefile || exit 0; \
-	[ -d bison ] || mkdir bison; \
+configure-bison: 
+	@test ! -f $(HOST_SUBDIR)/bison/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bison ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in bison; \
-	cd bison || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bison"; \
-	    libsrcdir="$$s/bison";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bison"; \
-	    libsrcdir="$$s/bison";; \
+	echo Configuring in $(HOST_SUBDIR)/bison; \
+	cd "$(HOST_SUBDIR)/bison" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bison/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/bison"; \
+	libsrcdir="$$s/bison"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif bison
 
+
+
+
+
 .PHONY: all-bison maybe-all-bison
 maybe-all-bison:
 @if bison
@@ -4976,12 +5803,14 @@
 all-bison: configure-bison
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bison && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-bison))
+	(cd $(HOST_SUBDIR)/bison && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-bison))
 @endif bison
 
+
+
+
 .PHONY: check-bison maybe-check-bison
 maybe-check-bison:
 @if bison
@@ -4992,9 +5821,9 @@
 	@if [ '$(host)' = '$(target)' ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
-	  (cd bison && $(MAKE) $(FLAGS_TO_PASS)  check); \
+	  (cd $(HOST_SUBDIR)/bison && \
+	    $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
 @endif bison
@@ -5007,9 +5836,9 @@
 install-bison: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bison && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/bison && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif bison
 
@@ -5025,13 +5854,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5051,13 +5879,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5077,13 +5904,12 @@
 	@[ -f ./bison/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 html in bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5103,13 +5929,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5130,13 +5955,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5156,13 +5980,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5181,13 +6004,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5206,13 +6028,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5231,13 +6052,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5256,13 +6076,12 @@
 	@[ -f ./bison/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 bison" ; \
-	(cd bison && \
+	(cd $(HOST_SUBDIR)/bison && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5273,34 +6092,35 @@
 @endif bison
 
 
+
 .PHONY: configure-byacc maybe-configure-byacc
 maybe-configure-byacc:
 @if byacc
 maybe-configure-byacc: configure-byacc
-configure-byacc:
-	@test ! -f byacc/Makefile || exit 0; \
-	[ -d byacc ] || mkdir byacc; \
+configure-byacc: 
+	@test ! -f $(HOST_SUBDIR)/byacc/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/byacc ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in byacc; \
-	cd byacc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/byacc"; \
-	    libsrcdir="$$s/byacc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/byacc"; \
-	    libsrcdir="$$s/byacc";; \
+	echo Configuring in $(HOST_SUBDIR)/byacc; \
+	cd "$(HOST_SUBDIR)/byacc" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/byacc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/byacc"; \
+	libsrcdir="$$s/byacc"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif byacc
 
+
+
+
+
 .PHONY: all-byacc maybe-all-byacc
 maybe-all-byacc:
 @if byacc
@@ -5309,12 +6129,14 @@
 all-byacc: configure-byacc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd byacc && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-byacc))
+	(cd $(HOST_SUBDIR)/byacc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-byacc))
 @endif byacc
 
+
+
+
 .PHONY: check-byacc maybe-check-byacc
 maybe-check-byacc:
 @if byacc
@@ -5325,9 +6147,9 @@
 	@if [ '$(host)' = '$(target)' ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
-	  (cd byacc && $(MAKE) $(FLAGS_TO_PASS)  check); \
+	  (cd $(HOST_SUBDIR)/byacc && \
+	    $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
 @endif byacc
@@ -5340,9 +6162,9 @@
 install-byacc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd byacc && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/byacc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif byacc
 
@@ -5358,13 +6180,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5384,13 +6205,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5410,13 +6230,12 @@
 	@[ -f ./byacc/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 html in byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5436,13 +6255,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5463,13 +6281,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5489,13 +6306,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5514,13 +6330,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5539,13 +6354,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5564,13 +6378,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5589,13 +6402,12 @@
 	@[ -f ./byacc/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 byacc" ; \
-	(cd byacc && \
+	(cd $(HOST_SUBDIR)/byacc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5606,34 +6418,35 @@
 @endif byacc
 
 
+
 .PHONY: configure-bzip2 maybe-configure-bzip2
 maybe-configure-bzip2:
 @if bzip2
 maybe-configure-bzip2: configure-bzip2
-configure-bzip2:
-	@test ! -f bzip2/Makefile || exit 0; \
-	[ -d bzip2 ] || mkdir bzip2; \
+configure-bzip2: 
+	@test ! -f $(HOST_SUBDIR)/bzip2/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bzip2 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in bzip2; \
-	cd bzip2 || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bzip2"; \
-	    libsrcdir="$$s/bzip2";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bzip2"; \
-	    libsrcdir="$$s/bzip2";; \
+	echo Configuring in $(HOST_SUBDIR)/bzip2; \
+	cd "$(HOST_SUBDIR)/bzip2" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bzip2/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/bzip2"; \
+	libsrcdir="$$s/bzip2"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif bzip2
 
+
+
+
+
 .PHONY: all-bzip2 maybe-all-bzip2
 maybe-all-bzip2:
 @if bzip2
@@ -5642,12 +6455,14 @@
 all-bzip2: configure-bzip2
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-bzip2))
+	(cd $(HOST_SUBDIR)/bzip2 && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-bzip2))
 @endif bzip2
 
+
+
+
 .PHONY: check-bzip2 maybe-check-bzip2
 maybe-check-bzip2:
 @if bzip2
@@ -5656,9 +6471,9 @@
 check-bzip2:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/bzip2 && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif bzip2
 
@@ -5670,9 +6485,9 @@
 install-bzip2: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/bzip2 && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif bzip2
 
@@ -5688,13 +6503,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5714,13 +6528,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5740,13 +6553,12 @@
 	@[ -f ./bzip2/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 html in bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5766,13 +6578,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5793,13 +6604,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5819,13 +6629,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5844,13 +6653,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5869,13 +6677,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5894,13 +6701,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5919,13 +6725,12 @@
 	@[ -f ./bzip2/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 bzip2" ; \
-	(cd bzip2 && \
+	(cd $(HOST_SUBDIR)/bzip2 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -5936,34 +6741,35 @@
 @endif bzip2
 
 
+
 .PHONY: configure-dejagnu maybe-configure-dejagnu
 maybe-configure-dejagnu:
 @if dejagnu
 maybe-configure-dejagnu: configure-dejagnu
-configure-dejagnu:
-	@test ! -f dejagnu/Makefile || exit 0; \
-	[ -d dejagnu ] || mkdir dejagnu; \
+configure-dejagnu: 
+	@test ! -f $(HOST_SUBDIR)/dejagnu/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/dejagnu ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in dejagnu; \
-	cd dejagnu || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/dejagnu"; \
-	    libsrcdir="$$s/dejagnu";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/dejagnu"; \
-	    libsrcdir="$$s/dejagnu";; \
+	echo Configuring in $(HOST_SUBDIR)/dejagnu; \
+	cd "$(HOST_SUBDIR)/dejagnu" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/dejagnu/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/dejagnu"; \
+	libsrcdir="$$s/dejagnu"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif dejagnu
 
+
+
+
+
 .PHONY: all-dejagnu maybe-all-dejagnu
 maybe-all-dejagnu:
 @if dejagnu
@@ -5972,12 +6778,14 @@
 all-dejagnu: configure-dejagnu
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-dejagnu))
+	(cd $(HOST_SUBDIR)/dejagnu && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-dejagnu))
 @endif dejagnu
 
+
+
+
 .PHONY: check-dejagnu maybe-check-dejagnu
 maybe-check-dejagnu:
 @if dejagnu
@@ -5986,9 +6794,9 @@
 check-dejagnu:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/dejagnu && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif dejagnu
 
@@ -6000,9 +6808,9 @@
 install-dejagnu: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/dejagnu && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif dejagnu
 
@@ -6018,13 +6826,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6044,13 +6851,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6070,13 +6876,12 @@
 	@[ -f ./dejagnu/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 html in dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6096,13 +6901,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6123,13 +6927,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6149,13 +6952,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6174,13 +6976,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6199,13 +7000,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6224,13 +7024,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6249,13 +7048,12 @@
 	@[ -f ./dejagnu/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 dejagnu" ; \
-	(cd dejagnu && \
+	(cd $(HOST_SUBDIR)/dejagnu && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6266,34 +7064,35 @@
 @endif dejagnu
 
 
+
 .PHONY: configure-diff maybe-configure-diff
 maybe-configure-diff:
 @if diff
 maybe-configure-diff: configure-diff
-configure-diff:
-	@test ! -f diff/Makefile || exit 0; \
-	[ -d diff ] || mkdir diff; \
+configure-diff: 
+	@test ! -f $(HOST_SUBDIR)/diff/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/diff ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in diff; \
-	cd diff || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/diff"; \
-	    libsrcdir="$$s/diff";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/diff"; \
-	    libsrcdir="$$s/diff";; \
+	echo Configuring in $(HOST_SUBDIR)/diff; \
+	cd "$(HOST_SUBDIR)/diff" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/diff/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/diff"; \
+	libsrcdir="$$s/diff"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif diff
 
+
+
+
+
 .PHONY: all-diff maybe-all-diff
 maybe-all-diff:
 @if diff
@@ -6302,12 +7101,14 @@
 all-diff: configure-diff
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd diff && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-diff))
+	(cd $(HOST_SUBDIR)/diff && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-diff))
 @endif diff
 
+
+
+
 .PHONY: check-diff maybe-check-diff
 maybe-check-diff:
 @if diff
@@ -6316,9 +7117,9 @@
 check-diff:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd diff && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/diff && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif diff
 
@@ -6330,9 +7131,9 @@
 install-diff: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd diff && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/diff && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif diff
 
@@ -6348,13 +7149,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6374,13 +7174,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6400,13 +7199,12 @@
 	@[ -f ./diff/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 html in diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6426,13 +7224,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6453,13 +7250,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6479,13 +7275,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6504,13 +7299,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6529,13 +7323,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6554,13 +7347,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6579,13 +7371,12 @@
 	@[ -f ./diff/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 diff" ; \
-	(cd diff && \
+	(cd $(HOST_SUBDIR)/diff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6596,34 +7387,35 @@
 @endif diff
 
 
+
 .PHONY: configure-dosutils maybe-configure-dosutils
 maybe-configure-dosutils:
 @if dosutils
 maybe-configure-dosutils: configure-dosutils
-configure-dosutils:
-	@test ! -f dosutils/Makefile || exit 0; \
-	[ -d dosutils ] || mkdir dosutils; \
+configure-dosutils: 
+	@test ! -f $(HOST_SUBDIR)/dosutils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/dosutils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in dosutils; \
-	cd dosutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/dosutils"; \
-	    libsrcdir="$$s/dosutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/dosutils"; \
-	    libsrcdir="$$s/dosutils";; \
+	echo Configuring in $(HOST_SUBDIR)/dosutils; \
+	cd "$(HOST_SUBDIR)/dosutils" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/dosutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/dosutils"; \
+	libsrcdir="$$s/dosutils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif dosutils
 
+
+
+
+
 .PHONY: all-dosutils maybe-all-dosutils
 maybe-all-dosutils:
 @if dosutils
@@ -6632,12 +7424,14 @@
 all-dosutils: configure-dosutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd dosutils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-dosutils))
+	(cd $(HOST_SUBDIR)/dosutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-dosutils))
 @endif dosutils
 
+
+
+
 .PHONY: check-dosutils maybe-check-dosutils
 maybe-check-dosutils:
 @if dosutils
@@ -6655,9 +7449,9 @@
 install-dosutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/dosutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif dosutils
 
@@ -6673,13 +7467,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6699,13 +7492,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6725,13 +7517,12 @@
 	@[ -f ./dosutils/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 html in dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6751,13 +7542,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6778,13 +7568,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6804,13 +7593,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6829,13 +7617,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6854,13 +7641,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6879,13 +7665,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6904,13 +7689,12 @@
 	@[ -f ./dosutils/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 dosutils" ; \
-	(cd dosutils && \
+	(cd $(HOST_SUBDIR)/dosutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -6921,34 +7705,35 @@
 @endif dosutils
 
 
+
 .PHONY: configure-etc maybe-configure-etc
 maybe-configure-etc:
 @if etc
 maybe-configure-etc: configure-etc
-configure-etc:
-	@test ! -f etc/Makefile || exit 0; \
-	[ -d etc ] || mkdir etc; \
+configure-etc: 
+	@test ! -f $(HOST_SUBDIR)/etc/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/etc ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in etc; \
-	cd etc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/etc"; \
-	    libsrcdir="$$s/etc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/etc"; \
-	    libsrcdir="$$s/etc";; \
+	echo Configuring in $(HOST_SUBDIR)/etc; \
+	cd "$(HOST_SUBDIR)/etc" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/etc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/etc"; \
+	libsrcdir="$$s/etc"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif etc
 
+
+
+
+
 .PHONY: all-etc maybe-all-etc
 maybe-all-etc:
 @if etc
@@ -6957,12 +7742,14 @@
 all-etc: configure-etc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd etc && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-etc))
+	(cd $(HOST_SUBDIR)/etc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-etc))
 @endif etc
 
+
+
+
 .PHONY: check-etc maybe-check-etc
 maybe-check-etc:
 @if etc
@@ -6971,9 +7758,9 @@
 check-etc:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd etc && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/etc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif etc
 
@@ -6985,9 +7772,9 @@
 install-etc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd etc && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/etc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif etc
 
@@ -7003,13 +7790,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7029,13 +7815,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7055,13 +7840,12 @@
 	@[ -f ./etc/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 html in etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7081,13 +7865,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7108,13 +7891,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7134,13 +7916,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7159,13 +7940,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7184,13 +7964,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7209,13 +7988,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7234,13 +8012,12 @@
 	@[ -f ./etc/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 etc" ; \
-	(cd etc && \
+	(cd $(HOST_SUBDIR)/etc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7251,34 +8028,35 @@
 @endif etc
 
 
+
 .PHONY: configure-fastjar maybe-configure-fastjar
 maybe-configure-fastjar:
 @if fastjar
 maybe-configure-fastjar: configure-fastjar
-configure-fastjar:
-	@test ! -f fastjar/Makefile || exit 0; \
-	[ -d fastjar ] || mkdir fastjar; \
+configure-fastjar: 
+	@test ! -f $(HOST_SUBDIR)/fastjar/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fastjar ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in fastjar; \
-	cd fastjar || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/fastjar"; \
-	    libsrcdir="$$s/fastjar";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/fastjar"; \
-	    libsrcdir="$$s/fastjar";; \
+	echo Configuring in $(HOST_SUBDIR)/fastjar; \
+	cd "$(HOST_SUBDIR)/fastjar" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/fastjar/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/fastjar"; \
+	libsrcdir="$$s/fastjar"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif fastjar
 
+
+
+
+
 .PHONY: all-fastjar maybe-all-fastjar
 maybe-all-fastjar:
 @if fastjar
@@ -7287,12 +8065,14 @@
 all-fastjar: configure-fastjar
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-fastjar))
+	(cd $(HOST_SUBDIR)/fastjar && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-fastjar))
 @endif fastjar
 
+
+
+
 .PHONY: check-fastjar maybe-check-fastjar
 maybe-check-fastjar:
 @if fastjar
@@ -7303,9 +8083,9 @@
 	@if [ '$(host)' = '$(target)' ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
-	  (cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  check); \
+	  (cd $(HOST_SUBDIR)/fastjar && \
+	    $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
 @endif fastjar
@@ -7318,9 +8098,9 @@
 install-fastjar: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/fastjar && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif fastjar
 
@@ -7336,13 +8116,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7362,13 +8141,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7388,13 +8166,12 @@
 	@[ -f ./fastjar/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 html in fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7414,13 +8191,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7441,13 +8217,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7467,13 +8242,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7492,13 +8266,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7517,13 +8290,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7542,13 +8314,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7567,13 +8338,12 @@
 	@[ -f ./fastjar/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 fastjar" ; \
-	(cd fastjar && \
+	(cd $(HOST_SUBDIR)/fastjar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7584,34 +8354,35 @@
 @endif fastjar
 
 
+
 .PHONY: configure-fileutils maybe-configure-fileutils
 maybe-configure-fileutils:
 @if fileutils
 maybe-configure-fileutils: configure-fileutils
-configure-fileutils:
-	@test ! -f fileutils/Makefile || exit 0; \
-	[ -d fileutils ] || mkdir fileutils; \
+configure-fileutils: 
+	@test ! -f $(HOST_SUBDIR)/fileutils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fileutils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in fileutils; \
-	cd fileutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/fileutils"; \
-	    libsrcdir="$$s/fileutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/fileutils"; \
-	    libsrcdir="$$s/fileutils";; \
+	echo Configuring in $(HOST_SUBDIR)/fileutils; \
+	cd "$(HOST_SUBDIR)/fileutils" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/fileutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/fileutils"; \
+	libsrcdir="$$s/fileutils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif fileutils
 
+
+
+
+
 .PHONY: all-fileutils maybe-all-fileutils
 maybe-all-fileutils:
 @if fileutils
@@ -7620,12 +8391,14 @@
 all-fileutils: configure-fileutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-fileutils))
+	(cd $(HOST_SUBDIR)/fileutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-fileutils))
 @endif fileutils
 
+
+
+
 .PHONY: check-fileutils maybe-check-fileutils
 maybe-check-fileutils:
 @if fileutils
@@ -7634,9 +8407,9 @@
 check-fileutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/fileutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif fileutils
 
@@ -7648,9 +8421,9 @@
 install-fileutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/fileutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif fileutils
 
@@ -7666,13 +8439,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7692,13 +8464,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7718,13 +8489,12 @@
 	@[ -f ./fileutils/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 html in fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7744,13 +8514,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7771,13 +8540,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7797,13 +8565,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7822,13 +8589,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7847,13 +8613,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7872,13 +8637,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7897,13 +8661,12 @@
 	@[ -f ./fileutils/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 fileutils" ; \
-	(cd fileutils && \
+	(cd $(HOST_SUBDIR)/fileutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -7914,34 +8677,35 @@
 @endif fileutils
 
 
+
 .PHONY: configure-findutils maybe-configure-findutils
 maybe-configure-findutils:
 @if findutils
 maybe-configure-findutils: configure-findutils
-configure-findutils:
-	@test ! -f findutils/Makefile || exit 0; \
-	[ -d findutils ] || mkdir findutils; \
+configure-findutils: 
+	@test ! -f $(HOST_SUBDIR)/findutils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/findutils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in findutils; \
-	cd findutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/findutils"; \
-	    libsrcdir="$$s/findutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/findutils"; \
-	    libsrcdir="$$s/findutils";; \
+	echo Configuring in $(HOST_SUBDIR)/findutils; \
+	cd "$(HOST_SUBDIR)/findutils" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/findutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/findutils"; \
+	libsrcdir="$$s/findutils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif findutils
 
+
+
+
+
 .PHONY: all-findutils maybe-all-findutils
 maybe-all-findutils:
 @if findutils
@@ -7950,12 +8714,14 @@
 all-findutils: configure-findutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd findutils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-findutils))
+	(cd $(HOST_SUBDIR)/findutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-findutils))
 @endif findutils
 
+
+
+
 .PHONY: check-findutils maybe-check-findutils
 maybe-check-findutils:
 @if findutils
@@ -7964,9 +8730,9 @@
 check-findutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd findutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/findutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif findutils
 
@@ -7978,9 +8744,9 @@
 install-findutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd findutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/findutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif findutils
 
@@ -7996,13 +8762,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8022,13 +8787,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8048,13 +8812,12 @@
 	@[ -f ./findutils/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 html in findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8074,13 +8837,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8101,13 +8863,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8127,13 +8888,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8152,13 +8912,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8177,13 +8936,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8202,13 +8960,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8227,13 +8984,12 @@
 	@[ -f ./findutils/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 findutils" ; \
-	(cd findutils && \
+	(cd $(HOST_SUBDIR)/findutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8244,34 +9000,35 @@
 @endif findutils
 
 
+
 .PHONY: configure-find maybe-configure-find
 maybe-configure-find:
 @if find
 maybe-configure-find: configure-find
-configure-find:
-	@test ! -f find/Makefile || exit 0; \
-	[ -d find ] || mkdir find; \
+configure-find: 
+	@test ! -f $(HOST_SUBDIR)/find/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/find ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in find; \
-	cd find || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/find"; \
-	    libsrcdir="$$s/find";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/find"; \
-	    libsrcdir="$$s/find";; \
+	echo Configuring in $(HOST_SUBDIR)/find; \
+	cd "$(HOST_SUBDIR)/find" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/find/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/find"; \
+	libsrcdir="$$s/find"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif find
 
+
+
+
+
 .PHONY: all-find maybe-all-find
 maybe-all-find:
 @if find
@@ -8280,12 +9037,14 @@
 all-find: configure-find
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd find && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-find))
+	(cd $(HOST_SUBDIR)/find && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-find))
 @endif find
 
+
+
+
 .PHONY: check-find maybe-check-find
 maybe-check-find:
 @if find
@@ -8294,9 +9053,9 @@
 check-find:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd find && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/find && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif find
 
@@ -8308,9 +9067,9 @@
 install-find: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd find && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/find && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif find
 
@@ -8326,13 +9085,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8352,13 +9110,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8378,13 +9135,12 @@
 	@[ -f ./find/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 html in find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8404,13 +9160,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8431,13 +9186,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8457,13 +9211,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8482,13 +9235,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8507,13 +9259,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8532,13 +9283,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8557,13 +9307,12 @@
 	@[ -f ./find/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 find" ; \
-	(cd find && \
+	(cd $(HOST_SUBDIR)/find && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8574,34 +9323,35 @@
 @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; \
+configure-fixincludes: 
+	@test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/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";; \
+	echo Configuring in $(HOST_SUBDIR)/fixincludes; \
+	cd "$(HOST_SUBDIR)/fixincludes" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/fixincludes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/fixincludes"; \
+	libsrcdir="$$s/fixincludes"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif fixincludes
 
+
+
+
+
 .PHONY: all-fixincludes maybe-all-fixincludes
 maybe-all-fixincludes:
 @if fixincludes
@@ -8610,12 +9360,14 @@
 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))
+	(cd $(HOST_SUBDIR)/fixincludes && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-fixincludes))
 @endif fixincludes
 
+
+
+
 .PHONY: check-fixincludes maybe-check-fixincludes
 maybe-check-fixincludes:
 @if fixincludes
@@ -8624,9 +9376,9 @@
 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)
+	(cd $(HOST_SUBDIR)/fixincludes && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif fixincludes
 
@@ -8638,9 +9390,9 @@
 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)
+	(cd $(HOST_SUBDIR)/fixincludes && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif fixincludes
 
@@ -8676,13 +9428,12 @@
 	@[ -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 html in fixincludes" ; \
-	(cd fixincludes && \
+	(cd $(HOST_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8731,13 +9482,12 @@
 	@[ -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 && \
+	(cd $(HOST_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8756,13 +9506,12 @@
 	@[ -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 && \
+	(cd $(HOST_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8781,13 +9530,12 @@
 	@[ -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 && \
+	(cd $(HOST_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8806,13 +9554,12 @@
 	@[ -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 && \
+	(cd $(HOST_SUBDIR)/fixincludes && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8823,34 +9570,35 @@
 @endif fixincludes
 
 
+
 .PHONY: configure-flex maybe-configure-flex
 maybe-configure-flex:
 @if flex
 maybe-configure-flex: configure-flex
-configure-flex:
-	@test ! -f flex/Makefile || exit 0; \
-	[ -d flex ] || mkdir flex; \
+configure-flex: 
+	@test ! -f $(HOST_SUBDIR)/flex/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/flex ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in flex; \
-	cd flex || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/flex"; \
-	    libsrcdir="$$s/flex";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/flex"; \
-	    libsrcdir="$$s/flex";; \
+	echo Configuring in $(HOST_SUBDIR)/flex; \
+	cd "$(HOST_SUBDIR)/flex" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/flex/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/flex"; \
+	libsrcdir="$$s/flex"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif flex
 
+
+
+
+
 .PHONY: all-flex maybe-all-flex
 maybe-all-flex:
 @if flex
@@ -8859,12 +9607,14 @@
 all-flex: configure-flex
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd flex && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-flex))
+	(cd $(HOST_SUBDIR)/flex && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-flex))
 @endif flex
 
+
+
+
 .PHONY: check-flex maybe-check-flex
 maybe-check-flex:
 @if flex
@@ -8875,9 +9625,9 @@
 	@if [ '$(host)' = '$(target)' ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
-	  (cd flex && $(MAKE) $(FLAGS_TO_PASS)  check); \
+	  (cd $(HOST_SUBDIR)/flex && \
+	    $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
 @endif flex
@@ -8890,9 +9640,9 @@
 install-flex: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd flex && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/flex && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif flex
 
@@ -8908,13 +9658,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8934,13 +9683,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8960,13 +9708,12 @@
 	@[ -f ./flex/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 html in flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -8986,13 +9733,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9013,13 +9759,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9039,13 +9784,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9064,13 +9808,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9089,13 +9832,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9114,13 +9856,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9139,13 +9880,12 @@
 	@[ -f ./flex/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 flex" ; \
-	(cd flex && \
+	(cd $(HOST_SUBDIR)/flex && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9156,35 +9896,187 @@
 @endif flex
 
 
+
 .PHONY: configure-gas maybe-configure-gas
 maybe-configure-gas:
 @if gas
 maybe-configure-gas: configure-gas
-configure-gas:
+configure-gas: 
 	@test -f stage_last && exit 0; \
-	test ! -f gas/Makefile || exit 0; \
-	[ -d gas ] || mkdir gas; \
+	test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gas; \
-	cd gas || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/gas; \
+	cd "$(HOST_SUBDIR)/gas" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gas
 
+
+
+.PHONY: configure-stage1-gas maybe-configure-stage1-gas
+maybe-configure-stage1-gas:
+@if gas-bootstrap
+maybe-configure-stage1-gas: configure-stage1-gas
+configure-stage1-gas: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif gas-bootstrap
+
+.PHONY: configure-stage2-gas maybe-configure-stage2-gas
+maybe-configure-stage2-gas:
+@if gas-bootstrap
+maybe-configure-stage2-gas: configure-stage2-gas
+configure-stage2-gas: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gas-bootstrap
+
+.PHONY: configure-stage3-gas maybe-configure-stage3-gas
+maybe-configure-stage3-gas:
+@if gas-bootstrap
+maybe-configure-stage3-gas: configure-stage3-gas
+configure-stage3-gas: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gas-bootstrap
+
+.PHONY: configure-stage4-gas maybe-configure-stage4-gas
+maybe-configure-stage4-gas:
+@if gas-bootstrap
+maybe-configure-stage4-gas: configure-stage4-gas
+configure-stage4-gas: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gas-bootstrap
+
+.PHONY: configure-stageprofile-gas maybe-configure-stageprofile-gas
+maybe-configure-stageprofile-gas:
+@if gas-bootstrap
+maybe-configure-stageprofile-gas: configure-stageprofile-gas
+configure-stageprofile-gas: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gas-bootstrap
+
+.PHONY: configure-stagefeedback-gas maybe-configure-stagefeedback-gas
+maybe-configure-stagefeedback-gas:
+@if gas-bootstrap
+maybe-configure-stagefeedback-gas: configure-stagefeedback-gas
+configure-stagefeedback-gas: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gas"; \
+	libsrcdir="$$s/gas"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gas-bootstrap
+
+
+
+
+
 .PHONY: all-gas maybe-all-gas
 maybe-all-gas:
 @if gas
@@ -9194,60 +10086,235 @@
 	@test -f stage_last && exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gas && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-gas))
+	(cd $(HOST_SUBDIR)/gas && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gas))
 @endif gas
 
-.PHONY: check-gas maybe-check-gas
-maybe-check-gas:
-@if gas
-maybe-check-gas: check-gas
 
-check-gas:
+
+.PHONY: all-stage1-gas maybe-all-stage1-gas
+.PHONY: clean-stage1-gas maybe-clean-stage1-gas
+maybe-all-stage1-gas:
+maybe-clean-stage1-gas:
+@if gas-bootstrap
+maybe-all-stage1-gas: all-stage1-gas
+all-stage1: all-stage1-gas
+all-stage1-gas: configure-stage1-gas
+	@$(MAKE) stage1-start
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gas && $(MAKE) $(FLAGS_TO_PASS) check)
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
 
-@endif gas
+maybe-clean-stage1-gas: clean-stage1-gas
+clean-stage1: clean-stage1-gas
+clean-stage1-gas:
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif gas-bootstrap
 
-.PHONY: install-gas maybe-install-gas
-maybe-install-gas:
-@if gas
-maybe-install-gas: install-gas
 
-install-gas: installdirs
+.PHONY: all-stage2-gas maybe-all-stage2-gas
+.PHONY: clean-stage2-gas maybe-clean-stage2-gas
+maybe-all-stage2-gas:
+maybe-clean-stage2-gas:
+@if gas-bootstrap
+maybe-all-stage2-gas: all-stage2-gas
+all-stage2: all-stage2-gas
+all-stage2-gas: configure-stage2-gas
+	@$(MAKE) stage2-start
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gas && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
 
-@endif gas
-
-# Other targets (info, dvi, etc.)
+maybe-clean-stage2-gas: clean-stage2-gas
+clean-stage2: clean-stage2-gas
+clean-stage2-gas:
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif gas-bootstrap
 
-.PHONY: maybe-info-gas info-gas
-maybe-info-gas:
-@if gas
-maybe-info-gas: info-gas
 
-info-gas: \
-    configure-gas 
-	@[ -f ./gas/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
+.PHONY: all-stage3-gas maybe-all-stage3-gas
+.PHONY: clean-stage3-gas maybe-clean-stage3-gas
+maybe-all-stage3-gas:
+maybe-clean-stage3-gas:
+@if gas-bootstrap
+maybe-all-stage3-gas: all-stage3-gas
+all-stage3: all-stage3-gas
+all-stage3-gas: configure-stage3-gas
+	@$(MAKE) stage3-start
+	@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 gas" ; \
-	(cd gas && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-gas: clean-stage3-gas
+clean-stage3: clean-stage3-gas
+clean-stage3-gas:
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif gas-bootstrap
+
+
+.PHONY: all-stage4-gas maybe-all-stage4-gas
+.PHONY: clean-stage4-gas maybe-clean-stage4-gas
+maybe-all-stage4-gas:
+maybe-clean-stage4-gas:
+@if gas-bootstrap
+maybe-all-stage4-gas: all-stage4-gas
+all-stage4: all-stage4-gas
+all-stage4-gas: configure-stage4-gas
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-gas: clean-stage4-gas
+clean-stage4: clean-stage4-gas
+clean-stage4-gas:
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif gas-bootstrap
+
+
+.PHONY: all-stageprofile-gas maybe-all-stageprofile-gas
+.PHONY: clean-stageprofile-gas maybe-clean-stageprofile-gas
+maybe-all-stageprofile-gas:
+maybe-clean-stageprofile-gas:
+@if gas-bootstrap
+maybe-all-stageprofile-gas: all-stageprofile-gas
+all-stageprofile: all-stageprofile-gas
+all-stageprofile-gas: configure-stageprofile-gas
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-gas: clean-stageprofile-gas
+clean-stageprofile: clean-stageprofile-gas
+clean-stageprofile-gas:
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif gas-bootstrap
+
+
+.PHONY: all-stagefeedback-gas maybe-all-stagefeedback-gas
+.PHONY: clean-stagefeedback-gas maybe-clean-stagefeedback-gas
+maybe-all-stagefeedback-gas:
+maybe-clean-stagefeedback-gas:
+@if gas-bootstrap
+maybe-all-stagefeedback-gas: all-stagefeedback-gas
+all-stagefeedback: all-stagefeedback-gas
+all-stagefeedback-gas: configure-stagefeedback-gas
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-gas: clean-stagefeedback-gas
+clean-stagefeedback: clean-stagefeedback-gas
+clean-stagefeedback-gas:
+	@[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif gas-bootstrap
+
+
+
+
+
+.PHONY: check-gas maybe-check-gas
+maybe-check-gas:
+@if gas
+maybe-check-gas: check-gas
+
+check-gas:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gas && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif gas
+
+.PHONY: install-gas maybe-install-gas
+maybe-install-gas:
+@if gas
+maybe-install-gas: install-gas
+
+install-gas: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gas && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
+
+@endif gas
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-gas info-gas
+maybe-info-gas:
+@if gas
+maybe-info-gas: info-gas
+
+info-gas: \
+    configure-gas 
+	@[ -f ./gas/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in gas" ; \
+	(cd $(HOST_SUBDIR)/gas && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
@@ -9266,13 +10333,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9292,13 +10358,12 @@
 	@[ -f ./gas/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 html in gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9318,13 +10383,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9345,13 +10409,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9371,13 +10434,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9396,13 +10458,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9421,13 +10482,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9446,13 +10506,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9471,13 +10530,12 @@
 	@[ -f ./gas/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 gas" ; \
-	(cd gas && \
+	(cd $(HOST_SUBDIR)/gas && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9488,35 +10546,187 @@
 @endif gas
 
 
+
 .PHONY: configure-gcc maybe-configure-gcc
 maybe-configure-gcc:
 @if gcc
 maybe-configure-gcc: configure-gcc
-configure-gcc:
+configure-gcc: 
 	@test -f stage_last && exit 0; \
-	test ! -f gcc/Makefile || exit 0; \
-	[ -d gcc ] || mkdir gcc; \
+	test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gcc; \
-	cd gcc || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/gcc; \
+	cd "$(HOST_SUBDIR)/gcc" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gcc
 
+
+
+.PHONY: configure-stage1-gcc maybe-configure-stage1-gcc
+maybe-configure-stage1-gcc:
+@if gcc-bootstrap
+maybe-configure-stage1-gcc: configure-stage1-gcc
+configure-stage1-gcc: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif gcc-bootstrap
+
+.PHONY: configure-stage2-gcc maybe-configure-stage2-gcc
+maybe-configure-stage2-gcc:
+@if gcc-bootstrap
+maybe-configure-stage2-gcc: configure-stage2-gcc
+configure-stage2-gcc: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gcc-bootstrap
+
+.PHONY: configure-stage3-gcc maybe-configure-stage3-gcc
+maybe-configure-stage3-gcc:
+@if gcc-bootstrap
+maybe-configure-stage3-gcc: configure-stage3-gcc
+configure-stage3-gcc: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gcc-bootstrap
+
+.PHONY: configure-stage4-gcc maybe-configure-stage4-gcc
+maybe-configure-stage4-gcc:
+@if gcc-bootstrap
+maybe-configure-stage4-gcc: configure-stage4-gcc
+configure-stage4-gcc: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gcc-bootstrap
+
+.PHONY: configure-stageprofile-gcc maybe-configure-stageprofile-gcc
+maybe-configure-stageprofile-gcc:
+@if gcc-bootstrap
+maybe-configure-stageprofile-gcc: configure-stageprofile-gcc
+configure-stageprofile-gcc: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gcc-bootstrap
+
+.PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc
+maybe-configure-stagefeedback-gcc:
+@if gcc-bootstrap
+maybe-configure-stagefeedback-gcc: configure-stagefeedback-gcc
+configure-stagefeedback-gcc: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gcc"; \
+	libsrcdir="$$s/gcc"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif gcc-bootstrap
+
+
+
+
+
 .PHONY: all-gcc maybe-all-gcc
 maybe-all-gcc:
 @if gcc
@@ -9526,45 +10736,221 @@
 	@test -f stage_last && exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gcc && $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
-	  $(TARGET-gcc))
+	(cd $(HOST_SUBDIR)/gcc && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) $(TARGET-gcc))
 @endif gcc
 
-.PHONY: check-gcc maybe-check-gcc
-maybe-check-gcc:
-@if gcc
-maybe-check-gcc: check-gcc
 
-check-gcc:
+
+.PHONY: all-stage1-gcc maybe-all-stage1-gcc
+.PHONY: clean-stage1-gcc maybe-clean-stage1-gcc
+maybe-all-stage1-gcc:
+maybe-clean-stage1-gcc:
+@if gcc-bootstrap
+maybe-all-stage1-gcc: all-stage1-gcc
+all-stage1: all-stage1-gcc
+all-stage1-gcc: configure-stage1-gcc
+	@$(MAKE) stage1-start
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gcc && $(MAKE) $(FLAGS_TO_PASS)$(EXTRA_GCC_FLAGS) check)
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS)
 
-@endif gcc
+maybe-clean-stage1-gcc: clean-stage1-gcc
+clean-stage1: clean-stage1-gcc
+clean-stage1-gcc:
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
 
-.PHONY: install-gcc maybe-install-gcc
-maybe-install-gcc:
-@if gcc
-maybe-install-gcc: install-gcc
 
-install-gcc: installdirs
+.PHONY: all-stage2-gcc maybe-all-stage2-gcc
+.PHONY: clean-stage2-gcc maybe-clean-stage2-gcc
+maybe-all-stage2-gcc:
+maybe-clean-stage2-gcc:
+@if gcc-bootstrap
+maybe-all-stage2-gcc: all-stage2-gcc
+all-stage2: all-stage2-gcc
+all-stage2-gcc: configure-stage2-gcc
+	@$(MAKE) stage2-start
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gcc && $(MAKE) $(FLAGS_TO_PASS)$(EXTRA_GCC_FLAGS) install)
-
-@endif gcc
-
-# Other targets (info, dvi, etc.)
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  $(EXTRA_GCC_FLAGS)
 
-.PHONY: maybe-info-gcc info-gcc
-maybe-info-gcc:
-@if gcc
+maybe-clean-stage2-gcc: clean-stage2-gcc
+clean-stage2: clean-stage2-gcc
+clean-stage2-gcc:
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
+
+
+.PHONY: all-stage3-gcc maybe-all-stage3-gcc
+.PHONY: clean-stage3-gcc maybe-clean-stage3-gcc
+maybe-all-stage3-gcc:
+maybe-clean-stage3-gcc:
+@if gcc-bootstrap
+maybe-all-stage3-gcc: all-stage3-gcc
+all-stage3: all-stage3-gcc
+all-stage3-gcc: configure-stage3-gcc
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  $(EXTRA_GCC_FLAGS)
+
+maybe-clean-stage3-gcc: clean-stage3-gcc
+clean-stage3: clean-stage3-gcc
+clean-stage3-gcc:
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
+
+
+.PHONY: all-stage4-gcc maybe-all-stage4-gcc
+.PHONY: clean-stage4-gcc maybe-clean-stage4-gcc
+maybe-all-stage4-gcc:
+maybe-clean-stage4-gcc:
+@if gcc-bootstrap
+maybe-all-stage4-gcc: all-stage4-gcc
+all-stage4: all-stage4-gcc
+all-stage4-gcc: configure-stage4-gcc
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  $(EXTRA_GCC_FLAGS)
+
+maybe-clean-stage4-gcc: clean-stage4-gcc
+clean-stage4: clean-stage4-gcc
+clean-stage4-gcc:
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
+
+
+.PHONY: all-stageprofile-gcc maybe-all-stageprofile-gcc
+.PHONY: clean-stageprofile-gcc maybe-clean-stageprofile-gcc
+maybe-all-stageprofile-gcc:
+maybe-clean-stageprofile-gcc:
+@if gcc-bootstrap
+maybe-all-stageprofile-gcc: all-stageprofile-gcc
+all-stageprofile: all-stageprofile-gcc
+all-stageprofile-gcc: configure-stageprofile-gcc
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS)
+
+maybe-clean-stageprofile-gcc: clean-stageprofile-gcc
+clean-stageprofile: clean-stageprofile-gcc
+clean-stageprofile-gcc:
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
+
+
+.PHONY: all-stagefeedback-gcc maybe-all-stagefeedback-gcc
+.PHONY: clean-stagefeedback-gcc maybe-clean-stagefeedback-gcc
+maybe-all-stagefeedback-gcc:
+maybe-clean-stagefeedback-gcc:
+@if gcc-bootstrap
+maybe-all-stagefeedback-gcc: all-stagefeedback-gcc
+all-stagefeedback: all-stagefeedback-gcc
+all-stagefeedback-gcc: configure-stagefeedback-gcc
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS)
+
+maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc
+clean-stagefeedback: clean-stagefeedback-gcc
+clean-stagefeedback-gcc:
+	@[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
+
+
+
+
+
+.PHONY: check-gcc maybe-check-gcc
+maybe-check-gcc:
+@if gcc
+maybe-check-gcc: check-gcc
+
+check-gcc:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gcc && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) check)
+
+@endif gcc
+
+.PHONY: install-gcc maybe-install-gcc
+maybe-install-gcc:
+@if gcc
+maybe-install-gcc: install-gcc
+
+install-gcc: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gcc && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) install)
+
+@endif gcc
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-gcc info-gcc
+maybe-info-gcc:
+@if gcc
 maybe-info-gcc: info-gcc
 
 info-gcc: \
@@ -9572,13 +10958,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9598,13 +10983,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9624,13 +11008,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9650,13 +11033,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9677,13 +11059,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9703,13 +11084,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9728,13 +11108,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9753,13 +11132,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9778,13 +11156,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9803,13 +11180,12 @@
 	@[ -f ./gcc/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) $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in gcc" ; \
-	(cd gcc && \
+	(cd $(HOST_SUBDIR)/gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9820,34 +11196,35 @@
 @endif gcc
 
 
+
 .PHONY: configure-gawk maybe-configure-gawk
 maybe-configure-gawk:
 @if gawk
 maybe-configure-gawk: configure-gawk
-configure-gawk:
-	@test ! -f gawk/Makefile || exit 0; \
-	[ -d gawk ] || mkdir gawk; \
+configure-gawk: 
+	@test ! -f $(HOST_SUBDIR)/gawk/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gawk ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gawk; \
-	cd gawk || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gawk"; \
-	    libsrcdir="$$s/gawk";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gawk"; \
-	    libsrcdir="$$s/gawk";; \
+	echo Configuring in $(HOST_SUBDIR)/gawk; \
+	cd "$(HOST_SUBDIR)/gawk" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gawk/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gawk"; \
+	libsrcdir="$$s/gawk"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gawk
 
+
+
+
+
 .PHONY: all-gawk maybe-all-gawk
 maybe-all-gawk:
 @if gawk
@@ -9856,12 +11233,14 @@
 all-gawk: configure-gawk
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gawk && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-gawk))
+	(cd $(HOST_SUBDIR)/gawk && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gawk))
 @endif gawk
 
+
+
+
 .PHONY: check-gawk maybe-check-gawk
 maybe-check-gawk:
 @if gawk
@@ -9870,9 +11249,9 @@
 check-gawk:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gawk && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/gawk && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif gawk
 
@@ -9884,9 +11263,9 @@
 install-gawk: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gawk && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/gawk && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif gawk
 
@@ -9902,13 +11281,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9928,13 +11306,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9954,13 +11331,12 @@
 	@[ -f ./gawk/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 html in gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -9980,13 +11356,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10007,13 +11382,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10033,13 +11407,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10058,13 +11431,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10083,13 +11455,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10108,13 +11479,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10133,13 +11503,12 @@
 	@[ -f ./gawk/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 gawk" ; \
-	(cd gawk && \
+	(cd $(HOST_SUBDIR)/gawk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10150,34 +11519,35 @@
 @endif gawk
 
 
+
 .PHONY: configure-gettext maybe-configure-gettext
 maybe-configure-gettext:
 @if gettext
 maybe-configure-gettext: configure-gettext
-configure-gettext:
-	@test ! -f gettext/Makefile || exit 0; \
-	[ -d gettext ] || mkdir gettext; \
+configure-gettext: 
+	@test ! -f $(HOST_SUBDIR)/gettext/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gettext ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gettext; \
-	cd gettext || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gettext"; \
-	    libsrcdir="$$s/gettext";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gettext"; \
-	    libsrcdir="$$s/gettext";; \
+	echo Configuring in $(HOST_SUBDIR)/gettext; \
+	cd "$(HOST_SUBDIR)/gettext" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gettext/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gettext"; \
+	libsrcdir="$$s/gettext"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gettext
 
+
+
+
+
 .PHONY: all-gettext maybe-all-gettext
 maybe-all-gettext:
 @if gettext
@@ -10186,12 +11556,14 @@
 all-gettext: configure-gettext
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gettext && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-gettext))
+	(cd $(HOST_SUBDIR)/gettext && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gettext))
 @endif gettext
 
+
+
+
 .PHONY: check-gettext maybe-check-gettext
 maybe-check-gettext:
 @if gettext
@@ -10200,9 +11572,9 @@
 check-gettext:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gettext && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/gettext && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif gettext
 
@@ -10214,9 +11586,9 @@
 install-gettext: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gettext && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/gettext && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif gettext
 
@@ -10232,13 +11604,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10258,13 +11629,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10284,13 +11654,12 @@
 	@[ -f ./gettext/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 html in gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10310,13 +11679,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10337,13 +11705,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10363,13 +11730,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10388,13 +11754,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10413,13 +11778,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10438,13 +11802,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10463,13 +11826,12 @@
 	@[ -f ./gettext/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 gettext" ; \
-	(cd gettext && \
+	(cd $(HOST_SUBDIR)/gettext && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10480,34 +11842,35 @@
 @endif gettext
 
 
+
 .PHONY: configure-gnuserv maybe-configure-gnuserv
 maybe-configure-gnuserv:
 @if gnuserv
 maybe-configure-gnuserv: configure-gnuserv
-configure-gnuserv:
-	@test ! -f gnuserv/Makefile || exit 0; \
-	[ -d gnuserv ] || mkdir gnuserv; \
+configure-gnuserv: 
+	@test ! -f $(HOST_SUBDIR)/gnuserv/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gnuserv ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gnuserv; \
-	cd gnuserv || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gnuserv"; \
-	    libsrcdir="$$s/gnuserv";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gnuserv"; \
-	    libsrcdir="$$s/gnuserv";; \
+	echo Configuring in $(HOST_SUBDIR)/gnuserv; \
+	cd "$(HOST_SUBDIR)/gnuserv" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gnuserv/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gnuserv"; \
+	libsrcdir="$$s/gnuserv"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gnuserv
 
+
+
+
+
 .PHONY: all-gnuserv maybe-all-gnuserv
 maybe-all-gnuserv:
 @if gnuserv
@@ -10516,12 +11879,14 @@
 all-gnuserv: configure-gnuserv
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-gnuserv))
+	(cd $(HOST_SUBDIR)/gnuserv && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gnuserv))
 @endif gnuserv
 
+
+
+
 .PHONY: check-gnuserv maybe-check-gnuserv
 maybe-check-gnuserv:
 @if gnuserv
@@ -10530,9 +11895,9 @@
 check-gnuserv:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/gnuserv && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif gnuserv
 
@@ -10544,9 +11909,9 @@
 install-gnuserv: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/gnuserv && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif gnuserv
 
@@ -10562,13 +11927,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10588,13 +11952,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10614,13 +11977,12 @@
 	@[ -f ./gnuserv/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 html in gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10640,13 +12002,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10667,13 +12028,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10693,13 +12053,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10718,13 +12077,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10743,13 +12101,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10768,13 +12125,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10793,13 +12149,12 @@
 	@[ -f ./gnuserv/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 gnuserv" ; \
-	(cd gnuserv && \
+	(cd $(HOST_SUBDIR)/gnuserv && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10810,34 +12165,35 @@
 @endif gnuserv
 
 
+
 .PHONY: configure-gprof maybe-configure-gprof
 maybe-configure-gprof:
 @if gprof
 maybe-configure-gprof: configure-gprof
-configure-gprof:
-	@test ! -f gprof/Makefile || exit 0; \
-	[ -d gprof ] || mkdir gprof; \
+configure-gprof: 
+	@test ! -f $(HOST_SUBDIR)/gprof/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gprof ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gprof; \
-	cd gprof || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gprof"; \
-	    libsrcdir="$$s/gprof";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gprof"; \
-	    libsrcdir="$$s/gprof";; \
+	echo Configuring in $(HOST_SUBDIR)/gprof; \
+	cd "$(HOST_SUBDIR)/gprof" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gprof/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gprof"; \
+	libsrcdir="$$s/gprof"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gprof
 
+
+
+
+
 .PHONY: all-gprof maybe-all-gprof
 maybe-all-gprof:
 @if gprof
@@ -10846,12 +12202,14 @@
 all-gprof: configure-gprof
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gprof && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-gprof))
+	(cd $(HOST_SUBDIR)/gprof && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gprof))
 @endif gprof
 
+
+
+
 .PHONY: check-gprof maybe-check-gprof
 maybe-check-gprof:
 @if gprof
@@ -10860,9 +12218,9 @@
 check-gprof:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gprof && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/gprof && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif gprof
 
@@ -10874,9 +12232,9 @@
 install-gprof: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gprof && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/gprof && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif gprof
 
@@ -10892,13 +12250,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10918,13 +12275,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10944,13 +12300,12 @@
 	@[ -f ./gprof/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 html in gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10970,13 +12325,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -10997,13 +12351,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11023,13 +12376,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11048,13 +12400,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11073,13 +12424,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11098,13 +12448,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11123,13 +12472,12 @@
 	@[ -f ./gprof/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 gprof" ; \
-	(cd gprof && \
+	(cd $(HOST_SUBDIR)/gprof && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11140,34 +12488,35 @@
 @endif gprof
 
 
+
 .PHONY: configure-gzip maybe-configure-gzip
 maybe-configure-gzip:
 @if gzip
 maybe-configure-gzip: configure-gzip
-configure-gzip:
-	@test ! -f gzip/Makefile || exit 0; \
-	[ -d gzip ] || mkdir gzip; \
+configure-gzip: 
+	@test ! -f $(HOST_SUBDIR)/gzip/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gzip ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gzip; \
-	cd gzip || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gzip"; \
-	    libsrcdir="$$s/gzip";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gzip"; \
-	    libsrcdir="$$s/gzip";; \
+	echo Configuring in $(HOST_SUBDIR)/gzip; \
+	cd "$(HOST_SUBDIR)/gzip" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gzip/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gzip"; \
+	libsrcdir="$$s/gzip"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gzip
 
+
+
+
+
 .PHONY: all-gzip maybe-all-gzip
 maybe-all-gzip:
 @if gzip
@@ -11176,12 +12525,14 @@
 all-gzip: configure-gzip
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gzip && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-gzip))
+	(cd $(HOST_SUBDIR)/gzip && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gzip))
 @endif gzip
 
+
+
+
 .PHONY: check-gzip maybe-check-gzip
 maybe-check-gzip:
 @if gzip
@@ -11190,9 +12541,9 @@
 check-gzip:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gzip && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/gzip && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif gzip
 
@@ -11204,9 +12555,9 @@
 install-gzip: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gzip && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/gzip && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif gzip
 
@@ -11222,13 +12573,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11248,13 +12598,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11274,13 +12623,12 @@
 	@[ -f ./gzip/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 html in gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11300,13 +12648,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11327,13 +12674,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11353,13 +12699,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11378,13 +12723,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11403,13 +12747,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11428,13 +12771,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11453,13 +12795,12 @@
 	@[ -f ./gzip/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 gzip" ; \
-	(cd gzip && \
+	(cd $(HOST_SUBDIR)/gzip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11470,34 +12811,35 @@
 @endif gzip
 
 
+
 .PHONY: configure-hello maybe-configure-hello
 maybe-configure-hello:
 @if hello
 maybe-configure-hello: configure-hello
-configure-hello:
-	@test ! -f hello/Makefile || exit 0; \
-	[ -d hello ] || mkdir hello; \
+configure-hello: 
+	@test ! -f $(HOST_SUBDIR)/hello/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/hello ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in hello; \
-	cd hello || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/hello"; \
-	    libsrcdir="$$s/hello";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/hello"; \
-	    libsrcdir="$$s/hello";; \
+	echo Configuring in $(HOST_SUBDIR)/hello; \
+	cd "$(HOST_SUBDIR)/hello" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/hello/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/hello"; \
+	libsrcdir="$$s/hello"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif hello
 
+
+
+
+
 .PHONY: all-hello maybe-all-hello
 maybe-all-hello:
 @if hello
@@ -11506,12 +12848,14 @@
 all-hello: configure-hello
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd hello && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-hello))
+	(cd $(HOST_SUBDIR)/hello && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-hello))
 @endif hello
 
+
+
+
 .PHONY: check-hello maybe-check-hello
 maybe-check-hello:
 @if hello
@@ -11520,9 +12864,9 @@
 check-hello:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd hello && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/hello && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif hello
 
@@ -11534,9 +12878,9 @@
 install-hello: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd hello && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/hello && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif hello
 
@@ -11552,13 +12896,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11578,13 +12921,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11604,13 +12946,12 @@
 	@[ -f ./hello/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 html in hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11630,13 +12971,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11657,13 +12997,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11683,13 +13022,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11708,13 +13046,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11733,13 +13070,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11758,13 +13094,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11783,13 +13118,12 @@
 	@[ -f ./hello/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 hello" ; \
-	(cd hello && \
+	(cd $(HOST_SUBDIR)/hello && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11800,34 +13134,35 @@
 @endif hello
 
 
+
 .PHONY: configure-indent maybe-configure-indent
 maybe-configure-indent:
 @if indent
 maybe-configure-indent: configure-indent
-configure-indent:
-	@test ! -f indent/Makefile || exit 0; \
-	[ -d indent ] || mkdir indent; \
+configure-indent: 
+	@test ! -f $(HOST_SUBDIR)/indent/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/indent ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in indent; \
-	cd indent || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/indent"; \
-	    libsrcdir="$$s/indent";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/indent"; \
-	    libsrcdir="$$s/indent";; \
+	echo Configuring in $(HOST_SUBDIR)/indent; \
+	cd "$(HOST_SUBDIR)/indent" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/indent/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/indent"; \
+	libsrcdir="$$s/indent"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif indent
 
+
+
+
+
 .PHONY: all-indent maybe-all-indent
 maybe-all-indent:
 @if indent
@@ -11836,12 +13171,14 @@
 all-indent: configure-indent
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd indent && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-indent))
+	(cd $(HOST_SUBDIR)/indent && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-indent))
 @endif indent
 
+
+
+
 .PHONY: check-indent maybe-check-indent
 maybe-check-indent:
 @if indent
@@ -11850,9 +13187,9 @@
 check-indent:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd indent && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/indent && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif indent
 
@@ -11864,9 +13201,9 @@
 install-indent: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd indent && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/indent && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif indent
 
@@ -11882,13 +13219,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11908,13 +13244,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11934,13 +13269,12 @@
 	@[ -f ./indent/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 html in indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11960,13 +13294,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -11987,13 +13320,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12013,13 +13345,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12038,13 +13369,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12063,13 +13393,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12088,13 +13417,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12113,13 +13441,12 @@
 	@[ -f ./indent/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 indent" ; \
-	(cd indent && \
+	(cd $(HOST_SUBDIR)/indent && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12130,97 +13457,424 @@
 @endif indent
 
 
+
 .PHONY: configure-intl maybe-configure-intl
 maybe-configure-intl:
 @if intl
 maybe-configure-intl: configure-intl
-configure-intl:
+configure-intl: 
 	@test -f stage_last && exit 0; \
-	test ! -f intl/Makefile || exit 0; \
-	[ -d intl ] || mkdir intl; \
+	test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in intl; \
-	cd intl || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/intl; \
+	cd "$(HOST_SUBDIR)/intl" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif intl
 
-.PHONY: all-intl maybe-all-intl
-maybe-all-intl:
-@if intl
-TARGET-intl=all
-maybe-all-intl: all-intl
-all-intl: configure-intl
-	@test -f stage_last && exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
-	$(HOST_EXPORTS) \
-	(cd intl && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-intl))
-@endif intl
 
-.PHONY: check-intl maybe-check-intl
-maybe-check-intl:
-@if intl
-maybe-check-intl: check-intl
 
-check-intl:
-	@r=`${PWD_COMMAND}`; export r; \
+.PHONY: configure-stage1-intl maybe-configure-stage1-intl
+maybe-configure-stage1-intl:
+@if intl-bootstrap
+maybe-configure-stage1-intl: configure-stage1-intl
+configure-stage1-intl: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd intl && $(MAKE) $(FLAGS_TO_PASS) check)
-
-@endif intl
-
-.PHONY: install-intl maybe-install-intl
-maybe-install-intl:
-@if intl
-maybe-install-intl: install-intl
+	echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif intl-bootstrap
 
-install-intl: installdirs
-	@r=`${PWD_COMMAND}`; export r; \
+.PHONY: configure-stage2-intl maybe-configure-stage2-intl
+maybe-configure-stage2-intl:
+@if intl-bootstrap
+maybe-configure-stage2-intl: configure-stage2-intl
+configure-stage2-intl: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd intl && $(MAKE) $(FLAGS_TO_PASS) install)
-
-@endif intl
-
-# Other targets (info, dvi, etc.)
-
-.PHONY: maybe-info-intl info-intl
-maybe-info-intl:
-@if intl
-maybe-info-intl: info-intl
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif intl-bootstrap
 
-info-intl: \
-    configure-intl 
-	@[ -f ./intl/Makefile ] || exit 0; \
+.PHONY: configure-stage3-intl maybe-configure-stage3-intl
+maybe-configure-stage3-intl:
+@if intl-bootstrap
+maybe-configure-stage3-intl: configure-stage3-intl
+configure-stage3-intl: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif intl-bootstrap
+
+.PHONY: configure-stage4-intl maybe-configure-stage4-intl
+maybe-configure-stage4-intl:
+@if intl-bootstrap
+maybe-configure-stage4-intl: configure-stage4-intl
+configure-stage4-intl: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif intl-bootstrap
+
+.PHONY: configure-stageprofile-intl maybe-configure-stageprofile-intl
+maybe-configure-stageprofile-intl:
+@if intl-bootstrap
+maybe-configure-stageprofile-intl: configure-stageprofile-intl
+configure-stageprofile-intl: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif intl-bootstrap
+
+.PHONY: configure-stagefeedback-intl maybe-configure-stagefeedback-intl
+maybe-configure-stagefeedback-intl:
+@if intl-bootstrap
+maybe-configure-stagefeedback-intl: configure-stagefeedback-intl
+configure-stagefeedback-intl: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/intl"; \
+	libsrcdir="$$s/intl"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif intl-bootstrap
+
+
+
+
+
+.PHONY: all-intl maybe-all-intl
+maybe-all-intl:
+@if intl
+TARGET-intl=all
+maybe-all-intl: all-intl
+all-intl: configure-intl
+	@test -f stage_last && exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/intl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-intl))
+@endif intl
+
+
+
+.PHONY: all-stage1-intl maybe-all-stage1-intl
+.PHONY: clean-stage1-intl maybe-clean-stage1-intl
+maybe-all-stage1-intl:
+maybe-clean-stage1-intl:
+@if intl-bootstrap
+maybe-all-stage1-intl: all-stage1-intl
+all-stage1: all-stage1-intl
+all-stage1-intl: configure-stage1-intl
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-intl: clean-stage1-intl
+clean-stage1: clean-stage1-intl
+clean-stage1-intl:
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif intl-bootstrap
+
+
+.PHONY: all-stage2-intl maybe-all-stage2-intl
+.PHONY: clean-stage2-intl maybe-clean-stage2-intl
+maybe-all-stage2-intl:
+maybe-clean-stage2-intl:
+@if intl-bootstrap
+maybe-all-stage2-intl: all-stage2-intl
+all-stage2: all-stage2-intl
+all-stage2-intl: configure-stage2-intl
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-intl: clean-stage2-intl
+clean-stage2: clean-stage2-intl
+clean-stage2-intl:
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif intl-bootstrap
+
+
+.PHONY: all-stage3-intl maybe-all-stage3-intl
+.PHONY: clean-stage3-intl maybe-clean-stage3-intl
+maybe-all-stage3-intl:
+maybe-clean-stage3-intl:
+@if intl-bootstrap
+maybe-all-stage3-intl: all-stage3-intl
+all-stage3: all-stage3-intl
+all-stage3-intl: configure-stage3-intl
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-intl: clean-stage3-intl
+clean-stage3: clean-stage3-intl
+clean-stage3-intl:
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif intl-bootstrap
+
+
+.PHONY: all-stage4-intl maybe-all-stage4-intl
+.PHONY: clean-stage4-intl maybe-clean-stage4-intl
+maybe-all-stage4-intl:
+maybe-clean-stage4-intl:
+@if intl-bootstrap
+maybe-all-stage4-intl: all-stage4-intl
+all-stage4: all-stage4-intl
+all-stage4-intl: configure-stage4-intl
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-intl: clean-stage4-intl
+clean-stage4: clean-stage4-intl
+clean-stage4-intl:
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif intl-bootstrap
+
+
+.PHONY: all-stageprofile-intl maybe-all-stageprofile-intl
+.PHONY: clean-stageprofile-intl maybe-clean-stageprofile-intl
+maybe-all-stageprofile-intl:
+maybe-clean-stageprofile-intl:
+@if intl-bootstrap
+maybe-all-stageprofile-intl: all-stageprofile-intl
+all-stageprofile: all-stageprofile-intl
+all-stageprofile-intl: configure-stageprofile-intl
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-intl: clean-stageprofile-intl
+clean-stageprofile: clean-stageprofile-intl
+clean-stageprofile-intl:
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif intl-bootstrap
+
+
+.PHONY: all-stagefeedback-intl maybe-all-stagefeedback-intl
+.PHONY: clean-stagefeedback-intl maybe-clean-stagefeedback-intl
+maybe-all-stagefeedback-intl:
+maybe-clean-stagefeedback-intl:
+@if intl-bootstrap
+maybe-all-stagefeedback-intl: all-stagefeedback-intl
+all-stagefeedback: all-stagefeedback-intl
+all-stagefeedback-intl: configure-stagefeedback-intl
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-intl: clean-stagefeedback-intl
+clean-stagefeedback: clean-stagefeedback-intl
+clean-stagefeedback-intl:
+	@[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif intl-bootstrap
+
+
+
+
+
+.PHONY: check-intl maybe-check-intl
+maybe-check-intl:
+@if intl
+maybe-check-intl: check-intl
+
+check-intl:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/intl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif intl
+
+.PHONY: install-intl maybe-install-intl
+maybe-install-intl:
+@if intl
+maybe-install-intl: install-intl
+
+install-intl: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/intl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
+
+@endif intl
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-intl info-intl
+maybe-info-intl:
+@if intl
+maybe-info-intl: info-intl
+
+info-intl: \
+    configure-intl 
+	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12240,13 +13894,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12266,13 +13919,12 @@
 	@[ -f ./intl/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 html in intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12292,13 +13944,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12319,13 +13970,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12345,13 +13995,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12370,13 +14019,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12395,13 +14043,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12420,13 +14067,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12445,13 +14091,12 @@
 	@[ -f ./intl/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 intl" ; \
-	(cd intl && \
+	(cd $(HOST_SUBDIR)/intl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12462,34 +14107,35 @@
 @endif intl
 
 
+
 .PHONY: configure-tcl maybe-configure-tcl
 maybe-configure-tcl:
 @if tcl
 maybe-configure-tcl: configure-tcl
-configure-tcl:
-	@test ! -f tcl/Makefile || exit 0; \
-	[ -d tcl ] || mkdir tcl; \
+configure-tcl: 
+	@test ! -f $(HOST_SUBDIR)/tcl/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tcl ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in tcl; \
-	cd tcl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/tcl"; \
-	    libsrcdir="$$s/tcl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/tcl"; \
-	    libsrcdir="$$s/tcl";; \
+	echo Configuring in $(HOST_SUBDIR)/tcl; \
+	cd "$(HOST_SUBDIR)/tcl" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/tcl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/tcl"; \
+	libsrcdir="$$s/tcl"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif tcl
 
+
+
+
+
 .PHONY: all-tcl maybe-all-tcl
 maybe-all-tcl:
 @if tcl
@@ -12498,12 +14144,14 @@
 all-tcl: configure-tcl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tcl && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-tcl))
+	(cd $(HOST_SUBDIR)/tcl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-tcl))
 @endif tcl
 
+
+
+
 .PHONY: check-tcl maybe-check-tcl
 maybe-check-tcl:
 @if tcl
@@ -12512,9 +14160,9 @@
 check-tcl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tcl && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/tcl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif tcl
 
@@ -12526,9 +14174,9 @@
 install-tcl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tcl && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/tcl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif tcl
 
@@ -12544,13 +14192,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12570,13 +14217,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12596,13 +14242,12 @@
 	@[ -f ./tcl/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 html in tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12622,13 +14267,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12649,13 +14293,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12675,13 +14318,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12710,13 +14352,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12735,13 +14376,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12760,13 +14400,12 @@
 	@[ -f ./tcl/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 tcl" ; \
-	(cd tcl && \
+	(cd $(HOST_SUBDIR)/tcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12777,34 +14416,35 @@
 @endif tcl
 
 
+
 .PHONY: configure-itcl maybe-configure-itcl
 maybe-configure-itcl:
 @if itcl
 maybe-configure-itcl: configure-itcl
-configure-itcl:
-	@test ! -f itcl/Makefile || exit 0; \
-	[ -d itcl ] || mkdir itcl; \
+configure-itcl: 
+	@test ! -f $(HOST_SUBDIR)/itcl/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/itcl ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in itcl; \
-	cd itcl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/itcl"; \
-	    libsrcdir="$$s/itcl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/itcl"; \
-	    libsrcdir="$$s/itcl";; \
+	echo Configuring in $(HOST_SUBDIR)/itcl; \
+	cd "$(HOST_SUBDIR)/itcl" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/itcl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/itcl"; \
+	libsrcdir="$$s/itcl"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif itcl
 
+
+
+
+
 .PHONY: all-itcl maybe-all-itcl
 maybe-all-itcl:
 @if itcl
@@ -12813,12 +14453,14 @@
 all-itcl: configure-itcl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd itcl && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-itcl))
+	(cd $(HOST_SUBDIR)/itcl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-itcl))
 @endif itcl
 
+
+
+
 .PHONY: check-itcl maybe-check-itcl
 maybe-check-itcl:
 @if itcl
@@ -12827,9 +14469,9 @@
 check-itcl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd itcl && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/itcl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif itcl
 
@@ -12841,9 +14483,9 @@
 install-itcl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd itcl && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/itcl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif itcl
 
@@ -12859,13 +14501,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12885,13 +14526,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12911,13 +14551,12 @@
 	@[ -f ./itcl/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 html in itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12937,13 +14576,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12964,13 +14602,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -12990,13 +14627,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13015,13 +14651,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13040,13 +14675,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13065,13 +14699,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13090,13 +14723,12 @@
 	@[ -f ./itcl/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 itcl" ; \
-	(cd itcl && \
+	(cd $(HOST_SUBDIR)/itcl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13107,37 +14739,189 @@
 @endif itcl
 
 
+
 .PHONY: configure-ld maybe-configure-ld
 maybe-configure-ld:
 @if ld
 maybe-configure-ld: configure-ld
-configure-ld:
+configure-ld: 
 	@test -f stage_last && exit 0; \
-	test ! -f ld/Makefile || exit 0; \
-	[ -d ld ] || mkdir ld; \
+	test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in ld; \
-	cd ld || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/ld; \
+	cd "$(HOST_SUBDIR)/ld" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif ld
 
-.PHONY: all-ld maybe-all-ld
-maybe-all-ld:
+
+
+.PHONY: configure-stage1-ld maybe-configure-stage1-ld
+maybe-configure-stage1-ld:
+@if ld-bootstrap
+maybe-configure-stage1-ld: configure-stage1-ld
+configure-stage1-ld: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif ld-bootstrap
+
+.PHONY: configure-stage2-ld maybe-configure-stage2-ld
+maybe-configure-stage2-ld:
+@if ld-bootstrap
+maybe-configure-stage2-ld: configure-stage2-ld
+configure-stage2-ld: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif ld-bootstrap
+
+.PHONY: configure-stage3-ld maybe-configure-stage3-ld
+maybe-configure-stage3-ld:
+@if ld-bootstrap
+maybe-configure-stage3-ld: configure-stage3-ld
+configure-stage3-ld: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif ld-bootstrap
+
+.PHONY: configure-stage4-ld maybe-configure-stage4-ld
+maybe-configure-stage4-ld:
+@if ld-bootstrap
+maybe-configure-stage4-ld: configure-stage4-ld
+configure-stage4-ld: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif ld-bootstrap
+
+.PHONY: configure-stageprofile-ld maybe-configure-stageprofile-ld
+maybe-configure-stageprofile-ld:
+@if ld-bootstrap
+maybe-configure-stageprofile-ld: configure-stageprofile-ld
+configure-stageprofile-ld: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif ld-bootstrap
+
+.PHONY: configure-stagefeedback-ld maybe-configure-stagefeedback-ld
+maybe-configure-stagefeedback-ld:
+@if ld-bootstrap
+maybe-configure-stagefeedback-ld: configure-stagefeedback-ld
+configure-stagefeedback-ld: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/ld"; \
+	libsrcdir="$$s/ld"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif ld-bootstrap
+
+
+
+
+
+.PHONY: all-ld maybe-all-ld
+maybe-all-ld:
 @if ld
 TARGET-ld=all
 maybe-all-ld: all-ld
@@ -13145,12 +14929,188 @@
 	@test -f stage_last && exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd ld && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-ld))
+	(cd $(HOST_SUBDIR)/ld && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-ld))
 @endif ld
 
+
+
+.PHONY: all-stage1-ld maybe-all-stage1-ld
+.PHONY: clean-stage1-ld maybe-clean-stage1-ld
+maybe-all-stage1-ld:
+maybe-clean-stage1-ld:
+@if ld-bootstrap
+maybe-all-stage1-ld: all-stage1-ld
+all-stage1: all-stage1-ld
+all-stage1-ld: configure-stage1-ld
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-ld: clean-stage1-ld
+clean-stage1: clean-stage1-ld
+clean-stage1-ld:
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif ld-bootstrap
+
+
+.PHONY: all-stage2-ld maybe-all-stage2-ld
+.PHONY: clean-stage2-ld maybe-clean-stage2-ld
+maybe-all-stage2-ld:
+maybe-clean-stage2-ld:
+@if ld-bootstrap
+maybe-all-stage2-ld: all-stage2-ld
+all-stage2: all-stage2-ld
+all-stage2-ld: configure-stage2-ld
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-ld: clean-stage2-ld
+clean-stage2: clean-stage2-ld
+clean-stage2-ld:
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif ld-bootstrap
+
+
+.PHONY: all-stage3-ld maybe-all-stage3-ld
+.PHONY: clean-stage3-ld maybe-clean-stage3-ld
+maybe-all-stage3-ld:
+maybe-clean-stage3-ld:
+@if ld-bootstrap
+maybe-all-stage3-ld: all-stage3-ld
+all-stage3: all-stage3-ld
+all-stage3-ld: configure-stage3-ld
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-ld: clean-stage3-ld
+clean-stage3: clean-stage3-ld
+clean-stage3-ld:
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif ld-bootstrap
+
+
+.PHONY: all-stage4-ld maybe-all-stage4-ld
+.PHONY: clean-stage4-ld maybe-clean-stage4-ld
+maybe-all-stage4-ld:
+maybe-clean-stage4-ld:
+@if ld-bootstrap
+maybe-all-stage4-ld: all-stage4-ld
+all-stage4: all-stage4-ld
+all-stage4-ld: configure-stage4-ld
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-ld: clean-stage4-ld
+clean-stage4: clean-stage4-ld
+clean-stage4-ld:
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif ld-bootstrap
+
+
+.PHONY: all-stageprofile-ld maybe-all-stageprofile-ld
+.PHONY: clean-stageprofile-ld maybe-clean-stageprofile-ld
+maybe-all-stageprofile-ld:
+maybe-clean-stageprofile-ld:
+@if ld-bootstrap
+maybe-all-stageprofile-ld: all-stageprofile-ld
+all-stageprofile: all-stageprofile-ld
+all-stageprofile-ld: configure-stageprofile-ld
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-ld: clean-stageprofile-ld
+clean-stageprofile: clean-stageprofile-ld
+clean-stageprofile-ld:
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif ld-bootstrap
+
+
+.PHONY: all-stagefeedback-ld maybe-all-stagefeedback-ld
+.PHONY: clean-stagefeedback-ld maybe-clean-stagefeedback-ld
+maybe-all-stagefeedback-ld:
+maybe-clean-stagefeedback-ld:
+@if ld-bootstrap
+maybe-all-stagefeedback-ld: all-stagefeedback-ld
+all-stagefeedback: all-stagefeedback-ld
+all-stagefeedback-ld: configure-stagefeedback-ld
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-ld: clean-stagefeedback-ld
+clean-stagefeedback: clean-stagefeedback-ld
+clean-stagefeedback-ld:
+	@[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif ld-bootstrap
+
+
+
+
+
 .PHONY: check-ld maybe-check-ld
 maybe-check-ld:
 @if ld
@@ -13159,9 +15119,9 @@
 check-ld:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd ld && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/ld && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif ld
 
@@ -13173,9 +15133,9 @@
 install-ld: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd ld && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/ld && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif ld
 
@@ -13191,13 +15151,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13217,13 +15176,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13243,13 +15201,12 @@
 	@[ -f ./ld/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 html in ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13269,13 +15226,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13296,13 +15252,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13322,13 +15277,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13347,13 +15301,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13372,13 +15325,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13397,13 +15349,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13422,13 +15373,12 @@
 	@[ -f ./ld/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 ld" ; \
-	(cd ld && \
+	(cd $(HOST_SUBDIR)/ld && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13439,65 +15389,393 @@
 @endif ld
 
 
+
 .PHONY: configure-libcpp maybe-configure-libcpp
 maybe-configure-libcpp:
 @if libcpp
 maybe-configure-libcpp: configure-libcpp
-configure-libcpp:
+configure-libcpp: 
 	@test -f stage_last && exit 0; \
-	test ! -f libcpp/Makefile || exit 0; \
-	[ -d libcpp ] || mkdir libcpp; \
+	test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in libcpp; \
-	cd libcpp || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/libcpp; \
+	cd "$(HOST_SUBDIR)/libcpp" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif libcpp
 
-.PHONY: all-libcpp maybe-all-libcpp
-maybe-all-libcpp:
-@if libcpp
-TARGET-libcpp=all
-maybe-all-libcpp: all-libcpp
-all-libcpp: configure-libcpp
-	@test -f stage_last && exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
-	$(HOST_EXPORTS) \
-	(cd libcpp && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-libcpp))
-@endif libcpp
 
-.PHONY: check-libcpp maybe-check-libcpp
-maybe-check-libcpp:
-@if libcpp
-maybe-check-libcpp: check-libcpp
 
-check-libcpp:
-	@r=`${PWD_COMMAND}`; export r; \
+.PHONY: configure-stage1-libcpp maybe-configure-stage1-libcpp
+maybe-configure-stage1-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stage1-libcpp: configure-stage1-libcpp
+configure-stage1-libcpp: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libcpp && $(MAKE) $(FLAGS_TO_PASS) check)
-
-@endif libcpp
-
-.PHONY: install-libcpp maybe-install-libcpp
+	echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif libcpp-bootstrap
+
+.PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp
+maybe-configure-stage2-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stage2-libcpp: configure-stage2-libcpp
+configure-stage2-libcpp: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libcpp-bootstrap
+
+.PHONY: configure-stage3-libcpp maybe-configure-stage3-libcpp
+maybe-configure-stage3-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stage3-libcpp: configure-stage3-libcpp
+configure-stage3-libcpp: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libcpp-bootstrap
+
+.PHONY: configure-stage4-libcpp maybe-configure-stage4-libcpp
+maybe-configure-stage4-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stage4-libcpp: configure-stage4-libcpp
+configure-stage4-libcpp: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libcpp-bootstrap
+
+.PHONY: configure-stageprofile-libcpp maybe-configure-stageprofile-libcpp
+maybe-configure-stageprofile-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stageprofile-libcpp: configure-stageprofile-libcpp
+configure-stageprofile-libcpp: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libcpp-bootstrap
+
+.PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp
+maybe-configure-stagefeedback-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stagefeedback-libcpp: configure-stagefeedback-libcpp
+configure-stagefeedback-libcpp: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libcpp"; \
+	libsrcdir="$$s/libcpp"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libcpp-bootstrap
+
+
+
+
+
+.PHONY: all-libcpp maybe-all-libcpp
+maybe-all-libcpp:
+@if libcpp
+TARGET-libcpp=all
+maybe-all-libcpp: all-libcpp
+all-libcpp: configure-libcpp
+	@test -f stage_last && exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/libcpp && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-libcpp))
+@endif libcpp
+
+
+
+.PHONY: all-stage1-libcpp maybe-all-stage1-libcpp
+.PHONY: clean-stage1-libcpp maybe-clean-stage1-libcpp
+maybe-all-stage1-libcpp:
+maybe-clean-stage1-libcpp:
+@if libcpp-bootstrap
+maybe-all-stage1-libcpp: all-stage1-libcpp
+all-stage1: all-stage1-libcpp
+all-stage1-libcpp: configure-stage1-libcpp
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-libcpp: clean-stage1-libcpp
+clean-stage1: clean-stage1-libcpp
+clean-stage1-libcpp:
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif libcpp-bootstrap
+
+
+.PHONY: all-stage2-libcpp maybe-all-stage2-libcpp
+.PHONY: clean-stage2-libcpp maybe-clean-stage2-libcpp
+maybe-all-stage2-libcpp:
+maybe-clean-stage2-libcpp:
+@if libcpp-bootstrap
+maybe-all-stage2-libcpp: all-stage2-libcpp
+all-stage2: all-stage2-libcpp
+all-stage2-libcpp: configure-stage2-libcpp
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-libcpp: clean-stage2-libcpp
+clean-stage2: clean-stage2-libcpp
+clean-stage2-libcpp:
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif libcpp-bootstrap
+
+
+.PHONY: all-stage3-libcpp maybe-all-stage3-libcpp
+.PHONY: clean-stage3-libcpp maybe-clean-stage3-libcpp
+maybe-all-stage3-libcpp:
+maybe-clean-stage3-libcpp:
+@if libcpp-bootstrap
+maybe-all-stage3-libcpp: all-stage3-libcpp
+all-stage3: all-stage3-libcpp
+all-stage3-libcpp: configure-stage3-libcpp
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-libcpp: clean-stage3-libcpp
+clean-stage3: clean-stage3-libcpp
+clean-stage3-libcpp:
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif libcpp-bootstrap
+
+
+.PHONY: all-stage4-libcpp maybe-all-stage4-libcpp
+.PHONY: clean-stage4-libcpp maybe-clean-stage4-libcpp
+maybe-all-stage4-libcpp:
+maybe-clean-stage4-libcpp:
+@if libcpp-bootstrap
+maybe-all-stage4-libcpp: all-stage4-libcpp
+all-stage4: all-stage4-libcpp
+all-stage4-libcpp: configure-stage4-libcpp
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-libcpp: clean-stage4-libcpp
+clean-stage4: clean-stage4-libcpp
+clean-stage4-libcpp:
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif libcpp-bootstrap
+
+
+.PHONY: all-stageprofile-libcpp maybe-all-stageprofile-libcpp
+.PHONY: clean-stageprofile-libcpp maybe-clean-stageprofile-libcpp
+maybe-all-stageprofile-libcpp:
+maybe-clean-stageprofile-libcpp:
+@if libcpp-bootstrap
+maybe-all-stageprofile-libcpp: all-stageprofile-libcpp
+all-stageprofile: all-stageprofile-libcpp
+all-stageprofile-libcpp: configure-stageprofile-libcpp
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp
+clean-stageprofile: clean-stageprofile-libcpp
+clean-stageprofile-libcpp:
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif libcpp-bootstrap
+
+
+.PHONY: all-stagefeedback-libcpp maybe-all-stagefeedback-libcpp
+.PHONY: clean-stagefeedback-libcpp maybe-clean-stagefeedback-libcpp
+maybe-all-stagefeedback-libcpp:
+maybe-clean-stagefeedback-libcpp:
+@if libcpp-bootstrap
+maybe-all-stagefeedback-libcpp: all-stagefeedback-libcpp
+all-stagefeedback: all-stagefeedback-libcpp
+all-stagefeedback-libcpp: configure-stagefeedback-libcpp
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp
+clean-stagefeedback: clean-stagefeedback-libcpp
+clean-stagefeedback-libcpp:
+	@[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif libcpp-bootstrap
+
+
+
+
+
+.PHONY: check-libcpp maybe-check-libcpp
+maybe-check-libcpp:
+@if libcpp
+maybe-check-libcpp: check-libcpp
+
+check-libcpp:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/libcpp && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif libcpp
+
+.PHONY: install-libcpp maybe-install-libcpp
 maybe-install-libcpp:
 @if libcpp
 maybe-install-libcpp: install-libcpp
@@ -13505,9 +15783,9 @@
 install-libcpp: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libcpp && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/libcpp && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif libcpp
 
@@ -13523,13 +15801,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13549,13 +15826,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13575,13 +15851,12 @@
 	@[ -f ./libcpp/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 html in libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13601,13 +15876,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13628,13 +15902,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13654,13 +15927,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13679,13 +15951,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13704,13 +15975,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13729,13 +15999,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13754,13 +16023,12 @@
 	@[ -f ./libcpp/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 libcpp" ; \
-	(cd libcpp && \
+	(cd $(HOST_SUBDIR)/libcpp && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13771,34 +16039,35 @@
 @endif libcpp
 
 
+
 .PHONY: configure-libgui maybe-configure-libgui
 maybe-configure-libgui:
 @if libgui
 maybe-configure-libgui: configure-libgui
-configure-libgui:
-	@test ! -f libgui/Makefile || exit 0; \
-	[ -d libgui ] || mkdir libgui; \
+configure-libgui: 
+	@test ! -f $(HOST_SUBDIR)/libgui/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libgui ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in libgui; \
-	cd libgui || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libgui"; \
-	    libsrcdir="$$s/libgui";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libgui"; \
-	    libsrcdir="$$s/libgui";; \
+	echo Configuring in $(HOST_SUBDIR)/libgui; \
+	cd "$(HOST_SUBDIR)/libgui" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libgui/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/libgui"; \
+	libsrcdir="$$s/libgui"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif libgui
 
+
+
+
+
 .PHONY: all-libgui maybe-all-libgui
 maybe-all-libgui:
 @if libgui
@@ -13807,12 +16076,14 @@
 all-libgui: configure-libgui
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libgui && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-libgui))
+	(cd $(HOST_SUBDIR)/libgui && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-libgui))
 @endif libgui
 
+
+
+
 .PHONY: check-libgui maybe-check-libgui
 maybe-check-libgui:
 @if libgui
@@ -13821,9 +16092,9 @@
 check-libgui:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libgui && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/libgui && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif libgui
 
@@ -13835,9 +16106,9 @@
 install-libgui: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libgui && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/libgui && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif libgui
 
@@ -13853,13 +16124,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13879,13 +16149,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13905,13 +16174,12 @@
 	@[ -f ./libgui/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 html in libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13931,13 +16199,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13958,13 +16225,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -13984,13 +16250,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14009,13 +16274,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14034,13 +16298,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14059,13 +16322,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14084,13 +16346,12 @@
 	@[ -f ./libgui/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 libgui" ; \
-	(cd libgui && \
+	(cd $(HOST_SUBDIR)/libgui && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14101,50 +16362,378 @@
 @endif libgui
 
 
+
 .PHONY: configure-libiberty maybe-configure-libiberty
 maybe-configure-libiberty:
 @if libiberty
 maybe-configure-libiberty: configure-libiberty
-configure-libiberty:
+configure-libiberty: 
 	@test -f stage_last && exit 0; \
-	test ! -f libiberty/Makefile || exit 0; \
-	[ -d libiberty ] || mkdir libiberty; \
+	test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in libiberty; \
-	cd libiberty || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/libiberty; \
+	cd "$(HOST_SUBDIR)/libiberty" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif libiberty
 
-.PHONY: all-libiberty maybe-all-libiberty
-maybe-all-libiberty:
-@if libiberty
-TARGET-libiberty=all
-maybe-all-libiberty: all-libiberty
+
+
+.PHONY: configure-stage1-libiberty maybe-configure-stage1-libiberty
+maybe-configure-stage1-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stage1-libiberty: configure-stage1-libiberty
+configure-stage1-libiberty: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif libiberty-bootstrap
+
+.PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty
+maybe-configure-stage2-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stage2-libiberty: configure-stage2-libiberty
+configure-stage2-libiberty: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libiberty-bootstrap
+
+.PHONY: configure-stage3-libiberty maybe-configure-stage3-libiberty
+maybe-configure-stage3-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stage3-libiberty: configure-stage3-libiberty
+configure-stage3-libiberty: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libiberty-bootstrap
+
+.PHONY: configure-stage4-libiberty maybe-configure-stage4-libiberty
+maybe-configure-stage4-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stage4-libiberty: configure-stage4-libiberty
+configure-stage4-libiberty: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libiberty-bootstrap
+
+.PHONY: configure-stageprofile-libiberty maybe-configure-stageprofile-libiberty
+maybe-configure-stageprofile-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stageprofile-libiberty: configure-stageprofile-libiberty
+configure-stageprofile-libiberty: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libiberty-bootstrap
+
+.PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty
+maybe-configure-stagefeedback-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stagefeedback-libiberty: configure-stagefeedback-libiberty
+configure-stagefeedback-libiberty: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif libiberty-bootstrap
+
+
+
+
+
+.PHONY: all-libiberty maybe-all-libiberty
+maybe-all-libiberty:
+@if libiberty
+TARGET-libiberty=all
+maybe-all-libiberty: all-libiberty
 all-libiberty: configure-libiberty
 	@test -f stage_last && exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-libiberty))
+	(cd $(HOST_SUBDIR)/libiberty && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-libiberty))
 @endif libiberty
 
+
+
+.PHONY: all-stage1-libiberty maybe-all-stage1-libiberty
+.PHONY: clean-stage1-libiberty maybe-clean-stage1-libiberty
+maybe-all-stage1-libiberty:
+maybe-clean-stage1-libiberty:
+@if libiberty-bootstrap
+maybe-all-stage1-libiberty: all-stage1-libiberty
+all-stage1: all-stage1-libiberty
+all-stage1-libiberty: configure-stage1-libiberty
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-libiberty: clean-stage1-libiberty
+clean-stage1: clean-stage1-libiberty
+clean-stage1-libiberty:
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif libiberty-bootstrap
+
+
+.PHONY: all-stage2-libiberty maybe-all-stage2-libiberty
+.PHONY: clean-stage2-libiberty maybe-clean-stage2-libiberty
+maybe-all-stage2-libiberty:
+maybe-clean-stage2-libiberty:
+@if libiberty-bootstrap
+maybe-all-stage2-libiberty: all-stage2-libiberty
+all-stage2: all-stage2-libiberty
+all-stage2-libiberty: configure-stage2-libiberty
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-libiberty: clean-stage2-libiberty
+clean-stage2: clean-stage2-libiberty
+clean-stage2-libiberty:
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif libiberty-bootstrap
+
+
+.PHONY: all-stage3-libiberty maybe-all-stage3-libiberty
+.PHONY: clean-stage3-libiberty maybe-clean-stage3-libiberty
+maybe-all-stage3-libiberty:
+maybe-clean-stage3-libiberty:
+@if libiberty-bootstrap
+maybe-all-stage3-libiberty: all-stage3-libiberty
+all-stage3: all-stage3-libiberty
+all-stage3-libiberty: configure-stage3-libiberty
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-libiberty: clean-stage3-libiberty
+clean-stage3: clean-stage3-libiberty
+clean-stage3-libiberty:
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif libiberty-bootstrap
+
+
+.PHONY: all-stage4-libiberty maybe-all-stage4-libiberty
+.PHONY: clean-stage4-libiberty maybe-clean-stage4-libiberty
+maybe-all-stage4-libiberty:
+maybe-clean-stage4-libiberty:
+@if libiberty-bootstrap
+maybe-all-stage4-libiberty: all-stage4-libiberty
+all-stage4: all-stage4-libiberty
+all-stage4-libiberty: configure-stage4-libiberty
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-libiberty: clean-stage4-libiberty
+clean-stage4: clean-stage4-libiberty
+clean-stage4-libiberty:
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif libiberty-bootstrap
+
+
+.PHONY: all-stageprofile-libiberty maybe-all-stageprofile-libiberty
+.PHONY: clean-stageprofile-libiberty maybe-clean-stageprofile-libiberty
+maybe-all-stageprofile-libiberty:
+maybe-clean-stageprofile-libiberty:
+@if libiberty-bootstrap
+maybe-all-stageprofile-libiberty: all-stageprofile-libiberty
+all-stageprofile: all-stageprofile-libiberty
+all-stageprofile-libiberty: configure-stageprofile-libiberty
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty
+clean-stageprofile: clean-stageprofile-libiberty
+clean-stageprofile-libiberty:
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif libiberty-bootstrap
+
+
+.PHONY: all-stagefeedback-libiberty maybe-all-stagefeedback-libiberty
+.PHONY: clean-stagefeedback-libiberty maybe-clean-stagefeedback-libiberty
+maybe-all-stagefeedback-libiberty:
+maybe-clean-stagefeedback-libiberty:
+@if libiberty-bootstrap
+maybe-all-stagefeedback-libiberty: all-stagefeedback-libiberty
+all-stagefeedback: all-stagefeedback-libiberty
+all-stagefeedback-libiberty: configure-stagefeedback-libiberty
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty
+clean-stagefeedback: clean-stagefeedback-libiberty
+clean-stagefeedback-libiberty:
+	@[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif libiberty-bootstrap
+
+
+
+
+
 .PHONY: check-libiberty maybe-check-libiberty
 maybe-check-libiberty:
 @if libiberty
@@ -14153,9 +16742,9 @@
 check-libiberty:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/libiberty && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif libiberty
 
@@ -14167,9 +16756,9 @@
 install-libiberty: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/libiberty && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif libiberty
 
@@ -14185,13 +16774,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14211,13 +16799,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14237,13 +16824,12 @@
 	@[ -f ./libiberty/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 html in libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14263,13 +16849,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14290,13 +16875,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14316,13 +16900,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14341,13 +16924,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14366,13 +16948,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14391,13 +16972,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14416,13 +16996,12 @@
 	@[ -f ./libiberty/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 libiberty" ; \
-	(cd libiberty && \
+	(cd $(HOST_SUBDIR)/libiberty && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14433,34 +17012,35 @@
 @endif libiberty
 
 
+
 .PHONY: configure-libtool maybe-configure-libtool
 maybe-configure-libtool:
 @if libtool
 maybe-configure-libtool: configure-libtool
-configure-libtool:
-	@test ! -f libtool/Makefile || exit 0; \
-	[ -d libtool ] || mkdir libtool; \
+configure-libtool: 
+	@test ! -f $(HOST_SUBDIR)/libtool/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libtool ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in libtool; \
-	cd libtool || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libtool"; \
-	    libsrcdir="$$s/libtool";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libtool"; \
-	    libsrcdir="$$s/libtool";; \
+	echo Configuring in $(HOST_SUBDIR)/libtool; \
+	cd "$(HOST_SUBDIR)/libtool" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libtool/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/libtool"; \
+	libsrcdir="$$s/libtool"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif libtool
 
+
+
+
+
 .PHONY: all-libtool maybe-all-libtool
 maybe-all-libtool:
 @if libtool
@@ -14469,12 +17049,14 @@
 all-libtool: configure-libtool
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libtool && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-libtool))
+	(cd $(HOST_SUBDIR)/libtool && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-libtool))
 @endif libtool
 
+
+
+
 .PHONY: check-libtool maybe-check-libtool
 maybe-check-libtool:
 @if libtool
@@ -14483,9 +17065,9 @@
 check-libtool:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libtool && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/libtool && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif libtool
 
@@ -14497,9 +17079,9 @@
 install-libtool: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libtool && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/libtool && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif libtool
 
@@ -14515,13 +17097,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14541,13 +17122,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14567,13 +17147,12 @@
 	@[ -f ./libtool/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 html in libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14593,13 +17172,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14620,13 +17198,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14646,13 +17223,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14671,13 +17247,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14696,13 +17271,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14721,13 +17295,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14746,13 +17319,12 @@
 	@[ -f ./libtool/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 libtool" ; \
-	(cd libtool && \
+	(cd $(HOST_SUBDIR)/libtool && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14763,34 +17335,35 @@
 @endif libtool
 
 
+
 .PHONY: configure-m4 maybe-configure-m4
 maybe-configure-m4:
 @if m4
 maybe-configure-m4: configure-m4
-configure-m4:
-	@test ! -f m4/Makefile || exit 0; \
-	[ -d m4 ] || mkdir m4; \
+configure-m4: 
+	@test ! -f $(HOST_SUBDIR)/m4/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/m4 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in m4; \
-	cd m4 || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/m4"; \
-	    libsrcdir="$$s/m4";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/m4"; \
-	    libsrcdir="$$s/m4";; \
+	echo Configuring in $(HOST_SUBDIR)/m4; \
+	cd "$(HOST_SUBDIR)/m4" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/m4/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/m4"; \
+	libsrcdir="$$s/m4"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif m4
 
+
+
+
+
 .PHONY: all-m4 maybe-all-m4
 maybe-all-m4:
 @if m4
@@ -14799,12 +17372,14 @@
 all-m4: configure-m4
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd m4 && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-m4))
+	(cd $(HOST_SUBDIR)/m4 && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-m4))
 @endif m4
 
+
+
+
 .PHONY: check-m4 maybe-check-m4
 maybe-check-m4:
 @if m4
@@ -14813,9 +17388,9 @@
 check-m4:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd m4 && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/m4 && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif m4
 
@@ -14827,9 +17402,9 @@
 install-m4: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd m4 && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/m4 && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif m4
 
@@ -14845,13 +17420,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14871,13 +17445,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14897,13 +17470,12 @@
 	@[ -f ./m4/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 html in m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14923,13 +17495,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14950,13 +17521,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -14976,13 +17546,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15001,13 +17570,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15026,13 +17594,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15051,13 +17618,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15076,13 +17642,12 @@
 	@[ -f ./m4/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 m4" ; \
-	(cd m4 && \
+	(cd $(HOST_SUBDIR)/m4 && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15093,34 +17658,35 @@
 @endif m4
 
 
+
 .PHONY: configure-make maybe-configure-make
 maybe-configure-make:
 @if make
 maybe-configure-make: configure-make
-configure-make:
-	@test ! -f make/Makefile || exit 0; \
-	[ -d make ] || mkdir make; \
+configure-make: 
+	@test ! -f $(HOST_SUBDIR)/make/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/make ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in make; \
-	cd make || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/make"; \
-	    libsrcdir="$$s/make";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/make"; \
-	    libsrcdir="$$s/make";; \
+	echo Configuring in $(HOST_SUBDIR)/make; \
+	cd "$(HOST_SUBDIR)/make" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/make/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/make"; \
+	libsrcdir="$$s/make"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif make
 
+
+
+
+
 .PHONY: all-make maybe-all-make
 maybe-all-make:
 @if make
@@ -15129,13 +17695,15 @@
 all-make: configure-make
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd make && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-make))
+	(cd $(HOST_SUBDIR)/make && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-make))
 @endif make
 
-.PHONY: check-make maybe-check-make
+
+
+
+.PHONY: check-make maybe-check-make
 maybe-check-make:
 @if make
 maybe-check-make: check-make
@@ -15143,9 +17711,9 @@
 check-make:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd make && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/make && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif make
 
@@ -15157,9 +17725,9 @@
 install-make: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd make && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/make && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif make
 
@@ -15175,13 +17743,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15201,13 +17768,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15227,13 +17793,12 @@
 	@[ -f ./make/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 html in make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15253,13 +17818,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15280,13 +17844,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15306,13 +17869,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15331,13 +17893,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15356,13 +17917,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15381,13 +17941,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15406,13 +17965,12 @@
 	@[ -f ./make/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 make" ; \
-	(cd make && \
+	(cd $(HOST_SUBDIR)/make && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15423,34 +17981,35 @@
 @endif make
 
 
+
 .PHONY: configure-mmalloc maybe-configure-mmalloc
 maybe-configure-mmalloc:
 @if mmalloc
 maybe-configure-mmalloc: configure-mmalloc
-configure-mmalloc:
-	@test ! -f mmalloc/Makefile || exit 0; \
-	[ -d mmalloc ] || mkdir mmalloc; \
+configure-mmalloc: 
+	@test ! -f $(HOST_SUBDIR)/mmalloc/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mmalloc ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in mmalloc; \
-	cd mmalloc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/mmalloc"; \
-	    libsrcdir="$$s/mmalloc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/mmalloc"; \
-	    libsrcdir="$$s/mmalloc";; \
+	echo Configuring in $(HOST_SUBDIR)/mmalloc; \
+	cd "$(HOST_SUBDIR)/mmalloc" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/mmalloc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/mmalloc"; \
+	libsrcdir="$$s/mmalloc"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif mmalloc
 
+
+
+
+
 .PHONY: all-mmalloc maybe-all-mmalloc
 maybe-all-mmalloc:
 @if mmalloc
@@ -15459,12 +18018,14 @@
 all-mmalloc: configure-mmalloc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd mmalloc && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-mmalloc))
+	(cd $(HOST_SUBDIR)/mmalloc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-mmalloc))
 @endif mmalloc
 
+
+
+
 .PHONY: check-mmalloc maybe-check-mmalloc
 maybe-check-mmalloc:
 @if mmalloc
@@ -15482,9 +18043,9 @@
 install-mmalloc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/mmalloc && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif mmalloc
 
@@ -15500,13 +18061,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15526,13 +18086,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15552,13 +18111,12 @@
 	@[ -f ./mmalloc/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 html in mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15578,13 +18136,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15605,13 +18162,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15631,13 +18187,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15656,13 +18211,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15681,13 +18235,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15706,13 +18259,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15731,13 +18283,12 @@
 	@[ -f ./mmalloc/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 mmalloc" ; \
-	(cd mmalloc && \
+	(cd $(HOST_SUBDIR)/mmalloc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15748,34 +18299,35 @@
 @endif mmalloc
 
 
+
 .PHONY: configure-patch maybe-configure-patch
 maybe-configure-patch:
 @if patch
 maybe-configure-patch: configure-patch
-configure-patch:
-	@test ! -f patch/Makefile || exit 0; \
-	[ -d patch ] || mkdir patch; \
+configure-patch: 
+	@test ! -f $(HOST_SUBDIR)/patch/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/patch ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in patch; \
-	cd patch || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/patch"; \
-	    libsrcdir="$$s/patch";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/patch"; \
-	    libsrcdir="$$s/patch";; \
+	echo Configuring in $(HOST_SUBDIR)/patch; \
+	cd "$(HOST_SUBDIR)/patch" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/patch/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/patch"; \
+	libsrcdir="$$s/patch"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif patch
 
+
+
+
+
 .PHONY: all-patch maybe-all-patch
 maybe-all-patch:
 @if patch
@@ -15784,12 +18336,14 @@
 all-patch: configure-patch
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd patch && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-patch))
+	(cd $(HOST_SUBDIR)/patch && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-patch))
 @endif patch
 
+
+
+
 .PHONY: check-patch maybe-check-patch
 maybe-check-patch:
 @if patch
@@ -15798,9 +18352,9 @@
 check-patch:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd patch && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/patch && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif patch
 
@@ -15812,9 +18366,9 @@
 install-patch: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd patch && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/patch && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif patch
 
@@ -15830,13 +18384,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15856,13 +18409,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15882,13 +18434,12 @@
 	@[ -f ./patch/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 html in patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15908,13 +18459,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15935,13 +18485,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15961,13 +18510,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -15986,13 +18534,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16011,13 +18558,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16036,13 +18582,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16061,13 +18606,12 @@
 	@[ -f ./patch/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 patch" ; \
-	(cd patch && \
+	(cd $(HOST_SUBDIR)/patch && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16078,34 +18622,35 @@
 @endif patch
 
 
+
 .PHONY: configure-perl maybe-configure-perl
 maybe-configure-perl:
 @if perl
 maybe-configure-perl: configure-perl
-configure-perl:
-	@test ! -f perl/Makefile || exit 0; \
-	[ -d perl ] || mkdir perl; \
+configure-perl: 
+	@test ! -f $(HOST_SUBDIR)/perl/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/perl ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in perl; \
-	cd perl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/perl"; \
-	    libsrcdir="$$s/perl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/perl"; \
-	    libsrcdir="$$s/perl";; \
+	echo Configuring in $(HOST_SUBDIR)/perl; \
+	cd "$(HOST_SUBDIR)/perl" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/perl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/perl"; \
+	libsrcdir="$$s/perl"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif perl
 
+
+
+
+
 .PHONY: all-perl maybe-all-perl
 maybe-all-perl:
 @if perl
@@ -16114,12 +18659,14 @@
 all-perl: configure-perl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd perl && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-perl))
+	(cd $(HOST_SUBDIR)/perl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-perl))
 @endif perl
 
+
+
+
 .PHONY: check-perl maybe-check-perl
 maybe-check-perl:
 @if perl
@@ -16128,9 +18675,9 @@
 check-perl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd perl && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/perl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif perl
 
@@ -16142,9 +18689,9 @@
 install-perl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd perl && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/perl && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif perl
 
@@ -16160,13 +18707,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16186,13 +18732,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16212,13 +18757,12 @@
 	@[ -f ./perl/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 html in perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16238,13 +18782,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16265,13 +18808,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16291,13 +18833,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16316,13 +18857,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16341,13 +18881,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16366,13 +18905,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16391,13 +18929,12 @@
 	@[ -f ./perl/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 perl" ; \
-	(cd perl && \
+	(cd $(HOST_SUBDIR)/perl && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16408,34 +18945,35 @@
 @endif perl
 
 
+
 .PHONY: configure-prms maybe-configure-prms
 maybe-configure-prms:
 @if prms
 maybe-configure-prms: configure-prms
-configure-prms:
-	@test ! -f prms/Makefile || exit 0; \
-	[ -d prms ] || mkdir prms; \
+configure-prms: 
+	@test ! -f $(HOST_SUBDIR)/prms/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/prms ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in prms; \
-	cd prms || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/prms"; \
-	    libsrcdir="$$s/prms";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/prms"; \
-	    libsrcdir="$$s/prms";; \
+	echo Configuring in $(HOST_SUBDIR)/prms; \
+	cd "$(HOST_SUBDIR)/prms" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/prms/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/prms"; \
+	libsrcdir="$$s/prms"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif prms
 
+
+
+
+
 .PHONY: all-prms maybe-all-prms
 maybe-all-prms:
 @if prms
@@ -16444,12 +18982,14 @@
 all-prms: configure-prms
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd prms && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-prms))
+	(cd $(HOST_SUBDIR)/prms && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-prms))
 @endif prms
 
+
+
+
 .PHONY: check-prms maybe-check-prms
 maybe-check-prms:
 @if prms
@@ -16458,9 +18998,9 @@
 check-prms:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd prms && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/prms && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif prms
 
@@ -16472,9 +19012,9 @@
 install-prms: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd prms && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/prms && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif prms
 
@@ -16490,13 +19030,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16516,13 +19055,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16542,13 +19080,12 @@
 	@[ -f ./prms/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 html in prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16568,13 +19105,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16595,13 +19131,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16621,13 +19156,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16646,13 +19180,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16671,13 +19204,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16696,13 +19228,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16721,13 +19252,12 @@
 	@[ -f ./prms/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 prms" ; \
-	(cd prms && \
+	(cd $(HOST_SUBDIR)/prms && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16738,34 +19268,35 @@
 @endif prms
 
 
+
 .PHONY: configure-rcs maybe-configure-rcs
 maybe-configure-rcs:
 @if rcs
 maybe-configure-rcs: configure-rcs
-configure-rcs:
-	@test ! -f rcs/Makefile || exit 0; \
-	[ -d rcs ] || mkdir rcs; \
+configure-rcs: 
+	@test ! -f $(HOST_SUBDIR)/rcs/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/rcs ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in rcs; \
-	cd rcs || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/rcs"; \
-	    libsrcdir="$$s/rcs";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/rcs"; \
-	    libsrcdir="$$s/rcs";; \
+	echo Configuring in $(HOST_SUBDIR)/rcs; \
+	cd "$(HOST_SUBDIR)/rcs" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/rcs/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/rcs"; \
+	libsrcdir="$$s/rcs"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif rcs
 
+
+
+
+
 .PHONY: all-rcs maybe-all-rcs
 maybe-all-rcs:
 @if rcs
@@ -16774,12 +19305,14 @@
 all-rcs: configure-rcs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd rcs && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-rcs))
+	(cd $(HOST_SUBDIR)/rcs && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-rcs))
 @endif rcs
 
+
+
+
 .PHONY: check-rcs maybe-check-rcs
 maybe-check-rcs:
 @if rcs
@@ -16788,9 +19321,9 @@
 check-rcs:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd rcs && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/rcs && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif rcs
 
@@ -16802,9 +19335,9 @@
 install-rcs: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd rcs && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/rcs && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif rcs
 
@@ -16820,13 +19353,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16846,13 +19378,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16872,13 +19403,12 @@
 	@[ -f ./rcs/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 html in rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16898,13 +19428,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16925,13 +19454,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16951,13 +19479,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -16976,13 +19503,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17001,13 +19527,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17026,13 +19551,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17051,13 +19575,12 @@
 	@[ -f ./rcs/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 rcs" ; \
-	(cd rcs && \
+	(cd $(HOST_SUBDIR)/rcs && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17068,34 +19591,35 @@
 @endif rcs
 
 
+
 .PHONY: configure-readline maybe-configure-readline
 maybe-configure-readline:
 @if readline
 maybe-configure-readline: configure-readline
-configure-readline:
-	@test ! -f readline/Makefile || exit 0; \
-	[ -d readline ] || mkdir readline; \
+configure-readline: 
+	@test ! -f $(HOST_SUBDIR)/readline/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/readline ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in readline; \
-	cd readline || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/readline"; \
-	    libsrcdir="$$s/readline";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/readline"; \
-	    libsrcdir="$$s/readline";; \
+	echo Configuring in $(HOST_SUBDIR)/readline; \
+	cd "$(HOST_SUBDIR)/readline" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/readline/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/readline"; \
+	libsrcdir="$$s/readline"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif readline
 
+
+
+
+
 .PHONY: all-readline maybe-all-readline
 maybe-all-readline:
 @if readline
@@ -17104,12 +19628,14 @@
 all-readline: configure-readline
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd readline && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-readline))
+	(cd $(HOST_SUBDIR)/readline && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-readline))
 @endif readline
 
+
+
+
 .PHONY: check-readline maybe-check-readline
 maybe-check-readline:
 @if readline
@@ -17118,9 +19644,9 @@
 check-readline:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd readline && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/readline && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif readline
 
@@ -17132,9 +19658,9 @@
 install-readline: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd readline && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/readline && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif readline
 
@@ -17150,13 +19676,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17176,13 +19701,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17202,13 +19726,12 @@
 	@[ -f ./readline/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 html in readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17228,13 +19751,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17255,13 +19777,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17281,13 +19802,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17306,13 +19826,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17331,13 +19850,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17356,13 +19874,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17381,13 +19898,12 @@
 	@[ -f ./readline/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 readline" ; \
-	(cd readline && \
+	(cd $(HOST_SUBDIR)/readline && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17398,34 +19914,35 @@
 @endif readline
 
 
+
 .PHONY: configure-release maybe-configure-release
 maybe-configure-release:
 @if release
 maybe-configure-release: configure-release
-configure-release:
-	@test ! -f release/Makefile || exit 0; \
-	[ -d release ] || mkdir release; \
+configure-release: 
+	@test ! -f $(HOST_SUBDIR)/release/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/release ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in release; \
-	cd release || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/release"; \
-	    libsrcdir="$$s/release";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/release"; \
-	    libsrcdir="$$s/release";; \
+	echo Configuring in $(HOST_SUBDIR)/release; \
+	cd "$(HOST_SUBDIR)/release" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/release/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/release"; \
+	libsrcdir="$$s/release"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif release
 
+
+
+
+
 .PHONY: all-release maybe-all-release
 maybe-all-release:
 @if release
@@ -17434,12 +19951,14 @@
 all-release: configure-release
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd release && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-release))
+	(cd $(HOST_SUBDIR)/release && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-release))
 @endif release
 
+
+
+
 .PHONY: check-release maybe-check-release
 maybe-check-release:
 @if release
@@ -17470,13 +19989,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17496,13 +20014,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17522,13 +20039,12 @@
 	@[ -f ./release/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 html in release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17548,13 +20064,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17575,13 +20090,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17601,13 +20115,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17626,13 +20139,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17651,13 +20163,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17676,13 +20187,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17701,13 +20211,12 @@
 	@[ -f ./release/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 release" ; \
-	(cd release && \
+	(cd $(HOST_SUBDIR)/release && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17718,34 +20227,35 @@
 @endif release
 
 
+
 .PHONY: configure-recode maybe-configure-recode
 maybe-configure-recode:
 @if recode
 maybe-configure-recode: configure-recode
-configure-recode:
-	@test ! -f recode/Makefile || exit 0; \
-	[ -d recode ] || mkdir recode; \
+configure-recode: 
+	@test ! -f $(HOST_SUBDIR)/recode/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/recode ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in recode; \
-	cd recode || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/recode"; \
-	    libsrcdir="$$s/recode";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/recode"; \
-	    libsrcdir="$$s/recode";; \
+	echo Configuring in $(HOST_SUBDIR)/recode; \
+	cd "$(HOST_SUBDIR)/recode" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/recode/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/recode"; \
+	libsrcdir="$$s/recode"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif recode
 
+
+
+
+
 .PHONY: all-recode maybe-all-recode
 maybe-all-recode:
 @if recode
@@ -17754,12 +20264,14 @@
 all-recode: configure-recode
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd recode && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-recode))
+	(cd $(HOST_SUBDIR)/recode && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-recode))
 @endif recode
 
+
+
+
 .PHONY: check-recode maybe-check-recode
 maybe-check-recode:
 @if recode
@@ -17768,9 +20280,9 @@
 check-recode:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd recode && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/recode && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif recode
 
@@ -17782,9 +20294,9 @@
 install-recode: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd recode && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/recode && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif recode
 
@@ -17800,13 +20312,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17826,13 +20337,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17852,13 +20362,12 @@
 	@[ -f ./recode/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 html in recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17878,13 +20387,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17905,13 +20413,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17931,13 +20438,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17956,13 +20462,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -17981,13 +20486,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18006,13 +20510,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18031,13 +20534,12 @@
 	@[ -f ./recode/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 recode" ; \
-	(cd recode && \
+	(cd $(HOST_SUBDIR)/recode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18048,34 +20550,35 @@
 @endif recode
 
 
+
 .PHONY: configure-sed maybe-configure-sed
 maybe-configure-sed:
 @if sed
 maybe-configure-sed: configure-sed
-configure-sed:
-	@test ! -f sed/Makefile || exit 0; \
-	[ -d sed ] || mkdir sed; \
+configure-sed: 
+	@test ! -f $(HOST_SUBDIR)/sed/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sed ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in sed; \
-	cd sed || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/sed"; \
-	    libsrcdir="$$s/sed";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/sed"; \
-	    libsrcdir="$$s/sed";; \
+	echo Configuring in $(HOST_SUBDIR)/sed; \
+	cd "$(HOST_SUBDIR)/sed" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/sed/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/sed"; \
+	libsrcdir="$$s/sed"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif sed
 
+
+
+
+
 .PHONY: all-sed maybe-all-sed
 maybe-all-sed:
 @if sed
@@ -18084,12 +20587,14 @@
 all-sed: configure-sed
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sed && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-sed))
+	(cd $(HOST_SUBDIR)/sed && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-sed))
 @endif sed
 
+
+
+
 .PHONY: check-sed maybe-check-sed
 maybe-check-sed:
 @if sed
@@ -18098,9 +20603,9 @@
 check-sed:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sed && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/sed && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif sed
 
@@ -18112,9 +20617,9 @@
 install-sed: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sed && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/sed && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif sed
 
@@ -18130,13 +20635,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18156,13 +20660,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18182,13 +20685,12 @@
 	@[ -f ./sed/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 html in sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18208,13 +20710,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18235,13 +20736,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18261,13 +20761,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18286,13 +20785,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18311,13 +20809,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18336,13 +20833,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18361,13 +20857,12 @@
 	@[ -f ./sed/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 sed" ; \
-	(cd sed && \
+	(cd $(HOST_SUBDIR)/sed && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18378,34 +20873,35 @@
 @endif sed
 
 
+
 .PHONY: configure-send-pr maybe-configure-send-pr
 maybe-configure-send-pr:
 @if send-pr
 maybe-configure-send-pr: configure-send-pr
-configure-send-pr:
-	@test ! -f send-pr/Makefile || exit 0; \
-	[ -d send-pr ] || mkdir send-pr; \
+configure-send-pr: 
+	@test ! -f $(HOST_SUBDIR)/send-pr/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/send-pr ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in send-pr; \
-	cd send-pr || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/send-pr"; \
-	    libsrcdir="$$s/send-pr";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/send-pr"; \
-	    libsrcdir="$$s/send-pr";; \
+	echo Configuring in $(HOST_SUBDIR)/send-pr; \
+	cd "$(HOST_SUBDIR)/send-pr" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/send-pr/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/send-pr"; \
+	libsrcdir="$$s/send-pr"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif send-pr
 
+
+
+
+
 .PHONY: all-send-pr maybe-all-send-pr
 maybe-all-send-pr:
 @if send-pr
@@ -18414,12 +20910,14 @@
 all-send-pr: configure-send-pr
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-send-pr))
+	(cd $(HOST_SUBDIR)/send-pr && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-send-pr))
 @endif send-pr
 
+
+
+
 .PHONY: check-send-pr maybe-check-send-pr
 maybe-check-send-pr:
 @if send-pr
@@ -18428,9 +20926,9 @@
 check-send-pr:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/send-pr && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif send-pr
 
@@ -18442,9 +20940,9 @@
 install-send-pr: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/send-pr && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif send-pr
 
@@ -18460,13 +20958,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18486,13 +20983,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18512,13 +21008,12 @@
 	@[ -f ./send-pr/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 html in send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18538,13 +21033,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18565,13 +21059,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18591,13 +21084,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18616,13 +21108,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18641,13 +21132,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18666,13 +21156,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18691,13 +21180,12 @@
 	@[ -f ./send-pr/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 send-pr" ; \
-	(cd send-pr && \
+	(cd $(HOST_SUBDIR)/send-pr && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18708,34 +21196,35 @@
 @endif send-pr
 
 
+
 .PHONY: configure-shellutils maybe-configure-shellutils
 maybe-configure-shellutils:
 @if shellutils
 maybe-configure-shellutils: configure-shellutils
-configure-shellutils:
-	@test ! -f shellutils/Makefile || exit 0; \
-	[ -d shellutils ] || mkdir shellutils; \
+configure-shellutils: 
+	@test ! -f $(HOST_SUBDIR)/shellutils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/shellutils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in shellutils; \
-	cd shellutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/shellutils"; \
-	    libsrcdir="$$s/shellutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/shellutils"; \
-	    libsrcdir="$$s/shellutils";; \
+	echo Configuring in $(HOST_SUBDIR)/shellutils; \
+	cd "$(HOST_SUBDIR)/shellutils" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/shellutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/shellutils"; \
+	libsrcdir="$$s/shellutils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif shellutils
 
+
+
+
+
 .PHONY: all-shellutils maybe-all-shellutils
 maybe-all-shellutils:
 @if shellutils
@@ -18744,12 +21233,14 @@
 all-shellutils: configure-shellutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-shellutils))
+	(cd $(HOST_SUBDIR)/shellutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-shellutils))
 @endif shellutils
 
+
+
+
 .PHONY: check-shellutils maybe-check-shellutils
 maybe-check-shellutils:
 @if shellutils
@@ -18758,9 +21249,9 @@
 check-shellutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/shellutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif shellutils
 
@@ -18772,9 +21263,9 @@
 install-shellutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/shellutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif shellutils
 
@@ -18790,13 +21281,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18816,13 +21306,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18842,13 +21331,12 @@
 	@[ -f ./shellutils/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 html in shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18868,13 +21356,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18895,13 +21382,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18921,13 +21407,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18946,13 +21431,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18971,13 +21455,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -18996,13 +21479,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19021,13 +21503,12 @@
 	@[ -f ./shellutils/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 shellutils" ; \
-	(cd shellutils && \
+	(cd $(HOST_SUBDIR)/shellutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19038,34 +21519,35 @@
 @endif shellutils
 
 
+
 .PHONY: configure-sid maybe-configure-sid
 maybe-configure-sid:
 @if sid
 maybe-configure-sid: configure-sid
-configure-sid:
-	@test ! -f sid/Makefile || exit 0; \
-	[ -d sid ] || mkdir sid; \
+configure-sid: 
+	@test ! -f $(HOST_SUBDIR)/sid/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sid ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in sid; \
-	cd sid || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/sid"; \
-	    libsrcdir="$$s/sid";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/sid"; \
-	    libsrcdir="$$s/sid";; \
+	echo Configuring in $(HOST_SUBDIR)/sid; \
+	cd "$(HOST_SUBDIR)/sid" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/sid/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/sid"; \
+	libsrcdir="$$s/sid"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif sid
 
+
+
+
+
 .PHONY: all-sid maybe-all-sid
 maybe-all-sid:
 @if sid
@@ -19074,12 +21556,14 @@
 all-sid: configure-sid
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sid && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-sid))
+	(cd $(HOST_SUBDIR)/sid && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-sid))
 @endif sid
 
+
+
+
 .PHONY: check-sid maybe-check-sid
 maybe-check-sid:
 @if sid
@@ -19088,9 +21572,9 @@
 check-sid:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sid && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/sid && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif sid
 
@@ -19102,9 +21586,9 @@
 install-sid: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sid && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/sid && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif sid
 
@@ -19120,13 +21604,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19146,13 +21629,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19172,13 +21654,12 @@
 	@[ -f ./sid/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 html in sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19198,13 +21679,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19225,13 +21705,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19251,13 +21730,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19276,13 +21754,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19301,13 +21778,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19326,13 +21802,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19351,13 +21826,12 @@
 	@[ -f ./sid/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 sid" ; \
-	(cd sid && \
+	(cd $(HOST_SUBDIR)/sid && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19368,34 +21842,35 @@
 @endif sid
 
 
+
 .PHONY: configure-sim maybe-configure-sim
 maybe-configure-sim:
 @if sim
 maybe-configure-sim: configure-sim
-configure-sim:
-	@test ! -f sim/Makefile || exit 0; \
-	[ -d sim ] || mkdir sim; \
+configure-sim: 
+	@test ! -f $(HOST_SUBDIR)/sim/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sim ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in sim; \
-	cd sim || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/sim"; \
-	    libsrcdir="$$s/sim";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/sim"; \
-	    libsrcdir="$$s/sim";; \
+	echo Configuring in $(HOST_SUBDIR)/sim; \
+	cd "$(HOST_SUBDIR)/sim" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/sim/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/sim"; \
+	libsrcdir="$$s/sim"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif sim
 
+
+
+
+
 .PHONY: all-sim maybe-all-sim
 maybe-all-sim:
 @if sim
@@ -19404,12 +21879,14 @@
 all-sim: configure-sim
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sim && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-sim))
+	(cd $(HOST_SUBDIR)/sim && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-sim))
 @endif sim
 
+
+
+
 .PHONY: check-sim maybe-check-sim
 maybe-check-sim:
 @if sim
@@ -19418,9 +21895,9 @@
 check-sim:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sim && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/sim && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif sim
 
@@ -19432,9 +21909,9 @@
 install-sim: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd sim && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/sim && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif sim
 
@@ -19450,13 +21927,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19476,13 +21952,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19502,13 +21977,12 @@
 	@[ -f ./sim/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 html in sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19528,13 +22002,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19555,13 +22028,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19581,13 +22053,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19606,13 +22077,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19631,13 +22101,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19656,13 +22125,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19681,13 +22149,12 @@
 	@[ -f ./sim/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 sim" ; \
-	(cd sim && \
+	(cd $(HOST_SUBDIR)/sim && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19698,34 +22165,35 @@
 @endif sim
 
 
+
 .PHONY: configure-tar maybe-configure-tar
 maybe-configure-tar:
 @if tar
 maybe-configure-tar: configure-tar
-configure-tar:
-	@test ! -f tar/Makefile || exit 0; \
-	[ -d tar ] || mkdir tar; \
+configure-tar: 
+	@test ! -f $(HOST_SUBDIR)/tar/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tar ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in tar; \
-	cd tar || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/tar"; \
-	    libsrcdir="$$s/tar";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/tar"; \
-	    libsrcdir="$$s/tar";; \
+	echo Configuring in $(HOST_SUBDIR)/tar; \
+	cd "$(HOST_SUBDIR)/tar" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/tar/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/tar"; \
+	libsrcdir="$$s/tar"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif tar
 
+
+
+
+
 .PHONY: all-tar maybe-all-tar
 maybe-all-tar:
 @if tar
@@ -19734,12 +22202,14 @@
 all-tar: configure-tar
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tar && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-tar))
+	(cd $(HOST_SUBDIR)/tar && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-tar))
 @endif tar
 
+
+
+
 .PHONY: check-tar maybe-check-tar
 maybe-check-tar:
 @if tar
@@ -19748,9 +22218,9 @@
 check-tar:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tar && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/tar && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif tar
 
@@ -19762,9 +22232,9 @@
 install-tar: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tar && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/tar && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif tar
 
@@ -19780,13 +22250,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19806,13 +22275,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19832,13 +22300,12 @@
 	@[ -f ./tar/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 html in tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19858,13 +22325,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19885,13 +22351,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19911,13 +22376,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19936,13 +22400,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19961,13 +22424,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -19986,13 +22448,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20011,13 +22472,12 @@
 	@[ -f ./tar/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 tar" ; \
-	(cd tar && \
+	(cd $(HOST_SUBDIR)/tar && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20028,34 +22488,35 @@
 @endif tar
 
 
+
 .PHONY: configure-texinfo maybe-configure-texinfo
 maybe-configure-texinfo:
 @if texinfo
 maybe-configure-texinfo: configure-texinfo
-configure-texinfo:
-	@test ! -f texinfo/Makefile || exit 0; \
-	[ -d texinfo ] || mkdir texinfo; \
+configure-texinfo: 
+	@test ! -f $(HOST_SUBDIR)/texinfo/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/texinfo ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in texinfo; \
-	cd texinfo || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/texinfo"; \
-	    libsrcdir="$$s/texinfo";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/texinfo"; \
-	    libsrcdir="$$s/texinfo";; \
+	echo Configuring in $(HOST_SUBDIR)/texinfo; \
+	cd "$(HOST_SUBDIR)/texinfo" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/texinfo/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/texinfo"; \
+	libsrcdir="$$s/texinfo"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif texinfo
 
+
+
+
+
 .PHONY: all-texinfo maybe-all-texinfo
 maybe-all-texinfo:
 @if texinfo
@@ -20064,12 +22525,14 @@
 all-texinfo: configure-texinfo
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd texinfo && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-texinfo))
+	(cd $(HOST_SUBDIR)/texinfo && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-texinfo))
 @endif texinfo
 
+
+
+
 .PHONY: check-texinfo maybe-check-texinfo
 maybe-check-texinfo:
 @if texinfo
@@ -20078,9 +22541,9 @@
 check-texinfo:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/texinfo && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif texinfo
 
@@ -20105,13 +22568,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20131,13 +22593,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20157,13 +22618,12 @@
 	@[ -f ./texinfo/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 html in texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20183,13 +22643,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20210,13 +22669,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20236,13 +22694,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20261,13 +22718,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20286,13 +22742,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20311,13 +22766,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20336,13 +22790,12 @@
 	@[ -f ./texinfo/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 texinfo" ; \
-	(cd texinfo && \
+	(cd $(HOST_SUBDIR)/texinfo && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20353,34 +22806,35 @@
 @endif texinfo
 
 
+
 .PHONY: configure-textutils maybe-configure-textutils
 maybe-configure-textutils:
 @if textutils
 maybe-configure-textutils: configure-textutils
-configure-textutils:
-	@test ! -f textutils/Makefile || exit 0; \
-	[ -d textutils ] || mkdir textutils; \
+configure-textutils: 
+	@test ! -f $(HOST_SUBDIR)/textutils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/textutils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in textutils; \
-	cd textutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/textutils"; \
-	    libsrcdir="$$s/textutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/textutils"; \
-	    libsrcdir="$$s/textutils";; \
+	echo Configuring in $(HOST_SUBDIR)/textutils; \
+	cd "$(HOST_SUBDIR)/textutils" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/textutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/textutils"; \
+	libsrcdir="$$s/textutils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif textutils
 
+
+
+
+
 .PHONY: all-textutils maybe-all-textutils
 maybe-all-textutils:
 @if textutils
@@ -20389,12 +22843,14 @@
 all-textutils: configure-textutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd textutils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-textutils))
+	(cd $(HOST_SUBDIR)/textutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-textutils))
 @endif textutils
 
+
+
+
 .PHONY: check-textutils maybe-check-textutils
 maybe-check-textutils:
 @if textutils
@@ -20403,9 +22859,9 @@
 check-textutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd textutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/textutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif textutils
 
@@ -20417,9 +22873,9 @@
 install-textutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd textutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/textutils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif textutils
 
@@ -20435,13 +22891,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20461,13 +22916,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20487,13 +22941,12 @@
 	@[ -f ./textutils/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 html in textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20513,13 +22966,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20540,13 +22992,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20566,13 +23017,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20591,13 +23041,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20616,13 +23065,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20641,13 +23089,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20666,13 +23113,12 @@
 	@[ -f ./textutils/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 textutils" ; \
-	(cd textutils && \
+	(cd $(HOST_SUBDIR)/textutils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20683,34 +23129,35 @@
 @endif textutils
 
 
+
 .PHONY: configure-time maybe-configure-time
 maybe-configure-time:
 @if time
 maybe-configure-time: configure-time
-configure-time:
-	@test ! -f time/Makefile || exit 0; \
-	[ -d time ] || mkdir time; \
+configure-time: 
+	@test ! -f $(HOST_SUBDIR)/time/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/time ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in time; \
-	cd time || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/time"; \
-	    libsrcdir="$$s/time";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/time"; \
-	    libsrcdir="$$s/time";; \
+	echo Configuring in $(HOST_SUBDIR)/time; \
+	cd "$(HOST_SUBDIR)/time" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/time/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/time"; \
+	libsrcdir="$$s/time"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif time
 
+
+
+
+
 .PHONY: all-time maybe-all-time
 maybe-all-time:
 @if time
@@ -20719,12 +23166,14 @@
 all-time: configure-time
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd time && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-time))
+	(cd $(HOST_SUBDIR)/time && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-time))
 @endif time
 
+
+
+
 .PHONY: check-time maybe-check-time
 maybe-check-time:
 @if time
@@ -20733,9 +23182,9 @@
 check-time:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd time && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/time && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif time
 
@@ -20747,9 +23196,9 @@
 install-time: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd time && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/time && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif time
 
@@ -20765,13 +23214,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20791,13 +23239,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20817,13 +23264,12 @@
 	@[ -f ./time/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 html in time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20843,13 +23289,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20870,13 +23315,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20896,13 +23340,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20921,13 +23364,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20946,13 +23388,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20971,13 +23412,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -20996,13 +23436,12 @@
 	@[ -f ./time/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 time" ; \
-	(cd time && \
+	(cd $(HOST_SUBDIR)/time && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21013,34 +23452,35 @@
 @endif time
 
 
+
 .PHONY: configure-uudecode maybe-configure-uudecode
 maybe-configure-uudecode:
 @if uudecode
 maybe-configure-uudecode: configure-uudecode
-configure-uudecode:
-	@test ! -f uudecode/Makefile || exit 0; \
-	[ -d uudecode ] || mkdir uudecode; \
+configure-uudecode: 
+	@test ! -f $(HOST_SUBDIR)/uudecode/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/uudecode ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in uudecode; \
-	cd uudecode || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/uudecode"; \
-	    libsrcdir="$$s/uudecode";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/uudecode"; \
-	    libsrcdir="$$s/uudecode";; \
+	echo Configuring in $(HOST_SUBDIR)/uudecode; \
+	cd "$(HOST_SUBDIR)/uudecode" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/uudecode/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/uudecode"; \
+	libsrcdir="$$s/uudecode"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif uudecode
 
+
+
+
+
 .PHONY: all-uudecode maybe-all-uudecode
 maybe-all-uudecode:
 @if uudecode
@@ -21049,12 +23489,14 @@
 all-uudecode: configure-uudecode
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-uudecode))
+	(cd $(HOST_SUBDIR)/uudecode && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-uudecode))
 @endif uudecode
 
+
+
+
 .PHONY: check-uudecode maybe-check-uudecode
 maybe-check-uudecode:
 @if uudecode
@@ -21063,9 +23505,9 @@
 check-uudecode:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/uudecode && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif uudecode
 
@@ -21077,9 +23519,9 @@
 install-uudecode: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/uudecode && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif uudecode
 
@@ -21095,13 +23537,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21121,13 +23562,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21147,13 +23587,12 @@
 	@[ -f ./uudecode/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 html in uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21173,13 +23612,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21200,13 +23638,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21226,13 +23663,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21251,13 +23687,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21276,13 +23711,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21301,13 +23735,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21326,13 +23759,12 @@
 	@[ -f ./uudecode/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 uudecode" ; \
-	(cd uudecode && \
+	(cd $(HOST_SUBDIR)/uudecode && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21343,34 +23775,35 @@
 @endif uudecode
 
 
+
 .PHONY: configure-wdiff maybe-configure-wdiff
 maybe-configure-wdiff:
 @if wdiff
 maybe-configure-wdiff: configure-wdiff
-configure-wdiff:
-	@test ! -f wdiff/Makefile || exit 0; \
-	[ -d wdiff ] || mkdir wdiff; \
+configure-wdiff: 
+	@test ! -f $(HOST_SUBDIR)/wdiff/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/wdiff ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in wdiff; \
-	cd wdiff || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/wdiff"; \
-	    libsrcdir="$$s/wdiff";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/wdiff"; \
-	    libsrcdir="$$s/wdiff";; \
+	echo Configuring in $(HOST_SUBDIR)/wdiff; \
+	cd "$(HOST_SUBDIR)/wdiff" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/wdiff/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/wdiff"; \
+	libsrcdir="$$s/wdiff"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif wdiff
 
+
+
+
+
 .PHONY: all-wdiff maybe-all-wdiff
 maybe-all-wdiff:
 @if wdiff
@@ -21379,12 +23812,14 @@
 all-wdiff: configure-wdiff
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-wdiff))
+	(cd $(HOST_SUBDIR)/wdiff && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-wdiff))
 @endif wdiff
 
+
+
+
 .PHONY: check-wdiff maybe-check-wdiff
 maybe-check-wdiff:
 @if wdiff
@@ -21393,9 +23828,9 @@
 check-wdiff:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/wdiff && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
 
 @endif wdiff
 
@@ -21407,9 +23842,9 @@
 install-wdiff: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/wdiff && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif wdiff
 
@@ -21425,13 +23860,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21451,13 +23885,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21477,13 +23910,12 @@
 	@[ -f ./wdiff/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 html in wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21503,13 +23935,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21530,13 +23961,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21556,13 +23986,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21581,13 +24010,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21606,13 +24034,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21631,13 +24058,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21656,13 +24082,12 @@
 	@[ -f ./wdiff/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 wdiff" ; \
-	(cd wdiff && \
+	(cd $(HOST_SUBDIR)/wdiff && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21673,34 +24098,35 @@
 @endif wdiff
 
 
+
 .PHONY: configure-zip maybe-configure-zip
 maybe-configure-zip:
 @if zip
 maybe-configure-zip: configure-zip
-configure-zip:
-	@test ! -f zip/Makefile || exit 0; \
-	[ -d zip ] || mkdir zip; \
+configure-zip: 
+	@test ! -f $(HOST_SUBDIR)/zip/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zip ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in zip; \
-	cd zip || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zip"; \
-	    libsrcdir="$$s/zip";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zip"; \
-	    libsrcdir="$$s/zip";; \
+	echo Configuring in $(HOST_SUBDIR)/zip; \
+	cd "$(HOST_SUBDIR)/zip" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zip/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/zip"; \
+	libsrcdir="$$s/zip"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif zip
 
+
+
+
+
 .PHONY: all-zip maybe-all-zip
 maybe-all-zip:
 @if zip
@@ -21709,12 +24135,14 @@
 all-zip: configure-zip
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd zip && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-zip))
+	(cd $(HOST_SUBDIR)/zip && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-zip))
 @endif zip
 
+
+
+
 .PHONY: check-zip maybe-check-zip
 maybe-check-zip:
 @if zip
@@ -21725,9 +24153,9 @@
 	@if [ '$(host)' = '$(target)' ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
-	  (cd zip && $(MAKE) $(FLAGS_TO_PASS)  check); \
+	  (cd $(HOST_SUBDIR)/zip && \
+	    $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
 @endif zip
@@ -21740,9 +24168,9 @@
 install-zip: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd zip && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/zip && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif zip
 
@@ -21758,13 +24186,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21784,13 +24211,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21810,13 +24236,12 @@
 	@[ -f ./zip/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 html in zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21836,13 +24261,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21863,13 +24287,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21889,13 +24312,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21914,13 +24336,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21939,13 +24360,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21964,13 +24384,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -21989,13 +24408,12 @@
 	@[ -f ./zip/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 zip" ; \
-	(cd zip && \
+	(cd $(HOST_SUBDIR)/zip && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22006,95 +24424,422 @@
 @endif zip
 
 
+
 .PHONY: configure-zlib maybe-configure-zlib
 maybe-configure-zlib:
 @if zlib
 maybe-configure-zlib: configure-zlib
-configure-zlib:
+configure-zlib: 
 	@test -f stage_last && exit 0; \
-	test ! -f zlib/Makefile || exit 0; \
-	[ -d zlib ] || mkdir zlib; \
+	test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in zlib; \
-	cd zlib || exit 1; \
+	echo Configuring in $(HOST_SUBDIR)/zlib; \
+	cd "$(HOST_SUBDIR)/zlib" || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif zlib
 
-.PHONY: all-zlib maybe-all-zlib
-maybe-all-zlib:
-@if zlib
-TARGET-zlib=all
-maybe-all-zlib: all-zlib
-all-zlib: configure-zlib
-	@test -f stage_last && exit 0; \
+
+
+.PHONY: configure-stage1-zlib maybe-configure-stage1-zlib
+maybe-configure-stage1-zlib:
+@if zlib-bootstrap
+maybe-configure-stage1-zlib: configure-stage1-zlib
+configure-stage1-zlib: 
+	@$(MAKE) stage1-start
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd zlib && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-zlib))
-@endif zlib
-
-.PHONY: check-zlib maybe-check-zlib
-maybe-check-zlib:
-@if zlib
-maybe-check-zlib: check-zlib
-
-check-zlib:
-
-@endif zlib
-
-.PHONY: install-zlib maybe-install-zlib
-maybe-install-zlib:
-@if zlib
-maybe-install-zlib: install-zlib
-
-install-zlib:
-
-@endif zlib
-
-# Other targets (info, dvi, etc.)
-
-.PHONY: maybe-info-zlib info-zlib
-maybe-info-zlib:
-@if zlib
-maybe-info-zlib: info-zlib
+	echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+@endif zlib-bootstrap
 
-info-zlib: \
-    configure-zlib 
-	@[ -f ./zlib/Makefile ] || exit 0; \
+.PHONY: configure-stage2-zlib maybe-configure-stage2-zlib
+maybe-configure-stage2-zlib:
+@if zlib-bootstrap
+maybe-configure-stage2-zlib: configure-stage2-zlib
+configure-stage2-zlib: 
+	@$(MAKE) stage2-start
+	@[ -f $(HOST_SUBDIR)/zlib/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 zlib" ; \
-	(cd zlib && \
-	  $(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
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif zlib-bootstrap
 
-@endif zlib
+.PHONY: configure-stage3-zlib maybe-configure-stage3-zlib
+maybe-configure-stage3-zlib:
+@if zlib-bootstrap
+maybe-configure-stage3-zlib: configure-stage3-zlib
+configure-stage3-zlib: 
+	@$(MAKE) stage3-start
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif zlib-bootstrap
+
+.PHONY: configure-stage4-zlib maybe-configure-stage4-zlib
+maybe-configure-stage4-zlib:
+@if zlib-bootstrap
+maybe-configure-stage4-zlib: configure-stage4-zlib
+configure-stage4-zlib: 
+	@$(MAKE) stage4-start
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif zlib-bootstrap
+
+.PHONY: configure-stageprofile-zlib maybe-configure-stageprofile-zlib
+maybe-configure-stageprofile-zlib:
+@if zlib-bootstrap
+maybe-configure-stageprofile-zlib: configure-stageprofile-zlib
+configure-stageprofile-zlib: 
+	@$(MAKE) stageprofile-start
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif zlib-bootstrap
+
+.PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib
+maybe-configure-stagefeedback-zlib:
+@if zlib-bootstrap
+maybe-configure-stagefeedback-zlib: configure-stagefeedback-zlib
+configure-stagefeedback-zlib: 
+	@$(MAKE) stagefeedback-start
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ 
+@endif zlib-bootstrap
+
+
+
+
+
+.PHONY: all-zlib maybe-all-zlib
+maybe-all-zlib:
+@if zlib
+TARGET-zlib=all
+maybe-all-zlib: all-zlib
+all-zlib: configure-zlib
+	@test -f stage_last && exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/zlib && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-zlib))
+@endif zlib
+
+
+
+.PHONY: all-stage1-zlib maybe-all-stage1-zlib
+.PHONY: clean-stage1-zlib maybe-clean-stage1-zlib
+maybe-all-stage1-zlib:
+maybe-clean-stage1-zlib:
+@if zlib-bootstrap
+maybe-all-stage1-zlib: all-stage1-zlib
+all-stage1: all-stage1-zlib
+all-stage1-zlib: configure-stage1-zlib
+	@$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  CFLAGS="$(STAGE1_CFLAGS)" 
+
+maybe-clean-stage1-zlib: clean-stage1-zlib
+clean-stage1: clean-stage1-zlib
+clean-stage1-zlib:
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage1-start ; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)"  clean
+@endif zlib-bootstrap
+
+
+.PHONY: all-stage2-zlib maybe-all-stage2-zlib
+.PHONY: clean-stage2-zlib maybe-clean-stage2-zlib
+maybe-all-stage2-zlib:
+maybe-clean-stage2-zlib:
+@if zlib-bootstrap
+maybe-all-stage2-zlib: all-stage2-zlib
+all-stage2: all-stage2-zlib
+all-stage2-zlib: configure-stage2-zlib
+	@$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage2-zlib: clean-stage2-zlib
+clean-stage2: clean-stage2-zlib
+clean-stage2-zlib:
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage2-start ; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif zlib-bootstrap
+
+
+.PHONY: all-stage3-zlib maybe-all-stage3-zlib
+.PHONY: clean-stage3-zlib maybe-clean-stage3-zlib
+maybe-all-stage3-zlib:
+maybe-clean-stage3-zlib:
+@if zlib-bootstrap
+maybe-all-stage3-zlib: all-stage3-zlib
+all-stage3: all-stage3-zlib
+all-stage3-zlib: configure-stage3-zlib
+	@$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage3-zlib: clean-stage3-zlib
+clean-stage3: clean-stage3-zlib
+clean-stage3-zlib:
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage3-start ; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif zlib-bootstrap
+
+
+.PHONY: all-stage4-zlib maybe-all-stage4-zlib
+.PHONY: clean-stage4-zlib maybe-clean-stage4-zlib
+maybe-all-stage4-zlib:
+maybe-clean-stage4-zlib:
+@if zlib-bootstrap
+maybe-all-stage4-zlib: all-stage4-zlib
+all-stage4: all-stage4-zlib
+all-stage4-zlib: configure-stage4-zlib
+	@$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS)  
+
+maybe-clean-stage4-zlib: clean-stage4-zlib
+clean-stage4: clean-stage4-zlib
+clean-stage4-zlib:
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage4-start ; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		  clean
+@endif zlib-bootstrap
+
+
+.PHONY: all-stageprofile-zlib maybe-all-stageprofile-zlib
+.PHONY: clean-stageprofile-zlib maybe-clean-stageprofile-zlib
+maybe-all-stageprofile-zlib:
+maybe-clean-stageprofile-zlib:
+@if zlib-bootstrap
+maybe-all-stageprofile-zlib: all-stageprofile-zlib
+all-stageprofile: all-stageprofile-zlib
+all-stageprofile-zlib: configure-stageprofile-zlib
+	@$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
+
+maybe-clean-stageprofile-zlib: clean-stageprofile-zlib
+clean-stageprofile: clean-stageprofile-zlib
+clean-stageprofile-zlib:
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stageprofile-start ; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
+@endif zlib-bootstrap
+
+
+.PHONY: all-stagefeedback-zlib maybe-all-stagefeedback-zlib
+.PHONY: clean-stagefeedback-zlib maybe-clean-stagefeedback-zlib
+maybe-all-stagefeedback-zlib:
+maybe-clean-stagefeedback-zlib:
+@if zlib-bootstrap
+maybe-all-stagefeedback-zlib: all-stagefeedback-zlib
+all-stagefeedback: all-stagefeedback-zlib
+all-stagefeedback-zlib: configure-stagefeedback-zlib
+	@$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+
+maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib
+clean-stagefeedback: clean-stagefeedback-zlib
+clean-stagefeedback-zlib:
+	@[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] \
+	  || exit 0 ; \
+	[ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stagefeedback-start ; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
+@endif zlib-bootstrap
+
+
+
+
+
+.PHONY: check-zlib maybe-check-zlib
+maybe-check-zlib:
+@if zlib
+maybe-check-zlib: check-zlib
+
+check-zlib:
+
+@endif zlib
+
+.PHONY: install-zlib maybe-install-zlib
+maybe-install-zlib:
+@if zlib
+maybe-install-zlib: install-zlib
+
+install-zlib:
+
+@endif zlib
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-zlib info-zlib
+maybe-info-zlib:
+@if zlib
+maybe-info-zlib: info-zlib
+
+info-zlib: \
+    configure-zlib 
+	@[ -f ./zlib/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in zlib" ; \
+	(cd $(HOST_SUBDIR)/zlib && \
+	  $(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 zlib
 
 .PHONY: maybe-dvi-zlib dvi-zlib
 maybe-dvi-zlib:
@@ -22106,13 +24851,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22132,13 +24876,12 @@
 	@[ -f ./zlib/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 html in zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22158,13 +24901,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22185,13 +24927,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22211,13 +24952,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22236,13 +24976,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22261,13 +25000,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22286,13 +25024,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22311,13 +25048,12 @@
 	@[ -f ./zlib/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 zlib" ; \
-	(cd zlib && \
+	(cd $(HOST_SUBDIR)/zlib && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22328,34 +25064,35 @@
 @endif zlib
 
 
+
 .PHONY: configure-gdb maybe-configure-gdb
 maybe-configure-gdb:
 @if gdb
 maybe-configure-gdb: configure-gdb
-configure-gdb:
-	@test ! -f gdb/Makefile || exit 0; \
-	[ -d gdb ] || mkdir gdb; \
+configure-gdb: 
+	@test ! -f $(HOST_SUBDIR)/gdb/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gdb ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in gdb; \
-	cd gdb || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gdb"; \
-	    libsrcdir="$$s/gdb";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gdb"; \
-	    libsrcdir="$$s/gdb";; \
+	echo Configuring in $(HOST_SUBDIR)/gdb; \
+	cd "$(HOST_SUBDIR)/gdb" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gdb/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/gdb"; \
+	libsrcdir="$$s/gdb"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif gdb
 
+
+
+
+
 .PHONY: all-gdb maybe-all-gdb
 maybe-all-gdb:
 @if gdb
@@ -22364,13 +25101,15 @@
 all-gdb: configure-gdb
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-	  $(TARGET-gdb))
+	(cd $(HOST_SUBDIR)/gdb && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-gdb))
 @endif gdb
 
-.PHONY: check-gdb maybe-check-gdb
+
+
+
+.PHONY: check-gdb maybe-check-gdb
 maybe-check-gdb:
 @if gdb
 maybe-check-gdb: check-gdb
@@ -22378,9 +25117,9 @@
 check-gdb:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gdb && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/gdb && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
 
 @endif gdb
 
@@ -22392,9 +25131,9 @@
 install-gdb: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd gdb && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/gdb && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
 
 @endif gdb
 
@@ -22410,13 +25149,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22436,13 +25174,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22462,13 +25199,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22488,13 +25224,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22515,13 +25250,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22541,13 +25275,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22566,13 +25299,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22591,13 +25323,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22616,13 +25347,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22641,13 +25371,12 @@
 	@[ -f ./gdb/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in gdb" ; \
-	(cd gdb && \
+	(cd $(HOST_SUBDIR)/gdb && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22658,34 +25387,35 @@
 @endif gdb
 
 
+
 .PHONY: configure-expect maybe-configure-expect
 maybe-configure-expect:
 @if expect
 maybe-configure-expect: configure-expect
-configure-expect:
-	@test ! -f expect/Makefile || exit 0; \
-	[ -d expect ] || mkdir expect; \
+configure-expect: 
+	@test ! -f $(HOST_SUBDIR)/expect/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/expect ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in expect; \
-	cd expect || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/expect"; \
-	    libsrcdir="$$s/expect";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/expect"; \
-	    libsrcdir="$$s/expect";; \
+	echo Configuring in $(HOST_SUBDIR)/expect; \
+	cd "$(HOST_SUBDIR)/expect" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/expect/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/expect"; \
+	libsrcdir="$$s/expect"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif expect
 
+
+
+
+
 .PHONY: all-expect maybe-all-expect
 maybe-all-expect:
 @if expect
@@ -22694,12 +25424,14 @@
 all-expect: configure-expect
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-	  $(TARGET-expect))
+	(cd $(HOST_SUBDIR)/expect && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-expect))
 @endif expect
 
+
+
+
 .PHONY: check-expect maybe-check-expect
 maybe-check-expect:
 @if expect
@@ -22708,9 +25440,9 @@
 check-expect:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd expect && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/expect && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
 
 @endif expect
 
@@ -22722,9 +25454,9 @@
 install-expect: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd expect && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/expect && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
 
 @endif expect
 
@@ -22740,13 +25472,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22766,13 +25497,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22792,13 +25522,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22818,13 +25547,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22845,13 +25573,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22871,13 +25598,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22896,13 +25622,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22921,13 +25646,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22946,13 +25670,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22971,13 +25694,12 @@
 	@[ -f ./expect/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in expect" ; \
-	(cd expect && \
+	(cd $(HOST_SUBDIR)/expect && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -22988,34 +25710,35 @@
 @endif expect
 
 
+
 .PHONY: configure-guile maybe-configure-guile
 maybe-configure-guile:
 @if guile
 maybe-configure-guile: configure-guile
-configure-guile:
-	@test ! -f guile/Makefile || exit 0; \
-	[ -d guile ] || mkdir guile; \
+configure-guile: 
+	@test ! -f $(HOST_SUBDIR)/guile/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/guile ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in guile; \
-	cd guile || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/guile"; \
-	    libsrcdir="$$s/guile";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/guile"; \
-	    libsrcdir="$$s/guile";; \
+	echo Configuring in $(HOST_SUBDIR)/guile; \
+	cd "$(HOST_SUBDIR)/guile" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/guile/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/guile"; \
+	libsrcdir="$$s/guile"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif guile
 
+
+
+
+
 .PHONY: all-guile maybe-all-guile
 maybe-all-guile:
 @if guile
@@ -23024,12 +25747,14 @@
 all-guile: configure-guile
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-	  $(TARGET-guile))
+	(cd $(HOST_SUBDIR)/guile && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-guile))
 @endif guile
 
+
+
+
 .PHONY: check-guile maybe-check-guile
 maybe-check-guile:
 @if guile
@@ -23038,9 +25763,9 @@
 check-guile:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd guile && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/guile && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
 
 @endif guile
 
@@ -23052,9 +25777,9 @@
 install-guile: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd guile && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/guile && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
 
 @endif guile
 
@@ -23070,13 +25795,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23096,13 +25820,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23122,13 +25845,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23148,13 +25870,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23175,13 +25896,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23201,13 +25921,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23226,13 +25945,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23251,13 +25969,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23276,13 +25993,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23301,13 +26017,12 @@
 	@[ -f ./guile/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in guile" ; \
-	(cd guile && \
+	(cd $(HOST_SUBDIR)/guile && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23318,34 +26033,35 @@
 @endif guile
 
 
+
 .PHONY: configure-tk maybe-configure-tk
 maybe-configure-tk:
 @if tk
 maybe-configure-tk: configure-tk
-configure-tk:
-	@test ! -f tk/Makefile || exit 0; \
-	[ -d tk ] || mkdir tk; \
+configure-tk: 
+	@test ! -f $(HOST_SUBDIR)/tk/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tk ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in tk; \
-	cd tk || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/tk"; \
-	    libsrcdir="$$s/tk";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/tk"; \
-	    libsrcdir="$$s/tk";; \
+	echo Configuring in $(HOST_SUBDIR)/tk; \
+	cd "$(HOST_SUBDIR)/tk" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/tk/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/tk"; \
+	libsrcdir="$$s/tk"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif tk
 
+
+
+
+
 .PHONY: all-tk maybe-all-tk
 maybe-all-tk:
 @if tk
@@ -23354,12 +26070,14 @@
 all-tk: configure-tk
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) \
-	  $(TARGET-tk))
+	(cd $(HOST_SUBDIR)/tk && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-tk))
 @endif tk
 
+
+
+
 .PHONY: check-tk maybe-check-tk
 maybe-check-tk:
 @if tk
@@ -23368,9 +26086,9 @@
 check-tk:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tk && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) check)
+	(cd $(HOST_SUBDIR)/tk && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
 
 @endif tk
 
@@ -23382,9 +26100,9 @@
 install-tk: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd tk && $(MAKE) $(FLAGS_TO_PASS)$(X11_FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/tk && \
+	  $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
 
 @endif tk
 
@@ -23400,13 +26118,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23426,13 +26143,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23452,13 +26168,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23478,13 +26193,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23505,13 +26219,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23531,13 +26244,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23556,13 +26268,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23581,13 +26292,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23606,13 +26316,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23631,13 +26340,12 @@
 	@[ -f ./tk/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) $(X11_FLAGS_TO_PASS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in tk" ; \
-	(cd tk && \
+	(cd $(HOST_SUBDIR)/tk && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23648,34 +26356,35 @@
 @endif tk
 
 
+
 .PHONY: configure-libtermcap maybe-configure-libtermcap
 maybe-configure-libtermcap:
 @if libtermcap
 maybe-configure-libtermcap: configure-libtermcap
-configure-libtermcap:
-	@test ! -f libtermcap/Makefile || exit 0; \
-	[ -d libtermcap ] || mkdir libtermcap; \
+configure-libtermcap: 
+	@test ! -f $(HOST_SUBDIR)/libtermcap/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libtermcap ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in libtermcap; \
-	cd libtermcap || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libtermcap"; \
-	    libsrcdir="$$s/libtermcap";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libtermcap"; \
-	    libsrcdir="$$s/libtermcap";; \
+	echo Configuring in $(HOST_SUBDIR)/libtermcap; \
+	cd "$(HOST_SUBDIR)/libtermcap" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libtermcap/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/libtermcap"; \
+	libsrcdir="$$s/libtermcap"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif libtermcap
 
+
+
+
+
 .PHONY: all-libtermcap maybe-all-libtermcap
 maybe-all-libtermcap:
 @if libtermcap
@@ -23684,12 +26393,14 @@
 all-libtermcap: configure-libtermcap
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libtermcap && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-libtermcap))
+	(cd $(HOST_SUBDIR)/libtermcap && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-libtermcap))
 @endif libtermcap
 
+
+
+
 .PHONY: check-libtermcap maybe-check-libtermcap
 maybe-check-libtermcap:
 @if libtermcap
@@ -23707,9 +26418,9 @@
 install-libtermcap: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/libtermcap && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif libtermcap
 
@@ -23725,13 +26436,12 @@
 	@[ -f ./libtermcap/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 libtermcap" ; \
-	(cd libtermcap && \
+	(cd $(HOST_SUBDIR)/libtermcap && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23751,13 +26461,12 @@
 	@[ -f ./libtermcap/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 libtermcap" ; \
-	(cd libtermcap && \
+	(cd $(HOST_SUBDIR)/libtermcap && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23777,13 +26486,12 @@
 	@[ -f ./libtermcap/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 html in libtermcap" ; \
-	(cd libtermcap && \
+	(cd $(HOST_SUBDIR)/libtermcap && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23803,13 +26511,12 @@
 	@[ -f ./libtermcap/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 libtermcap" ; \
-	(cd libtermcap && \
+	(cd $(HOST_SUBDIR)/libtermcap && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23830,13 +26537,12 @@
 	@[ -f ./libtermcap/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 libtermcap" ; \
-	(cd libtermcap && \
+	(cd $(HOST_SUBDIR)/libtermcap && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23856,13 +26562,12 @@
 	@[ -f ./libtermcap/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 libtermcap" ; \
-	(cd libtermcap && \
+	(cd $(HOST_SUBDIR)/libtermcap && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -23913,34 +26618,35 @@
 @endif libtermcap
 
 
+
 .PHONY: configure-utils maybe-configure-utils
 maybe-configure-utils:
 @if utils
 maybe-configure-utils: configure-utils
-configure-utils:
-	@test ! -f utils/Makefile || exit 0; \
-	[ -d utils ] || mkdir utils; \
+configure-utils: 
+	@test ! -f $(HOST_SUBDIR)/utils/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/utils ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	echo Configuring in utils; \
-	cd utils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/utils"; \
-	    libsrcdir="$$s/utils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/utils"; \
-	    libsrcdir="$$s/utils";; \
+	echo Configuring in $(HOST_SUBDIR)/utils; \
+	cd "$(HOST_SUBDIR)/utils" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/utils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/utils"; \
+	libsrcdir="$$s/utils"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif utils
 
+
+
+
+
 .PHONY: all-utils maybe-all-utils
 maybe-all-utils:
 @if utils
@@ -23949,12 +26655,14 @@
 all-utils: configure-utils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd utils && $(MAKE) $(FLAGS_TO_PASS)  \
-	  $(TARGET-utils))
+	(cd $(HOST_SUBDIR)/utils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-utils))
 @endif utils
 
+
+
+
 .PHONY: check-utils maybe-check-utils
 maybe-check-utils:
 @if utils
@@ -23972,9 +26680,9 @@
 install-utils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd utils && $(MAKE) $(FLAGS_TO_PASS) install)
+	(cd $(HOST_SUBDIR)/utils && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
 
 @endif utils
 
@@ -23990,13 +26698,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24016,13 +26723,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24042,13 +26748,12 @@
 	@[ -f ./utils/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 html in utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24068,13 +26773,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24095,13 +26799,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24121,13 +26824,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24146,13 +26848,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24171,13 +26872,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24196,13 +26896,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24221,13 +26920,12 @@
 	@[ -f ./utils/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 utils" ; \
-	(cd utils && \
+	(cd $(HOST_SUBDIR)/utils && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -24239,48 +26937,373 @@
 
 
 
+.PHONY: configure-gnattools maybe-configure-gnattools
+maybe-configure-gnattools:
+@if gnattools
+maybe-configure-gnattools: configure-gnattools
+configure-gnattools: 
+	@test ! -f $(HOST_SUBDIR)/gnattools/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gnattools ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring in $(HOST_SUBDIR)/gnattools; \
+	cd "$(HOST_SUBDIR)/gnattools" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gnattools/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/gnattools"; \
+	libsrcdir="$$s/gnattools"; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
+	  || exit 1
+@endif gnattools
+
+
+
+
+
+.PHONY: all-gnattools maybe-all-gnattools
+maybe-all-gnattools:
+@if gnattools
+TARGET-gnattools=all
+maybe-all-gnattools: all-gnattools
+all-gnattools: configure-gnattools
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(MAKE) $(FLAGS_TO_PASS)  $(TARGET-gnattools))
+@endif gnattools
+
+
+
+
+.PHONY: check-gnattools maybe-check-gnattools
+maybe-check-gnattools:
+@if gnattools
+maybe-check-gnattools: check-gnattools
+
+check-gnattools:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif gnattools
+
+.PHONY: install-gnattools maybe-install-gnattools
+maybe-install-gnattools:
+@if gnattools
+maybe-install-gnattools: install-gnattools
+
+install-gnattools: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
+
+@endif gnattools
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-gnattools info-gnattools
+maybe-info-gnattools:
+@if gnattools
+maybe-info-gnattools: info-gnattools
+
+info-gnattools: \
+    configure-gnattools 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-dvi-gnattools dvi-gnattools
+maybe-dvi-gnattools:
+@if gnattools
+maybe-dvi-gnattools: dvi-gnattools
+
+dvi-gnattools: \
+    configure-gnattools 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing dvi in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-html-gnattools html-gnattools
+maybe-html-gnattools:
+@if gnattools
+maybe-html-gnattools: html-gnattools
+
+html-gnattools: \
+    configure-gnattools 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing html in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          html) \
+	  || exit 1
+
+@endif gnattools
+
+.PHONY: maybe-TAGS-gnattools TAGS-gnattools
+maybe-TAGS-gnattools:
+@if gnattools
+maybe-TAGS-gnattools: TAGS-gnattools
+
+TAGS-gnattools: \
+    configure-gnattools 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing TAGS in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-install-info-gnattools install-info-gnattools
+maybe-install-info-gnattools:
+@if gnattools
+maybe-install-info-gnattools: install-info-gnattools
+
+install-info-gnattools: \
+    configure-gnattools \
+    info-gnattools 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(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 gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-installcheck-gnattools installcheck-gnattools
+maybe-installcheck-gnattools:
+@if gnattools
+maybe-installcheck-gnattools: installcheck-gnattools
+
+installcheck-gnattools: \
+    configure-gnattools 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing installcheck in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-mostlyclean-gnattools mostlyclean-gnattools
+maybe-mostlyclean-gnattools:
+@if gnattools
+maybe-mostlyclean-gnattools: mostlyclean-gnattools
+
+mostlyclean-gnattools: 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing mostlyclean in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-clean-gnattools clean-gnattools
+maybe-clean-gnattools:
+@if gnattools
+maybe-clean-gnattools: clean-gnattools
+
+clean-gnattools: 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing clean in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-distclean-gnattools distclean-gnattools
+maybe-distclean-gnattools:
+@if gnattools
+maybe-distclean-gnattools: distclean-gnattools
+
+distclean-gnattools: 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing distclean in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+.PHONY: maybe-maintainer-clean-gnattools maintainer-clean-gnattools
+maybe-maintainer-clean-gnattools:
+@if gnattools
+maybe-maintainer-clean-gnattools: maintainer-clean-gnattools
+
+maintainer-clean-gnattools: 
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(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 gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(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 gnattools
+
+
+
 # ---------------------------------------
 # Modules which run on the target machine
 # ---------------------------------------
 
-.PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3
-maybe-configure-target-libstdc++-v3:
-@if target-libstdc++-v3
-maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libstdc++-v3
 $(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \
 	rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
+@endif target-libstdc++-v3
+
 
+
+.PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3
+maybe-configure-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3
 configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \
 	cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
-	  libsrcdir="$$s/libstdc++-v3"; \
+	srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
+	libsrcdir="$$s/libstdc++-v3"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libstdc++-v3
 
+
+
+
+
 .PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3
 maybe-all-target-libstdc++-v3:
 @if target-libstdc++-v3
@@ -24289,12 +27312,15 @@
 all-target-libstdc++-v3: configure-target-libstdc++-v3
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   $(TARGET-target-libstdc++-v3))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  $(TARGET-target-libstdc++-v3))
 @endif target-libstdc++-v3
 
+
+
+
+
 .PHONY: check-target-libstdc++-v3 maybe-check-target-libstdc++-v3
 maybe-check-target-libstdc++-v3:
 @if target-libstdc++-v3
@@ -24303,7 +27329,6 @@
 check-target-libstdc++-v3:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   check)
@@ -24318,7 +27343,6 @@
 install-target-libstdc++-v3: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -24337,7 +27361,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24363,7 +27386,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24389,7 +27411,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24415,7 +27436,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24442,7 +27462,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24468,7 +27487,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24493,7 +27511,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24518,7 +27535,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24543,7 +27559,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24568,7 +27583,6 @@
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24585,44 +27599,46 @@
 @endif target-libstdc++-v3
 
 
-.PHONY: configure-target-libmudflap maybe-configure-target-libmudflap
-maybe-configure-target-libmudflap:
-@if target-libmudflap
-maybe-configure-target-libmudflap: configure-target-libmudflap
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libmudflap
 $(TARGET_SUBDIR)/libmudflap/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \
 	rm -f $(TARGET_SUBDIR)/libmudflap/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libmudflap/multilib.out
+@endif target-libmudflap
+
 
+
+.PHONY: configure-target-libmudflap maybe-configure-target-libmudflap
+maybe-configure-target-libmudflap:
+@if target-libmudflap
+maybe-configure-target-libmudflap: configure-target-libmudflap
 configure-target-libmudflap: $(TARGET_SUBDIR)/libmudflap/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libmudflap/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libmudflap; \
 	cd "$(TARGET_SUBDIR)/libmudflap" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libmudflap/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libmudflap"; \
-	  libsrcdir="$$s/libmudflap"; \
+	srcdiroption="--srcdir=$${topdir}/libmudflap"; \
+	libsrcdir="$$s/libmudflap"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libmudflap
 
+
+
+
+
 .PHONY: all-target-libmudflap maybe-all-target-libmudflap
 maybe-all-target-libmudflap:
 @if target-libmudflap
@@ -24631,12 +27647,15 @@
 all-target-libmudflap: configure-target-libmudflap
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libmudflap && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libmudflap))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libmudflap))
 @endif target-libmudflap
 
+
+
+
+
 .PHONY: check-target-libmudflap maybe-check-target-libmudflap
 maybe-check-target-libmudflap:
 @if target-libmudflap
@@ -24645,7 +27664,6 @@
 check-target-libmudflap:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libmudflap && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -24660,7 +27678,6 @@
 install-target-libmudflap: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libmudflap && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -24679,7 +27696,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24705,7 +27721,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24731,7 +27746,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24757,7 +27771,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24784,7 +27797,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24810,7 +27822,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24835,7 +27846,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24860,7 +27870,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24885,7 +27894,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24910,7 +27918,6 @@
 	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libmudflap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -24927,44 +27934,46 @@
 @endif target-libmudflap
 
 
-.PHONY: configure-target-newlib maybe-configure-target-newlib
-maybe-configure-target-newlib:
-@if target-newlib
-maybe-configure-target-newlib: configure-target-newlib
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-newlib
 $(TARGET_SUBDIR)/newlib/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \
 	rm -f $(TARGET_SUBDIR)/newlib/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/newlib/multilib.out
+@endif target-newlib
+
 
+
+.PHONY: configure-target-newlib maybe-configure-target-newlib
+maybe-configure-target-newlib:
+@if target-newlib
+maybe-configure-target-newlib: configure-target-newlib
 configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/newlib; \
 	cd "$(TARGET_SUBDIR)/newlib" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/newlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/newlib"; \
-	  libsrcdir="$$s/newlib"; \
+	srcdiroption="--srcdir=$${topdir}/newlib"; \
+	libsrcdir="$$s/newlib"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-newlib
 
+
+
+
+
 .PHONY: all-target-newlib maybe-all-target-newlib
 maybe-all-target-newlib:
 @if target-newlib
@@ -24973,12 +27982,15 @@
 all-target-newlib: configure-target-newlib
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/newlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-newlib))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-newlib))
 @endif target-newlib
 
+
+
+
+
 .PHONY: check-target-newlib maybe-check-target-newlib
 maybe-check-target-newlib:
 @if target-newlib
@@ -24987,7 +27999,6 @@
 check-target-newlib:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/newlib && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -25002,7 +28013,6 @@
 install-target-newlib: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/newlib && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -25021,7 +28031,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25047,7 +28056,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25073,7 +28081,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25099,7 +28106,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25126,7 +28132,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25152,7 +28157,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25177,7 +28181,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25202,7 +28205,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25227,7 +28229,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25252,7 +28253,6 @@
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25269,44 +28269,46 @@
 @endif target-newlib
 
 
-.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran
-maybe-configure-target-libgfortran:
-@if target-libgfortran
-maybe-configure-target-libgfortran: configure-target-libgfortran
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libgfortran
 $(TARGET_SUBDIR)/libgfortran/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \
 	rm -f $(TARGET_SUBDIR)/libgfortran/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libgfortran/multilib.out
+@endif target-libgfortran
+
 
+
+.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran
+maybe-configure-target-libgfortran:
+@if target-libgfortran
+maybe-configure-target-libgfortran: configure-target-libgfortran
 configure-target-libgfortran: $(TARGET_SUBDIR)/libgfortran/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libgfortran/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libgfortran; \
 	cd "$(TARGET_SUBDIR)/libgfortran" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libgfortran/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libgfortran"; \
-	  libsrcdir="$$s/libgfortran"; \
+	srcdiroption="--srcdir=$${topdir}/libgfortran"; \
+	libsrcdir="$$s/libgfortran"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libgfortran
 
+
+
+
+
 .PHONY: all-target-libgfortran maybe-all-target-libgfortran
 maybe-all-target-libgfortran:
 @if target-libgfortran
@@ -25315,12 +28317,15 @@
 all-target-libgfortran: configure-target-libgfortran
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgfortran && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libgfortran))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libgfortran))
 @endif target-libgfortran
 
+
+
+
+
 .PHONY: check-target-libgfortran maybe-check-target-libgfortran
 maybe-check-target-libgfortran:
 @if target-libgfortran
@@ -25329,7 +28334,6 @@
 check-target-libgfortran:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -25344,7 +28348,6 @@
 install-target-libgfortran: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -25363,7 +28366,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25389,7 +28391,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25415,7 +28416,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25441,7 +28441,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25468,7 +28467,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25494,7 +28492,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25519,7 +28516,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25544,7 +28540,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25569,7 +28564,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25594,7 +28588,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25611,44 +28604,46 @@
 @endif target-libgfortran
 
 
-.PHONY: configure-target-libobjc maybe-configure-target-libobjc
-maybe-configure-target-libobjc:
-@if target-libobjc
-maybe-configure-target-libobjc: configure-target-libobjc
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libobjc
 $(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \
 	rm -f $(TARGET_SUBDIR)/libobjc/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libobjc/multilib.out
+@endif target-libobjc
+
 
+
+.PHONY: configure-target-libobjc maybe-configure-target-libobjc
+maybe-configure-target-libobjc:
+@if target-libobjc
+maybe-configure-target-libobjc: configure-target-libobjc
 configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libobjc; \
 	cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libobjc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libobjc"; \
-	  libsrcdir="$$s/libobjc"; \
+	srcdiroption="--srcdir=$${topdir}/libobjc"; \
+	libsrcdir="$$s/libobjc"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libobjc
 
+
+
+
+
 .PHONY: all-target-libobjc maybe-all-target-libobjc
 maybe-all-target-libobjc:
 @if target-libobjc
@@ -25657,12 +28652,15 @@
 all-target-libobjc: configure-target-libobjc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libobjc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libobjc))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libobjc))
 @endif target-libobjc
 
+
+
+
+
 .PHONY: check-target-libobjc maybe-check-target-libobjc
 maybe-check-target-libobjc:
 @if target-libobjc
@@ -25671,7 +28669,6 @@
 check-target-libobjc:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libobjc && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -25686,7 +28683,6 @@
 install-target-libobjc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libobjc && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -25705,7 +28701,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25731,7 +28726,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25757,7 +28751,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25783,7 +28776,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25810,7 +28802,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25836,7 +28827,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25861,7 +28851,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25886,7 +28875,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25911,7 +28899,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25936,7 +28923,6 @@
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -25953,66 +28939,46 @@
 @endif target-libobjc
 
 
-.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap
-maybe-configure-target-libtermcap:
-@if target-libtermcap
-maybe-configure-target-libtermcap: configure-target-libtermcap
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libtermcap
 $(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \
 	rm -f $(TARGET_SUBDIR)/libtermcap/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libtermcap/multilib.out
+@endif target-libtermcap
+
 
+
+.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap
+maybe-configure-target-libtermcap:
+@if target-libtermcap
+maybe-configure-target-libtermcap: configure-target-libtermcap
 configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libtermcap; \
 	cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(TARGET_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/libtermcap "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/libtermcap"; \
-	  libsrcdir="$$s/libtermcap"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libtermcap/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libtermcap"; \
+	libsrcdir="$$s/libtermcap"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libtermcap
 
+
+
+
+
 .PHONY: all-target-libtermcap maybe-all-target-libtermcap
 maybe-all-target-libtermcap:
 @if target-libtermcap
@@ -26021,12 +28987,15 @@
 all-target-libtermcap: configure-target-libtermcap
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libtermcap && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libtermcap))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libtermcap))
 @endif target-libtermcap
 
+
+
+
+
 .PHONY: check-target-libtermcap maybe-check-target-libtermcap
 maybe-check-target-libtermcap:
 @if target-libtermcap
@@ -26045,7 +29014,6 @@
 install-target-libtermcap: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libtermcap && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -26064,7 +29032,6 @@
 	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26090,7 +29057,6 @@
 	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26116,7 +29082,6 @@
 	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26142,7 +29107,6 @@
 	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26169,7 +29133,6 @@
 	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26195,7 +29158,6 @@
 	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26252,44 +29214,46 @@
 @endif target-libtermcap
 
 
-.PHONY: configure-target-winsup maybe-configure-target-winsup
-maybe-configure-target-winsup:
-@if target-winsup
-maybe-configure-target-winsup: configure-target-winsup
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-winsup
 $(TARGET_SUBDIR)/winsup/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \
 	rm -f $(TARGET_SUBDIR)/winsup/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/winsup/multilib.out
+@endif target-winsup
 
+
+
+.PHONY: configure-target-winsup maybe-configure-target-winsup
+maybe-configure-target-winsup:
+@if target-winsup
+maybe-configure-target-winsup: configure-target-winsup
 configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/winsup; \
 	cd "$(TARGET_SUBDIR)/winsup" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/winsup/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/winsup"; \
-	  libsrcdir="$$s/winsup"; \
+	srcdiroption="--srcdir=$${topdir}/winsup"; \
+	libsrcdir="$$s/winsup"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-winsup
 
+
+
+
+
 .PHONY: all-target-winsup maybe-all-target-winsup
 maybe-all-target-winsup:
 @if target-winsup
@@ -26298,12 +29262,15 @@
 all-target-winsup: configure-target-winsup
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/winsup && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-winsup))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-winsup))
 @endif target-winsup
 
+
+
+
+
 .PHONY: check-target-winsup maybe-check-target-winsup
 maybe-check-target-winsup:
 @if target-winsup
@@ -26312,7 +29279,6 @@
 check-target-winsup:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/winsup && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -26327,7 +29293,6 @@
 install-target-winsup: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/winsup && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -26346,7 +29311,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26372,7 +29336,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26398,7 +29361,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26424,7 +29386,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26451,7 +29412,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26477,7 +29437,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26502,7 +29461,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26527,7 +29485,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26552,7 +29509,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26577,7 +29533,6 @@
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26594,44 +29549,46 @@
 @endif target-winsup
 
 
-.PHONY: configure-target-libgloss maybe-configure-target-libgloss
-maybe-configure-target-libgloss:
-@if target-libgloss
-maybe-configure-target-libgloss: configure-target-libgloss
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libgloss
 $(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \
 	rm -f $(TARGET_SUBDIR)/libgloss/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libgloss/multilib.out
+@endif target-libgloss
 
+
+
+.PHONY: configure-target-libgloss maybe-configure-target-libgloss
+maybe-configure-target-libgloss:
+@if target-libgloss
+maybe-configure-target-libgloss: configure-target-libgloss
 configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libgloss; \
 	cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libgloss/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libgloss"; \
-	  libsrcdir="$$s/libgloss"; \
+	srcdiroption="--srcdir=$${topdir}/libgloss"; \
+	libsrcdir="$$s/libgloss"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libgloss
 
+
+
+
+
 .PHONY: all-target-libgloss maybe-all-target-libgloss
 maybe-all-target-libgloss:
 @if target-libgloss
@@ -26640,12 +29597,15 @@
 all-target-libgloss: configure-target-libgloss
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgloss && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libgloss))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libgloss))
 @endif target-libgloss
 
+
+
+
+
 .PHONY: check-target-libgloss maybe-check-target-libgloss
 maybe-check-target-libgloss:
 @if target-libgloss
@@ -26664,7 +29624,6 @@
 install-target-libgloss: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgloss && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -26683,7 +29642,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26709,7 +29667,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26735,7 +29692,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26761,7 +29717,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26788,7 +29743,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26814,7 +29768,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26839,7 +29792,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26864,7 +29816,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26889,7 +29840,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26914,7 +29864,6 @@
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -26931,44 +29880,46 @@
 @endif target-libgloss
 
 
-.PHONY: configure-target-libiberty maybe-configure-target-libiberty
-maybe-configure-target-libiberty:
-@if target-libiberty
-maybe-configure-target-libiberty: configure-target-libiberty
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libiberty
 $(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \
 	rm -f $(TARGET_SUBDIR)/libiberty/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libiberty/multilib.out
+@endif target-libiberty
 
+
+
+.PHONY: configure-target-libiberty maybe-configure-target-libiberty
+maybe-configure-target-libiberty:
+@if target-libiberty
+maybe-configure-target-libiberty: configure-target-libiberty
 configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libiberty/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libiberty; \
 	cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libiberty"; \
-	  libsrcdir="$$s/libiberty"; \
+	srcdiroption="--srcdir=$${topdir}/libiberty"; \
+	libsrcdir="$$s/libiberty"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libiberty
 
+
+
+
+
 .PHONY: all-target-libiberty maybe-all-target-libiberty
 maybe-all-target-libiberty:
 @if target-libiberty
@@ -26977,12 +29928,15 @@
 all-target-libiberty: configure-target-libiberty
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libiberty && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libiberty))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libiberty))
 @endif target-libiberty
 
+
+
+
+
 .PHONY: check-target-libiberty maybe-check-target-libiberty
 maybe-check-target-libiberty:
 @if target-libiberty
@@ -26991,7 +29945,6 @@
 check-target-libiberty:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libiberty && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -27006,7 +29959,6 @@
 install-target-libiberty: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libiberty && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -27025,7 +29977,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27051,7 +30002,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27077,7 +30027,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27103,7 +30052,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27130,7 +30078,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27156,7 +30103,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27181,7 +30127,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27206,7 +30151,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27231,7 +30175,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27256,7 +30199,6 @@
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27273,44 +30215,46 @@
 @endif target-libiberty
 
 
-.PHONY: configure-target-gperf maybe-configure-target-gperf
-maybe-configure-target-gperf:
-@if target-gperf
-maybe-configure-target-gperf: configure-target-gperf
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-gperf
 $(TARGET_SUBDIR)/gperf/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \
 	rm -f $(TARGET_SUBDIR)/gperf/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/gperf/multilib.out
+@endif target-gperf
 
+
+
+.PHONY: configure-target-gperf maybe-configure-target-gperf
+maybe-configure-target-gperf:
+@if target-gperf
+maybe-configure-target-gperf: configure-target-gperf
 configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/gperf/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/gperf; \
 	cd "$(TARGET_SUBDIR)/gperf" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/gperf/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/gperf"; \
-	  libsrcdir="$$s/gperf"; \
+	srcdiroption="--srcdir=$${topdir}/gperf"; \
+	libsrcdir="$$s/gperf"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-gperf
 
+
+
+
+
 .PHONY: all-target-gperf maybe-all-target-gperf
 maybe-all-target-gperf:
 @if target-gperf
@@ -27319,12 +30263,15 @@
 all-target-gperf: configure-target-gperf
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/gperf && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-gperf))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-gperf))
 @endif target-gperf
 
+
+
+
+
 .PHONY: check-target-gperf maybe-check-target-gperf
 maybe-check-target-gperf:
 @if target-gperf
@@ -27333,7 +30280,6 @@
 check-target-gperf:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/gperf && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -27348,7 +30294,6 @@
 install-target-gperf: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/gperf && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -27367,7 +30312,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27393,7 +30337,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27419,7 +30362,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27445,7 +30387,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27472,7 +30413,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27498,7 +30438,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27523,7 +30462,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27548,7 +30486,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27573,7 +30510,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27598,7 +30534,6 @@
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27615,44 +30550,46 @@
 @endif target-gperf
 
 
-.PHONY: configure-target-examples maybe-configure-target-examples
-maybe-configure-target-examples:
-@if target-examples
-maybe-configure-target-examples: configure-target-examples
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-examples
 $(TARGET_SUBDIR)/examples/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \
 	rm -f $(TARGET_SUBDIR)/examples/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/examples/multilib.out
+@endif target-examples
 
+
+
+.PHONY: configure-target-examples maybe-configure-target-examples
+maybe-configure-target-examples:
+@if target-examples
+maybe-configure-target-examples: configure-target-examples
 configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/examples/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/examples; \
 	cd "$(TARGET_SUBDIR)/examples" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/examples/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/examples"; \
-	  libsrcdir="$$s/examples"; \
+	srcdiroption="--srcdir=$${topdir}/examples"; \
+	libsrcdir="$$s/examples"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-examples
 
+
+
+
+
 .PHONY: all-target-examples maybe-all-target-examples
 maybe-all-target-examples:
 @if target-examples
@@ -27661,12 +30598,15 @@
 all-target-examples: configure-target-examples
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/examples && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-examples))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-examples))
 @endif target-examples
 
+
+
+
+
 .PHONY: check-target-examples maybe-check-target-examples
 maybe-check-target-examples:
 @if target-examples
@@ -27699,7 +30639,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27725,7 +30664,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27751,7 +30689,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27777,7 +30714,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27804,7 +30740,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27830,7 +30765,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27855,7 +30789,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27880,7 +30813,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27905,7 +30837,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27930,7 +30861,6 @@
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -27947,44 +30877,46 @@
 @endif target-examples
 
 
-.PHONY: configure-target-libffi maybe-configure-target-libffi
-maybe-configure-target-libffi:
-@if target-libffi
-maybe-configure-target-libffi: configure-target-libffi
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libffi
 $(TARGET_SUBDIR)/libffi/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \
 	rm -f $(TARGET_SUBDIR)/libffi/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libffi/multilib.out
+@endif target-libffi
 
+
+
+.PHONY: configure-target-libffi maybe-configure-target-libffi
+maybe-configure-target-libffi:
+@if target-libffi
+maybe-configure-target-libffi: configure-target-libffi
 configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libffi; \
 	cd "$(TARGET_SUBDIR)/libffi" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libffi/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libffi"; \
-	  libsrcdir="$$s/libffi"; \
+	srcdiroption="--srcdir=$${topdir}/libffi"; \
+	libsrcdir="$$s/libffi"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libffi
 
+
+
+
+
 .PHONY: all-target-libffi maybe-all-target-libffi
 maybe-all-target-libffi:
 @if target-libffi
@@ -27993,12 +30925,15 @@
 all-target-libffi: configure-target-libffi
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libffi && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libffi))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libffi))
 @endif target-libffi
 
+
+
+
+
 .PHONY: check-target-libffi maybe-check-target-libffi
 maybe-check-target-libffi:
 @if target-libffi
@@ -28007,7 +30942,6 @@
 check-target-libffi:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libffi && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -28022,7 +30956,6 @@
 install-target-libffi: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libffi && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -28041,7 +30974,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28067,7 +30999,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28093,7 +31024,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28119,7 +31049,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28146,7 +31075,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28172,7 +31100,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28197,7 +31124,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28222,7 +31148,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28247,7 +31172,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28272,7 +31196,6 @@
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28289,44 +31212,46 @@
 @endif target-libffi
 
 
-.PHONY: configure-target-libjava maybe-configure-target-libjava
-maybe-configure-target-libjava:
-@if target-libjava
-maybe-configure-target-libjava: configure-target-libjava
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libjava
 $(TARGET_SUBDIR)/libjava/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \
 	rm -f $(TARGET_SUBDIR)/libjava/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libjava/multilib.out
+@endif target-libjava
 
+
+
+.PHONY: configure-target-libjava maybe-configure-target-libjava
+maybe-configure-target-libjava:
+@if target-libjava
+maybe-configure-target-libjava: configure-target-libjava
 configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libjava; \
 	cd "$(TARGET_SUBDIR)/libjava" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libjava/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libjava"; \
-	  libsrcdir="$$s/libjava"; \
+	srcdiroption="--srcdir=$${topdir}/libjava"; \
+	libsrcdir="$$s/libjava"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libjava
 
+
+
+
+
 .PHONY: all-target-libjava maybe-all-target-libjava
 maybe-all-target-libjava:
 @if target-libjava
@@ -28335,12 +31260,15 @@
 all-target-libjava: configure-target-libjava
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libjava && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   $(TARGET-target-libjava))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  $(TARGET-target-libjava))
 @endif target-libjava
 
+
+
+
+
 .PHONY: check-target-libjava maybe-check-target-libjava
 maybe-check-target-libjava:
 @if target-libjava
@@ -28349,7 +31277,6 @@
 check-target-libjava:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libjava && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   check)
@@ -28364,7 +31291,6 @@
 install-target-libjava: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libjava && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -28383,7 +31309,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28409,7 +31334,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28435,7 +31359,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28461,7 +31384,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28488,7 +31410,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28514,7 +31435,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28539,7 +31459,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28564,7 +31483,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28589,7 +31507,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28614,7 +31531,6 @@
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28631,66 +31547,46 @@
 @endif target-libjava
 
 
-.PHONY: configure-target-zlib maybe-configure-target-zlib
-maybe-configure-target-zlib:
-@if target-zlib
-maybe-configure-target-zlib: configure-target-zlib
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-zlib
 $(TARGET_SUBDIR)/zlib/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \
 	rm -f $(TARGET_SUBDIR)/zlib/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/zlib/multilib.out
+@endif target-zlib
 
+
+
+.PHONY: configure-target-zlib maybe-configure-target-zlib
+maybe-configure-target-zlib:
+@if target-zlib
+maybe-configure-target-zlib: configure-target-zlib
 configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/zlib; \
 	cd "$(TARGET_SUBDIR)/zlib" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(TARGET_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/zlib "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/zlib"; \
-	  libsrcdir="$$s/zlib"; \
-	fi; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/zlib"; \
+	libsrcdir="$$s/zlib"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-zlib
 
+
+
+
+
 .PHONY: all-target-zlib maybe-all-target-zlib
 maybe-all-target-zlib:
 @if target-zlib
@@ -28699,12 +31595,15 @@
 all-target-zlib: configure-target-zlib
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/zlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-zlib))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-zlib))
 @endif target-zlib
 
+
+
+
+
 .PHONY: check-target-zlib maybe-check-target-zlib
 maybe-check-target-zlib:
 @if target-zlib
@@ -28713,7 +31612,6 @@
 check-target-zlib:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/zlib && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -28728,7 +31626,6 @@
 install-target-zlib: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/zlib && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -28747,7 +31644,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28773,7 +31669,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28799,7 +31694,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28825,7 +31719,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28852,7 +31745,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28878,7 +31770,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28903,7 +31794,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28928,7 +31818,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28953,7 +31842,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28978,7 +31866,6 @@
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -28995,44 +31882,46 @@
 @endif target-zlib
 
 
-.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc
-maybe-configure-target-boehm-gc:
-@if target-boehm-gc
-maybe-configure-target-boehm-gc: configure-target-boehm-gc
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-boehm-gc
 $(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \
 	rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/boehm-gc/multilib.out
+@endif target-boehm-gc
+
 
+
+.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc
+maybe-configure-target-boehm-gc:
+@if target-boehm-gc
+maybe-configure-target-boehm-gc: configure-target-boehm-gc
 configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \
 	cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/boehm-gc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/boehm-gc"; \
-	  libsrcdir="$$s/boehm-gc"; \
+	srcdiroption="--srcdir=$${topdir}/boehm-gc"; \
+	libsrcdir="$$s/boehm-gc"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-boehm-gc
 
+
+
+
+
 .PHONY: all-target-boehm-gc maybe-all-target-boehm-gc
 maybe-all-target-boehm-gc:
 @if target-boehm-gc
@@ -29041,12 +31930,15 @@
 all-target-boehm-gc: configure-target-boehm-gc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/boehm-gc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-boehm-gc))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-boehm-gc))
 @endif target-boehm-gc
 
+
+
+
+
 .PHONY: check-target-boehm-gc maybe-check-target-boehm-gc
 maybe-check-target-boehm-gc:
 @if target-boehm-gc
@@ -29055,7 +31947,6 @@
 check-target-boehm-gc:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/boehm-gc && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -29070,7 +31961,6 @@
 install-target-boehm-gc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/boehm-gc && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -29089,7 +31979,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29115,7 +32004,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29141,7 +32029,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29167,7 +32054,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29194,7 +32080,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29220,7 +32105,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29245,7 +32129,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29270,7 +32153,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29295,7 +32177,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29320,7 +32201,6 @@
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29337,44 +32217,46 @@
 @endif target-boehm-gc
 
 
-.PHONY: configure-target-qthreads maybe-configure-target-qthreads
-maybe-configure-target-qthreads:
-@if target-qthreads
-maybe-configure-target-qthreads: configure-target-qthreads
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-qthreads
 $(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \
 	rm -f $(TARGET_SUBDIR)/qthreads/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/qthreads/multilib.out
+@endif target-qthreads
+
 
+
+.PHONY: configure-target-qthreads maybe-configure-target-qthreads
+maybe-configure-target-qthreads:
+@if target-qthreads
+maybe-configure-target-qthreads: configure-target-qthreads
 configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/qthreads/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/qthreads; \
 	cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/qthreads/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/qthreads"; \
-	  libsrcdir="$$s/qthreads"; \
+	srcdiroption="--srcdir=$${topdir}/qthreads"; \
+	libsrcdir="$$s/qthreads"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-qthreads
 
+
+
+
+
 .PHONY: all-target-qthreads maybe-all-target-qthreads
 maybe-all-target-qthreads:
 @if target-qthreads
@@ -29383,12 +32265,15 @@
 all-target-qthreads: configure-target-qthreads
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/qthreads && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-qthreads))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-qthreads))
 @endif target-qthreads
 
+
+
+
+
 .PHONY: check-target-qthreads maybe-check-target-qthreads
 maybe-check-target-qthreads:
 @if target-qthreads
@@ -29397,7 +32282,6 @@
 check-target-qthreads:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/qthreads && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -29412,7 +32296,6 @@
 install-target-qthreads: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/qthreads && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -29431,7 +32314,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29457,7 +32339,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29483,7 +32364,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29509,7 +32389,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29536,7 +32415,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29562,7 +32440,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29587,7 +32464,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29612,7 +32488,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29637,7 +32512,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29662,7 +32536,6 @@
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29679,44 +32552,46 @@
 @endif target-qthreads
 
 
-.PHONY: configure-target-rda maybe-configure-target-rda
-maybe-configure-target-rda:
-@if target-rda
-maybe-configure-target-rda: configure-target-rda
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-rda
 $(TARGET_SUBDIR)/rda/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \
 	rm -f $(TARGET_SUBDIR)/rda/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/rda/multilib.out
+@endif target-rda
+
 
+
+.PHONY: configure-target-rda maybe-configure-target-rda
+maybe-configure-target-rda:
+@if target-rda
+maybe-configure-target-rda: configure-target-rda
 configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/rda; \
 	cd "$(TARGET_SUBDIR)/rda" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/rda/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/rda"; \
-	  libsrcdir="$$s/rda"; \
+	srcdiroption="--srcdir=$${topdir}/rda"; \
+	libsrcdir="$$s/rda"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-rda
 
+
+
+
+
 .PHONY: all-target-rda maybe-all-target-rda
 maybe-all-target-rda:
 @if target-rda
@@ -29725,12 +32600,15 @@
 all-target-rda: configure-target-rda
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/rda && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-rda))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-rda))
 @endif target-rda
 
+
+
+
+
 .PHONY: check-target-rda maybe-check-target-rda
 maybe-check-target-rda:
 @if target-rda
@@ -29739,7 +32617,6 @@
 check-target-rda:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/rda && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -29754,7 +32631,6 @@
 install-target-rda: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/rda && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -29773,7 +32649,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29799,7 +32674,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29825,7 +32699,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29851,7 +32724,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29878,7 +32750,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29904,7 +32775,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29929,7 +32799,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29954,7 +32823,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -29979,7 +32847,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30004,7 +32871,6 @@
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30021,44 +32887,46 @@
 @endif target-rda
 
 
-.PHONY: configure-target-libada maybe-configure-target-libada
-maybe-configure-target-libada:
-@if target-libada
-maybe-configure-target-libada: configure-target-libada
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-libada
 $(TARGET_SUBDIR)/libada/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \
 	rm -f $(TARGET_SUBDIR)/libada/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/libada/multilib.out
+@endif target-libada
+
 
+
+.PHONY: configure-target-libada maybe-configure-target-libada
+maybe-configure-target-libada:
+@if target-libada
+maybe-configure-target-libada: configure-target-libada
 configure-target-libada: $(TARGET_SUBDIR)/libada/multilib.out
 	@test ! -f $(TARGET_SUBDIR)/libada/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libada; \
 	cd "$(TARGET_SUBDIR)/libada" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libada/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libada"; \
-	  libsrcdir="$$s/libada"; \
+	srcdiroption="--srcdir=$${topdir}/libada"; \
+	libsrcdir="$$s/libada"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  $(TARGET_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
 @endif target-libada
 
+
+
+
+
 .PHONY: all-target-libada maybe-all-target-libada
 maybe-all-target-libada:
 @if target-libada
@@ -30067,12 +32935,15 @@
 all-target-libada: configure-target-libada
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libada && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   $(TARGET-target-libada))
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  $(TARGET-target-libada))
 @endif target-libada
 
+
+
+
+
 .PHONY: check-target-libada maybe-check-target-libada
 maybe-check-target-libada:
 @if target-libada
@@ -30081,7 +32952,6 @@
 check-target-libada:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libada && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
@@ -30096,7 +32966,6 @@
 install-target-libada: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libada && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
@@ -30115,7 +32984,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30141,7 +33009,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30167,7 +33034,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing html in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30193,7 +33059,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30220,7 +33085,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30246,7 +33110,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30271,7 +33134,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30296,7 +33158,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30321,7 +33182,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30346,7 +33206,6 @@
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
@@ -30378,9 +33237,9 @@
 $(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@@ -30398,32 +33257,28 @@
 	    msg="Comparing stage2 and stage3 of the compiler"; \
 	    compare=compare ;; \
 	esac; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "$$msg"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
 	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 
 profiledbootstrap: all-prebootstrap configure-gcc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
 	echo "Bootstrapping training compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Building feedback based compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
 	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 
@@ -30431,13 +33286,11 @@
 cross: all-build all-gas all-ld
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Building the C and C++ compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
 	$(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
 @endif gcc-no-bootstrap
@@ -30448,7 +33301,6 @@
 	@if [ -f ./gcc/Makefile ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
 	else \
@@ -30472,7 +33324,6 @@
 	  rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
 	  (cd ./gcc && \
 	   $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
@@ -30562,79 +33413,110 @@
 stage1-start::
 	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
 	echo stage1 > stage_current ; \
-	echo stage1 > stage_last
+	echo stage1 > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
 @if bfd
-	@[ -d stage1-bfd ] || mkdir stage1-bfd; \
-	set stage1-bfd bfd ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-bfd ] || \
+	  mkdir stage1-bfd; \
+	set stage1-bfd bfd ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif bfd
 @if opcodes
-	@[ -d stage1-opcodes ] || mkdir stage1-opcodes; \
-	set stage1-opcodes opcodes ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-opcodes ] || \
+	  mkdir stage1-opcodes; \
+	set stage1-opcodes opcodes ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif opcodes
 @if binutils
-	@[ -d stage1-binutils ] || mkdir stage1-binutils; \
-	set stage1-binutils binutils ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-binutils ] || \
+	  mkdir stage1-binutils; \
+	set stage1-binutils binutils ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif binutils
 @if gas
-	@[ -d stage1-gas ] || mkdir stage1-gas; \
-	set stage1-gas gas ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-gas ] || \
+	  mkdir stage1-gas; \
+	set stage1-gas gas ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif gas
 @if gcc
-	@[ -d stage1-gcc ] || mkdir stage1-gcc; \
-	set stage1-gcc gcc ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-gcc ] || \
+	  mkdir stage1-gcc; \
+	set stage1-gcc gcc ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif gcc
 @if intl
-	@[ -d stage1-intl ] || mkdir stage1-intl; \
-	set stage1-intl intl ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-intl ] || \
+	  mkdir stage1-intl; \
+	set stage1-intl intl ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif intl
 @if ld
-	@[ -d stage1-ld ] || mkdir stage1-ld; \
-	set stage1-ld ld ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-ld ] || \
+	  mkdir stage1-ld; \
+	set stage1-ld ld ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif ld
 @if libcpp
-	@[ -d stage1-libcpp ] || mkdir stage1-libcpp; \
-	set stage1-libcpp libcpp ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-libcpp ] || \
+	  mkdir stage1-libcpp; \
+	set stage1-libcpp libcpp ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif libcpp
 @if libiberty
-	@[ -d stage1-libiberty ] || mkdir stage1-libiberty; \
-	set stage1-libiberty libiberty ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-libiberty ] || \
+	  mkdir stage1-libiberty; \
+	set stage1-libiberty libiberty ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif libiberty
 @if zlib
-	@[ -d stage1-zlib ] || mkdir stage1-zlib; \
-	set stage1-zlib zlib ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage1-zlib ] || \
+	  mkdir stage1-zlib; \
+	set stage1-zlib zlib ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif zlib
 
 stage1-end::
 	@rm -f stage_current
 @if bfd
-	@set bfd stage1-bfd ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set bfd stage1-bfd ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif bfd
 @if opcodes
-	@set opcodes stage1-opcodes ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set opcodes stage1-opcodes ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif opcodes
 @if binutils
-	@set binutils stage1-binutils ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set binutils stage1-binutils ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif binutils
 @if gas
-	@set gas stage1-gas ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set gas stage1-gas ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif gas
 @if gcc
-	@set gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set gcc stage1-gcc ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif gcc
 @if intl
-	@set intl stage1-intl ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set intl stage1-intl ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif intl
 @if ld
-	@set ld stage1-ld ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set ld stage1-ld ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif ld
 @if libcpp
-	@set libcpp stage1-libcpp ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set libcpp stage1-libcpp ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif libcpp
 @if libiberty
-	@set libiberty stage1-libiberty ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set libiberty stage1-libiberty ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif libiberty
 @if zlib
-	@set zlib stage1-zlib ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set zlib stage1-zlib ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif zlib
 
 # Bubble a bugfix through all the stages up to stage 1.  They
@@ -30649,4225 +33531,990 @@
 	fi
 
 .PHONY: all-stage1 clean-stage1
-all-stage1:     \
-  maybe-all-stage1-bfd \
-  maybe-all-stage1-opcodes \
-  maybe-all-stage1-binutils              \
-  maybe-all-stage1-gas \
-  maybe-all-stage1-gcc        \
-  maybe-all-stage1-intl   \
-  maybe-all-stage1-ld \
-  maybe-all-stage1-libcpp  \
-  maybe-all-stage1-libiberty                        \
-  maybe-all-stage1-zlib       
-
 do-clean: clean-stage1
-clean-stage1:     \
-  maybe-clean-stage1-bfd \
-  maybe-clean-stage1-opcodes \
-  maybe-clean-stage1-binutils              \
-  maybe-clean-stage1-gas \
-  maybe-clean-stage1-gcc        \
-  maybe-clean-stage1-intl   \
-  maybe-clean-stage1-ld \
-  maybe-clean-stage1-libcpp  \
-  maybe-clean-stage1-libiberty                        \
-  maybe-clean-stage1-zlib       
 
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
+@if gcc-bootstrap
 
-.PHONY: configure-stage1-bfd maybe-configure-stage1-bfd
-.PHONY: all-stage1-bfd maybe-all-stage1-bfd
-.PHONY: clean-stage1-bfd maybe-clean-stage1-bfd
 
-maybe-configure-stage1-bfd:
-maybe-all-stage1-bfd:
-maybe-clean-stage1-bfd:
 
-@if bfd-bootstrap
-maybe-configure-stage1-bfd: configure-stage1-bfd
-configure-stage1-bfd:
-	@$(MAKE) stage1-start
-	@[ -f bfd/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in bfd ; \
-	cd bfd || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
 
-maybe-all-stage1-bfd: all-stage1-bfd
-all-stage1-bfd: configure-stage1-bfd
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
+# Rules to wipe a stage and all the following ones, also used for cleanstrap
 
-maybe-clean-stage1-bfd: clean-stage1-bfd
-clean-stage1-bfd:
-	@[ -f bfd/Makefile ] || [ -f stage1-bfd/Makefile ] \
-	  || exit 0 ; \
-	[ -f bfd/Makefile ] || $(MAKE) stage1-start ; \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif bfd-bootstrap
+.PHONY: distclean-stage1
+distclean-stage1::
+	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
+	rm -rf stage1-* 
 
 
-.PHONY: configure-stage1-opcodes maybe-configure-stage1-opcodes
-.PHONY: all-stage1-opcodes maybe-all-stage1-opcodes
-.PHONY: clean-stage1-opcodes maybe-clean-stage1-opcodes
+@endif gcc-bootstrap
 
-maybe-configure-stage1-opcodes:
-maybe-all-stage1-opcodes:
-maybe-clean-stage1-opcodes:
 
-@if opcodes-bootstrap
-maybe-configure-stage1-opcodes: configure-stage1-opcodes
-configure-stage1-opcodes:
-	@$(MAKE) stage1-start
-	@[ -f opcodes/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in opcodes ; \
-	cd opcodes || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
+.PHONY: stage2-start stage2-end
 
-maybe-all-stage1-opcodes: all-stage1-opcodes
-all-stage1-opcodes: configure-stage1-opcodes
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
+stage2-start::
+	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
+	echo stage2 > stage_current ; \
+	echo stage2 > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
+@if bfd
+	@cd $(HOST_SUBDIR); [ -d stage2-bfd ] || \
+	  mkdir stage2-bfd; \
+	set stage2-bfd bfd ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-bfd prev-bfd ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); [ -d stage2-opcodes ] || \
+	  mkdir stage2-opcodes; \
+	set stage2-opcodes opcodes ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-opcodes prev-opcodes ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); [ -d stage2-binutils ] || \
+	  mkdir stage2-binutils; \
+	set stage2-binutils binutils ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-binutils prev-binutils ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif binutils
+@if gas
+	@cd $(HOST_SUBDIR); [ -d stage2-gas ] || \
+	  mkdir stage2-gas; \
+	set stage2-gas gas ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-gas prev-gas ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); [ -d stage2-gcc ] || \
+	  mkdir stage2-gcc; \
+	set stage2-gcc gcc ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-gcc prev-gcc ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif gcc
+@if intl
+	@cd $(HOST_SUBDIR); [ -d stage2-intl ] || \
+	  mkdir stage2-intl; \
+	set stage2-intl intl ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-intl prev-intl ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); [ -d stage2-ld ] || \
+	  mkdir stage2-ld; \
+	set stage2-ld ld ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-ld prev-ld ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif ld
+@if libcpp
+	@cd $(HOST_SUBDIR); [ -d stage2-libcpp ] || \
+	  mkdir stage2-libcpp; \
+	set stage2-libcpp libcpp ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-libcpp prev-libcpp ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif libcpp
+@if libiberty
+	@cd $(HOST_SUBDIR); [ -d stage2-libiberty ] || \
+	  mkdir stage2-libiberty; \
+	set stage2-libiberty libiberty ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-libiberty prev-libiberty ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif libiberty
+@if zlib
+	@cd $(HOST_SUBDIR); [ -d stage2-zlib ] || \
+	  mkdir stage2-zlib; \
+	set stage2-zlib zlib ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-zlib prev-zlib ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif zlib
 
-maybe-clean-stage1-opcodes: clean-stage1-opcodes
-clean-stage1-opcodes:
-	@[ -f opcodes/Makefile ] || [ -f stage1-opcodes/Makefile ] \
-	  || exit 0 ; \
-	[ -f opcodes/Makefile ] || $(MAKE) stage1-start ; \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif opcodes-bootstrap
+stage2-end::
+	@rm -f stage_current
+@if bfd
+	@cd $(HOST_SUBDIR); set bfd stage2-bfd ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-bfd stage1-bfd ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); set opcodes stage2-opcodes ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-opcodes stage1-opcodes ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); set binutils stage2-binutils ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-binutils stage1-binutils ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif binutils
+@if gas
+	@cd $(HOST_SUBDIR); set gas stage2-gas ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gas stage1-gas ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); set gcc stage2-gcc ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage1-gcc ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif gcc
+@if intl
+	@cd $(HOST_SUBDIR); set intl stage2-intl ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-intl stage1-intl ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); set ld stage2-ld ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-ld stage1-ld ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif ld
+@if libcpp
+	@cd $(HOST_SUBDIR); set libcpp stage2-libcpp ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libcpp stage1-libcpp ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif libcpp
+@if libiberty
+	@cd $(HOST_SUBDIR); set libiberty stage2-libiberty ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libiberty stage1-libiberty ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif libiberty
+@if zlib
+	@cd $(HOST_SUBDIR); set zlib stage2-zlib ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-zlib stage1-zlib ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif zlib
 
+# Bubble a bugfix through all the stages up to stage 2.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage2-bubble
+stage2-bubble:: stage1-bubble
+	@if test -f stage2-lean || test -f stage1-lean  ; then \
+	  echo Skipping rebuild of stage2 ; \
+	else \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage2; \
+	fi
 
-.PHONY: configure-stage1-binutils maybe-configure-stage1-binutils
-.PHONY: all-stage1-binutils maybe-all-stage1-binutils
-.PHONY: clean-stage1-binutils maybe-clean-stage1-binutils
+.PHONY: all-stage2 clean-stage2
+do-clean: clean-stage2
 
-maybe-configure-stage1-binutils:
-maybe-all-stage1-binutils:
-maybe-clean-stage1-binutils:
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
+@if gcc-bootstrap
 
-@if binutils-bootstrap
-maybe-configure-stage1-binutils: configure-stage1-binutils
-configure-stage1-binutils:
-	@$(MAKE) stage1-start
-	@[ -f binutils/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in binutils ; \
-	cd binutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
 
-maybe-all-stage1-binutils: all-stage1-binutils
-all-stage1-binutils: configure-stage1-binutils
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
 
-maybe-clean-stage1-binutils: clean-stage1-binutils
-clean-stage1-binutils:
-	@[ -f binutils/Makefile ] || [ -f stage1-binutils/Makefile ] \
-	  || exit 0 ; \
-	[ -f binutils/Makefile ] || $(MAKE) stage1-start ; \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif binutils-bootstrap
+.PHONY: bootstrap2
+bootstrap2: stage2-bubble  all
 
 
-.PHONY: configure-stage1-gas maybe-configure-stage1-gas
-.PHONY: all-stage1-gas maybe-all-stage1-gas
-.PHONY: clean-stage1-gas maybe-clean-stage1-gas
-
-maybe-configure-stage1-gas:
-maybe-all-stage1-gas:
-maybe-clean-stage1-gas:
-
-@if gas-bootstrap
-maybe-configure-stage1-gas: configure-stage1-gas
-configure-stage1-gas:
-	@$(MAKE) stage1-start
-	@[ -f gas/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in gas ; \
-	cd gas || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-gas: all-stage1-gas
-all-stage1-gas: configure-stage1-gas
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
-
-maybe-clean-stage1-gas: clean-stage1-gas
-clean-stage1-gas:
-	@[ -f gas/Makefile ] || [ -f stage1-gas/Makefile ] \
-	  || exit 0 ; \
-	[ -f gas/Makefile ] || $(MAKE) stage1-start ; \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif gas-bootstrap
-
-
-.PHONY: configure-stage1-gcc maybe-configure-stage1-gcc
-.PHONY: all-stage1-gcc maybe-all-stage1-gcc
-.PHONY: clean-stage1-gcc maybe-clean-stage1-gcc
-
-maybe-configure-stage1-gcc:
-maybe-all-stage1-gcc:
-maybe-clean-stage1-gcc:
-
-@if gcc-bootstrap
-maybe-configure-stage1-gcc: configure-stage1-gcc
-configure-stage1-gcc:
-	@$(MAKE) stage1-start
-	@[ -f gcc/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in gcc ; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-gcc: all-stage1-gcc
-all-stage1-gcc: configure-stage1-gcc
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS)
-
-maybe-clean-stage1-gcc: clean-stage1-gcc
-clean-stage1-gcc:
-	@[ -f gcc/Makefile ] || [ -f stage1-gcc/Makefile ] \
-	  || exit 0 ; \
-	[ -f gcc/Makefile ] || $(MAKE) stage1-start ; \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean
-@endif gcc-bootstrap
-
-
-.PHONY: configure-stage1-intl maybe-configure-stage1-intl
-.PHONY: all-stage1-intl maybe-all-stage1-intl
-.PHONY: clean-stage1-intl maybe-clean-stage1-intl
-
-maybe-configure-stage1-intl:
-maybe-all-stage1-intl:
-maybe-clean-stage1-intl:
-
-@if intl-bootstrap
-maybe-configure-stage1-intl: configure-stage1-intl
-configure-stage1-intl:
-	@$(MAKE) stage1-start
-	@[ -f intl/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in intl ; \
-	cd intl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-intl: all-stage1-intl
-all-stage1-intl: configure-stage1-intl
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
-
-maybe-clean-stage1-intl: clean-stage1-intl
-clean-stage1-intl:
-	@[ -f intl/Makefile ] || [ -f stage1-intl/Makefile ] \
-	  || exit 0 ; \
-	[ -f intl/Makefile ] || $(MAKE) stage1-start ; \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif intl-bootstrap
-
-
-.PHONY: configure-stage1-ld maybe-configure-stage1-ld
-.PHONY: all-stage1-ld maybe-all-stage1-ld
-.PHONY: clean-stage1-ld maybe-clean-stage1-ld
-
-maybe-configure-stage1-ld:
-maybe-all-stage1-ld:
-maybe-clean-stage1-ld:
-
-@if ld-bootstrap
-maybe-configure-stage1-ld: configure-stage1-ld
-configure-stage1-ld:
-	@$(MAKE) stage1-start
-	@[ -f ld/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in ld ; \
-	cd ld || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-ld: all-stage1-ld
-all-stage1-ld: configure-stage1-ld
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
-
-maybe-clean-stage1-ld: clean-stage1-ld
-clean-stage1-ld:
-	@[ -f ld/Makefile ] || [ -f stage1-ld/Makefile ] \
-	  || exit 0 ; \
-	[ -f ld/Makefile ] || $(MAKE) stage1-start ; \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif ld-bootstrap
-
-
-.PHONY: configure-stage1-libcpp maybe-configure-stage1-libcpp
-.PHONY: all-stage1-libcpp maybe-all-stage1-libcpp
-.PHONY: clean-stage1-libcpp maybe-clean-stage1-libcpp
-
-maybe-configure-stage1-libcpp:
-maybe-all-stage1-libcpp:
-maybe-clean-stage1-libcpp:
-
-@if libcpp-bootstrap
-maybe-configure-stage1-libcpp: configure-stage1-libcpp
-configure-stage1-libcpp:
-	@$(MAKE) stage1-start
-	@[ -f libcpp/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in libcpp ; \
-	cd libcpp || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-libcpp: all-stage1-libcpp
-all-stage1-libcpp: configure-stage1-libcpp
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
-
-maybe-clean-stage1-libcpp: clean-stage1-libcpp
-clean-stage1-libcpp:
-	@[ -f libcpp/Makefile ] || [ -f stage1-libcpp/Makefile ] \
-	  || exit 0 ; \
-	[ -f libcpp/Makefile ] || $(MAKE) stage1-start ; \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif libcpp-bootstrap
-
-
-.PHONY: configure-stage1-libiberty maybe-configure-stage1-libiberty
-.PHONY: all-stage1-libiberty maybe-all-stage1-libiberty
-.PHONY: clean-stage1-libiberty maybe-clean-stage1-libiberty
-
-maybe-configure-stage1-libiberty:
-maybe-all-stage1-libiberty:
-maybe-clean-stage1-libiberty:
-
-@if libiberty-bootstrap
-maybe-configure-stage1-libiberty: configure-stage1-libiberty
-configure-stage1-libiberty:
-	@$(MAKE) stage1-start
-	@[ -f libiberty/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in libiberty ; \
-	cd libiberty || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-libiberty: all-stage1-libiberty
-all-stage1-libiberty: configure-stage1-libiberty
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
-
-maybe-clean-stage1-libiberty: clean-stage1-libiberty
-clean-stage1-libiberty:
-	@[ -f libiberty/Makefile ] || [ -f stage1-libiberty/Makefile ] \
-	  || exit 0 ; \
-	[ -f libiberty/Makefile ] || $(MAKE) stage1-start ; \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif libiberty-bootstrap
-
-
-.PHONY: configure-stage1-zlib maybe-configure-stage1-zlib
-.PHONY: all-stage1-zlib maybe-all-stage1-zlib
-.PHONY: clean-stage1-zlib maybe-clean-stage1-zlib
-
-maybe-configure-stage1-zlib:
-maybe-all-stage1-zlib:
-maybe-clean-stage1-zlib:
-
-@if zlib-bootstrap
-maybe-configure-stage1-zlib: configure-stage1-zlib
-configure-stage1-zlib:
-	@$(MAKE) stage1-start
-	@[ -f zlib/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	echo Configuring stage 1 in zlib ; \
-	cd zlib || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" 
-
-maybe-all-stage1-zlib: all-stage1-zlib
-all-stage1-zlib: configure-stage1-zlib
-	@$(MAKE) stage1-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(HOST_EXPORTS)  \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)" 
-
-maybe-clean-stage1-zlib: clean-stage1-zlib
-clean-stage1-zlib:
-	@[ -f zlib/Makefile ] || [ -f stage1-zlib/Makefile ] \
-	  || exit 0 ; \
-	[ -f zlib/Makefile ] || $(MAKE) stage1-start ; \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		CFLAGS="$(STAGE1_CFLAGS)"  clean
-@endif zlib-bootstrap
-
-
-
-# FIXME: Will not need to be conditional when toplevel bootstrap is the
-# only possibility, but now it conflicts with no-bootstrap rules
-@if gcc-bootstrap
-
-
-
-
-# Rules to wipe a stage and all the following ones, also used for cleanstrap
-
-.PHONY: distclean-stage1
-distclean-stage1::
-	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
-	rm -rf stage1-* 
+# Rules to wipe a stage and all the following ones, also used for cleanstrap
+distclean-stage1:: distclean-stage2 
+.PHONY: distclean-stage2
+distclean-stage2::
+	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
+	rm -rf stage2-* 
 
 
 @endif gcc-bootstrap
 
 
-.PHONY: stage2-start stage2-end
+.PHONY: stage3-start stage3-end
 
-stage2-start::
+stage3-start::
 	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	echo stage2 > stage_current ; \
-	echo stage2 > stage_last
+	echo stage3 > stage_current ; \
+	echo stage3 > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
 @if bfd
-	@[ -d stage2-bfd ] || mkdir stage2-bfd; \
-	set stage2-bfd bfd ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-bfd prev-bfd ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-bfd ] || \
+	  mkdir stage3-bfd; \
+	set stage3-bfd bfd ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-bfd prev-bfd ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif bfd
 @if opcodes
-	@[ -d stage2-opcodes ] || mkdir stage2-opcodes; \
-	set stage2-opcodes opcodes ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-opcodes prev-opcodes ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-opcodes ] || \
+	  mkdir stage3-opcodes; \
+	set stage3-opcodes opcodes ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-opcodes prev-opcodes ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif opcodes
 @if binutils
-	@[ -d stage2-binutils ] || mkdir stage2-binutils; \
-	set stage2-binutils binutils ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-binutils prev-binutils ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-binutils ] || \
+	  mkdir stage3-binutils; \
+	set stage3-binutils binutils ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-binutils prev-binutils ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif binutils
 @if gas
-	@[ -d stage2-gas ] || mkdir stage2-gas; \
-	set stage2-gas gas ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-gas prev-gas ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-gas ] || \
+	  mkdir stage3-gas; \
+	set stage3-gas gas ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-gas prev-gas ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif gas
 @if gcc
-	@[ -d stage2-gcc ] || mkdir stage2-gcc; \
-	set stage2-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-gcc ] || \
+	  mkdir stage3-gcc; \
+	set stage3-gcc gcc ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-gcc prev-gcc ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif gcc
 @if intl
-	@[ -d stage2-intl ] || mkdir stage2-intl; \
-	set stage2-intl intl ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-intl prev-intl ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-intl ] || \
+	  mkdir stage3-intl; \
+	set stage3-intl intl ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-intl prev-intl ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif intl
 @if ld
-	@[ -d stage2-ld ] || mkdir stage2-ld; \
-	set stage2-ld ld ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-ld prev-ld ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-ld ] || \
+	  mkdir stage3-ld; \
+	set stage3-ld ld ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-ld prev-ld ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif ld
 @if libcpp
-	@[ -d stage2-libcpp ] || mkdir stage2-libcpp; \
-	set stage2-libcpp libcpp ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-libcpp prev-libcpp ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-libcpp ] || \
+	  mkdir stage3-libcpp; \
+	set stage3-libcpp libcpp ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-libcpp prev-libcpp ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif libcpp
 @if libiberty
-	@[ -d stage2-libiberty ] || mkdir stage2-libiberty; \
-	set stage2-libiberty libiberty ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-libiberty prev-libiberty ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-libiberty ] || \
+	  mkdir stage3-libiberty; \
+	set stage3-libiberty libiberty ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-libiberty prev-libiberty ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif libiberty
 @if zlib
-	@[ -d stage2-zlib ] || mkdir stage2-zlib; \
-	set stage2-zlib zlib ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-zlib prev-zlib ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage3-zlib ] || \
+	  mkdir stage3-zlib; \
+	set stage3-zlib zlib ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage2-zlib prev-zlib ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif zlib
 
-stage2-end::
+stage3-end::
 	@rm -f stage_current
 @if bfd
-	@set bfd stage2-bfd ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-bfd stage1-bfd ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set bfd stage3-bfd ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-bfd stage2-bfd ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif bfd
 @if opcodes
-	@set opcodes stage2-opcodes ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-opcodes stage1-opcodes ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set opcodes stage3-opcodes ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-opcodes stage2-opcodes ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif opcodes
 @if binutils
-	@set binutils stage2-binutils ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-binutils stage1-binutils ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set binutils stage3-binutils ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-binutils stage2-binutils ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif binutils
 @if gas
-	@set gas stage2-gas ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gas stage1-gas ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set gas stage3-gas ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gas stage2-gas ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif gas
 @if gcc
-	@set gcc stage2-gcc ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set gcc stage3-gcc ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage2-gcc ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif gcc
 @if intl
-	@set intl stage2-intl ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-intl stage1-intl ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set intl stage3-intl ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-intl stage2-intl ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif intl
 @if ld
-	@set ld stage2-ld ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-ld stage1-ld ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set ld stage3-ld ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-ld stage2-ld ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif ld
 @if libcpp
-	@set libcpp stage2-libcpp ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libcpp stage1-libcpp ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set libcpp stage3-libcpp ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libcpp stage2-libcpp ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif libcpp
 @if libiberty
-	@set libiberty stage2-libiberty ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libiberty stage1-libiberty ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set libiberty stage3-libiberty ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libiberty stage2-libiberty ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif libiberty
 @if zlib
-	@set zlib stage2-zlib ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-zlib stage1-zlib ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set zlib stage3-zlib ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-zlib stage2-zlib ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif zlib
 
-# Bubble a bugfix through all the stages up to stage 2.  They
+# Bubble a bugfix through all the stages up to stage 3.  They
 # are remade, but not reconfigured.  The next stage (if any) will not
 # be reconfigured as well.
-.PHONY: stage2-bubble
-stage2-bubble:: stage1-bubble
-	@if test -f stage2-lean || test -f stage1-lean  ; then \
-	  echo Skipping rebuild of stage2 ; \
+.PHONY: stage3-bubble
+stage3-bubble:: stage2-bubble
+	@bootstrap_lean@-rm -rf stage1-* ; $(STAMP) stage1-lean
+	@if test -f stage3-lean || test -f stage2-lean  ; then \
+	  echo Skipping rebuild of stage3 ; \
 	else \
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage2; \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage3; \
 	fi
 
-.PHONY: all-stage2 clean-stage2
-all-stage2:     \
-  maybe-all-stage2-bfd \
-  maybe-all-stage2-opcodes \
-  maybe-all-stage2-binutils              \
-  maybe-all-stage2-gas \
-  maybe-all-stage2-gcc        \
-  maybe-all-stage2-intl   \
-  maybe-all-stage2-ld \
-  maybe-all-stage2-libcpp  \
-  maybe-all-stage2-libiberty                        \
-  maybe-all-stage2-zlib       
-
-do-clean: clean-stage2
-clean-stage2:     \
-  maybe-clean-stage2-bfd \
-  maybe-clean-stage2-opcodes \
-  maybe-clean-stage2-binutils              \
-  maybe-clean-stage2-gas \
-  maybe-clean-stage2-gcc        \
-  maybe-clean-stage2-intl   \
-  maybe-clean-stage2-ld \
-  maybe-clean-stage2-libcpp  \
-  maybe-clean-stage2-libiberty                        \
-  maybe-clean-stage2-zlib       
-
-
-.PHONY: configure-stage2-bfd maybe-configure-stage2-bfd
-.PHONY: all-stage2-bfd maybe-all-stage2-bfd
-.PHONY: clean-stage2-bfd maybe-clean-stage2-bfd
+.PHONY: all-stage3 clean-stage3
+do-clean: clean-stage3
 
-maybe-configure-stage2-bfd:
-maybe-all-stage2-bfd:
-maybe-clean-stage2-bfd:
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
+@if gcc-bootstrap
 
-@if bfd-bootstrap
-maybe-configure-stage2-bfd: configure-stage2-bfd
-configure-stage2-bfd:
-	@$(MAKE) stage2-start
-	@[ -f bfd/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in bfd ; \
-	cd bfd || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-bfd: all-stage2-bfd
-all-stage2-bfd: configure-stage2-bfd
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-bfd: clean-stage2-bfd
-clean-stage2-bfd:
-	@[ -f bfd/Makefile ] || [ -f stage2-bfd/Makefile ] \
-	  || exit 0 ; \
-	[ -f bfd/Makefile ] || $(MAKE) stage2-start ; \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif bfd-bootstrap
-
-
-.PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes
-.PHONY: all-stage2-opcodes maybe-all-stage2-opcodes
-.PHONY: clean-stage2-opcodes maybe-clean-stage2-opcodes
-
-maybe-configure-stage2-opcodes:
-maybe-all-stage2-opcodes:
-maybe-clean-stage2-opcodes:
-
-@if opcodes-bootstrap
-maybe-configure-stage2-opcodes: configure-stage2-opcodes
-configure-stage2-opcodes:
-	@$(MAKE) stage2-start
-	@[ -f opcodes/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in opcodes ; \
-	cd opcodes || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-opcodes: all-stage2-opcodes
-all-stage2-opcodes: configure-stage2-opcodes
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-opcodes: clean-stage2-opcodes
-clean-stage2-opcodes:
-	@[ -f opcodes/Makefile ] || [ -f stage2-opcodes/Makefile ] \
-	  || exit 0 ; \
-	[ -f opcodes/Makefile ] || $(MAKE) stage2-start ; \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif opcodes-bootstrap
-
-
-.PHONY: configure-stage2-binutils maybe-configure-stage2-binutils
-.PHONY: all-stage2-binutils maybe-all-stage2-binutils
-.PHONY: clean-stage2-binutils maybe-clean-stage2-binutils
-
-maybe-configure-stage2-binutils:
-maybe-all-stage2-binutils:
-maybe-clean-stage2-binutils:
-
-@if binutils-bootstrap
-maybe-configure-stage2-binutils: configure-stage2-binutils
-configure-stage2-binutils:
-	@$(MAKE) stage2-start
-	@[ -f binutils/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in binutils ; \
-	cd binutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-binutils: all-stage2-binutils
-all-stage2-binutils: configure-stage2-binutils
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-binutils: clean-stage2-binutils
-clean-stage2-binutils:
-	@[ -f binutils/Makefile ] || [ -f stage2-binutils/Makefile ] \
-	  || exit 0 ; \
-	[ -f binutils/Makefile ] || $(MAKE) stage2-start ; \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif binutils-bootstrap
-
-
-.PHONY: configure-stage2-gas maybe-configure-stage2-gas
-.PHONY: all-stage2-gas maybe-all-stage2-gas
-.PHONY: clean-stage2-gas maybe-clean-stage2-gas
-
-maybe-configure-stage2-gas:
-maybe-all-stage2-gas:
-maybe-clean-stage2-gas:
-
-@if gas-bootstrap
-maybe-configure-stage2-gas: configure-stage2-gas
-configure-stage2-gas:
-	@$(MAKE) stage2-start
-	@[ -f gas/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in gas ; \
-	cd gas || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-gas: all-stage2-gas
-all-stage2-gas: configure-stage2-gas
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-gas: clean-stage2-gas
-clean-stage2-gas:
-	@[ -f gas/Makefile ] || [ -f stage2-gas/Makefile ] \
-	  || exit 0 ; \
-	[ -f gas/Makefile ] || $(MAKE) stage2-start ; \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif gas-bootstrap
-
-
-.PHONY: configure-stage2-gcc maybe-configure-stage2-gcc
-.PHONY: all-stage2-gcc maybe-all-stage2-gcc
-.PHONY: clean-stage2-gcc maybe-clean-stage2-gcc
-
-maybe-configure-stage2-gcc:
-maybe-all-stage2-gcc:
-maybe-clean-stage2-gcc:
-
-@if gcc-bootstrap
-maybe-configure-stage2-gcc: configure-stage2-gcc
-configure-stage2-gcc:
-	@$(MAKE) stage2-start
-	@[ -f gcc/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in gcc ; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-gcc: all-stage2-gcc
-all-stage2-gcc: configure-stage2-gcc
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 $(EXTRA_GCC_FLAGS)
-
-maybe-clean-stage2-gcc: clean-stage2-gcc
-clean-stage2-gcc:
-	@[ -f gcc/Makefile ] || [ -f stage2-gcc/Makefile ] \
-	  || exit 0 ; \
-	[ -f gcc/Makefile ] || $(MAKE) stage2-start ; \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 $(EXTRA_GCC_FLAGS) clean
-@endif gcc-bootstrap
-
-
-.PHONY: configure-stage2-intl maybe-configure-stage2-intl
-.PHONY: all-stage2-intl maybe-all-stage2-intl
-.PHONY: clean-stage2-intl maybe-clean-stage2-intl
-
-maybe-configure-stage2-intl:
-maybe-all-stage2-intl:
-maybe-clean-stage2-intl:
-
-@if intl-bootstrap
-maybe-configure-stage2-intl: configure-stage2-intl
-configure-stage2-intl:
-	@$(MAKE) stage2-start
-	@[ -f intl/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in intl ; \
-	cd intl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-intl: all-stage2-intl
-all-stage2-intl: configure-stage2-intl
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-intl: clean-stage2-intl
-clean-stage2-intl:
-	@[ -f intl/Makefile ] || [ -f stage2-intl/Makefile ] \
-	  || exit 0 ; \
-	[ -f intl/Makefile ] || $(MAKE) stage2-start ; \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif intl-bootstrap
-
-
-.PHONY: configure-stage2-ld maybe-configure-stage2-ld
-.PHONY: all-stage2-ld maybe-all-stage2-ld
-.PHONY: clean-stage2-ld maybe-clean-stage2-ld
-
-maybe-configure-stage2-ld:
-maybe-all-stage2-ld:
-maybe-clean-stage2-ld:
-
-@if ld-bootstrap
-maybe-configure-stage2-ld: configure-stage2-ld
-configure-stage2-ld:
-	@$(MAKE) stage2-start
-	@[ -f ld/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in ld ; \
-	cd ld || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-ld: all-stage2-ld
-all-stage2-ld: configure-stage2-ld
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-ld: clean-stage2-ld
-clean-stage2-ld:
-	@[ -f ld/Makefile ] || [ -f stage2-ld/Makefile ] \
-	  || exit 0 ; \
-	[ -f ld/Makefile ] || $(MAKE) stage2-start ; \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif ld-bootstrap
-
-
-.PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp
-.PHONY: all-stage2-libcpp maybe-all-stage2-libcpp
-.PHONY: clean-stage2-libcpp maybe-clean-stage2-libcpp
-
-maybe-configure-stage2-libcpp:
-maybe-all-stage2-libcpp:
-maybe-clean-stage2-libcpp:
-
-@if libcpp-bootstrap
-maybe-configure-stage2-libcpp: configure-stage2-libcpp
-configure-stage2-libcpp:
-	@$(MAKE) stage2-start
-	@[ -f libcpp/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in libcpp ; \
-	cd libcpp || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-libcpp: all-stage2-libcpp
-all-stage2-libcpp: configure-stage2-libcpp
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-libcpp: clean-stage2-libcpp
-clean-stage2-libcpp:
-	@[ -f libcpp/Makefile ] || [ -f stage2-libcpp/Makefile ] \
-	  || exit 0 ; \
-	[ -f libcpp/Makefile ] || $(MAKE) stage2-start ; \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif libcpp-bootstrap
-
-
-.PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty
-.PHONY: all-stage2-libiberty maybe-all-stage2-libiberty
-.PHONY: clean-stage2-libiberty maybe-clean-stage2-libiberty
-
-maybe-configure-stage2-libiberty:
-maybe-all-stage2-libiberty:
-maybe-clean-stage2-libiberty:
-
-@if libiberty-bootstrap
-maybe-configure-stage2-libiberty: configure-stage2-libiberty
-configure-stage2-libiberty:
-	@$(MAKE) stage2-start
-	@[ -f libiberty/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in libiberty ; \
-	cd libiberty || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-libiberty: all-stage2-libiberty
-all-stage2-libiberty: configure-stage2-libiberty
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-libiberty: clean-stage2-libiberty
-clean-stage2-libiberty:
-	@[ -f libiberty/Makefile ] || [ -f stage2-libiberty/Makefile ] \
-	  || exit 0 ; \
-	[ -f libiberty/Makefile ] || $(MAKE) stage2-start ; \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif libiberty-bootstrap
-
-
-.PHONY: configure-stage2-zlib maybe-configure-stage2-zlib
-.PHONY: all-stage2-zlib maybe-all-stage2-zlib
-.PHONY: clean-stage2-zlib maybe-clean-stage2-zlib
-
-maybe-configure-stage2-zlib:
-maybe-all-stage2-zlib:
-maybe-clean-stage2-zlib:
-
-@if zlib-bootstrap
-maybe-configure-stage2-zlib: configure-stage2-zlib
-configure-stage2-zlib:
-	@$(MAKE) stage2-start
-	@[ -f zlib/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 2 in zlib ; \
-	cd zlib || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage2-zlib: all-stage2-zlib
-all-stage2-zlib: configure-stage2-zlib
-	@$(MAKE) stage2-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage2-zlib: clean-stage2-zlib
-clean-stage2-zlib:
-	@[ -f zlib/Makefile ] || [ -f stage2-zlib/Makefile ] \
-	  || exit 0 ; \
-	[ -f zlib/Makefile ] || $(MAKE) stage2-start ; \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif zlib-bootstrap
-
-
-
-# FIXME: Will not need to be conditional when toplevel bootstrap is the
-# only possibility, but now it conflicts with no-bootstrap rules
-@if gcc-bootstrap
-
-
-
-.PHONY: bootstrap2
-bootstrap2: stage2-bubble  all
-
-
-# Rules to wipe a stage and all the following ones, also used for cleanstrap
-distclean-stage1:: distclean-stage2 
-.PHONY: distclean-stage2
-distclean-stage2::
-	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
-	rm -rf stage2-* 
-
-
-@endif gcc-bootstrap
-
-
-.PHONY: stage3-start stage3-end
-
-stage3-start::
-	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	echo stage3 > stage_current ; \
-	echo stage3 > stage_last
-@if bfd
-	@[ -d stage3-bfd ] || mkdir stage3-bfd; \
-	set stage3-bfd bfd ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-bfd prev-bfd ; @CREATE_LINK_TO_DIR@ 
-@endif bfd
-@if opcodes
-	@[ -d stage3-opcodes ] || mkdir stage3-opcodes; \
-	set stage3-opcodes opcodes ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-opcodes prev-opcodes ; @CREATE_LINK_TO_DIR@ 
-@endif opcodes
-@if binutils
-	@[ -d stage3-binutils ] || mkdir stage3-binutils; \
-	set stage3-binutils binutils ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-binutils prev-binutils ; @CREATE_LINK_TO_DIR@ 
-@endif binutils
-@if gas
-	@[ -d stage3-gas ] || mkdir stage3-gas; \
-	set stage3-gas gas ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-gas prev-gas ; @CREATE_LINK_TO_DIR@ 
-@endif gas
-@if gcc
-	@[ -d stage3-gcc ] || mkdir stage3-gcc; \
-	set stage3-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
-@endif gcc
-@if intl
-	@[ -d stage3-intl ] || mkdir stage3-intl; \
-	set stage3-intl intl ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-intl prev-intl ; @CREATE_LINK_TO_DIR@ 
-@endif intl
-@if ld
-	@[ -d stage3-ld ] || mkdir stage3-ld; \
-	set stage3-ld ld ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-ld prev-ld ; @CREATE_LINK_TO_DIR@ 
-@endif ld
-@if libcpp
-	@[ -d stage3-libcpp ] || mkdir stage3-libcpp; \
-	set stage3-libcpp libcpp ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-libcpp prev-libcpp ; @CREATE_LINK_TO_DIR@ 
-@endif libcpp
-@if libiberty
-	@[ -d stage3-libiberty ] || mkdir stage3-libiberty; \
-	set stage3-libiberty libiberty ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-libiberty prev-libiberty ; @CREATE_LINK_TO_DIR@ 
-@endif libiberty
-@if zlib
-	@[ -d stage3-zlib ] || mkdir stage3-zlib; \
-	set stage3-zlib zlib ; @CREATE_LINK_TO_DIR@  ; \
-	set stage2-zlib prev-zlib ; @CREATE_LINK_TO_DIR@ 
-@endif zlib
-
-stage3-end::
-	@rm -f stage_current
-@if bfd
-	@set bfd stage3-bfd ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-bfd stage2-bfd ; @UNDO_LINK_TO_DIR@ 
-@endif bfd
-@if opcodes
-	@set opcodes stage3-opcodes ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-opcodes stage2-opcodes ; @UNDO_LINK_TO_DIR@ 
-@endif opcodes
-@if binutils
-	@set binutils stage3-binutils ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-binutils stage2-binutils ; @UNDO_LINK_TO_DIR@ 
-@endif binutils
-@if gas
-	@set gas stage3-gas ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gas stage2-gas ; @UNDO_LINK_TO_DIR@ 
-@endif gas
-@if gcc
-	@set gcc stage3-gcc ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gcc stage2-gcc ; @UNDO_LINK_TO_DIR@ 
-@endif gcc
-@if intl
-	@set intl stage3-intl ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-intl stage2-intl ; @UNDO_LINK_TO_DIR@ 
-@endif intl
-@if ld
-	@set ld stage3-ld ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-ld stage2-ld ; @UNDO_LINK_TO_DIR@ 
-@endif ld
-@if libcpp
-	@set libcpp stage3-libcpp ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libcpp stage2-libcpp ; @UNDO_LINK_TO_DIR@ 
-@endif libcpp
-@if libiberty
-	@set libiberty stage3-libiberty ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libiberty stage2-libiberty ; @UNDO_LINK_TO_DIR@ 
-@endif libiberty
-@if zlib
-	@set zlib stage3-zlib ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-zlib stage2-zlib ; @UNDO_LINK_TO_DIR@ 
-@endif zlib
-
-# Bubble a bugfix through all the stages up to stage 3.  They
-# are remade, but not reconfigured.  The next stage (if any) will not
-# be reconfigured as well.
-.PHONY: stage3-bubble
-stage3-bubble:: stage2-bubble
-	@bootstrap_lean@-rm -rf stage1-* ; $(STAMP) stage1-lean
-	@if test -f stage3-lean || test -f stage2-lean  ; then \
-	  echo Skipping rebuild of stage3 ; \
-	else \
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage3; \
-	fi
-
-.PHONY: all-stage3 clean-stage3
-all-stage3:     \
-  maybe-all-stage3-bfd \
-  maybe-all-stage3-opcodes \
-  maybe-all-stage3-binutils              \
-  maybe-all-stage3-gas \
-  maybe-all-stage3-gcc        \
-  maybe-all-stage3-intl   \
-  maybe-all-stage3-ld \
-  maybe-all-stage3-libcpp  \
-  maybe-all-stage3-libiberty                        \
-  maybe-all-stage3-zlib       
-
-do-clean: clean-stage3
-clean-stage3:     \
-  maybe-clean-stage3-bfd \
-  maybe-clean-stage3-opcodes \
-  maybe-clean-stage3-binutils              \
-  maybe-clean-stage3-gas \
-  maybe-clean-stage3-gcc        \
-  maybe-clean-stage3-intl   \
-  maybe-clean-stage3-ld \
-  maybe-clean-stage3-libcpp  \
-  maybe-clean-stage3-libiberty                        \
-  maybe-clean-stage3-zlib       
-
-
-.PHONY: configure-stage3-bfd maybe-configure-stage3-bfd
-.PHONY: all-stage3-bfd maybe-all-stage3-bfd
-.PHONY: clean-stage3-bfd maybe-clean-stage3-bfd
-
-maybe-configure-stage3-bfd:
-maybe-all-stage3-bfd:
-maybe-clean-stage3-bfd:
-
-@if bfd-bootstrap
-maybe-configure-stage3-bfd: configure-stage3-bfd
-configure-stage3-bfd:
-	@$(MAKE) stage3-start
-	@[ -f bfd/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in bfd ; \
-	cd bfd || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-bfd: all-stage3-bfd
-all-stage3-bfd: configure-stage3-bfd
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-bfd: clean-stage3-bfd
-clean-stage3-bfd:
-	@[ -f bfd/Makefile ] || [ -f stage3-bfd/Makefile ] \
-	  || exit 0 ; \
-	[ -f bfd/Makefile ] || $(MAKE) stage3-start ; \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif bfd-bootstrap
-
-
-.PHONY: configure-stage3-opcodes maybe-configure-stage3-opcodes
-.PHONY: all-stage3-opcodes maybe-all-stage3-opcodes
-.PHONY: clean-stage3-opcodes maybe-clean-stage3-opcodes
-
-maybe-configure-stage3-opcodes:
-maybe-all-stage3-opcodes:
-maybe-clean-stage3-opcodes:
-
-@if opcodes-bootstrap
-maybe-configure-stage3-opcodes: configure-stage3-opcodes
-configure-stage3-opcodes:
-	@$(MAKE) stage3-start
-	@[ -f opcodes/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in opcodes ; \
-	cd opcodes || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-opcodes: all-stage3-opcodes
-all-stage3-opcodes: configure-stage3-opcodes
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-opcodes: clean-stage3-opcodes
-clean-stage3-opcodes:
-	@[ -f opcodes/Makefile ] || [ -f stage3-opcodes/Makefile ] \
-	  || exit 0 ; \
-	[ -f opcodes/Makefile ] || $(MAKE) stage3-start ; \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif opcodes-bootstrap
-
-
-.PHONY: configure-stage3-binutils maybe-configure-stage3-binutils
-.PHONY: all-stage3-binutils maybe-all-stage3-binutils
-.PHONY: clean-stage3-binutils maybe-clean-stage3-binutils
-
-maybe-configure-stage3-binutils:
-maybe-all-stage3-binutils:
-maybe-clean-stage3-binutils:
-
-@if binutils-bootstrap
-maybe-configure-stage3-binutils: configure-stage3-binutils
-configure-stage3-binutils:
-	@$(MAKE) stage3-start
-	@[ -f binutils/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in binutils ; \
-	cd binutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-binutils: all-stage3-binutils
-all-stage3-binutils: configure-stage3-binutils
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-binutils: clean-stage3-binutils
-clean-stage3-binutils:
-	@[ -f binutils/Makefile ] || [ -f stage3-binutils/Makefile ] \
-	  || exit 0 ; \
-	[ -f binutils/Makefile ] || $(MAKE) stage3-start ; \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif binutils-bootstrap
-
-
-.PHONY: configure-stage3-gas maybe-configure-stage3-gas
-.PHONY: all-stage3-gas maybe-all-stage3-gas
-.PHONY: clean-stage3-gas maybe-clean-stage3-gas
-
-maybe-configure-stage3-gas:
-maybe-all-stage3-gas:
-maybe-clean-stage3-gas:
-
-@if gas-bootstrap
-maybe-configure-stage3-gas: configure-stage3-gas
-configure-stage3-gas:
-	@$(MAKE) stage3-start
-	@[ -f gas/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in gas ; \
-	cd gas || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-gas: all-stage3-gas
-all-stage3-gas: configure-stage3-gas
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-gas: clean-stage3-gas
-clean-stage3-gas:
-	@[ -f gas/Makefile ] || [ -f stage3-gas/Makefile ] \
-	  || exit 0 ; \
-	[ -f gas/Makefile ] || $(MAKE) stage3-start ; \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif gas-bootstrap
-
-
-.PHONY: configure-stage3-gcc maybe-configure-stage3-gcc
-.PHONY: all-stage3-gcc maybe-all-stage3-gcc
-.PHONY: clean-stage3-gcc maybe-clean-stage3-gcc
-
-maybe-configure-stage3-gcc:
-maybe-all-stage3-gcc:
-maybe-clean-stage3-gcc:
-
-@if gcc-bootstrap
-maybe-configure-stage3-gcc: configure-stage3-gcc
-configure-stage3-gcc:
-	@$(MAKE) stage3-start
-	@[ -f gcc/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in gcc ; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-gcc: all-stage3-gcc
-all-stage3-gcc: configure-stage3-gcc
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 $(EXTRA_GCC_FLAGS)
-
-maybe-clean-stage3-gcc: clean-stage3-gcc
-clean-stage3-gcc:
-	@[ -f gcc/Makefile ] || [ -f stage3-gcc/Makefile ] \
-	  || exit 0 ; \
-	[ -f gcc/Makefile ] || $(MAKE) stage3-start ; \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 $(EXTRA_GCC_FLAGS) clean
-@endif gcc-bootstrap
-
-
-.PHONY: configure-stage3-intl maybe-configure-stage3-intl
-.PHONY: all-stage3-intl maybe-all-stage3-intl
-.PHONY: clean-stage3-intl maybe-clean-stage3-intl
-
-maybe-configure-stage3-intl:
-maybe-all-stage3-intl:
-maybe-clean-stage3-intl:
-
-@if intl-bootstrap
-maybe-configure-stage3-intl: configure-stage3-intl
-configure-stage3-intl:
-	@$(MAKE) stage3-start
-	@[ -f intl/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in intl ; \
-	cd intl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-intl: all-stage3-intl
-all-stage3-intl: configure-stage3-intl
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-intl: clean-stage3-intl
-clean-stage3-intl:
-	@[ -f intl/Makefile ] || [ -f stage3-intl/Makefile ] \
-	  || exit 0 ; \
-	[ -f intl/Makefile ] || $(MAKE) stage3-start ; \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif intl-bootstrap
-
-
-.PHONY: configure-stage3-ld maybe-configure-stage3-ld
-.PHONY: all-stage3-ld maybe-all-stage3-ld
-.PHONY: clean-stage3-ld maybe-clean-stage3-ld
-
-maybe-configure-stage3-ld:
-maybe-all-stage3-ld:
-maybe-clean-stage3-ld:
-
-@if ld-bootstrap
-maybe-configure-stage3-ld: configure-stage3-ld
-configure-stage3-ld:
-	@$(MAKE) stage3-start
-	@[ -f ld/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in ld ; \
-	cd ld || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-ld: all-stage3-ld
-all-stage3-ld: configure-stage3-ld
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-ld: clean-stage3-ld
-clean-stage3-ld:
-	@[ -f ld/Makefile ] || [ -f stage3-ld/Makefile ] \
-	  || exit 0 ; \
-	[ -f ld/Makefile ] || $(MAKE) stage3-start ; \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif ld-bootstrap
-
-
-.PHONY: configure-stage3-libcpp maybe-configure-stage3-libcpp
-.PHONY: all-stage3-libcpp maybe-all-stage3-libcpp
-.PHONY: clean-stage3-libcpp maybe-clean-stage3-libcpp
-
-maybe-configure-stage3-libcpp:
-maybe-all-stage3-libcpp:
-maybe-clean-stage3-libcpp:
-
-@if libcpp-bootstrap
-maybe-configure-stage3-libcpp: configure-stage3-libcpp
-configure-stage3-libcpp:
-	@$(MAKE) stage3-start
-	@[ -f libcpp/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in libcpp ; \
-	cd libcpp || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-libcpp: all-stage3-libcpp
-all-stage3-libcpp: configure-stage3-libcpp
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-libcpp: clean-stage3-libcpp
-clean-stage3-libcpp:
-	@[ -f libcpp/Makefile ] || [ -f stage3-libcpp/Makefile ] \
-	  || exit 0 ; \
-	[ -f libcpp/Makefile ] || $(MAKE) stage3-start ; \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif libcpp-bootstrap
-
-
-.PHONY: configure-stage3-libiberty maybe-configure-stage3-libiberty
-.PHONY: all-stage3-libiberty maybe-all-stage3-libiberty
-.PHONY: clean-stage3-libiberty maybe-clean-stage3-libiberty
-
-maybe-configure-stage3-libiberty:
-maybe-all-stage3-libiberty:
-maybe-clean-stage3-libiberty:
-
-@if libiberty-bootstrap
-maybe-configure-stage3-libiberty: configure-stage3-libiberty
-configure-stage3-libiberty:
-	@$(MAKE) stage3-start
-	@[ -f libiberty/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in libiberty ; \
-	cd libiberty || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-libiberty: all-stage3-libiberty
-all-stage3-libiberty: configure-stage3-libiberty
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-libiberty: clean-stage3-libiberty
-clean-stage3-libiberty:
-	@[ -f libiberty/Makefile ] || [ -f stage3-libiberty/Makefile ] \
-	  || exit 0 ; \
-	[ -f libiberty/Makefile ] || $(MAKE) stage3-start ; \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif libiberty-bootstrap
-
-
-.PHONY: configure-stage3-zlib maybe-configure-stage3-zlib
-.PHONY: all-stage3-zlib maybe-all-stage3-zlib
-.PHONY: clean-stage3-zlib maybe-clean-stage3-zlib
-
-maybe-configure-stage3-zlib:
-maybe-all-stage3-zlib:
-maybe-clean-stage3-zlib:
-
-@if zlib-bootstrap
-maybe-configure-stage3-zlib: configure-stage3-zlib
-configure-stage3-zlib:
-	@$(MAKE) stage3-start
-	@[ -f zlib/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 3 in zlib ; \
-	cd zlib || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage3-zlib: all-stage3-zlib
-all-stage3-zlib: configure-stage3-zlib
-	@$(MAKE) stage3-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage3-zlib: clean-stage3-zlib
-clean-stage3-zlib:
-	@[ -f zlib/Makefile ] || [ -f stage3-zlib/Makefile ] \
-	  || exit 0 ; \
-	[ -f zlib/Makefile ] || $(MAKE) stage3-start ; \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif zlib-bootstrap
-
-
-
-# FIXME: Will not need to be conditional when toplevel bootstrap is the
-# only possibility, but now it conflicts with no-bootstrap rules
-@if gcc-bootstrap
-
-compare:
-	@if test -f stage2-lean; then \
-	  echo Cannot compare object files as stage 2 was deleted. ; \
-	  exit 0 ; \
-	fi; \
-	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	rm -f .bad_compare ; \
-	cd stage3-gcc; \
-	files=`find . -name "*$(objext)" -print` ; \
-	cd .. ; \
-	for file in $${files} ; do \
-	  f1=$$r/stage2-gcc/$$file; f2=$$r/stage3-gcc/$$file; \
-	  @do_compare@ > /dev/null 2>&1; \
-	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
-	done ; \
-	if [ -f .bad_compare ]; then \
-	  echo "Bootstrap comparison failure!"; \
-	  cat .bad_compare; \
-	  exit 1; \
-	else \
-	  true; \
-	fi ; \
-	$(STAMP) compare
-	@bootstrap_lean@-rm -rf stage2-* ; $(STAMP) stage2-lean
-
-
-
-.PHONY: bootstrap
-bootstrap: stage3-bubble compare all
-
-
-# Rules to wipe a stage and all the following ones, also used for cleanstrap
-distclean-stage2:: distclean-stage3 
-.PHONY: distclean-stage3
-distclean-stage3::
-	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
-	rm -rf stage3-* compare 
-
-
-.PHONY: cleanstrap
-cleanstrap: distclean bootstrap
-
-@endif gcc-bootstrap
-
-
-.PHONY: stage4-start stage4-end
-
-stage4-start::
-	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	echo stage4 > stage_current ; \
-	echo stage4 > stage_last
-@if bfd
-	@[ -d stage4-bfd ] || mkdir stage4-bfd; \
-	set stage4-bfd bfd ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-bfd prev-bfd ; @CREATE_LINK_TO_DIR@ 
-@endif bfd
-@if opcodes
-	@[ -d stage4-opcodes ] || mkdir stage4-opcodes; \
-	set stage4-opcodes opcodes ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-opcodes prev-opcodes ; @CREATE_LINK_TO_DIR@ 
-@endif opcodes
-@if binutils
-	@[ -d stage4-binutils ] || mkdir stage4-binutils; \
-	set stage4-binutils binutils ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-binutils prev-binutils ; @CREATE_LINK_TO_DIR@ 
-@endif binutils
-@if gas
-	@[ -d stage4-gas ] || mkdir stage4-gas; \
-	set stage4-gas gas ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-gas prev-gas ; @CREATE_LINK_TO_DIR@ 
-@endif gas
-@if gcc
-	@[ -d stage4-gcc ] || mkdir stage4-gcc; \
-	set stage4-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
-@endif gcc
-@if intl
-	@[ -d stage4-intl ] || mkdir stage4-intl; \
-	set stage4-intl intl ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-intl prev-intl ; @CREATE_LINK_TO_DIR@ 
-@endif intl
-@if ld
-	@[ -d stage4-ld ] || mkdir stage4-ld; \
-	set stage4-ld ld ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-ld prev-ld ; @CREATE_LINK_TO_DIR@ 
-@endif ld
-@if libcpp
-	@[ -d stage4-libcpp ] || mkdir stage4-libcpp; \
-	set stage4-libcpp libcpp ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-libcpp prev-libcpp ; @CREATE_LINK_TO_DIR@ 
-@endif libcpp
-@if libiberty
-	@[ -d stage4-libiberty ] || mkdir stage4-libiberty; \
-	set stage4-libiberty libiberty ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-libiberty prev-libiberty ; @CREATE_LINK_TO_DIR@ 
-@endif libiberty
-@if zlib
-	@[ -d stage4-zlib ] || mkdir stage4-zlib; \
-	set stage4-zlib zlib ; @CREATE_LINK_TO_DIR@  ; \
-	set stage3-zlib prev-zlib ; @CREATE_LINK_TO_DIR@ 
-@endif zlib
-
-stage4-end::
-	@rm -f stage_current
-@if bfd
-	@set bfd stage4-bfd ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-bfd stage3-bfd ; @UNDO_LINK_TO_DIR@ 
-@endif bfd
-@if opcodes
-	@set opcodes stage4-opcodes ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-opcodes stage3-opcodes ; @UNDO_LINK_TO_DIR@ 
-@endif opcodes
-@if binutils
-	@set binutils stage4-binutils ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-binutils stage3-binutils ; @UNDO_LINK_TO_DIR@ 
-@endif binutils
-@if gas
-	@set gas stage4-gas ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gas stage3-gas ; @UNDO_LINK_TO_DIR@ 
-@endif gas
-@if gcc
-	@set gcc stage4-gcc ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gcc stage3-gcc ; @UNDO_LINK_TO_DIR@ 
-@endif gcc
-@if intl
-	@set intl stage4-intl ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-intl stage3-intl ; @UNDO_LINK_TO_DIR@ 
-@endif intl
-@if ld
-	@set ld stage4-ld ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-ld stage3-ld ; @UNDO_LINK_TO_DIR@ 
-@endif ld
-@if libcpp
-	@set libcpp stage4-libcpp ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libcpp stage3-libcpp ; @UNDO_LINK_TO_DIR@ 
-@endif libcpp
-@if libiberty
-	@set libiberty stage4-libiberty ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libiberty stage3-libiberty ; @UNDO_LINK_TO_DIR@ 
-@endif libiberty
-@if zlib
-	@set zlib stage4-zlib ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-zlib stage3-zlib ; @UNDO_LINK_TO_DIR@ 
-@endif zlib
-
-# Bubble a bugfix through all the stages up to stage 4.  They
-# are remade, but not reconfigured.  The next stage (if any) will not
-# be reconfigured as well.
-.PHONY: stage4-bubble
-stage4-bubble:: stage3-bubble
-	@bootstrap_lean@-rm -rf stage2-* ; $(STAMP) stage2-lean
-	@if test -f stage4-lean || test -f stage3-lean  ; then \
-	  echo Skipping rebuild of stage4 ; \
-	else \
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage4; \
-	fi
-
-.PHONY: all-stage4 clean-stage4
-all-stage4:     \
-  maybe-all-stage4-bfd \
-  maybe-all-stage4-opcodes \
-  maybe-all-stage4-binutils              \
-  maybe-all-stage4-gas \
-  maybe-all-stage4-gcc        \
-  maybe-all-stage4-intl   \
-  maybe-all-stage4-ld \
-  maybe-all-stage4-libcpp  \
-  maybe-all-stage4-libiberty                        \
-  maybe-all-stage4-zlib       
-
-do-clean: clean-stage4
-clean-stage4:     \
-  maybe-clean-stage4-bfd \
-  maybe-clean-stage4-opcodes \
-  maybe-clean-stage4-binutils              \
-  maybe-clean-stage4-gas \
-  maybe-clean-stage4-gcc        \
-  maybe-clean-stage4-intl   \
-  maybe-clean-stage4-ld \
-  maybe-clean-stage4-libcpp  \
-  maybe-clean-stage4-libiberty                        \
-  maybe-clean-stage4-zlib       
-
-
-.PHONY: configure-stage4-bfd maybe-configure-stage4-bfd
-.PHONY: all-stage4-bfd maybe-all-stage4-bfd
-.PHONY: clean-stage4-bfd maybe-clean-stage4-bfd
-
-maybe-configure-stage4-bfd:
-maybe-all-stage4-bfd:
-maybe-clean-stage4-bfd:
-
-@if bfd-bootstrap
-maybe-configure-stage4-bfd: configure-stage4-bfd
-configure-stage4-bfd:
-	@$(MAKE) stage4-start
-	@[ -f bfd/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in bfd ; \
-	cd bfd || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-bfd: all-stage4-bfd
-all-stage4-bfd: configure-stage4-bfd
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-bfd: clean-stage4-bfd
-clean-stage4-bfd:
-	@[ -f bfd/Makefile ] || [ -f stage4-bfd/Makefile ] \
-	  || exit 0 ; \
-	[ -f bfd/Makefile ] || $(MAKE) stage4-start ; \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif bfd-bootstrap
-
-
-.PHONY: configure-stage4-opcodes maybe-configure-stage4-opcodes
-.PHONY: all-stage4-opcodes maybe-all-stage4-opcodes
-.PHONY: clean-stage4-opcodes maybe-clean-stage4-opcodes
-
-maybe-configure-stage4-opcodes:
-maybe-all-stage4-opcodes:
-maybe-clean-stage4-opcodes:
-
-@if opcodes-bootstrap
-maybe-configure-stage4-opcodes: configure-stage4-opcodes
-configure-stage4-opcodes:
-	@$(MAKE) stage4-start
-	@[ -f opcodes/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in opcodes ; \
-	cd opcodes || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-opcodes: all-stage4-opcodes
-all-stage4-opcodes: configure-stage4-opcodes
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-opcodes: clean-stage4-opcodes
-clean-stage4-opcodes:
-	@[ -f opcodes/Makefile ] || [ -f stage4-opcodes/Makefile ] \
-	  || exit 0 ; \
-	[ -f opcodes/Makefile ] || $(MAKE) stage4-start ; \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif opcodes-bootstrap
-
-
-.PHONY: configure-stage4-binutils maybe-configure-stage4-binutils
-.PHONY: all-stage4-binutils maybe-all-stage4-binutils
-.PHONY: clean-stage4-binutils maybe-clean-stage4-binutils
-
-maybe-configure-stage4-binutils:
-maybe-all-stage4-binutils:
-maybe-clean-stage4-binutils:
-
-@if binutils-bootstrap
-maybe-configure-stage4-binutils: configure-stage4-binutils
-configure-stage4-binutils:
-	@$(MAKE) stage4-start
-	@[ -f binutils/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in binutils ; \
-	cd binutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-binutils: all-stage4-binutils
-all-stage4-binutils: configure-stage4-binutils
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-binutils: clean-stage4-binutils
-clean-stage4-binutils:
-	@[ -f binutils/Makefile ] || [ -f stage4-binutils/Makefile ] \
-	  || exit 0 ; \
-	[ -f binutils/Makefile ] || $(MAKE) stage4-start ; \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif binutils-bootstrap
-
-
-.PHONY: configure-stage4-gas maybe-configure-stage4-gas
-.PHONY: all-stage4-gas maybe-all-stage4-gas
-.PHONY: clean-stage4-gas maybe-clean-stage4-gas
-
-maybe-configure-stage4-gas:
-maybe-all-stage4-gas:
-maybe-clean-stage4-gas:
-
-@if gas-bootstrap
-maybe-configure-stage4-gas: configure-stage4-gas
-configure-stage4-gas:
-	@$(MAKE) stage4-start
-	@[ -f gas/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in gas ; \
-	cd gas || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-gas: all-stage4-gas
-all-stage4-gas: configure-stage4-gas
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-gas: clean-stage4-gas
-clean-stage4-gas:
-	@[ -f gas/Makefile ] || [ -f stage4-gas/Makefile ] \
-	  || exit 0 ; \
-	[ -f gas/Makefile ] || $(MAKE) stage4-start ; \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif gas-bootstrap
-
-
-.PHONY: configure-stage4-gcc maybe-configure-stage4-gcc
-.PHONY: all-stage4-gcc maybe-all-stage4-gcc
-.PHONY: clean-stage4-gcc maybe-clean-stage4-gcc
-
-maybe-configure-stage4-gcc:
-maybe-all-stage4-gcc:
-maybe-clean-stage4-gcc:
-
-@if gcc-bootstrap
-maybe-configure-stage4-gcc: configure-stage4-gcc
-configure-stage4-gcc:
-	@$(MAKE) stage4-start
-	@[ -f gcc/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in gcc ; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-gcc: all-stage4-gcc
-all-stage4-gcc: configure-stage4-gcc
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 $(EXTRA_GCC_FLAGS)
-
-maybe-clean-stage4-gcc: clean-stage4-gcc
-clean-stage4-gcc:
-	@[ -f gcc/Makefile ] || [ -f stage4-gcc/Makefile ] \
-	  || exit 0 ; \
-	[ -f gcc/Makefile ] || $(MAKE) stage4-start ; \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 $(EXTRA_GCC_FLAGS) clean
-@endif gcc-bootstrap
-
-
-.PHONY: configure-stage4-intl maybe-configure-stage4-intl
-.PHONY: all-stage4-intl maybe-all-stage4-intl
-.PHONY: clean-stage4-intl maybe-clean-stage4-intl
-
-maybe-configure-stage4-intl:
-maybe-all-stage4-intl:
-maybe-clean-stage4-intl:
-
-@if intl-bootstrap
-maybe-configure-stage4-intl: configure-stage4-intl
-configure-stage4-intl:
-	@$(MAKE) stage4-start
-	@[ -f intl/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in intl ; \
-	cd intl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-intl: all-stage4-intl
-all-stage4-intl: configure-stage4-intl
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-intl: clean-stage4-intl
-clean-stage4-intl:
-	@[ -f intl/Makefile ] || [ -f stage4-intl/Makefile ] \
-	  || exit 0 ; \
-	[ -f intl/Makefile ] || $(MAKE) stage4-start ; \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif intl-bootstrap
-
-
-.PHONY: configure-stage4-ld maybe-configure-stage4-ld
-.PHONY: all-stage4-ld maybe-all-stage4-ld
-.PHONY: clean-stage4-ld maybe-clean-stage4-ld
-
-maybe-configure-stage4-ld:
-maybe-all-stage4-ld:
-maybe-clean-stage4-ld:
-
-@if ld-bootstrap
-maybe-configure-stage4-ld: configure-stage4-ld
-configure-stage4-ld:
-	@$(MAKE) stage4-start
-	@[ -f ld/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in ld ; \
-	cd ld || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-ld: all-stage4-ld
-all-stage4-ld: configure-stage4-ld
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-ld: clean-stage4-ld
-clean-stage4-ld:
-	@[ -f ld/Makefile ] || [ -f stage4-ld/Makefile ] \
-	  || exit 0 ; \
-	[ -f ld/Makefile ] || $(MAKE) stage4-start ; \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif ld-bootstrap
-
-
-.PHONY: configure-stage4-libcpp maybe-configure-stage4-libcpp
-.PHONY: all-stage4-libcpp maybe-all-stage4-libcpp
-.PHONY: clean-stage4-libcpp maybe-clean-stage4-libcpp
-
-maybe-configure-stage4-libcpp:
-maybe-all-stage4-libcpp:
-maybe-clean-stage4-libcpp:
-
-@if libcpp-bootstrap
-maybe-configure-stage4-libcpp: configure-stage4-libcpp
-configure-stage4-libcpp:
-	@$(MAKE) stage4-start
-	@[ -f libcpp/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in libcpp ; \
-	cd libcpp || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-libcpp: all-stage4-libcpp
-all-stage4-libcpp: configure-stage4-libcpp
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-libcpp: clean-stage4-libcpp
-clean-stage4-libcpp:
-	@[ -f libcpp/Makefile ] || [ -f stage4-libcpp/Makefile ] \
-	  || exit 0 ; \
-	[ -f libcpp/Makefile ] || $(MAKE) stage4-start ; \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif libcpp-bootstrap
-
-
-.PHONY: configure-stage4-libiberty maybe-configure-stage4-libiberty
-.PHONY: all-stage4-libiberty maybe-all-stage4-libiberty
-.PHONY: clean-stage4-libiberty maybe-clean-stage4-libiberty
-
-maybe-configure-stage4-libiberty:
-maybe-all-stage4-libiberty:
-maybe-clean-stage4-libiberty:
-
-@if libiberty-bootstrap
-maybe-configure-stage4-libiberty: configure-stage4-libiberty
-configure-stage4-libiberty:
-	@$(MAKE) stage4-start
-	@[ -f libiberty/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in libiberty ; \
-	cd libiberty || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-libiberty: all-stage4-libiberty
-all-stage4-libiberty: configure-stage4-libiberty
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-libiberty: clean-stage4-libiberty
-clean-stage4-libiberty:
-	@[ -f libiberty/Makefile ] || [ -f stage4-libiberty/Makefile ] \
-	  || exit 0 ; \
-	[ -f libiberty/Makefile ] || $(MAKE) stage4-start ; \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif libiberty-bootstrap
-
-
-.PHONY: configure-stage4-zlib maybe-configure-stage4-zlib
-.PHONY: all-stage4-zlib maybe-all-stage4-zlib
-.PHONY: clean-stage4-zlib maybe-clean-stage4-zlib
-
-maybe-configure-stage4-zlib:
-maybe-all-stage4-zlib:
-maybe-clean-stage4-zlib:
-
-@if zlib-bootstrap
-maybe-configure-stage4-zlib: configure-stage4-zlib
-configure-stage4-zlib:
-	@$(MAKE) stage4-start
-	@[ -f zlib/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage 4 in zlib ; \
-	cd zlib || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stage4-zlib: all-stage4-zlib
-all-stage4-zlib: configure-stage4-zlib
-	@$(MAKE) stage4-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		 
-
-maybe-clean-stage4-zlib: clean-stage4-zlib
-clean-stage4-zlib:
-	@[ -f zlib/Makefile ] || [ -f stage4-zlib/Makefile ] \
-	  || exit 0 ; \
-	[ -f zlib/Makefile ] || $(MAKE) stage4-start ; \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		  clean
-@endif zlib-bootstrap
-
-
-
-# FIXME: Will not need to be conditional when toplevel bootstrap is the
-# only possibility, but now it conflicts with no-bootstrap rules
-@if gcc-bootstrap
-
-compare3:
-	@if test -f stage3-lean; then \
-	  echo Cannot compare object files as stage 3 was deleted. ; \
-	  exit 0 ; \
-	fi; \
-	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	rm -f .bad_compare ; \
-	cd stage4-gcc; \
-	files=`find . -name "*$(objext)" -print` ; \
-	cd .. ; \
-	for file in $${files} ; do \
-	  f1=$$r/stage3-gcc/$$file; f2=$$r/stage4-gcc/$$file; \
-	  @do_compare@ > /dev/null 2>&1; \
-	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
-	done ; \
-	if [ -f .bad_compare ]; then \
-	  echo "Bootstrap comparison failure!"; \
-	  cat .bad_compare; \
-	  exit 1; \
-	else \
-	  true; \
-	fi ; \
-	$(STAMP) compare3
-	@bootstrap_lean@-rm -rf stage3-* ; $(STAMP) stage3-lean
-
-
-
-.PHONY: bootstrap4
-bootstrap4: stage4-bubble compare3 all
-
-
-# Rules to wipe a stage and all the following ones, also used for cleanstrap
-distclean-stage3:: distclean-stage4 
-.PHONY: distclean-stage4
-distclean-stage4::
-	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
-	rm -rf stage4-* compare3 
-
-
-@endif gcc-bootstrap
-
-
-.PHONY: stageprofile-start stageprofile-end
-
-stageprofile-start::
-	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	echo stageprofile > stage_current ; \
-	echo stageprofile > stage_last
-@if bfd
-	@[ -d stageprofile-bfd ] || mkdir stageprofile-bfd; \
-	set stageprofile-bfd bfd ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-bfd prev-bfd ; @CREATE_LINK_TO_DIR@ 
-@endif bfd
-@if opcodes
-	@[ -d stageprofile-opcodes ] || mkdir stageprofile-opcodes; \
-	set stageprofile-opcodes opcodes ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-opcodes prev-opcodes ; @CREATE_LINK_TO_DIR@ 
-@endif opcodes
-@if binutils
-	@[ -d stageprofile-binutils ] || mkdir stageprofile-binutils; \
-	set stageprofile-binutils binutils ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-binutils prev-binutils ; @CREATE_LINK_TO_DIR@ 
-@endif binutils
-@if gas
-	@[ -d stageprofile-gas ] || mkdir stageprofile-gas; \
-	set stageprofile-gas gas ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-gas prev-gas ; @CREATE_LINK_TO_DIR@ 
-@endif gas
-@if gcc
-	@[ -d stageprofile-gcc ] || mkdir stageprofile-gcc; \
-	set stageprofile-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
-@endif gcc
-@if intl
-	@[ -d stageprofile-intl ] || mkdir stageprofile-intl; \
-	set stageprofile-intl intl ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-intl prev-intl ; @CREATE_LINK_TO_DIR@ 
-@endif intl
-@if ld
-	@[ -d stageprofile-ld ] || mkdir stageprofile-ld; \
-	set stageprofile-ld ld ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-ld prev-ld ; @CREATE_LINK_TO_DIR@ 
-@endif ld
-@if libcpp
-	@[ -d stageprofile-libcpp ] || mkdir stageprofile-libcpp; \
-	set stageprofile-libcpp libcpp ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-libcpp prev-libcpp ; @CREATE_LINK_TO_DIR@ 
-@endif libcpp
-@if libiberty
-	@[ -d stageprofile-libiberty ] || mkdir stageprofile-libiberty; \
-	set stageprofile-libiberty libiberty ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-libiberty prev-libiberty ; @CREATE_LINK_TO_DIR@ 
-@endif libiberty
-@if zlib
-	@[ -d stageprofile-zlib ] || mkdir stageprofile-zlib; \
-	set stageprofile-zlib zlib ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-zlib prev-zlib ; @CREATE_LINK_TO_DIR@ 
-@endif zlib
-
-stageprofile-end::
-	@rm -f stage_current
-@if bfd
-	@set bfd stageprofile-bfd ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-bfd stage1-bfd ; @UNDO_LINK_TO_DIR@ 
-@endif bfd
-@if opcodes
-	@set opcodes stageprofile-opcodes ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-opcodes stage1-opcodes ; @UNDO_LINK_TO_DIR@ 
-@endif opcodes
-@if binutils
-	@set binutils stageprofile-binutils ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-binutils stage1-binutils ; @UNDO_LINK_TO_DIR@ 
-@endif binutils
-@if gas
-	@set gas stageprofile-gas ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gas stage1-gas ; @UNDO_LINK_TO_DIR@ 
-@endif gas
-@if gcc
-	@set gcc stageprofile-gcc ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
-@endif gcc
-@if intl
-	@set intl stageprofile-intl ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-intl stage1-intl ; @UNDO_LINK_TO_DIR@ 
-@endif intl
-@if ld
-	@set ld stageprofile-ld ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-ld stage1-ld ; @UNDO_LINK_TO_DIR@ 
-@endif ld
-@if libcpp
-	@set libcpp stageprofile-libcpp ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libcpp stage1-libcpp ; @UNDO_LINK_TO_DIR@ 
-@endif libcpp
-@if libiberty
-	@set libiberty stageprofile-libiberty ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libiberty stage1-libiberty ; @UNDO_LINK_TO_DIR@ 
-@endif libiberty
-@if zlib
-	@set zlib stageprofile-zlib ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-zlib stage1-zlib ; @UNDO_LINK_TO_DIR@ 
-@endif zlib
-
-# Bubble a bugfix through all the stages up to stage profile.  They
-# are remade, but not reconfigured.  The next stage (if any) will not
-# be reconfigured as well.
-.PHONY: stageprofile-bubble
-stageprofile-bubble:: stage1-bubble
-	@if test -f stageprofile-lean || test -f stage1-lean  ; then \
-	  echo Skipping rebuild of stageprofile ; \
-	else \
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stageprofile; \
-	fi
-
-.PHONY: all-stageprofile clean-stageprofile
-all-stageprofile:     \
-  maybe-all-stageprofile-bfd \
-  maybe-all-stageprofile-opcodes \
-  maybe-all-stageprofile-binutils              \
-  maybe-all-stageprofile-gas \
-  maybe-all-stageprofile-gcc        \
-  maybe-all-stageprofile-intl   \
-  maybe-all-stageprofile-ld \
-  maybe-all-stageprofile-libcpp  \
-  maybe-all-stageprofile-libiberty                        \
-  maybe-all-stageprofile-zlib       
-
-do-clean: clean-stageprofile
-clean-stageprofile:     \
-  maybe-clean-stageprofile-bfd \
-  maybe-clean-stageprofile-opcodes \
-  maybe-clean-stageprofile-binutils              \
-  maybe-clean-stageprofile-gas \
-  maybe-clean-stageprofile-gcc        \
-  maybe-clean-stageprofile-intl   \
-  maybe-clean-stageprofile-ld \
-  maybe-clean-stageprofile-libcpp  \
-  maybe-clean-stageprofile-libiberty                        \
-  maybe-clean-stageprofile-zlib       
-
-
-.PHONY: configure-stageprofile-bfd maybe-configure-stageprofile-bfd
-.PHONY: all-stageprofile-bfd maybe-all-stageprofile-bfd
-.PHONY: clean-stageprofile-bfd maybe-clean-stageprofile-bfd
-
-maybe-configure-stageprofile-bfd:
-maybe-all-stageprofile-bfd:
-maybe-clean-stageprofile-bfd:
-
-@if bfd-bootstrap
-maybe-configure-stageprofile-bfd: configure-stageprofile-bfd
-configure-stageprofile-bfd:
-	@$(MAKE) stageprofile-start
-	@[ -f bfd/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in bfd ; \
-	cd bfd || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-bfd: all-stageprofile-bfd
-all-stageprofile-bfd: configure-stageprofile-bfd
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-bfd: clean-stageprofile-bfd
-clean-stageprofile-bfd:
-	@[ -f bfd/Makefile ] || [ -f stageprofile-bfd/Makefile ] \
-	  || exit 0 ; \
-	[ -f bfd/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif bfd-bootstrap
-
-
-.PHONY: configure-stageprofile-opcodes maybe-configure-stageprofile-opcodes
-.PHONY: all-stageprofile-opcodes maybe-all-stageprofile-opcodes
-.PHONY: clean-stageprofile-opcodes maybe-clean-stageprofile-opcodes
-
-maybe-configure-stageprofile-opcodes:
-maybe-all-stageprofile-opcodes:
-maybe-clean-stageprofile-opcodes:
-
-@if opcodes-bootstrap
-maybe-configure-stageprofile-opcodes: configure-stageprofile-opcodes
-configure-stageprofile-opcodes:
-	@$(MAKE) stageprofile-start
-	@[ -f opcodes/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in opcodes ; \
-	cd opcodes || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-opcodes: all-stageprofile-opcodes
-all-stageprofile-opcodes: configure-stageprofile-opcodes
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes
-clean-stageprofile-opcodes:
-	@[ -f opcodes/Makefile ] || [ -f stageprofile-opcodes/Makefile ] \
-	  || exit 0 ; \
-	[ -f opcodes/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif opcodes-bootstrap
-
-
-.PHONY: configure-stageprofile-binutils maybe-configure-stageprofile-binutils
-.PHONY: all-stageprofile-binutils maybe-all-stageprofile-binutils
-.PHONY: clean-stageprofile-binutils maybe-clean-stageprofile-binutils
-
-maybe-configure-stageprofile-binutils:
-maybe-all-stageprofile-binutils:
-maybe-clean-stageprofile-binutils:
-
-@if binutils-bootstrap
-maybe-configure-stageprofile-binutils: configure-stageprofile-binutils
-configure-stageprofile-binutils:
-	@$(MAKE) stageprofile-start
-	@[ -f binutils/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in binutils ; \
-	cd binutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-binutils: all-stageprofile-binutils
-all-stageprofile-binutils: configure-stageprofile-binutils
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-binutils: clean-stageprofile-binutils
-clean-stageprofile-binutils:
-	@[ -f binutils/Makefile ] || [ -f stageprofile-binutils/Makefile ] \
-	  || exit 0 ; \
-	[ -f binutils/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif binutils-bootstrap
-
-
-.PHONY: configure-stageprofile-gas maybe-configure-stageprofile-gas
-.PHONY: all-stageprofile-gas maybe-all-stageprofile-gas
-.PHONY: clean-stageprofile-gas maybe-clean-stageprofile-gas
-
-maybe-configure-stageprofile-gas:
-maybe-all-stageprofile-gas:
-maybe-clean-stageprofile-gas:
-
-@if gas-bootstrap
-maybe-configure-stageprofile-gas: configure-stageprofile-gas
-configure-stageprofile-gas:
-	@$(MAKE) stageprofile-start
-	@[ -f gas/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in gas ; \
-	cd gas || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-gas: all-stageprofile-gas
-all-stageprofile-gas: configure-stageprofile-gas
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-gas: clean-stageprofile-gas
-clean-stageprofile-gas:
-	@[ -f gas/Makefile ] || [ -f stageprofile-gas/Makefile ] \
-	  || exit 0 ; \
-	[ -f gas/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif gas-bootstrap
-
-
-.PHONY: configure-stageprofile-gcc maybe-configure-stageprofile-gcc
-.PHONY: all-stageprofile-gcc maybe-all-stageprofile-gcc
-.PHONY: clean-stageprofile-gcc maybe-clean-stageprofile-gcc
-
-maybe-configure-stageprofile-gcc:
-maybe-all-stageprofile-gcc:
-maybe-clean-stageprofile-gcc:
-
-@if gcc-bootstrap
-maybe-configure-stageprofile-gcc: configure-stageprofile-gcc
-configure-stageprofile-gcc:
-	@$(MAKE) stageprofile-start
-	@[ -f gcc/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in gcc ; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-gcc: all-stageprofile-gcc
-all-stageprofile-gcc: configure-stageprofile-gcc
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS)
-
-maybe-clean-stageprofile-gcc: clean-stageprofile-gcc
-clean-stageprofile-gcc:
-	@[ -f gcc/Makefile ] || [ -f stageprofile-gcc/Makefile ] \
-	  || exit 0 ; \
-	[ -f gcc/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean
-@endif gcc-bootstrap
-
-
-.PHONY: configure-stageprofile-intl maybe-configure-stageprofile-intl
-.PHONY: all-stageprofile-intl maybe-all-stageprofile-intl
-.PHONY: clean-stageprofile-intl maybe-clean-stageprofile-intl
-
-maybe-configure-stageprofile-intl:
-maybe-all-stageprofile-intl:
-maybe-clean-stageprofile-intl:
-
-@if intl-bootstrap
-maybe-configure-stageprofile-intl: configure-stageprofile-intl
-configure-stageprofile-intl:
-	@$(MAKE) stageprofile-start
-	@[ -f intl/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in intl ; \
-	cd intl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-intl: all-stageprofile-intl
-all-stageprofile-intl: configure-stageprofile-intl
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-intl: clean-stageprofile-intl
-clean-stageprofile-intl:
-	@[ -f intl/Makefile ] || [ -f stageprofile-intl/Makefile ] \
-	  || exit 0 ; \
-	[ -f intl/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif intl-bootstrap
-
-
-.PHONY: configure-stageprofile-ld maybe-configure-stageprofile-ld
-.PHONY: all-stageprofile-ld maybe-all-stageprofile-ld
-.PHONY: clean-stageprofile-ld maybe-clean-stageprofile-ld
-
-maybe-configure-stageprofile-ld:
-maybe-all-stageprofile-ld:
-maybe-clean-stageprofile-ld:
-
-@if ld-bootstrap
-maybe-configure-stageprofile-ld: configure-stageprofile-ld
-configure-stageprofile-ld:
-	@$(MAKE) stageprofile-start
-	@[ -f ld/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in ld ; \
-	cd ld || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-ld: all-stageprofile-ld
-all-stageprofile-ld: configure-stageprofile-ld
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-ld: clean-stageprofile-ld
-clean-stageprofile-ld:
-	@[ -f ld/Makefile ] || [ -f stageprofile-ld/Makefile ] \
-	  || exit 0 ; \
-	[ -f ld/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif ld-bootstrap
-
-
-.PHONY: configure-stageprofile-libcpp maybe-configure-stageprofile-libcpp
-.PHONY: all-stageprofile-libcpp maybe-all-stageprofile-libcpp
-.PHONY: clean-stageprofile-libcpp maybe-clean-stageprofile-libcpp
-
-maybe-configure-stageprofile-libcpp:
-maybe-all-stageprofile-libcpp:
-maybe-clean-stageprofile-libcpp:
-
-@if libcpp-bootstrap
-maybe-configure-stageprofile-libcpp: configure-stageprofile-libcpp
-configure-stageprofile-libcpp:
-	@$(MAKE) stageprofile-start
-	@[ -f libcpp/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in libcpp ; \
-	cd libcpp || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-libcpp: all-stageprofile-libcpp
-all-stageprofile-libcpp: configure-stageprofile-libcpp
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp
-clean-stageprofile-libcpp:
-	@[ -f libcpp/Makefile ] || [ -f stageprofile-libcpp/Makefile ] \
-	  || exit 0 ; \
-	[ -f libcpp/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif libcpp-bootstrap
-
-
-.PHONY: configure-stageprofile-libiberty maybe-configure-stageprofile-libiberty
-.PHONY: all-stageprofile-libiberty maybe-all-stageprofile-libiberty
-.PHONY: clean-stageprofile-libiberty maybe-clean-stageprofile-libiberty
-
-maybe-configure-stageprofile-libiberty:
-maybe-all-stageprofile-libiberty:
-maybe-clean-stageprofile-libiberty:
-
-@if libiberty-bootstrap
-maybe-configure-stageprofile-libiberty: configure-stageprofile-libiberty
-configure-stageprofile-libiberty:
-	@$(MAKE) stageprofile-start
-	@[ -f libiberty/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in libiberty ; \
-	cd libiberty || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-libiberty: all-stageprofile-libiberty
-all-stageprofile-libiberty: configure-stageprofile-libiberty
-	@$(MAKE) stageprofile-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty
-clean-stageprofile-libiberty:
-	@[ -f libiberty/Makefile ] || [ -f stageprofile-libiberty/Makefile ] \
-	  || exit 0 ; \
-	[ -f libiberty/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif libiberty-bootstrap
-
-
-.PHONY: configure-stageprofile-zlib maybe-configure-stageprofile-zlib
-.PHONY: all-stageprofile-zlib maybe-all-stageprofile-zlib
-.PHONY: clean-stageprofile-zlib maybe-clean-stageprofile-zlib
-
-maybe-configure-stageprofile-zlib:
-maybe-all-stageprofile-zlib:
-maybe-clean-stageprofile-zlib:
-
-@if zlib-bootstrap
-maybe-configure-stageprofile-zlib: configure-stageprofile-zlib
-configure-stageprofile-zlib:
-	@$(MAKE) stageprofile-start
-	@[ -f zlib/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage profile in zlib ; \
-	cd zlib || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stageprofile-zlib: all-stageprofile-zlib
-all-stageprofile-zlib: configure-stageprofile-zlib
-	@$(MAKE) stageprofile-start
+compare:
+	@if test -f stage2-lean; then \
+	  echo Cannot compare object files as stage 2 was deleted. ; \
+	  exit 0 ; \
+	fi; \
+	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
 	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" 
-
-maybe-clean-stageprofile-zlib: clean-stageprofile-zlib
-clean-stageprofile-zlib:
-	@[ -f zlib/Makefile ] || [ -f stageprofile-zlib/Makefile ] \
-	  || exit 0 ; \
-	[ -f zlib/Makefile ] || $(MAKE) stageprofile-start ; \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"  clean
-@endif zlib-bootstrap
-
-
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	rm -f .bad_compare ; \
+	cd stage3-gcc; \
+	files=`find . -name "*$(objext)" -print` ; \
+	cd .. ; \
+	for file in $${files} ; do \
+	  f1=$$r/stage2-gcc/$$file; f2=$$r/stage3-gcc/$$file; \
+	  @do_compare@ > /dev/null 2>&1; \
+	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
+	done ; \
+	if [ -f .bad_compare ]; then \
+	  echo "Bootstrap comparison failure!"; \
+	  cat .bad_compare; \
+	  exit 1; \
+	else \
+	  true; \
+	fi ; \
+	$(STAMP) compare
+	@bootstrap_lean@-rm -rf stage2-* ; $(STAMP) stage2-lean
 
-# FIXME: Will not need to be conditional when toplevel bootstrap is the
-# only possibility, but now it conflicts with no-bootstrap rules
-@if gcc-bootstrap
 
 
+.PHONY: bootstrap
+bootstrap: stage3-bubble compare all
 
 
 # Rules to wipe a stage and all the following ones, also used for cleanstrap
-distclean-stage1:: distclean-stageprofile 
-.PHONY: distclean-stageprofile
-distclean-stageprofile::
+distclean-stage2:: distclean-stage3 
+.PHONY: distclean-stage3
+distclean-stage3::
 	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
-	rm -rf stageprofile-* 
+	rm -rf stage3-* compare 
+
 
+.PHONY: cleanstrap
+cleanstrap: distclean bootstrap
 
 @endif gcc-bootstrap
 
 
-.PHONY: stagefeedback-start stagefeedback-end
+.PHONY: stage4-start stage4-end
 
-stagefeedback-start::
+stage4-start::
 	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
-	echo stagefeedback > stage_current ; \
-	echo stagefeedback > stage_last
+	echo stage4 > stage_current ; \
+	echo stage4 > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
 @if bfd
-	@[ -d stagefeedback-bfd ] || mkdir stagefeedback-bfd; \
-	set stagefeedback-bfd bfd ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-bfd prev-bfd ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-bfd ] || \
+	  mkdir stage4-bfd; \
+	set stage4-bfd bfd ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-bfd prev-bfd ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif bfd
 @if opcodes
-	@[ -d stagefeedback-opcodes ] || mkdir stagefeedback-opcodes; \
-	set stagefeedback-opcodes opcodes ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-opcodes prev-opcodes ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-opcodes ] || \
+	  mkdir stage4-opcodes; \
+	set stage4-opcodes opcodes ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-opcodes prev-opcodes ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif opcodes
 @if binutils
-	@[ -d stagefeedback-binutils ] || mkdir stagefeedback-binutils; \
-	set stagefeedback-binutils binutils ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-binutils prev-binutils ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-binutils ] || \
+	  mkdir stage4-binutils; \
+	set stage4-binutils binutils ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-binutils prev-binutils ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif binutils
 @if gas
-	@[ -d stagefeedback-gas ] || mkdir stagefeedback-gas; \
-	set stagefeedback-gas gas ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-gas prev-gas ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-gas ] || \
+	  mkdir stage4-gas; \
+	set stage4-gas gas ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-gas prev-gas ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif gas
 @if gcc
-	@[ -d stagefeedback-gcc ] || mkdir stagefeedback-gcc; \
-	set stagefeedback-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-gcc ] || \
+	  mkdir stage4-gcc; \
+	set stage4-gcc gcc ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-gcc prev-gcc ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif gcc
 @if intl
-	@[ -d stagefeedback-intl ] || mkdir stagefeedback-intl; \
-	set stagefeedback-intl intl ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-intl prev-intl ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-intl ] || \
+	  mkdir stage4-intl; \
+	set stage4-intl intl ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-intl prev-intl ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif intl
 @if ld
-	@[ -d stagefeedback-ld ] || mkdir stagefeedback-ld; \
-	set stagefeedback-ld ld ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-ld prev-ld ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-ld ] || \
+	  mkdir stage4-ld; \
+	set stage4-ld ld ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-ld prev-ld ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif ld
 @if libcpp
-	@[ -d stagefeedback-libcpp ] || mkdir stagefeedback-libcpp; \
-	set stagefeedback-libcpp libcpp ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-libcpp prev-libcpp ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-libcpp ] || \
+	  mkdir stage4-libcpp; \
+	set stage4-libcpp libcpp ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-libcpp prev-libcpp ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif libcpp
 @if libiberty
-	@[ -d stagefeedback-libiberty ] || mkdir stagefeedback-libiberty; \
-	set stagefeedback-libiberty libiberty ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-libiberty prev-libiberty ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-libiberty ] || \
+	  mkdir stage4-libiberty; \
+	set stage4-libiberty libiberty ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-libiberty prev-libiberty ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif libiberty
 @if zlib
-	@[ -d stagefeedback-zlib ] || mkdir stagefeedback-zlib; \
-	set stagefeedback-zlib zlib ; @CREATE_LINK_TO_DIR@  ; \
-	set stage1-zlib prev-zlib ; @CREATE_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); [ -d stage4-zlib ] || \
+	  mkdir stage4-zlib; \
+	set stage4-zlib zlib ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage3-zlib prev-zlib ; \
+	@CREATE_LINK_TO_DIR@ 
 @endif zlib
 
-stagefeedback-end::
+stage4-end::
 	@rm -f stage_current
 @if bfd
-	@set bfd stagefeedback-bfd ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-bfd stage1-bfd ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set bfd stage4-bfd ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-bfd stage3-bfd ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif bfd
 @if opcodes
-	@set opcodes stagefeedback-opcodes ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-opcodes stage1-opcodes ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set opcodes stage4-opcodes ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-opcodes stage3-opcodes ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif opcodes
 @if binutils
-	@set binutils stagefeedback-binutils ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-binutils stage1-binutils ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set binutils stage4-binutils ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-binutils stage3-binutils ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif binutils
 @if gas
-	@set gas stagefeedback-gas ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gas stage1-gas ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set gas stage4-gas ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gas stage3-gas ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif gas
 @if gcc
-	@set gcc stagefeedback-gcc ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set gcc stage4-gcc ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage3-gcc ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif gcc
 @if intl
-	@set intl stagefeedback-intl ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-intl stage1-intl ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set intl stage4-intl ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-intl stage3-intl ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif intl
 @if ld
-	@set ld stagefeedback-ld ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-ld stage1-ld ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set ld stage4-ld ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-ld stage3-ld ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif ld
 @if libcpp
-	@set libcpp stagefeedback-libcpp ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libcpp stage1-libcpp ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set libcpp stage4-libcpp ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libcpp stage3-libcpp ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif libcpp
 @if libiberty
-	@set libiberty stagefeedback-libiberty ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-libiberty stage1-libiberty ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set libiberty stage4-libiberty ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libiberty stage3-libiberty ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif libiberty
 @if zlib
-	@set zlib stagefeedback-zlib ; @UNDO_LINK_TO_DIR@  ; \
-	set prev-zlib stage1-zlib ; @UNDO_LINK_TO_DIR@ 
+	@cd $(HOST_SUBDIR); set zlib stage4-zlib ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-zlib stage3-zlib ; \
+	@UNDO_LINK_TO_DIR@ 
 @endif zlib
 
-# Bubble a bugfix through all the stages up to stage feedback.  They
+# Bubble a bugfix through all the stages up to stage 4.  They
 # are remade, but not reconfigured.  The next stage (if any) will not
 # be reconfigured as well.
-.PHONY: stagefeedback-bubble
-stagefeedback-bubble:: stage1-bubble
-	@if test -f stagefeedback-lean || test -f stage1-lean  ; then \
-	  echo Skipping rebuild of stagefeedback ; \
+.PHONY: stage4-bubble
+stage4-bubble:: stage3-bubble
+	@bootstrap_lean@-rm -rf stage2-* ; $(STAMP) stage2-lean
+	@if test -f stage4-lean || test -f stage3-lean  ; then \
+	  echo Skipping rebuild of stage4 ; \
 	else \
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stagefeedback; \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage4; \
 	fi
 
-.PHONY: all-stagefeedback clean-stagefeedback
-all-stagefeedback:     \
-  maybe-all-stagefeedback-bfd \
-  maybe-all-stagefeedback-opcodes \
-  maybe-all-stagefeedback-binutils              \
-  maybe-all-stagefeedback-gas \
-  maybe-all-stagefeedback-gcc        \
-  maybe-all-stagefeedback-intl   \
-  maybe-all-stagefeedback-ld \
-  maybe-all-stagefeedback-libcpp  \
-  maybe-all-stagefeedback-libiberty                        \
-  maybe-all-stagefeedback-zlib       
-
-do-clean: clean-stagefeedback
-clean-stagefeedback:     \
-  maybe-clean-stagefeedback-bfd \
-  maybe-clean-stagefeedback-opcodes \
-  maybe-clean-stagefeedback-binutils              \
-  maybe-clean-stagefeedback-gas \
-  maybe-clean-stagefeedback-gcc        \
-  maybe-clean-stagefeedback-intl   \
-  maybe-clean-stagefeedback-ld \
-  maybe-clean-stagefeedback-libcpp  \
-  maybe-clean-stagefeedback-libiberty                        \
-  maybe-clean-stagefeedback-zlib       
-
-
-.PHONY: configure-stagefeedback-bfd maybe-configure-stagefeedback-bfd
-.PHONY: all-stagefeedback-bfd maybe-all-stagefeedback-bfd
-.PHONY: clean-stagefeedback-bfd maybe-clean-stagefeedback-bfd
-
-maybe-configure-stagefeedback-bfd:
-maybe-all-stagefeedback-bfd:
-maybe-clean-stagefeedback-bfd:
-
-@if bfd-bootstrap
-maybe-configure-stagefeedback-bfd: configure-stagefeedback-bfd
-configure-stagefeedback-bfd:
-	@$(MAKE) stagefeedback-start
-	@[ -f bfd/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in bfd ; \
-	cd bfd || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/bfd"; \
-	    libsrcdir="$$s/bfd";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stagefeedback-bfd: all-stagefeedback-bfd
-all-stagefeedback-bfd: configure-stagefeedback-bfd
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
-
-maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd
-clean-stagefeedback-bfd:
-	@[ -f bfd/Makefile ] || [ -f stagefeedback-bfd/Makefile ] \
-	  || exit 0 ; \
-	[ -f bfd/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd bfd && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif bfd-bootstrap
-
-
-.PHONY: configure-stagefeedback-opcodes maybe-configure-stagefeedback-opcodes
-.PHONY: all-stagefeedback-opcodes maybe-all-stagefeedback-opcodes
-.PHONY: clean-stagefeedback-opcodes maybe-clean-stagefeedback-opcodes
-
-maybe-configure-stagefeedback-opcodes:
-maybe-all-stagefeedback-opcodes:
-maybe-clean-stagefeedback-opcodes:
-
-@if opcodes-bootstrap
-maybe-configure-stagefeedback-opcodes: configure-stagefeedback-opcodes
-configure-stagefeedback-opcodes:
-	@$(MAKE) stagefeedback-start
-	@[ -f opcodes/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in opcodes ; \
-	cd opcodes || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/opcodes"; \
-	    libsrcdir="$$s/opcodes";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stagefeedback-opcodes: all-stagefeedback-opcodes
-all-stagefeedback-opcodes: configure-stagefeedback-opcodes
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
-
-maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes
-clean-stagefeedback-opcodes:
-	@[ -f opcodes/Makefile ] || [ -f stagefeedback-opcodes/Makefile ] \
-	  || exit 0 ; \
-	[ -f opcodes/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd opcodes && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif opcodes-bootstrap
-
-
-.PHONY: configure-stagefeedback-binutils maybe-configure-stagefeedback-binutils
-.PHONY: all-stagefeedback-binutils maybe-all-stagefeedback-binutils
-.PHONY: clean-stagefeedback-binutils maybe-clean-stagefeedback-binutils
-
-maybe-configure-stagefeedback-binutils:
-maybe-all-stagefeedback-binutils:
-maybe-clean-stagefeedback-binutils:
-
-@if binutils-bootstrap
-maybe-configure-stagefeedback-binutils: configure-stagefeedback-binutils
-configure-stagefeedback-binutils:
-	@$(MAKE) stagefeedback-start
-	@[ -f binutils/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in binutils ; \
-	cd binutils || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/binutils"; \
-	    libsrcdir="$$s/binutils";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stagefeedback-binutils: all-stagefeedback-binutils
-all-stagefeedback-binutils: configure-stagefeedback-binutils
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
-
-maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils
-clean-stagefeedback-binutils:
-	@[ -f binutils/Makefile ] || [ -f stagefeedback-binutils/Makefile ] \
-	  || exit 0 ; \
-	[ -f binutils/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd binutils && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif binutils-bootstrap
-
-
-.PHONY: configure-stagefeedback-gas maybe-configure-stagefeedback-gas
-.PHONY: all-stagefeedback-gas maybe-all-stagefeedback-gas
-.PHONY: clean-stagefeedback-gas maybe-clean-stagefeedback-gas
-
-maybe-configure-stagefeedback-gas:
-maybe-all-stagefeedback-gas:
-maybe-clean-stagefeedback-gas:
-
-@if gas-bootstrap
-maybe-configure-stagefeedback-gas: configure-stagefeedback-gas
-configure-stagefeedback-gas:
-	@$(MAKE) stagefeedback-start
-	@[ -f gas/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in gas ; \
-	cd gas || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gas"; \
-	    libsrcdir="$$s/gas";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stagefeedback-gas: all-stagefeedback-gas
-all-stagefeedback-gas: configure-stagefeedback-gas
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
-
-maybe-clean-stagefeedback-gas: clean-stagefeedback-gas
-clean-stagefeedback-gas:
-	@[ -f gas/Makefile ] || [ -f stagefeedback-gas/Makefile ] \
-	  || exit 0 ; \
-	[ -f gas/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd gas && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif gas-bootstrap
-
-
-.PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc
-.PHONY: all-stagefeedback-gcc maybe-all-stagefeedback-gcc
-.PHONY: clean-stagefeedback-gcc maybe-clean-stagefeedback-gcc
-
-maybe-configure-stagefeedback-gcc:
-maybe-all-stagefeedback-gcc:
-maybe-clean-stagefeedback-gcc:
+.PHONY: all-stage4 clean-stage4
+do-clean: clean-stage4
 
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
 @if gcc-bootstrap
-maybe-configure-stagefeedback-gcc: configure-stagefeedback-gcc
-configure-stagefeedback-gcc:
-	@$(MAKE) stagefeedback-start
-	@[ -f gcc/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in gcc ; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
-
-maybe-all-stagefeedback-gcc: all-stagefeedback-gcc
-all-stagefeedback-gcc: configure-stagefeedback-gcc
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS)
-
-maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc
-clean-stagefeedback-gcc:
-	@[ -f gcc/Makefile ] || [ -f stagefeedback-gcc/Makefile ] \
-	  || exit 0 ; \
-	[ -f gcc/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd gcc && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean
-@endif gcc-bootstrap
-
-
-.PHONY: configure-stagefeedback-intl maybe-configure-stagefeedback-intl
-.PHONY: all-stagefeedback-intl maybe-all-stagefeedback-intl
-.PHONY: clean-stagefeedback-intl maybe-clean-stagefeedback-intl
-
-maybe-configure-stagefeedback-intl:
-maybe-all-stagefeedback-intl:
-maybe-clean-stagefeedback-intl:
-
-@if intl-bootstrap
-maybe-configure-stagefeedback-intl: configure-stagefeedback-intl
-configure-stagefeedback-intl:
-	@$(MAKE) stagefeedback-start
-	@[ -f intl/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in intl ; \
-	cd intl || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/intl"; \
-	    libsrcdir="$$s/intl";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
 
-maybe-all-stagefeedback-intl: all-stagefeedback-intl
-all-stagefeedback-intl: configure-stagefeedback-intl
-	@$(MAKE) stagefeedback-start
+compare3:
+	@if test -f stage3-lean; then \
+	  echo Cannot compare object files as stage 3 was deleted. ; \
+	  exit 0 ; \
+	fi; \
+	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
 	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
-
-maybe-clean-stagefeedback-intl: clean-stagefeedback-intl
-clean-stagefeedback-intl:
-	@[ -f intl/Makefile ] || [ -f stagefeedback-intl/Makefile ] \
-	  || exit 0 ; \
-	[ -f intl/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd intl && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif intl-bootstrap
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	rm -f .bad_compare ; \
+	cd stage4-gcc; \
+	files=`find . -name "*$(objext)" -print` ; \
+	cd .. ; \
+	for file in $${files} ; do \
+	  f1=$$r/stage3-gcc/$$file; f2=$$r/stage4-gcc/$$file; \
+	  @do_compare@ > /dev/null 2>&1; \
+	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
+	done ; \
+	if [ -f .bad_compare ]; then \
+	  echo "Bootstrap comparison failure!"; \
+	  cat .bad_compare; \
+	  exit 1; \
+	else \
+	  true; \
+	fi ; \
+	$(STAMP) compare3
+	@bootstrap_lean@-rm -rf stage3-* ; $(STAMP) stage3-lean
 
 
-.PHONY: configure-stagefeedback-ld maybe-configure-stagefeedback-ld
-.PHONY: all-stagefeedback-ld maybe-all-stagefeedback-ld
-.PHONY: clean-stagefeedback-ld maybe-clean-stagefeedback-ld
 
-maybe-configure-stagefeedback-ld:
-maybe-all-stagefeedback-ld:
-maybe-clean-stagefeedback-ld:
+.PHONY: bootstrap4
+bootstrap4: stage4-bubble compare3 all
 
-@if ld-bootstrap
-maybe-configure-stagefeedback-ld: configure-stagefeedback-ld
-configure-stagefeedback-ld:
-	@$(MAKE) stagefeedback-start
-	@[ -f ld/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in ld ; \
-	cd ld || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/ld"; \
-	    libsrcdir="$$s/ld";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
 
-maybe-all-stagefeedback-ld: all-stagefeedback-ld
-all-stagefeedback-ld: configure-stagefeedback-ld
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+# Rules to wipe a stage and all the following ones, also used for cleanstrap
+distclean-stage3:: distclean-stage4 
+.PHONY: distclean-stage4
+distclean-stage4::
+	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
+	rm -rf stage4-* compare3 
 
-maybe-clean-stagefeedback-ld: clean-stagefeedback-ld
-clean-stagefeedback-ld:
-	@[ -f ld/Makefile ] || [ -f stagefeedback-ld/Makefile ] \
-	  || exit 0 ; \
-	[ -f ld/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd ld && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif ld-bootstrap
 
+@endif gcc-bootstrap
 
-.PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp
-.PHONY: all-stagefeedback-libcpp maybe-all-stagefeedback-libcpp
-.PHONY: clean-stagefeedback-libcpp maybe-clean-stagefeedback-libcpp
 
-maybe-configure-stagefeedback-libcpp:
-maybe-all-stagefeedback-libcpp:
-maybe-clean-stagefeedback-libcpp:
+.PHONY: stageprofile-start stageprofile-end
 
-@if libcpp-bootstrap
-maybe-configure-stagefeedback-libcpp: configure-stagefeedback-libcpp
-configure-stagefeedback-libcpp:
-	@$(MAKE) stagefeedback-start
-	@[ -f libcpp/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in libcpp ; \
-	cd libcpp || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
-	    libsrcdir="$$s/libcpp";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
+stageprofile-start::
+	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
+	echo stageprofile > stage_current ; \
+	echo stageprofile > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
+@if bfd
+	@cd $(HOST_SUBDIR); [ -d stageprofile-bfd ] || \
+	  mkdir stageprofile-bfd; \
+	set stageprofile-bfd bfd ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-bfd prev-bfd ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); [ -d stageprofile-opcodes ] || \
+	  mkdir stageprofile-opcodes; \
+	set stageprofile-opcodes opcodes ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-opcodes prev-opcodes ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); [ -d stageprofile-binutils ] || \
+	  mkdir stageprofile-binutils; \
+	set stageprofile-binutils binutils ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-binutils prev-binutils ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif binutils
+@if gas
+	@cd $(HOST_SUBDIR); [ -d stageprofile-gas ] || \
+	  mkdir stageprofile-gas; \
+	set stageprofile-gas gas ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-gas prev-gas ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); [ -d stageprofile-gcc ] || \
+	  mkdir stageprofile-gcc; \
+	set stageprofile-gcc gcc ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-gcc prev-gcc ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif gcc
+@if intl
+	@cd $(HOST_SUBDIR); [ -d stageprofile-intl ] || \
+	  mkdir stageprofile-intl; \
+	set stageprofile-intl intl ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-intl prev-intl ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); [ -d stageprofile-ld ] || \
+	  mkdir stageprofile-ld; \
+	set stageprofile-ld ld ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-ld prev-ld ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif ld
+@if libcpp
+	@cd $(HOST_SUBDIR); [ -d stageprofile-libcpp ] || \
+	  mkdir stageprofile-libcpp; \
+	set stageprofile-libcpp libcpp ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-libcpp prev-libcpp ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif libcpp
+@if libiberty
+	@cd $(HOST_SUBDIR); [ -d stageprofile-libiberty ] || \
+	  mkdir stageprofile-libiberty; \
+	set stageprofile-libiberty libiberty ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-libiberty prev-libiberty ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif libiberty
+@if zlib
+	@cd $(HOST_SUBDIR); [ -d stageprofile-zlib ] || \
+	  mkdir stageprofile-zlib; \
+	set stageprofile-zlib zlib ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-zlib prev-zlib ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif zlib
 
-maybe-all-stagefeedback-libcpp: all-stagefeedback-libcpp
-all-stagefeedback-libcpp: configure-stagefeedback-libcpp
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+stageprofile-end::
+	@rm -f stage_current
+@if bfd
+	@cd $(HOST_SUBDIR); set bfd stageprofile-bfd ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-bfd stage1-bfd ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); set opcodes stageprofile-opcodes ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-opcodes stage1-opcodes ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); set binutils stageprofile-binutils ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-binutils stage1-binutils ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif binutils
+@if gas
+	@cd $(HOST_SUBDIR); set gas stageprofile-gas ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gas stage1-gas ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); set gcc stageprofile-gcc ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage1-gcc ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif gcc
+@if intl
+	@cd $(HOST_SUBDIR); set intl stageprofile-intl ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-intl stage1-intl ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); set ld stageprofile-ld ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-ld stage1-ld ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif ld
+@if libcpp
+	@cd $(HOST_SUBDIR); set libcpp stageprofile-libcpp ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libcpp stage1-libcpp ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif libcpp
+@if libiberty
+	@cd $(HOST_SUBDIR); set libiberty stageprofile-libiberty ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libiberty stage1-libiberty ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif libiberty
+@if zlib
+	@cd $(HOST_SUBDIR); set zlib stageprofile-zlib ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-zlib stage1-zlib ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif zlib
 
-maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp
-clean-stagefeedback-libcpp:
-	@[ -f libcpp/Makefile ] || [ -f stagefeedback-libcpp/Makefile ] \
-	  || exit 0 ; \
-	[ -f libcpp/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd libcpp && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif libcpp-bootstrap
+# Bubble a bugfix through all the stages up to stage profile.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stageprofile-bubble
+stageprofile-bubble:: stage1-bubble
+	@if test -f stageprofile-lean || test -f stage1-lean  ; then \
+	  echo Skipping rebuild of stageprofile ; \
+	else \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stageprofile; \
+	fi
 
+.PHONY: all-stageprofile clean-stageprofile
+do-clean: clean-stageprofile
 
-.PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty
-.PHONY: all-stagefeedback-libiberty maybe-all-stagefeedback-libiberty
-.PHONY: clean-stagefeedback-libiberty maybe-clean-stagefeedback-libiberty
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
+@if gcc-bootstrap
 
-maybe-configure-stagefeedback-libiberty:
-maybe-all-stagefeedback-libiberty:
-maybe-clean-stagefeedback-libiberty:
 
-@if libiberty-bootstrap
-maybe-configure-stagefeedback-libiberty: configure-stagefeedback-libiberty
-configure-stagefeedback-libiberty:
-	@$(MAKE) stagefeedback-start
-	@[ -f libiberty/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in libiberty ; \
-	cd libiberty || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/libiberty"; \
-	    libsrcdir="$$s/libiberty";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
 
-maybe-all-stagefeedback-libiberty: all-stagefeedback-libiberty
-all-stagefeedback-libiberty: configure-stagefeedback-libiberty
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
 
-maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty
-clean-stagefeedback-libiberty:
-	@[ -f libiberty/Makefile ] || [ -f stagefeedback-libiberty/Makefile ] \
-	  || exit 0 ; \
-	[ -f libiberty/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd libiberty && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif libiberty-bootstrap
+# Rules to wipe a stage and all the following ones, also used for cleanstrap
+distclean-stage1:: distclean-stageprofile 
+.PHONY: distclean-stageprofile
+distclean-stageprofile::
+	[ -f stage_current ] && $(MAKE) `cat stage_current`-end || :
+	rm -rf stageprofile-* 
 
 
-.PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib
-.PHONY: all-stagefeedback-zlib maybe-all-stagefeedback-zlib
-.PHONY: clean-stagefeedback-zlib maybe-clean-stagefeedback-zlib
+@endif gcc-bootstrap
 
-maybe-configure-stagefeedback-zlib:
-maybe-all-stagefeedback-zlib:
-maybe-clean-stagefeedback-zlib:
 
-@if zlib-bootstrap
-maybe-configure-stagefeedback-zlib: configure-stagefeedback-zlib
-configure-stagefeedback-zlib:
-	@$(MAKE) stagefeedback-start
-	@[ -f zlib/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	echo Configuring stage feedback in zlib ; \
-	cd zlib || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/zlib"; \
-	    libsrcdir="$$s/zlib";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  @stage2_werror_flag@ 
+.PHONY: stagefeedback-start stagefeedback-end
 
-maybe-all-stagefeedback-zlib: all-stagefeedback-zlib
-all-stagefeedback-zlib: configure-stagefeedback-zlib
-	@$(MAKE) stagefeedback-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
-	$(STAGE_HOST_EXPORTS)  \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" 
+stagefeedback-start::
+	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
+	echo stagefeedback > stage_current ; \
+	echo stagefeedback > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
+@if bfd
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-bfd ] || \
+	  mkdir stagefeedback-bfd; \
+	set stagefeedback-bfd bfd ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-bfd prev-bfd ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-opcodes ] || \
+	  mkdir stagefeedback-opcodes; \
+	set stagefeedback-opcodes opcodes ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-opcodes prev-opcodes ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-binutils ] || \
+	  mkdir stagefeedback-binutils; \
+	set stagefeedback-binutils binutils ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-binutils prev-binutils ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif binutils
+@if gas
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-gas ] || \
+	  mkdir stagefeedback-gas; \
+	set stagefeedback-gas gas ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-gas prev-gas ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-gcc ] || \
+	  mkdir stagefeedback-gcc; \
+	set stagefeedback-gcc gcc ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-gcc prev-gcc ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif gcc
+@if intl
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-intl ] || \
+	  mkdir stagefeedback-intl; \
+	set stagefeedback-intl intl ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-intl prev-intl ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-ld ] || \
+	  mkdir stagefeedback-ld; \
+	set stagefeedback-ld ld ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-ld prev-ld ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif ld
+@if libcpp
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-libcpp ] || \
+	  mkdir stagefeedback-libcpp; \
+	set stagefeedback-libcpp libcpp ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-libcpp prev-libcpp ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif libcpp
+@if libiberty
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-libiberty ] || \
+	  mkdir stagefeedback-libiberty; \
+	set stagefeedback-libiberty libiberty ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-libiberty prev-libiberty ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif libiberty
+@if zlib
+	@cd $(HOST_SUBDIR); [ -d stagefeedback-zlib ] || \
+	  mkdir stagefeedback-zlib; \
+	set stagefeedback-zlib zlib ; \
+	@CREATE_LINK_TO_DIR@  ; \
+	set stage1-zlib prev-zlib ; \
+	@CREATE_LINK_TO_DIR@ 
+@endif zlib
 
-maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib
-clean-stagefeedback-zlib:
-	@[ -f zlib/Makefile ] || [ -f stagefeedback-zlib/Makefile ] \
-	  || exit 0 ; \
-	[ -f zlib/Makefile ] || $(MAKE) stagefeedback-start ; \
-	cd zlib && \
-	$(MAKE) $(FLAGS_TO_PASS)  \
-		$(POSTSTAGE1_FLAGS_TO_PASS)  \
-		CFLAGS="$(BOOT_CFLAGS) -fprofile-use"  clean
-@endif zlib-bootstrap
+stagefeedback-end::
+	@rm -f stage_current
+@if bfd
+	@cd $(HOST_SUBDIR); set bfd stagefeedback-bfd ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-bfd stage1-bfd ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); set opcodes stagefeedback-opcodes ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-opcodes stage1-opcodes ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); set binutils stagefeedback-binutils ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-binutils stage1-binutils ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif binutils
+@if gas
+	@cd $(HOST_SUBDIR); set gas stagefeedback-gas ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gas stage1-gas ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); set gcc stagefeedback-gcc ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage1-gcc ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif gcc
+@if intl
+	@cd $(HOST_SUBDIR); set intl stagefeedback-intl ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-intl stage1-intl ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); set ld stagefeedback-ld ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-ld stage1-ld ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif ld
+@if libcpp
+	@cd $(HOST_SUBDIR); set libcpp stagefeedback-libcpp ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libcpp stage1-libcpp ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif libcpp
+@if libiberty
+	@cd $(HOST_SUBDIR); set libiberty stagefeedback-libiberty ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-libiberty stage1-libiberty ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif libiberty
+@if zlib
+	@cd $(HOST_SUBDIR); set zlib stagefeedback-zlib ; \
+	@UNDO_LINK_TO_DIR@  ; \
+	set prev-zlib stage1-zlib ; \
+	@UNDO_LINK_TO_DIR@ 
+@endif zlib
 
+# Bubble a bugfix through all the stages up to stage feedback.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stagefeedback-bubble
+stagefeedback-bubble:: stage1-bubble
+	@if test -f stagefeedback-lean || test -f stage1-lean  ; then \
+	  echo Skipping rebuild of stagefeedback ; \
+	else \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stagefeedback; \
+	fi
 
+.PHONY: all-stagefeedback clean-stagefeedback
+do-clean: clean-stagefeedback
 
 # FIXME: Will not need to be conditional when toplevel bootstrap is the
 # only possibility, but now it conflicts with no-bootstrap rules
@@ -34901,18 +34548,15 @@
 profiledbootstrap:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
 	$(MAKE) stageprofile-bubble distclean-stagefeedback
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries and training compiler"; \
 	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Building feedback based compiler"; \
 	$(MAKE) stagefeedback-bubble stagefeedback-end
@@ -35209,6 +34853,7 @@
 all-stageprofile-libcpp: maybe-all-stageprofile-intl
 all-stagefeedback-libcpp: maybe-all-stagefeedback-intl
 all-fixincludes: maybe-all-libiberty
+all-gnattools: maybe-all-target-libada
 configure-gdb: maybe-configure-itcl
 configure-gdb: maybe-configure-tcl
 configure-gdb: maybe-configure-tk
@@ -35554,7 +35199,7 @@
 Makefile: $(srcdir)/Makefile.in config.status
 	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-config.status: configure $(gcc_version_trigger)
+config.status: configure
 	CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
 
 # Rebuilding configure.
Index: src/Makefile.tpl
diff -u src/Makefile.tpl:1.122 src/Makefile.tpl:1.134
--- src/Makefile.tpl:1.122	Wed Dec  8 20:29:58 2004
+++ src/Makefile.tpl	Wed May  4 15:42:05 2005
@@ -75,45 +75,25 @@
 # Miscellaneous non-standard autoconf-set variables
 # -------------------------------------------------
 
-# The file containing GCC's version number.
-gcc_version_trigger = @gcc_version_trigger@
-gcc_version = @gcc_version@
-
 # The gcc driver likes to know the arguments it was configured with.
 TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
 
-gxx_include_dir = @gxx_include_dir@
-libstdcxx_incdir = @libstdcxx_incdir@
-
 tooldir = @tooldir@
 build_tooldir = @build_tooldir@
 
-# Directory in which the compiler finds executables, libraries, etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
 GDB_NLM_DEPS = 
 
 # This is the name of the environment variable used for the path to
 # the libraries.
 RPATH_ENVVAR = @RPATH_ENVVAR@
 
-# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
-# was used.
-SET_LIB_PATH = @SET_LIB_PATH@
-
-# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
-# Some platforms don't like blank entries, so we remove duplicate,
-# leading and trailing colons.
-REALLY_SET_LIB_PATH = \
-  @SET_GCC_LIB_PATH@ \
-  $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-
 # This is the list of directories to be built for the build system.
 BUILD_CONFIGDIRS = libiberty
 # Build programs are put under this directory.
 BUILD_SUBDIR = @build_subdir@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the build system.
-BUILD_CONFIGARGS = @build_configargs@
+BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
 
 # This is the list of variables to export in the environment when
 # configuring any subdirectory.  It must also be exported whenever
@@ -152,6 +132,9 @@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the host system.
 HOST_CONFIGARGS = @host_configargs@
+# Host programs are put under this directory, which is . except if building
+# with srcdir=..
+HOST_SUBDIR = @host_subdir@
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the host system.
 HOST_EXPORTS = \
@@ -175,14 +158,18 @@
 	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
 	GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
 	GMPINC="$(HOST_GMPINC)"; export GMPINC; \
-	SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-	@SET_GCC_LIB_PATH@
+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 # Similar, for later GCC stages.
-STAGE_HOST_EXPORTS = \
+POSTSTAGE1_HOST_EXPORTS = \
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
 	$(HOST_EXPORTS) \
-	CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
+	CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
+	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
+	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
+	  $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
+	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
+	  -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
@@ -191,7 +178,7 @@
 TARGET_SUBDIR = @target_subdir@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the target.
-TARGET_CONFIGARGS = @target_configargs@
+TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the host system.
 BASE_TARGET_EXPORTS = \
@@ -201,7 +188,7 @@
 	CC="$(CC_FOR_TARGET)"; export CC; \
 	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+	CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
 	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
 	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
 	GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
@@ -211,8 +198,7 @@
 	NM="$(NM_FOR_TARGET)"; export NM; \
 	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
 	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
-	SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
-	@SET_GCC_LIB_PATH@
+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 RAW_CXX_TARGET_EXPORTS = \
 	$(BASE_TARGET_EXPORTS) \
@@ -305,8 +291,9 @@
 # (Default to avoid splitting info files by setting the threshold high.)
 MAKEINFOFLAGS = --split-size=5000000
 
-EXPECT = `if [ -f $$r/expect/expect ] ; \
-	then echo $$r/expect/expect ; \
+# FIXME: expect may become a build tool?
+EXPECT = `if [ -f $$r/$(HOST_SUBDIR)/expect/expect ] ; \
+	then echo $$r/$(HOST_SUBDIR)/expect/expect ; \
 	else echo expect ; fi`
 
 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
@@ -317,10 +304,6 @@
 # Programs producing files for the HOST machine
 # ---------------------------------------------
 
-# This is the list of directories that may be needed in RPATH_ENVVAR
-# so that programs built for the host machine work.
-HOST_LIB_PATH = $$r/bfd:$$r/opcodes
-
 AS = @AS@
 
 AR = @AR@
@@ -351,17 +334,13 @@
 # Programs producing files for the TARGET machine
 # -----------------------------------------------
 
-# This is the list of directories that may be needed in RPATH_ENVVAR
-# so that prorgams built for the target machine work.
-TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs
-
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 
 AR_FOR_TARGET=@AR_FOR_TARGET@
 CONFIGURED_AR_FOR_TARGET=@CONFIGURED_AR_FOR_TARGET@
 USUAL_AR_FOR_TARGET = ` \
-  if [ -f $$r/binutils/ar ] ; then \
-    echo $$r/binutils/ar ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/ar ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/ar ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(AR); \
@@ -373,9 +352,9 @@
 AS_FOR_TARGET=@AS_FOR_TARGET@
 CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@
 USUAL_AS_FOR_TARGET = ` \
-  if [ -f $$r/gas/as-new ] ; then \
-    echo $$r/gas/as-new ; \
-  elif [ -f $$r/gcc/xgcc ]; then \
+  if [ -f $$r/$(HOST_SUBDIR)/gas/as-new ] ; then \
+    echo $$r/$(HOST_SUBDIR)/gas/as-new ; \
+  elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=as ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
@@ -396,7 +375,8 @@
 # build libgcc2.a.  We define it here so that it can itself be
 # overridden on the command line.
 GCC_FOR_TARGET=@GCC_FOR_TARGET@
-USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
+USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) \
+  $$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/ $(FLAGS_FOR_TARGET)
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 
 CXX_FOR_TARGET = @CXX_FOR_TARGET@
@@ -409,8 +389,8 @@
 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
 CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@
 USUAL_DLLTOOL_FOR_TARGET = ` \
-  if [ -f $$r/binutils/dlltool ] ; then \
-    echo $$r/binutils/dlltool ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/dlltool ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/dlltool ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(DLLTOOL); \
@@ -425,9 +405,9 @@
 LD_FOR_TARGET=@LD_FOR_TARGET@
 CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@
 USUAL_LD_FOR_TARGET = ` \
-  if [ -f $$r/ld/ld-new ] ; then \
-    echo $$r/ld/ld-new ; \
-  elif [ -f $$r/gcc/xgcc ]; then \
+  if [ -f $$r/$(HOST_SUBDIR)/ld/ld-new ] ; then \
+    echo $$r/$(HOST_SUBDIR)/ld/ld-new ; \
+  elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=ld ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
@@ -442,9 +422,9 @@
 NM_FOR_TARGET=@NM_FOR_TARGET@
 CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
 USUAL_NM_FOR_TARGET = ` \
-  if [ -f $$r/binutils/nm-new ] ; then \
-    echo $$r/binutils/nm-new ; \
-  elif [ -f $$r/gcc/xgcc ]; then \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/nm-new ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/nm-new ; \
+  elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \
     $(CC_FOR_TARGET) -print-prog-name=nm ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
@@ -457,8 +437,8 @@
 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
 CONFIGURED_RANLIB_FOR_TARGET=@CONFIGURED_RANLIB_FOR_TARGET@
 USUAL_RANLIB_FOR_TARGET = ` \
-  if [ -f $$r/binutils/ranlib ] ; then \
-    echo $$r/binutils/ranlib ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/ranlib ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/ranlib ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       if [ x'$(RANLIB)' != x ]; then \
@@ -474,8 +454,8 @@
 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
 CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@
 USUAL_WINDRES_FOR_TARGET = ` \
-  if [ -f $$r/binutils/windres ] ; then \
-    echo $$r/binutils/windres ; \
+  if [ -f $$r/$(HOST_SUBDIR)/binutils/windres ] ; then \
+    echo $$r/$(HOST_SUBDIR)/binutils/windres ; \
   else \
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(WINDRES); \
@@ -501,6 +481,37 @@
 @host_makefile_frag@
 ###
 
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that prorgams built for the target machine work.
+TARGET_LIB_PATH = [+ FOR target_modules +][+
+  IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
+  ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
+[+ FOR target_modules +][+ IF lib_path +]
+@if target-[+module+]
+TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
+@endif target-[+module+]
+[+ ENDIF lib_path +][+ ENDFOR target_modules +]
+
+
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that programs built for the host machine work.
+HOST_LIB_PATH = [+ FOR host_modules +][+
+  IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
+  ENDFOR host_modules +]
+
+# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
+@if gcc
+HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
+@endif gcc
+
+[+ FOR host_modules +][+ IF lib_path +]
+@if [+module+]
+HOST_LIB_PATH_[+module+] = \
+  $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
+  +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
+@endif [+module+]
+[+ ENDIF lib_path +][+ ENDFOR host_modules +]
+
 # Flags to pass down to all sub-makes.
 BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\
 	"[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\
@@ -528,7 +539,6 @@
 	'DLLTOOL=$(DLLTOOL)' \
 	'LD=$(LD)' \
 	'NM=$(NM)' \
-	'PICFLAG=$(PICFLAG)' \
 	'RANLIB=$(RANLIB)' \
 	'WINDRES=$(WINDRES)'
 
@@ -561,7 +571,6 @@
 	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
 	'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
 	'NM=$$(NM_FOR_TARGET)' \
-	'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
 	'RANLIB=$$(RANLIB_FOR_TARGET)' \
 	'WINDRES=$$(WINDRES_FOR_TARGET)'
 
@@ -672,6 +681,9 @@
 	  rm -rf $(TARGET_SUBDIR); \
 	else true; fi
 	-rm -rf $(BUILD_SUBDIR)
+	-if [ "$(HOST_SUBDIR)" != "." ]; then \
+	  rm -rf $(HOST_SUBDIR); \
+	else true; fi
 	-rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
 	-rm -f texinfo/doc/Makefile texinfo/po/POTFILES
 	-rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
@@ -763,7 +775,6 @@
 install.all: install-no-fixedincludes
 	@if [ -f ./gcc/Makefile ] ; then \
 		r=`${PWD_COMMAND}` ; export r ; \
-		$(SET_LIB_PATH) \
 		$(HOST_EXPORTS) \
 		(cd ./gcc && \
 		$(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
@@ -807,123 +818,143 @@
 # built are.
 TAGS: do-TAGS
 
-# --------------------------------------
-# Modules which run on the build machine
-# --------------------------------------
-[+ FOR build_modules +]
-.PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
-maybe-configure-build-[+module+]:
-@if build-[+module+]
-maybe-configure-build-[+module+]: configure-build-[+module+]
-configure-build-[+module+]:
-	@test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
-	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
+# ------------------------------------
+# Macros for configure and all targets
+# ------------------------------------
+
+[+ DEFINE configure +]
+.PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
+maybe-configure-[+prefix+][+module+]:
+@if [+prefix+][+module+]
+maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
+configure-[+prefix+][+module+]: [+deps+]
+	@[+ IF bootstrap +]test -f stage_last && exit 0; \
+	[+ ENDIF bootstrap +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(BUILD_EXPORTS) \
-	echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
-	cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
+	[+exports+] \
+	echo Configuring in [+subdir+]/[+module+]; \
+	cd "[+subdir+]/[+module+]" || exit 1; \
 	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo [+subdir+]/[+module+]/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \
-	  srcdiroption="--srcdir=$${topdir}/[+module+]"; \
-	  libsrcdir="$$s/[+module+]"; \
-	fi; \
-	rm -f no-such-file || : ; \
-	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)" [+extra_configure_flags+] \
+	srcdiroption="--srcdir=$${topdir}/[+module+]"; \
+	libsrcdir="$$s/[+module+]"; \
+	[+ IF no-config-site +]rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \
+	  [+args+] $${srcdiroption} [+extra_configure_flags+] \
 	  || exit 1
-@endif build-[+module+]
-
-.PHONY: all-build-[+module+] maybe-all-build-[+module+]
-maybe-all-build-[+module+]:
-@if build-[+module+]
-TARGET-build-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +]
-maybe-all-build-[+module+]: all-build-[+module+]
-all-build-[+module+]: configure-build-[+module+]
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(BUILD_EXPORTS) \
-	(cd $(BUILD_SUBDIR)/[+module+] && \
-	  $(MAKE) [+extra_make_flags+] $(TARGET-build-[+module+]))
-@endif build-[+module+]
-[+ ENDFOR build_modules +]
+@endif [+prefix+][+module+]
 
-# --------------------------------------
-# Modules which run on the host machine
-# --------------------------------------
-[+ FOR host_modules +]
-.PHONY: configure-[+module+] maybe-configure-[+module+]
-maybe-configure-[+module+]:
-@if [+module+]
-maybe-configure-[+module+]: configure-[+module+]
-configure-[+module+]:
-	@[+ IF bootstrap +]test -f stage_last && exit 0; \
-	[+ ENDIF bootstrap +]test ! -f [+module+]/Makefile || exit 0; \
-	[ -d [+module+] ] || mkdir [+module+]; \
+[+ IF bootstrap +]
+[+ FOR bootstrap_stage +]
+.PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+]
+maybe-configure-stage[+id+]-[+prefix+][+module+]:
+@if [+module+]-bootstrap
+maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
+configure-stage[+id+]-[+prefix+][+module+]: [+deps+]
+	@$(MAKE) stage[+id+]-start
+	@[ -f [+subdir+]/[+module+]/Makefile ] && exit 0 || : ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	echo Configuring in [+module+]; \
-	cd [+module+] || exit 1; \
+	[+exports+][+ IF prev +] \
+	[+poststage1_exports+][+ ENDIF prev +] \
+	echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
+	cd [+subdir+]/[+module+] || exit 1; \
 	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
-	    libsrcdir="$$s/[+module+]";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
-	    libsrcdir="$$s/[+module+]";; \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo [+subdir+]/[+module+]/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
 	esac; \
+	srcdiroption="--srcdir=$${topdir}/[+module+]"; \
+	libsrcdir="$$s/[+module+]"; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} [+extra_configure_flags+] \
-	  || exit 1
-@endif [+module+]
-
-.PHONY: all-[+module+] maybe-all-[+module+]
-maybe-all-[+module+]:
-@if [+module+]
-TARGET-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +]
-maybe-all-[+module+]: all-[+module+]
-all-[+module+]: configure-[+module+]
+	  [+args+] $${srcdiroption} \
+	  [+stage_configure_flags+] [+extra_configure_flags+]
+@endif [+module+]-bootstrap
+[+ ENDFOR bootstrap_stage +]
+[+ ENDIF bootstrap +]
+[+ ENDDEF +]
+
+[+ DEFINE all +]
+.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
+maybe-all-[+prefix+][+module+]:
+@if [+prefix+][+module+]
+TARGET-[+prefix+][+module+]=[+
+  IF target +][+target+][+ ELSE +]all[+ ENDIF target +]
+maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
+all-[+prefix+][+module+]: configure-[+prefix+][+module+]
 	@[+ IF bootstrap +]test -f stage_last && exit 0; \
 	[+ ENDIF bootstrap +]r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
-	$(HOST_EXPORTS) \
-	(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] \
-	  $(TARGET-[+module+]))
-@endif [+module+]
+	[+exports+] \
+	(cd [+subdir+]/[+module+] && \
+	  $(MAKE) [+args+] [+extra_make_flags+] $(TARGET-[+prefix+][+module+]))
+@endif [+prefix+][+module+]
+
+[+ IF bootstrap +]
+[+ FOR bootstrap_stage +]
+.PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
+.PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
+maybe-all-stage[+id+]-[+prefix+][+module+]:
+maybe-clean-stage[+id+]-[+prefix+][+module+]:
+@if [+module+]-bootstrap
+maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
+all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
+all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
+	@$(MAKE) stage[+id+]-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	[+exports+][+ IF prev +] \
+	[+poststage1_exports+][+ ENDIF prev +] \
+	cd [+subdir+]/[+module+] && \
+	$(MAKE) [+args+] [+ IF prev
+		+][+poststage1_args+][+ ENDIF prev
+		+] [+stage_make_flags+] [+extra_make_flags+]
+
+maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
+clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
+clean-stage[+id+]-[+prefix+][+module+]:
+	@[ -f [+subdir+]/[+module+]/Makefile ] || [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] \
+	  || exit 0 ; \
+	[ -f [+subdir+]/[+module+]/Makefile ] || $(MAKE) stage[+id+]-start ; \
+	cd [+subdir+]/[+module+] && \
+	$(MAKE) [+args+] [+ IF prev +] \
+		[+poststage1_args+] [+ ENDIF prev +] \
+		[+stage_make_flags+] [+extra_make_flags+] clean
+@endif [+module+]-bootstrap
+
+[+ ENDFOR bootstrap_stage +]
+[+ ENDIF bootstrap +]
+[+ ENDDEF +]
+
+# --------------------------------------
+# Modules which run on the build machine
+# --------------------------------------
+[+ FOR build_modules +]
+[+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
+	     args="$(BUILD_CONFIGARGS)" no-config-site=true +]
+
+[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +]
+[+ ENDFOR build_module +]
+
+# --------------------------------------
+# Modules which run on the host machine
+# --------------------------------------
+[+ FOR host_modules +]
+[+ configure prefix="" subdir="$(HOST_SUBDIR)"
+	     exports="$(HOST_EXPORTS)"
+	     poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
+	     args="$(HOST_CONFIGARGS)" +]
+
+[+ all prefix="" subdir="$(HOST_SUBDIR)"
+       exports="$(HOST_EXPORTS)"
+       poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
+       args="$(FLAGS_TO_PASS)"
+       poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
 
 .PHONY: check-[+module+] maybe-check-[+module+]
 maybe-check-[+module+]:
@@ -937,19 +968,17 @@
 	@if [ '$(host)' = '$(target)' ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
-	  (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS) [+ 
-	    extra_make_flags+] check); \
+	  (cd $(HOST_SUBDIR)/[+module+] && \
+	    $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check); \
 	fi
 [+ ELSE check +]
 check-[+module+]:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
-	  extra_make_flags+] check)
+	(cd $(HOST_SUBDIR)/[+module+] && \
+	  $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check)
 [+ ENDIF no_check +]
 @endif [+module+]
 
@@ -963,10 +992,9 @@
 install-[+module+]: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
-	(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
-	  extra_make_flags+] install)
+	(cd $(HOST_SUBDIR)/[+module+] && \
+	  $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
 [+ ENDIF no_install +]
 @endif [+module+]
 
@@ -987,13 +1015,12 @@
 	@[ -f ./[+module+]/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) [+extra_make_flags+]; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing [+make_target+] in [+module+]" ; \
-	(cd [+module+] && \
+	(cd $(HOST_SUBDIR)/[+module+] && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
@@ -1009,91 +1036,34 @@
 # Modules which run on the target machine
 # ---------------------------------------
 [+ FOR target_modules +]
-.PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
-maybe-configure-target-[+module+]:
-@if target-[+module+]
-maybe-configure-target-[+module+]: configure-target-[+module+]
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+@if target-[+module+]
 $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
 	rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \
 	cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
-
-configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
-	@test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \
-	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \[+
-IF raw_cxx +]
-	$(RAW_CXX_TARGET_EXPORTS) \[+
-ELSE normal_cxx +]
-	$(NORMAL_TARGET_EXPORTS) \[+
-ENDIF raw_cxx +]
-	echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
-	cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
-	case $(srcdir) in \
-	  /* | [A-Za-z]:[\\/]*) \
-	    topdir=$(srcdir) ;; \
-	  *) \
-	    case "$(TARGET_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
-	esac; \[+ IF stage +]
-	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(TARGET_SUBDIR)" != "." ] ; then \
-	    if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
-	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
-	      else \
-	        true; \
-	      fi; \
-	    else \
-	      exit 1; \
-	    fi; \
-	  else \
-	    true; \
-	  fi; \
-	  srcdiroption="--srcdir=."; \
-	  libsrcdir="."; \
-	else \[+ ENDIF stage +]
-	  srcdiroption="--srcdir=$${topdir}/[+module+]"; \
-	  libsrcdir="$$s/[+module+]"; \[+ IF stage +]
-	fi; \[+ ENDIF stage +]
-	rm -f no-such-file || : ; \
-	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
-	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" [+extra_configure_flags+] \
-	  || exit 1
 @endif target-[+module+]
 
-.PHONY: all-target-[+module+] maybe-all-target-[+module+]
-maybe-all-target-[+module+]:
-@if target-[+module+]
-TARGET-target-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +]
-maybe-all-target-[+module+]: all-target-[+module+]
-all-target-[+module+]: configure-target-[+module+]
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \[+
-IF raw_cxx +]
-	$(RAW_CXX_TARGET_EXPORTS) \[+
-ELSE normal_cxx +]
-	$(NORMAL_TARGET_EXPORTS) \[+
-ENDIF raw_cxx +]
-	(cd $(TARGET_SUBDIR)/[+module+] && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
-	    IF raw_cxx 
-	  +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
-	    ENDIF raw_cxx 
-	  +] [+extra_make_flags+] $(TARGET-target-[+module+]))
-@endif target-[+module+]
+[+ IF raw_cxx +]
+[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
+	     deps=(string-append "$(TARGET_SUBDIR)/" (get "module") "/multilib.out")
+	     exports="$(RAW_CXX_TARGET_EXPORTS)"
+	     args="$(TARGET_CONFIGARGS)" no-config-site=true +]
+
+[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
+       exports="$(RAW_CXX_TARGET_EXPORTS)"
+       args="$(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
+[+ ELSE +]
+[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
+	     deps=(string-append "$(TARGET_SUBDIR)/" (get "module") "/multilib.out")
+	     exports="$(NORMAL_TARGET_EXPORTS)"
+	     args="$(TARGET_CONFIGARGS)" no-config-site=true +]
+
+[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
+       exports="$(NORMAL_TARGET_EXPORTS)"
+       args="$(TARGET_FLAGS_TO_PASS)" +]
+[+ ENDIF +]
 
 .PHONY: check-target-[+module+] maybe-check-target-[+module+]
 maybe-check-target-[+module+]:
@@ -1105,8 +1075,7 @@
 [+ ELSE check +]
 check-target-[+module+]:
 	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \[+
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
 IF raw_cxx +]
 	$(RAW_CXX_TARGET_EXPORTS) \[+
 ELSE normal_cxx +]
@@ -1131,8 +1100,7 @@
 [+ ELSE install +]
 install-target-[+module+]: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \[+
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
 IF raw_cxx +]
 	$(RAW_CXX_TARGET_EXPORTS) \[+
 ELSE normal_cxx +]
@@ -1159,8 +1127,7 @@
   ENDFOR depend +]
 	@[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \[+
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
 IF raw_cxx +]
 	$(RAW_CXX_TARGET_EXPORTS) \[+
 ELSE normal_cxx +]
@@ -1196,9 +1163,9 @@
 $(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@@ -1216,32 +1183,28 @@
 	    msg="Comparing stage2 and stage3 of the compiler"; \
 	    compare=compare ;; \
 	esac; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "$$msg"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
 	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 
 profiledbootstrap: all-prebootstrap configure-gcc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
 	echo "Bootstrapping training compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Building feedback based compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
 	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 
@@ -1249,13 +1212,11 @@
 cross: all-build all-gas all-ld
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Building the C and C++ compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
 	$(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
 @endif gcc-no-bootstrap
@@ -1266,7 +1227,6 @@
 	@if [ -f ./gcc/Makefile ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
 	else \
@@ -1290,7 +1250,6 @@
 	  rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	  $(SET_LIB_PATH) \
 	  $(HOST_EXPORTS) \
 	  (cd ./gcc && \
 	   $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
@@ -1380,18 +1339,25 @@
 stage[+id+]-start::
 	@[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \
 	echo stage[+id+] > stage_current ; \
-	echo stage[+id+] > stage_last[+ FOR host_modules +][+ IF bootstrap +]
+	echo stage[+id+] > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
+   FOR host_modules +][+ IF bootstrap +]
 @if [+ module +]
-	@[ -d stage[+id+]-[+module+] ] || mkdir stage[+id+]-[+module+]; \
-	set stage[+id+]-[+module+] [+module+] ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
-	set stage[+prev+]-[+module+] prev-[+module+] ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
+	@cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
+	  mkdir stage[+id+]-[+module+]; \
+	set stage[+id+]-[+module+] [+module+] ; \
+	@CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
+	set stage[+prev+]-[+module+] prev-[+module+] ; \
+	@CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
 @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
 
 stage[+id+]-end::
 	@rm -f stage_current[+ FOR host_modules +][+ IF bootstrap +]
 @if [+ module +]
-	@set [+module+] stage[+id+]-[+module+] ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
-	set prev-[+module+] stage[+prev+]-[+module+] ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
+	@cd $(HOST_SUBDIR); set [+module+] stage[+id+]-[+module+] ; \
+	@UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
+	set prev-[+module+] stage[+prev+]-[+module+] ; \
+	@UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
 @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
 
 # Bubble a bugfix through all the stages up to stage [+id+].  They
@@ -1408,74 +1374,7 @@
 	fi
 
 .PHONY: all-stage[+id+] clean-stage[+id+]
-all-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\
-  maybe-all-stage[+id+]-[+module+][+
-ENDIF bootstrap+] [+ ENDFOR host_modules +]
-
 do-clean: clean-stage[+id+]
-clean-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\
-  maybe-clean-stage[+id+]-[+module+][+
-ENDIF bootstrap+] [+ ENDFOR host_modules +]
-
-[+ FOR host_modules +][+ IF bootstrap +]
-.PHONY: configure-stage[+id+]-[+module+] maybe-configure-stage[+id+]-[+module+]
-.PHONY: all-stage[+id+]-[+module+] maybe-all-stage[+id+]-[+module+]
-.PHONY: clean-stage[+id+]-[+module+] maybe-clean-stage[+id+]-[+module+]
-
-maybe-configure-stage[+id+]-[+module+]:
-maybe-all-stage[+id+]-[+module+]:
-maybe-clean-stage[+id+]-[+module+]:
-
-@if [+module+]-bootstrap
-maybe-configure-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
-configure-stage[+id+]-[+module+]:
-	@$(MAKE) stage[+id+]-start
-	@[ -f [+module+]/Makefile ] && exit 0 || : ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
-	$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
-	$(HOST_EXPORTS) [+ ENDIF prev +] \
-	echo Configuring stage [+id+] in [+module+] ; \
-	cd [+module+] || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
-	    libsrcdir="$$s/[+module+]";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
-	    libsrcdir="$$s/[+module+]";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  [+stage_configure_flags+] [+extra_configure_flags+]
-
-maybe-all-stage[+id+]-[+module+]: all-stage[+id+]-[+module+]
-all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+]
-	@$(MAKE) stage[+id+]-start
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
-	$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
-	$(HOST_EXPORTS) [+ ENDIF prev +] \
-	cd [+module+] && \
-	$(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \
-		$(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \
-		[+stage_make_flags+] [+extra_make_flags+]
-
-maybe-clean-stage[+id+]-[+module+]: clean-stage[+id+]-[+module+]
-clean-stage[+id+]-[+module+]:
-	@[ -f [+module+]/Makefile ] || [ -f stage[+id+]-[+module+]/Makefile ] \
-	  || exit 0 ; \
-	[ -f [+module+]/Makefile ] || $(MAKE) stage[+id+]-start ; \
-	cd [+module+] && \
-	$(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \
-		$(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \
-		[+stage_make_flags+] [+extra_make_flags+] clean
-@endif [+module+]-bootstrap
-
-[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
 
 # FIXME: Will not need to be conditional when toplevel bootstrap is the
 # only possibility, but now it conflicts with no-bootstrap rules
@@ -1543,18 +1442,15 @@
 profiledbootstrap:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
 	$(MAKE) stageprofile-bubble distclean-stagefeedback
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-	$(SET_LIB_PATH) \
 	echo "Building runtime libraries and training compiler"; \
 	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
 	$(HOST_EXPORTS) \
 	echo "Building feedback based compiler"; \
 	$(MAKE) stagefeedback-bubble stagefeedback-end
@@ -1716,7 +1612,7 @@
 Makefile: $(srcdir)/Makefile.in config.status
 	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-config.status: configure $(gcc_version_trigger)
+config.status: configure
 	CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
 
 # Rebuilding configure.
Index: src/config/ChangeLog
diff -u src/config/ChangeLog:1.43 src/config/ChangeLog:1.49
--- src/config/ChangeLog:1.43	Fri Dec  3 10:47:07 2004
+++ src/config/ChangeLog	Fri Apr 29 14:00:03 2005
@@ -1,3 +1,31 @@
+2005-04-29  Paolo Bonzini  <bonzini@gnu.org>
+
+	* acx.m4 (ACX_PROG_GNAT): Remove stray break.
+
+2005-03-31  Paolo Bonzini  <bonzini@gnu.org>
+
+	* gcc-lib-path.m4: Remove.
+
+2005-03-21  Zack Weinberg  <zack@codesourcery.com>
+
+	* gxx-include-dir.m4: In all substitutions, leave $(gcc_version)
+	to be expanded by the Makefile.
+
+2005-03-15  Zack Weinberg  <zack@codesourcery.com>
+
+	* gcc-version.m4: Delete.
+
+2005-02-28  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR bootstrap/17383
+	* acx.m4 (GCC_TOPLEV_SUBDIRS): Set HOST_SUBDIR if an in-src
+	gcc build is going.
+
+2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
+
+	* warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Don't do
+	anything for non-GCC compilers.
+
 2004-12-03  Richard Sandiford  <rsandifo@redhat.com>
 
 	* gxx-include-dir.m4: New file.
Index: src/config/acx.m4
diff -u src/config/acx.m4:1.10 src/config/acx.m4:1.12
--- src/config/acx.m4:1.10	Fri Aug 13 22:32:31 2004
+++ src/config/acx.m4	Fri Apr 29 14:00:03 2005
@@ -76,8 +76,13 @@
 AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
 # Prefix 'build-' so this never conflicts with target_subdir.
 build_subdir="build-${build_noncanonical}"
-# Not really a subdirectory, but here for completeness.
-host_subdir=.
+# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
+if ( test $srcdir = . && test -d gcc ) \
+   || test -d $srcdir/../host-${host_noncanonical}; then
+  host_subdir="host-${host_noncanonical}"
+else
+  host_subdir=.
+fi
 # No prefix.
 target_subdir=${target_noncanonical}
 AC_SUBST([build_subdir]) []dnl
@@ -207,7 +212,6 @@
 errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
 if test x"$errors" = x && test -f conftest.$ac_objext; then
   acx_cv_cc_gcc_supports_ada=yes
-  break
 fi
 rm -f conftest.*])
 
Index: src/config/gcc-lib-path.m4
diff -u src/config/gcc-lib-path.m4:1.1 src/config/gcc-lib-path.m4:removed
--- src/config/gcc-lib-path.m4:1.1	Fri Sep 24 00:40:22 2004
+++ src/config/gcc-lib-path.m4	Thu May 12 14:26:20 2005
@@ -1,15 +0,0 @@
-AC_DEFUN([TL_AC_GNU_MAKE_GCC_LIB_PATH],
-[
-if test x"$SET_GCC_LIB_PATH_CMD" != x; then
-  # SET_GCC_LIB_PATH_CMD is "XXX=path; export XXX;". It is expanded to
-  #
-  #	eval "set_gcc_lib_path=XXX=path; export XXX;"
-  #
-  eval "set_gcc_lib_path=$SET_GCC_LIB_PATH_CMD"
-  # It will set set_gcc_lib_path to "export XXX=path" for GNU make.
-  set_gcc_lib_path="export $set_gcc_lib_path"
-else
-  set_gcc_lib_path=
-fi
-AC_SUBST(set_gcc_lib_path)
-])dnl
Index: src/config/gcc-version.m4
diff -u src/config/gcc-version.m4:1.1 src/config/gcc-version.m4:removed
--- src/config/gcc-version.m4:1.1	Thu Dec  2 11:09:36 2004
+++ src/config/gcc-version.m4	Thu May 12 14:26:20 2005
@@ -1,28 +0,0 @@
-dnl Usage: TL_AC_GCC_VERSION(TOPSRCDIR)
-dnl
-dnl Set up the variables:
-dnl
-dnl     gcc_version_trigger: pathname of gcc's version.c, if available
-dnl     gcc_version_full: full gcc version string
-dnl     gcc_version: the first "word" in $gcc_version_full
-dnl
-dnl TOPSRCDIR is the top-level source directory.
-AC_DEFUN([TL_AC_GCC_VERSION],
-[
-changequote(,)dnl
-if test "${with_gcc_version_trigger+set}" = set; then
-  gcc_version_trigger=$with_gcc_version_trigger
-else
-  gcc_version_trigger=$1/gcc/version.c
-fi
-if test -f "${gcc_version_trigger}"; then
-  gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'`
-else
-  gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'`
-fi
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-changequote([,])dnl
-AC_SUBST(gcc_version_trigger)
-AC_SUBST(gcc_version_full)
-AC_SUBST(gcc_version)
-])dnl
Index: src/config/gxx-include-dir.m4
diff -u src/config/gxx-include-dir.m4:1.1 src/config/gxx-include-dir.m4:1.2
--- src/config/gxx-include-dir.m4:1.1	Fri Dec  3 10:47:07 2004
+++ src/config/gxx-include-dir.m4	Tue Mar 22 00:49:18 2005
@@ -14,10 +14,10 @@
     ;;
   no | "")
     case "${enable_version_specific_runtime_libs}" in
-      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
+      yes) gxx_include_dir='$(libsubdir)/include/c++' ;;
       *)
-	libstdcxx_incdir=c++/${gcc_version}
-	gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
+	libstdcxx_incdir='c++/$(gcc_version)'
+	gxx_include_dir='$(prefix)/include/$(libstdcxx_incdir)' ;;
     esac ;;
   *) gxx_include_dir=${with_gxx_include_dir} ;;
 esac
Index: src/config/mh-mingw32
diff -u src/config/mh-mingw32:1.2 src/config/mh-mingw32:removed
--- src/config/mh-mingw32:1.2	Fri Apr 19 17:28:03 2002
+++ src/config/mh-mingw32	Thu May 12 14:26:21 2005
@@ -1,7 +0,0 @@
-# We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
-# built without debugging information
-
-LIBGCC2_DEBUG_CFLAGS=
-
-# custom installation rules for mingw32 (append .exe to binaries, etc.)
-# INSTALL_DOSREL=install-dosrel
Index: src/config/warnings.m4
diff -u src/config/warnings.m4:1.1 src/config/warnings.m4:1.2
--- src/config/warnings.m4:1.1	Sat Sep 25 00:26:33 2004
+++ src/config/warnings.m4	Sun Jan 23 21:05:46 2005
@@ -1,6 +1,6 @@
 # Autoconf include file defining macros related to compile-time warnings.
 
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004, 2005 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -43,14 +43,15 @@
 ])# ACX_PROG_CC_WARNING_OPTS
 
 # ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long ...])
-#   Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler
-#   accepts all of those options simultaneously, otherwise to nothing.
+#   Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler is GCC
+#   and accepts all of those options simultaneously, otherwise to nothing.
 AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_SUBST([WARN_PEDANTIC])dnl
 AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
 WARN_PEDANTIC=
-AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
+AS_IF([test $GCC = yes],
+[AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
 [save_CFLAGS="$CFLAGS"
 CFLAGS="-pedantic $1"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
@@ -59,6 +60,7 @@
 CFLAGS="$save_CFLAGS"])
 AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
       [WARN_PEDANTIC="-pedantic $1"])
+])
 AS_VAR_POPDEF([acx_Pedantic])dnl
 ])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
 
Index: src/config.sub
diff -u src/config.sub:1.49 src/config.sub:1.51
--- src/config.sub:1.49	Tue Nov 16 01:18:39 2004
+++ src/config.sub	Fri Apr 29 14:00:02 2005
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2004-11-12'
+timestamp='2005-04-22'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -70,7 +70,7 @@
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -231,13 +231,14 @@
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| m32r | m32rle | m68000 | m68k | m88k | mcore \
+	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -262,12 +263,13 @@
 	| pyramid \
 	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b \
 	| strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
 	| we32k \
-	| x86 | xscale | xstormy16 | xtensa \
+	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
 	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
@@ -298,7 +300,7 @@
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* \
-	| bs2000-* \
+	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
@@ -310,7 +312,7 @@
 	| ip2k-* | iq2000-* \
 	| m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -336,15 +338,16 @@
 	| romp-* | rs6000-* \
 	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
 	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tron-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-	| xtensa-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
 	| ymp-* \
 	| z8k-*)
 		;;
@@ -1033,6 +1036,10 @@
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
Index: src/configure
diff -u src/configure:1.167 src/configure:1.177
--- src/configure:1.167	Thu Dec 16 19:51:28 2004
+++ src/configure	Thu May  5 01:36:32 2005
@@ -852,37 +852,6 @@
 
 extra_host_args=
 
-# Define the trigger file to make sure configure will re-run whenever
-# the gcc version number changes.
-
-if test "${with_gcc_version_trigger+set}" = set; then
-  gcc_version_trigger=$with_gcc_version_trigger
-else
-  gcc_version_trigger=$topsrcdir/gcc/version.c
-fi
-if test -f "${gcc_version_trigger}"; then
-  gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'`
-else
-  gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'`
-fi
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-
-
-
-
-if test -f $gcc_version_trigger ; then
-  case "$ac_configure_args" in
-    *--with-gcc-version-trigger=$gcc_version_trigger* )
-      ;;
-    * )
-      # Add to all subconfigure arguments: build, host, and target.
-      ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger"
-      ;;
-  esac
-else
-  gcc_version_trigger=
-fi
-
 ### To add a new directory to the tree, first choose whether it is a target
 ### or a host dependent tool.  Then put it into the appropriate list
 ### (library or tools, host or target), doing a dependency sort.
@@ -914,7 +883,7 @@
 # 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 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"
+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 gnattools"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
@@ -989,8 +958,13 @@
 
   # Prefix 'build-' so this never conflicts with target_subdir.
 build_subdir="build-${build_noncanonical}"
-# Not really a subdirectory, but here for completeness.
-host_subdir=.
+# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
+if ( test $srcdir = . && test -d gcc ) \
+   || test -d $srcdir/../host-${host_noncanonical}; then
+  host_subdir="host-${host_noncanonical}"
+else
+  host_subdir=.
+fi
 # No prefix.
 target_subdir=${target_noncanonical}
    
@@ -1095,9 +1069,6 @@
   powerpc-*-beos*)
     noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
     ;;
-  *-*-darwin*)
-    noconfigdirs="$noconfigdirs tk itcl libgui"
-    ;;
 esac
 
 
@@ -1111,6 +1082,7 @@
 
 if test "${ENABLE_LIBADA}" != "yes" ; then
   noconfigdirs="$noconfigdirs target-libada"
+  noconfigdirs="$noconfigdirs gnattools"
 fi
 
 # Save it here so that, even in case of --enable-libgcj, if the Java
@@ -1291,8 +1263,18 @@
   c54x*-*-* | tic54x-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
     ;;
-  cris-*-*)
-    noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+  cris-*-* | crisv32-*-*)
+    libgcj_ex_libffi=`echo ${libgcj} | sed -e 's/target-libffi//'`
+    case "${target}" in
+      *-*-aout)
+	noconfigdirs="$noconfigdirs ${libgcj}";;
+      *-*-elf)
+	noconfigdirs="$noconfigdirs ${libgcj_ex_libffi}";;
+      *-*-linux*)
+	noconfigdirs="$noconfigdirs ${libgcj_ex_libffi} target-newlib target-libgloss";;
+      *)
+	noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";;
+    esac
     ;;
   crx-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
@@ -1539,6 +1521,9 @@
            use_gnu_ld=no
     fi
     ;;
+  sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
   sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
     ;;
   v810-*-*)
@@ -1696,7 +1681,6 @@
     host_makefile_frag="config/mh-cygwin"
     ;;
   *-mingw32*)
-    host_makefile_frag="config/mh-mingw32"
     ;;
   *-interix*)
     host_makefile_frag="config/mh-interix"
@@ -1794,7 +1778,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1798: checking for $ac_word" >&5
+echo "configure:1782: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1824,7 +1808,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1828: checking for $ac_word" >&5
+echo "configure:1812: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1875,7 +1859,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1879: checking for $ac_word" >&5
+echo "configure:1863: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1907,7 +1891,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1911: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1918,12 +1902,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1922 "configure"
+#line 1906 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1949,12 +1933,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1953: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1958: checking whether we are using GNU C" >&5
+echo "configure:1942: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1963,7 +1947,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1982,7 +1966,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1986: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1970: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2049,7 +2033,7 @@
 # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2053: checking for $ac_word" >&5
+echo "configure:2037: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2081,7 +2065,7 @@
   # Extract the first word of "gnatbind", so it can be a program name with args.
 set dummy gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2085: checking for $ac_word" >&5
+echo "configure:2069: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2114,7 +2098,7 @@
 fi
 
 echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
-echo "configure:2118: checking whether compiler driver understands Ada" >&5
+echo "configure:2102: checking whether compiler driver understands Ada" >&5
 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2133,7 +2117,6 @@
 errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
 if test x"$errors" = x && test -f conftest.$ac_objext; then
   acx_cv_cc_gcc_supports_ada=yes
-  break
 fi
 rm -f conftest.*
 fi
@@ -2147,7 +2130,7 @@
 fi
 
 echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
-echo "configure:2151: checking how to compare bootstrapped objects" >&5
+echo "configure:2134: checking how to compare bootstrapped objects" >&5
 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2245,9 +2228,9 @@
 CFLAGS="$CFLAGS $gmpinc"
 # Check GMP actually works
 echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6
-echo "configure:2249: checking for correct version of gmp.h" >&5
+echo "configure:2232: checking for correct version of gmp.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2251 "configure"
+#line 2234 "configure"
 #include "confdefs.h"
 #include "gmp.h"
 int main() {
@@ -2258,7 +2241,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2271,12 +2254,12 @@
 
 if test x"$have_gmp" = xyes; then
   echo $ac_n "checking for MPFR""... $ac_c" 1>&6
-echo "configure:2275: checking for MPFR" >&5
+echo "configure:2258: checking for MPFR" >&5
 
   saved_LIBS="$LIBS"
   LIBS="$LIBS $gmplibs"
   cat > conftest.$ac_ext <<EOF
-#line 2280 "configure"
+#line 2263 "configure"
 #include "confdefs.h"
 #include <gmp.h>
 #include <mpfr.h>
@@ -2284,7 +2267,7 @@
 mpfr_t n; mpfr_init(n);
 ; return 0; }
 EOF
-if { (eval echo configure:2288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2771,7 +2754,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2775: checking for $ac_word" >&5
+echo "configure:2758: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2806,7 +2789,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2810: checking for $ac_word" >&5
+echo "configure:2793: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2841,7 +2824,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2845: checking for $ac_word" >&5
+echo "configure:2828: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2876,7 +2859,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2880: checking for $ac_word" >&5
+echo "configure:2863: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2911,7 +2894,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2915: checking for $ac_word" >&5
+echo "configure:2898: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2946,7 +2929,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2950: checking for $ac_word" >&5
+echo "configure:2933: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3043,30 +3026,9 @@
   ;;
 esac
 
-# If no --enable-shared nor --disable-shared is specified, we set up
-# LD_LIBRARY_PATH when we build for gcc.
-case $enable_shared in
-"")
-  if test -d ${srcdir}/gcc; then
-    set_lib_path=yes
-  else 
-    set_lib_path=no
-  fi
-  ;;
-*)
-  set_lib_path=$enable_shared
-  ;;
-esac
-
-# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
-# binutils tools will find libbfd.so.
-case "${set_lib_path}" in
-  no) SET_LIB_PATH= ;;
-  *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
-esac
-
 case "${host}" in
   *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
+  *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
   *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
 esac
 
@@ -3369,27 +3331,10 @@
 # fixed in future.  It's still worthwhile to use a cache file for each
 # directory.  I think.
 
-# Pass the appropriate --host, --build, and --cache-file arguments.
-target_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}"
-
-# provide a proper gxx_include_dir.
-
-case "${with_gxx_include_dir}" in
-  yes)
-    { echo "configure: error: --with-gxx-include-dir=[dir] requires a directory" 1>&2; exit 1; }
-    ;;
-  no | "")
-    case "${enable_version_specific_runtime_libs}" in
-      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
-      *)
-	libstdcxx_incdir=c++/${gcc_version}
-	gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
-    esac ;;
-  *) gxx_include_dir=${with_gxx_include_dir} ;;
-esac
-
-
-
+# Pass the appropriate --build, --host, --target and --cache-file arguments.
+# We need to pass --target, as newer autoconf's requires consistency
+# for target_alias and gcc doesn't manage it consistently.
+target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}"
 
 FLAGS_FOR_TARGET=
 case " $target_configdirs " in
@@ -3411,7 +3356,7 @@
        # to it.  This is right: we don't want to search that directory
        # for binaries, but we want the header files in there, so add
        # them explicitly.
-       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
+       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include'
 
        # Someone might think of using the pre-installed headers on
        # Canadian crosses, in case the installed compiler is not fully
@@ -3458,13 +3403,13 @@
 if test "x${use_gnu_ld}" = x &&
    echo " ${configdirs} " | grep " ld " > /dev/null ; then
   # Arrange for us to find uninstalled linker scripts.
-  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
+  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
 fi
 
 if test "x${CC_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${srcdir}/gcc; then
-  CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
+  CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
 elif test "$host" = "$target"; then
   CC_FOR_TARGET='$(CC)'
 else
@@ -3475,7 +3420,7 @@
 if test "x${GCJ_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${srcdir}/gcc; then
-  GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
+  GCJ_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/'
 elif test "$host" = "$target"; then
   GCJ_FOR_TARGET='gcj'
 else
@@ -3486,7 +3431,7 @@
 if test "x${GFORTRAN_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${srcdir}/gcc; then
-  GFORTRAN_FOR_TARGET='$$r/gcc/gfortran -B$$r/gcc/'
+  GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/'
 elif test "$host" = "$target"; then
   GFORTRAN_FOR_TARGET='gfortran'
 else
@@ -3511,8 +3456,8 @@
   # default whereas gcc does not.
   # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for
   # all other cases.
-  CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
-  RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags
+  CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ '$libstdcxx_flags
+  RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ '$raw_libstdcxx_flags
 elif test "$host" = "$target"; then
   CXX_FOR_TARGET='$(CXX)'
   RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
@@ -3565,7 +3510,6 @@
 
 
 
-
 # Build module lists & subconfigure args.
 
 
@@ -3592,7 +3536,7 @@
   # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3596: checking for $ac_word" >&5
+echo "configure:3540: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3625,7 +3569,7 @@
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3629: checking for $ac_word" >&5
+echo "configure:3573: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3664,7 +3608,7 @@
   # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3668: checking for $ac_word" >&5
+echo "configure:3612: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3697,7 +3641,7 @@
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3701: checking for $ac_word" >&5
+echo "configure:3645: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3736,7 +3680,7 @@
   # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3740: checking for $ac_word" >&5
+echo "configure:3684: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3769,7 +3713,7 @@
     # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3773: checking for $ac_word" >&5
+echo "configure:3717: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3808,7 +3752,7 @@
   # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3812: checking for $ac_word" >&5
+echo "configure:3756: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3841,7 +3785,7 @@
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3845: checking for $ac_word" >&5
+echo "configure:3789: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3880,7 +3824,7 @@
   # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3884: checking for $ac_word" >&5
+echo "configure:3828: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3913,7 +3857,7 @@
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3917: checking for $ac_word" >&5
+echo "configure:3861: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3952,7 +3896,7 @@
   # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3956: checking for $ac_word" >&5
+echo "configure:3900: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3985,7 +3929,7 @@
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3989: checking for $ac_word" >&5
+echo "configure:3933: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4024,7 +3968,7 @@
   # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4028: checking for $ac_word" >&5
+echo "configure:3972: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4057,7 +4001,7 @@
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4061: checking for $ac_word" >&5
+echo "configure:4005: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4096,7 +4040,7 @@
   # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4100: checking for $ac_word" >&5
+echo "configure:4044: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4129,7 +4073,7 @@
     # Extract the first word of "objcopy", so it can be a program name with args.
 set dummy objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4133: checking for $ac_word" >&5
+echo "configure:4077: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4168,7 +4112,7 @@
   # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4172: checking for $ac_word" >&5
+echo "configure:4116: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4201,7 +4145,7 @@
     # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4205: checking for $ac_word" >&5
+echo "configure:4149: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4247,7 +4191,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4251: checking for $ac_word" >&5
+echo "configure:4195: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4280,7 +4224,7 @@
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4284: checking for $ac_word" >&5
+echo "configure:4228: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4319,7 +4263,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4323: checking for $ac_word" >&5
+echo "configure:4267: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4352,7 +4296,7 @@
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4356: checking for $ac_word" >&5
+echo "configure:4300: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4391,7 +4335,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4395: checking for $ac_word" >&5
+echo "configure:4339: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4424,7 +4368,7 @@
     # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4428: checking for $ac_word" >&5
+echo "configure:4372: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4463,7 +4407,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4467: checking for $ac_word" >&5
+echo "configure:4411: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4496,7 +4440,7 @@
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4500: checking for $ac_word" >&5
+echo "configure:4444: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4535,7 +4479,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4539: checking for $ac_word" >&5
+echo "configure:4483: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4568,7 +4512,7 @@
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4572: checking for $ac_word" >&5
+echo "configure:4516: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4607,7 +4551,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4611: checking for $ac_word" >&5
+echo "configure:4555: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4640,7 +4584,7 @@
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4644: checking for $ac_word" >&5
+echo "configure:4588: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4679,7 +4623,7 @@
   # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4683: checking for $ac_word" >&5
+echo "configure:4627: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4712,7 +4656,7 @@
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4716: checking for $ac_word" >&5
+echo "configure:4660: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4797,7 +4741,7 @@
 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4801: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4745: checking whether to enable maintainer-specific portions of Makefiles" >&5
 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -4844,7 +4788,7 @@
 # gcc for stageN-gcc and stagePREV-gcc for stage(N-1).  In case this is not
 # possible, however, we can resort to mv.
 echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6
-echo "configure:4848: checking if symbolic links between directories work" >&5
+echo "configure:4792: checking if symbolic links between directories work" >&5
 if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4858,7 +4802,7 @@
    && rm -f confdir.s2; then
   gcc_cv_prog_ln_s_dir=yes
 else
-  gcc_cv_prog_ln_s_dir=yes
+  gcc_cv_prog_ln_s_dir=no
 fi
 rm -rf confdir.s1 confdir.s2
 fi
@@ -4892,26 +4836,6 @@
 esac
 
 
-# If gcc is built natively with shared library enabled, set
-# $RPATH_ENVVAR to make sure the newly built gcc shared librares are
-# used.
-SET_GCC_LIB_PATH=
-if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then
-  case "${set_lib_path}" in
-    no) ;;
-    *)
-      eval "d=\$$RPATH_ENVVAR"
-      if test x"$d" != x; then
-	d="$pwd/gcc:$d"
-      else
-	d="$pwd/gcc"
-    fi
-    SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
-    ;;
-  esac
-fi
-
-
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -4978,34 +4902,15 @@
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section.  Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*([^)]*)\)[ 	]*\(.*\),-D\1=\2,g
-t quote
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ 	`~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output.  A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
 
 
 # Without the "./", some shells look in PATH for config.status.
@@ -5097,9 +5002,6 @@
 s%@LN@%$LN%g
 s%@LN_S@%$LN_S%g
 s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g
-s%@gcc_version_trigger@%$gcc_version_trigger%g
-s%@gcc_version_full@%$gcc_version_full%g
-s%@gcc_version@%$gcc_version%g
 s%@build_subdir@%$build_subdir%g
 s%@host_subdir@%$host_subdir%g
 s%@target_subdir@%$target_subdir%g
@@ -5119,8 +5021,6 @@
 s%@default_target@%$default_target%g
 /@serialization_dependencies@/r $serialization_dependencies
 s%@serialization_dependencies@%%g
-s%@gxx_include_dir@%$gxx_include_dir%g
-s%@libstdcxx_incdir@%$libstdcxx_incdir%g
 /@host_makefile_frag@/r $host_makefile_frag
 s%@host_makefile_frag@%%g
 /@target_makefile_frag@/r $target_makefile_frag
@@ -5129,7 +5029,6 @@
 s%@alphaieee_frag@%%g
 /@ospace_frag@/r $ospace_frag
 s%@ospace_frag@%%g
-s%@SET_LIB_PATH@%$SET_LIB_PATH%g
 s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
 s%@BUILD_PREFIX@%$BUILD_PREFIX%g
 s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
@@ -5201,7 +5100,6 @@
 s%@CREATE_LINK_TO_DIR@%$CREATE_LINK_TO_DIR%g
 s%@UNDO_LINK_TO_DIR@%$UNDO_LINK_TO_DIR%g
 s%@stage2_werror_flag@%$stage2_werror_flag%g
-s%@SET_GCC_LIB_PATH@%$SET_GCC_LIB_PATH%g
 
 CEOF
 EOF
Index: src/configure.in
diff -u src/configure.in:1.256 src/configure.in:1.266
--- src/configure.in:1.256	Thu Dec 16 19:51:28 2004
+++ src/configure.in	Thu May  5 01:36:31 2005
@@ -19,8 +19,6 @@
 ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
 
 sinclude(config/acx.m4)
-sinclude(config/gcc-version.m4)
-sinclude(config/gxx-include-dir.m4)
 
 AC_INIT(move-if-change)
 AC_PREREQ(2.13)
@@ -101,22 +99,6 @@
 
 extra_host_args=
 
-# Define the trigger file to make sure configure will re-run whenever
-# the gcc version number changes.
-TL_AC_GCC_VERSION([$topsrcdir])
-if test -f $gcc_version_trigger ; then
-  case "$ac_configure_args" in
-    *--with-gcc-version-trigger=$gcc_version_trigger* )
-      ;;
-    * )
-      # Add to all subconfigure arguments: build, host, and target.
-      ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger"
-      ;;
-  esac
-else
-  gcc_version_trigger=
-fi
-
 ### To add a new directory to the tree, first choose whether it is a target
 ### or a host dependent tool.  Then put it into the appropriate list
 ### (library or tools, host or target), doing a dependency sort.
@@ -148,7 +130,7 @@
 # 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 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"
+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 gnattools"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
@@ -308,9 +290,6 @@
   powerpc-*-beos*)
     noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
     ;;
-  *-*-darwin*)
-    noconfigdirs="$noconfigdirs tk itcl libgui"
-    ;;
 esac
 
 
@@ -320,6 +299,7 @@
 ENABLE_LIBADA=yes)
 if test "${ENABLE_LIBADA}" != "yes" ; then
   noconfigdirs="$noconfigdirs target-libada"
+  noconfigdirs="$noconfigdirs gnattools"
 fi
 
 # Save it here so that, even in case of --enable-libgcj, if the Java
@@ -500,8 +480,18 @@
   c54x*-*-* | tic54x-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
     ;;
-  cris-*-*)
-    noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+  cris-*-* | crisv32-*-*)
+    libgcj_ex_libffi=`echo ${libgcj} | sed -e 's/target-libffi//'`
+    case "${target}" in
+      *-*-aout)
+	noconfigdirs="$noconfigdirs ${libgcj}";;
+      *-*-elf)
+	noconfigdirs="$noconfigdirs ${libgcj_ex_libffi}";;
+      *-*-linux*)
+	noconfigdirs="$noconfigdirs ${libgcj_ex_libffi} target-newlib target-libgloss";;
+      *)
+	noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";;
+    esac
     ;;
   crx-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-mudflap ${libgcj}"
@@ -748,6 +738,9 @@
            use_gnu_ld=no
     fi
     ;;
+  sparc-*-solaris2.[[0-6]] | sparc-*-solaris2.[[0-6]].*)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
   sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
     ;;
   v810-*-*)
@@ -905,7 +898,6 @@
     host_makefile_frag="config/mh-cygwin"
     ;;
   *-mingw32*)
-    host_makefile_frag="config/mh-mingw32"
     ;;
   *-interix*)
     host_makefile_frag="config/mh-interix"
@@ -1637,30 +1629,9 @@
   ;;
 esac
 
-# If no --enable-shared nor --disable-shared is specified, we set up
-# LD_LIBRARY_PATH when we build for gcc.
-case $enable_shared in
-"")
-  if test -d ${srcdir}/gcc; then
-    set_lib_path=yes
-  else 
-    set_lib_path=no
-  fi
-  ;;
-*)
-  set_lib_path=$enable_shared
-  ;;
-esac
-
-# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
-# binutils tools will find libbfd.so.
-case "${set_lib_path}" in
-  no) SET_LIB_PATH= ;;
-  *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
-esac
-
 case "${host}" in
   *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
+  *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
   *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
 esac
 
@@ -1957,11 +1928,10 @@
 # fixed in future.  It's still worthwhile to use a cache file for each
 # directory.  I think.
 
-# Pass the appropriate --host, --build, and --cache-file arguments.
-target_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}"
-
-# provide a proper gxx_include_dir.
-TL_AC_GXX_INCLUDE_DIR
+# Pass the appropriate --build, --host, --target and --cache-file arguments.
+# We need to pass --target, as newer autoconf's requires consistency
+# for target_alias and gcc doesn't manage it consistently.
+target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}"
 
 FLAGS_FOR_TARGET=
 case " $target_configdirs " in
@@ -1983,7 +1953,7 @@
        # to it.  This is right: we don't want to search that directory
        # for binaries, but we want the header files in there, so add
        # them explicitly.
-       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
+       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include'
 
        # Someone might think of using the pre-installed headers on
        # Canadian crosses, in case the installed compiler is not fully
@@ -2030,13 +2000,13 @@
 if test "x${use_gnu_ld}" = x &&
    echo " ${configdirs} " | grep " ld " > /dev/null ; then
   # Arrange for us to find uninstalled linker scripts.
-  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
+  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
 fi
 
 if test "x${CC_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${srcdir}/gcc; then
-  CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
+  CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
 elif test "$host" = "$target"; then
   CC_FOR_TARGET='$(CC)'
 else
@@ -2047,7 +2017,7 @@
 if test "x${GCJ_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${srcdir}/gcc; then
-  GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
+  GCJ_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/'
 elif test "$host" = "$target"; then
   GCJ_FOR_TARGET='gcj'
 else
@@ -2058,7 +2028,7 @@
 if test "x${GFORTRAN_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${srcdir}/gcc; then
-  GFORTRAN_FOR_TARGET='$$r/gcc/gfortran -B$$r/gcc/'
+  GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/'
 elif test "$host" = "$target"; then
   GFORTRAN_FOR_TARGET='gfortran'
 else
@@ -2083,8 +2053,8 @@
   # default whereas gcc does not.
   # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for
   # all other cases.
-  CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
-  RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags
+  CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ '$libstdcxx_flags
+  RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ '$raw_libstdcxx_flags
 elif test "$host" = "$target"; then
   CXX_FOR_TARGET='$(CXX)'
   RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
@@ -2130,7 +2100,6 @@
 AC_SUBST_FILE(ospace_frag)
 
 # Miscellanea: directories, flags, etc.
-AC_SUBST(SET_LIB_PATH)
 AC_SUBST(RPATH_ENVVAR)
 AC_SUBST(BUILD_PREFIX)
 AC_SUBST(BUILD_PREFIX_1)
@@ -2283,7 +2252,7 @@
    && rm -f confdir.s2; then
   gcc_cv_prog_ln_s_dir=yes
 else
-  gcc_cv_prog_ln_s_dir=yes
+  gcc_cv_prog_ln_s_dir=no
 fi
 rm -rf confdir.s1 confdir.s2])
 
@@ -2309,24 +2278,4 @@
 esac
 AC_SUBST(stage2_werror_flag)
 
-# If gcc is built natively with shared library enabled, set
-# $RPATH_ENVVAR to make sure the newly built gcc shared librares are
-# used.
-SET_GCC_LIB_PATH=
-if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then
-  case "${set_lib_path}" in
-    no) ;;
-    *)
-      eval "d=\$$RPATH_ENVVAR"
-      if test x"$d" != x; then
-	d="$pwd/gcc:$d"
-      else
-	d="$pwd/gcc"
-    fi
-    SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
-    ;;
-  esac
-fi
-AC_SUBST(SET_GCC_LIB_PATH)
-
 AC_OUTPUT(Makefile)
Index: src/gettext.m4
diff -u src/gettext.m4:1.3 src/gettext.m4:1.6
--- src/gettext.m4:1.3	Wed Jan 14 13:41:36 2004
+++ src/gettext.m4	Mon Jan 31 20:29:41 2005
@@ -24,7 +24,6 @@
 
     dnl If we use NLS figure out what method
     if test "$USE_NLS" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
       AC_MSG_CHECKING([whether included gettext is requested])
       AC_ARG_WITH(included-gettext,
         [  --with-included-gettext use the GNU gettext library included here],
@@ -40,7 +39,7 @@
 	dnl catgets is only used if permitted by option --with-catgets.
 	nls_cv_header_intl=
 	nls_cv_header_libgt=
-	CATOBJEXT=NONE
+	CATOBJEXT=
 
 	AC_CHECK_HEADER(libintl.h,
 	  [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
@@ -81,9 +80,9 @@
 	dnl In the standard gettext, we would now check for catgets.
         dnl However, we never want to use catgets for our releases.
 
-        if test "$CATOBJEXT" = "NONE"; then
-	  dnl Neither gettext nor catgets in included in the C library.
-	  dnl Fall back on GNU gettext library.
+        if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then
+	  # Neither gettext nor catgets in included in the C library.
+	  # Fall back on GNU gettext library (assuming it is present).
 	  nls_cv_use_gnu_gettext=yes
         fi
       fi
@@ -156,6 +155,9 @@
     AC_SUBST(INTLOBJS)
     AC_SUBST(POFILES)
     AC_SUBST(POSUB)
+    if test "x$CATOBJEXT" != "x"; then
+      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
+    fi
   ])
 
 AC_DEFUN([CY_GNU_GETTEXT],
Index: src/install-sh
diff -u src/install-sh:1.5 src/install-sh:1.6
--- src/install-sh:1.5	Tue Nov 16 01:18:39 2004
+++ src/install-sh	Wed Jan 19 00:34:56 2005
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2004-10-22.00
+scriptversion=2004-12-17.09
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -296,7 +296,7 @@
 	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
 	       || {
 		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit
+		 (exit 1); exit 1
 	       }
 	     else
 	       :
@@ -307,12 +307,12 @@
 	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
 	 }
     }
-  fi || { (exit 1); exit; }
+  fi || { (exit 1); exit 1; }
 done
 
 # The final little trick to "correctly" pass the exit status to the exit trap.
 {
-  (exit 0); exit
+  (exit 0); exit 0
 }
 
 # Local variables:
Index: src/ltmain.sh
diff -u src/ltmain.sh:1.15 src/ltmain.sh:1.16
--- src/ltmain.sh:1.15	Sat Mar 16 14:43:09 2002
+++ src/ltmain.sh	Tue Mar  1 22:33:54 2005
@@ -4234,6 +4234,63 @@
 #	  fi
 #	done
 
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+        if (for obj in $oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $echo "copying selected object files to avoid basename conflicts..."
+
+	  if test -z "$gentop"; then
+	    gentop="$output_objdir/${outputname}x"
+
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test $status -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	    generated="$generated $gentop"
+	  fi
+
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+	        newobj=lt$counter-$objbase
+	        counter=`expr $counter + 1`
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      $run ln "$obj" "$gentop/$newobj" ||
+	      $run cp "$obj" "$gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+
         eval cmds=\"$old_archive_cmds\"
 
         if len=`expr "X$cmds" : ".*"` &&
@@ -4247,6 +4304,7 @@
           objlist=
           concat_cmds=
           save_oldobjs=$oldobjs
+
           for obj in $save_oldobjs
           do
             oldobjs="$objlist $obj"
