Fixes for build directories with colons, AIX build problems.
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 29 Nov 2000 21:30:30 +0000 (21:30 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 29 Nov 2000 21:30:30 +0000 (21:30 +0000)
2000-11-29  Benjamin Kosnik  <bkoz@redhat.com>

Fixes for build directories with colons, AIX build problems.
* src/Makefile.am: Cleanups, add documentation.
(libstdc++.INC): Simplify rule.
(myinstallheaders): Consolidate install rules.
(myinstalldirs): New, make directores.
(base_headers): Subdivide based on install directory.
(ext_headers): New.
(backward_headers): New.
(headers): Remove.
(c_headers): Remove, unused.
(c_shadow_headers): Split up, deal with conditional usage in a
sane manner.
* src/Makefile.in: Regenerate.

From-SVN: r37858

libstdc++-v3/ChangeLog
libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in

index 793b950761115245eb28c408870a340642016b1c..8e1274e2504d25a690a0d4a3f0ac0611bc8af803 100644 (file)
@@ -1,3 +1,19 @@
+2000-11-29  Benjamin Kosnik  <bkoz@redhat.com>
+
+       Fixes for build directories with colons, AIX build problems.
+       * src/Makefile.am: Cleanups, add documentation.
+       (libstdc++.INC): Simplify rule.
+       (myinstallheaders): Consolidate install rules.
+       (myinstalldirs): New, make directores.
+       (base_headers): Subdivide based on install directory.
+       (ext_headers): New.
+       (backward_headers): New.
+       (headers): Remove.
+       (c_headers): Remove, unused.
+       (c_shadow_headers): Split up, deal with conditional usage in a
+       sane manner.
+       * src/Makefile.in: Regenerate.
+       
 2000-11-29  Phil Edwards  <pme@sources.redhat.com>
 
        Sync with the documentation from wwwdocs.
index 61650188fcf131bc40f701b0d0a6cb8dcfeb877b..6a874cd2ad753c7567d471bc4d5f9257cc64ce54 100644 (file)
@@ -21,7 +21,7 @@
 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 ## USA.
 
-## $Id: Makefile.am,v 1.52 2000/11/25 09:11:15 bkoz Exp $
+## $Id: Makefile.am,v 1.53 2000/11/29 01:09:09 gdr Exp $
 
 AUTOMAKE_OPTIONS = 1.3 gnits
 MAINT_CHARSET = latin1
@@ -93,17 +93,6 @@ base_headers = \
        bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
        bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
        bits/stl_threads.h bits/stl_iterator_base.h \
-       backward/complex.h backward/iomanip.h backward/istream.h \
-       backward/ostream.h backward/stream.h backward/streambuf.h \
-       backward/algo.h backward/algobase.h backward/alloc.h \
-       backward/bvector.h backward/defalloc.h backward/deque.h \
-       backward/function.h backward/hash_map.h backward/hash_set.h \
-       backward/hashtable.h backward/heap.h backward/iterator.h \
-       backward/list.h backward/map.h backward/multimap.h backward/new.h \
-       backward/multiset.h backward/pair.h backward/iostream.h \
-       backward/rope.h backward/set.h backward/slist.h backward/stack.h \
-       backward/tempbuf.h backward/tree.h backward/vector.h \
-       backward/fstream.h backward/strstream.h backward/strstream \
        bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
        bits/std_iterator.h bits/std_list.h \
        bits/std_map.h bits/std_memory.h bits/std_numeric.h \
@@ -119,10 +108,24 @@ base_headers = \
        bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
        bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
        bits/concept_checks.h bits/container_concepts.h \
-       bits/sequence_concepts.h \
+       bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
+
+backward_headers = \
+       backward/complex.h backward/iomanip.h backward/istream.h \
+       backward/ostream.h backward/stream.h backward/streambuf.h \
+       backward/algo.h backward/algobase.h backward/alloc.h \
+       backward/bvector.h backward/defalloc.h backward/deque.h \
+       backward/function.h backward/hash_map.h backward/hash_set.h \
+       backward/hashtable.h backward/heap.h backward/iterator.h \
+       backward/list.h backward/map.h backward/multimap.h backward/new.h \
+       backward/multiset.h backward/pair.h backward/iostream.h \
+       backward/rope.h backward/set.h backward/slist.h backward/stack.h \
+       backward/tempbuf.h backward/tree.h backward/vector.h \
+       backward/fstream.h backward/strstream.h backward/strstream
+
+ext_headers = \
        ext/ropeimpl.h ext/stl_rope.h \
-       ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h \
-       ext/stl_hashtable.h ext/stl_hash_fun.h \
+       ext/stl_bvector.h ext/stl_hashtable.h ext/stl_hash_fun.h \
        ext/hash_map ext/hash_set ext/rope ext/slist \
        ext/tree ext/bvector 
 
@@ -134,6 +137,7 @@ c_base_headers = \
        bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h \
        bits/std_cwchar.h bits/std_cwctype.h 
 
+if GLIBCPP_USE_CSHADOW
 c_shadow_headers = \
        assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \
        signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \
@@ -143,11 +147,8 @@ c_shadow_headers = \
        bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \
        bits/wrap_features.h bits/wrap_langinfo.h \
        sys/cdefs.h 
-
-if GLIBCPP_USE_CSHADOW
-c_headers = $(c_base_headers) $(c_shadow_headers)
 else
-c_headers = $(c_base_headers)
+c_shadow_headers =
 endif
 
 std_headers = \
@@ -171,8 +172,6 @@ build_headers = \
        bits/atomicity.h bits/os_defines.h \
        bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h 
 
-headers = $(base_headers) $(c_headers)
-
 sources = \
        limitsMEMBERS.cc \
        cmath.cc \
@@ -235,37 +234,68 @@ myincludep = $(prefix)/include/g++-@libstdcxx_interface@
 endif
 endif
 
-# We have our own special, needlessly complicated installation routine
+# We have our own special, ridiculously complicated installation routine
 # here, as automake/autoconf is currently brain-damaged when it comes
-# to installing sub-directories of headers.
-install-data-local: myinstallheaders
+# to installing sub-directories of headers. In particular, we want to
+# 1) install build headers from (blddir)/include/bits -> (install)/bits
+# 2) install source headers from
+#      (srcdir)/include/bits -> (install)/bits
+#      (srcdir)/include/ext -> (install)/ext
+#      (srcdir)/include/backward -> (install)/backward
+#      ... and the always entertaining "C" compatibility bits
+#      where * represents configure-time directory switching
+#      (srcdir)/include/c* -> (install)/
+#      (srcdir)/include/c*/bits -> (install)/bits
+#      (srcdir)/include/c*/sys -> (install)/sys
+install-data-local: myinstalldirs myinstallheaders
+
+# NB: installation of shadow header directories is not attempted.
+myinstalldirs:
+       if test -z "$(MULTISUBDIR)"; then \
+       $(mkinstalldirs) $(DESTDIR)$(myincludep)/bits; \
+       $(mkinstalldirs) $(DESTDIR)$(myincludep)/backward; \
+       $(mkinstalldirs) $(DESTDIR)$(myincludep)/ext; \
+       fi
 
 # NB: As libio_headers may be empty, need this to make sure bash doesn't
 # choke on an empty for... loop by using libio_headers_install
-myinstallheaders: $(headers:%=$(myincludep)/%)
+# NB: installation of shadow headers is not attempted.
+src_incdir = @GLIBCPP_INCLUDE_DIR@
+bld_incdir = $(top_builddir)/include
+c_incdir = @C_INCLUDE_DIR@
+myinstallheaders: 
        if test -z "$(MULTISUBDIR)"; then \
+       for i in $(base_headers); do \
+        echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/"; \
+         $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/; \
+       done; \
+       for i in $(ext_headers); do \
+        echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/"; \
+         $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/; \
+       done; \
+       for i in $(backward_headers); do \
+        echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/backward/"; \
+         $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/backward/; \
+       done; \
+       for i in $(c_base_headers); do \
+        echo "$(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/"; \
+         $(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/; \
+       done; \
        for i in $(std_headers); do \
-         echo "$(INSTALL_DATA) $(GLIBCPP_INCLUDE_DIR)/std/$$i $(myincludep)";\
-               $(INSTALL_DATA) $(GLIBCPP_INCLUDE_DIR)/std/$$i $(myincludep); \
+       echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep)";\
+         $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
        done; \
        for i in $(build_headers); do \
-          echo "$(INSTALL_DATA) $(top_builddir)/include/$$i $(myincludep)/bits/"; \
-            $(INSTALL_DATA) $(top_builddir)/include/$$i $(myincludep)/bits/; \
+        echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(myincludep)/bits/"; \
+         $(INSTALL_DATA) $(bld_incdir)/$$i $(myincludep)/bits/; \
        done; \
        libio_headers_install='$(libio_headers)'; \
        for i in $$libio_headers_install; do \
-          echo "$(INSTALL_DATA) $$i $(myincludep)"; \
-                $(INSTALL_DATA) $$i $(myincludep); \
+        echo "$(INSTALL_DATA) $$i $(myincludep)"; \
+          $(INSTALL_DATA) $$i $(myincludep); \
        done; \
        fi;
 
-$(headers:%=$(myincludep)/%): $(myincludep)/%: %
-       if test -z "$(MULTISUBDIR)"; then \
-       $(mkinstalldirs) $(@D); \
-       echo " $(INSTALL_DATA) $^ $@"; \
-       $(INSTALL_DATA) $^ $@; \
-       fi;
-
 # We have to handle misc-inst.cc and locale-inst.cc in a special way
 # since we cannot instantiate all classes due to missing definitions
 # for things like vptrs, type_info bits, etc. when using
@@ -289,14 +319,6 @@ wstring-inst.lo: string-inst.cc
 # Alexandre put this in here for some libtool-related reason.
 all: libstdc++.INC
 libstdc++.INC: Makefile
-       $(MAKE) \
-         top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
-         top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
-         tmp-$@
-       -rm -f $@
-       mv tmp-$@ $@
-
-tmp-libstdc++.INC: Makefile
        echo $(INCLUDES) > $@
 
 
@@ -340,12 +362,3 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
 # which of course is problematic at this point.
 CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
          @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
-
-
-
-
-
-
-
-
-
index 3921cfc8fdb0bef5d776b56a25c5dca03231e58c..0190c959fd2f5d7498ee50ce2fd1c8b7202e7ce8 100644 (file)
@@ -147,16 +147,19 @@ CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
 INCLUDES =     -nostdinc++     $(CSHADOW_INCLUDES) $(LIBSUPCXX_INCLUDES) -I$(GLIBCPP_INCLUDE_DIR)      $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) -I$(top_builddir)/include         $(TOPLEVEL_INCLUDES)    
 
 
-base_headers =         bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h        bits/basic_string.h bits/std_string.h  bits/string.tcc  bits/generic_shadow.h bits/std_utility.h        bits/std_complex.h      bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h      bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h   bits/gslice.h bits/gslice_array.h bits/indirect_array.h         bits/exception_support.h        bits/std_fstream.h bits/std_iomanip.h   bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc         bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h    bits/std_istream.h bits/istream.tcc bits/std_locale.h   bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc     bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h      bits/streambuf.tcc bits/basic_file.h    bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h    bits/stl_pthread_alloc.h bits/pthread_allocimpl.h       bits/stl_threads.h bits/stl_iterator_base.h     backward/complex.h backward/iomanip.h backward/istream.h        backward/ostream.h backward/stream.h backward/streambuf.h       backward/algo.h backward/algobase.h backward/alloc.h    backward/bvector.h backward/defalloc.h backward/deque.h         backward/function.h backward/hash_map.h backward/hash_set.h     backward/hashtable.h backward/heap.h backward/iterator.h        backward/list.h backward/map.h backward/multimap.h backward/new.h       backward/multiset.h backward/pair.h backward/iostream.h         backward/rope.h backward/set.h backward/slist.h backward/stack.h        backward/tempbuf.h backward/tree.h backward/vector.h    backward/fstream.h backward/strstream.h backward/strstream      bits/std_bitset.h bits/std_deque.h bits/std_functional.h        bits/std_iterator.h bits/std_list.h     bits/std_map.h bits/std_memory.h bits/std_numeric.h     bits/std_queue.h bits/std_set.h bits/std_stack.h        bits/std_stdexcept.h bits/std_vector.h  bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h    bits/stl_deque.h bits/stl_function.h    bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h      bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h      bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h    bits/stl_relops.h bits/stl_set.h        bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h       bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h      bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h         bits/concept_checks.h bits/container_concepts.h         bits/sequence_concepts.h        ext/ropeimpl.h ext/stl_rope.h   ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h        ext/stl_hashtable.h ext/stl_hash_fun.h  ext/hash_map ext/hash_set ext/rope ext/slist    ext/tree ext/bvector 
+base_headers =         bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h        bits/basic_string.h bits/std_string.h  bits/string.tcc  bits/generic_shadow.h bits/std_utility.h        bits/std_complex.h      bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h      bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h   bits/gslice.h bits/gslice_array.h bits/indirect_array.h         bits/exception_support.h        bits/std_fstream.h bits/std_iomanip.h   bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc         bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h    bits/std_istream.h bits/istream.tcc bits/std_locale.h   bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc     bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h      bits/streambuf.tcc bits/basic_file.h    bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h    bits/stl_pthread_alloc.h bits/pthread_allocimpl.h       bits/stl_threads.h bits/stl_iterator_base.h     bits/std_bitset.h bits/std_deque.h bits/std_functional.h        bits/std_iterator.h bits/std_list.h     bits/std_map.h bits/std_memory.h bits/std_numeric.h     bits/std_queue.h bits/std_set.h bits/std_stack.h        bits/std_stdexcept.h bits/std_vector.h  bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h    bits/stl_deque.h bits/stl_function.h    bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h      bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h      bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h    bits/stl_relops.h bits/stl_set.h        bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h       bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h      bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h         bits/concept_checks.h bits/container_concepts.h         bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
 
 
-c_base_headers =       bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h  bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h         bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h  bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h         bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h  bits/std_cwchar.h bits/std_cwctype.h 
+backward_headers =     backward/complex.h backward/iomanip.h backward/istream.h        backward/ostream.h backward/stream.h backward/streambuf.h       backward/algo.h backward/algobase.h backward/alloc.h    backward/bvector.h backward/defalloc.h backward/deque.h         backward/function.h backward/hash_map.h backward/hash_set.h     backward/hashtable.h backward/heap.h backward/iterator.h        backward/list.h backward/map.h backward/multimap.h backward/new.h       backward/multiset.h backward/pair.h backward/iostream.h         backward/rope.h backward/set.h backward/slist.h backward/stack.h        backward/tempbuf.h backward/tree.h backward/vector.h    backward/fstream.h backward/strstream.h backward/strstream
+
 
+ext_headers =          ext/ropeimpl.h ext/stl_rope.h   ext/stl_bvector.h ext/stl_hashtable.h ext/stl_hash_fun.h        ext/hash_map ext/hash_set ext/rope ext/slist    ext/tree ext/bvector 
 
-c_shadow_headers =     assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h      signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h     wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h   features.h langinfo.h   bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h        bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h         bits/wrap_features.h bits/wrap_langinfo.h       sys/cdefs.h 
 
-@GLIBCPP_USE_CSHADOW_TRUE@c_headers = $(c_base_headers) $(c_shadow_headers)
-@GLIBCPP_USE_CSHADOW_FALSE@c_headers = $(c_base_headers)
+c_base_headers =       bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h  bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h         bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h  bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h         bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h  bits/std_cwchar.h bits/std_cwctype.h 
+
+@GLIBCPP_USE_CSHADOW_TRUE@c_shadow_headers =   assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h      signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h     wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h   features.h langinfo.h   bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h        bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h         bits/wrap_features.h bits/wrap_langinfo.h       sys/cdefs.h 
+@GLIBCPP_USE_CSHADOW_FALSE@c_shadow_headers = 
 
 std_headers =          algorithm bitset complex deque fstream functional       iomanip ios iosfwd iostream istream iterator limits list locale         map memory numeric ostream queue set sstream stack stdexcept    streambuf string utility valarray vector        cassert cctype cerrno cfloat climits clocale ciso646    cmath csetjmp csignal cstdarg cstddef cstdio cstdlib    cstring ctime cwchar cwctype
 
@@ -166,8 +169,6 @@ std_headers =       algorithm bitset complex deque fstream functional       iomanip ios i
 build_headers =        bits/std_limits.h bits/c++config.h bits/c++io.h bits/c++threads.h       bits/atomicity.h bits/os_defines.h      bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h 
 
 
-headers = $(base_headers) $(c_headers)
-
 sources =      limitsMEMBERS.cc        cmath.cc        complex.cc complexf.cc complexl.cc complex_io.cc        stdexcept.cc bitset.cc  c++io.cc ios.cc stdstreams.cc strstream.cc      locale.cc localename.cc codecvt.cc      locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
 
 
@@ -194,6 +195,13 @@ libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
 @GXX_INCLUDE_DIR_FALSE@@VERSION_SPECIFIC_LIBS_TRUE@myincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
 @GXX_INCLUDE_DIR_FALSE@@VERSION_SPECIFIC_LIBS_FALSE@myincludep = $(prefix)/include/g++-@libstdcxx_interface@
 
+# NB: As libio_headers may be empty, need this to make sure bash doesn't
+# choke on an empty for... loop by using libio_headers_install
+# NB: installation of shadow headers is not attempted.
+src_incdir = @GLIBCPP_INCLUDE_DIR@
+bld_incdir = $(top_builddir)/include
+c_incdir = @C_INCLUDE_DIR@
+
 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
 # modified in a per-library or per-sub-library way.  Need to manually
 # set this option because CONFIG_CXXFLAGS has to be after
@@ -400,7 +408,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          if test -f $$file; then d=.; else d=$(srcdir); fi; \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -498,37 +506,61 @@ $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
        rm -f  $(top_builddir)/stamp-cshadow 
        echo "done" > $(top_builddir)/stamp-cshadow 
 
-# We have our own special, needlessly complicated installation routine
+# We have our own special, ridiculously complicated installation routine
 # here, as automake/autoconf is currently brain-damaged when it comes
-# to installing sub-directories of headers.
-install-data-local: myinstallheaders
-
-# NB: As libio_headers may be empty, need this to make sure bash doesn't
-# choke on an empty for... loop by using libio_headers_install
-myinstallheaders: $(headers:%=$(myincludep)/%)
+# to installing sub-directories of headers. In particular, we want to
+# 1) install build headers from (blddir)/include/bits -> (install)/bits
+# 2) install source headers from
+#      (srcdir)/include/bits -> (install)/bits
+#      (srcdir)/include/ext -> (install)/ext
+#      (srcdir)/include/backward -> (install)/backward
+#      ... and the always entertaining "C" compatibility bits
+#      where * represents configure-time directory switching
+#      (srcdir)/include/c* -> (install)/
+#      (srcdir)/include/c*/bits -> (install)/bits
+#      (srcdir)/include/c*/sys -> (install)/sys
+install-data-local: myinstalldirs myinstallheaders
+
+# NB: installation of shadow header directories is not attempted.
+myinstalldirs:
+       if test -z "$(MULTISUBDIR)"; then \
+       $(mkinstalldirs) $(DESTDIR)$(myincludep)/bits; \
+       $(mkinstalldirs) $(DESTDIR)$(myincludep)/backward; \
+       $(mkinstalldirs) $(DESTDIR)$(myincludep)/ext; \
+       fi
+myinstallheaders: 
        if test -z "$(MULTISUBDIR)"; then \
+       for i in $(base_headers); do \
+        echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/"; \
+         $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/; \
+       done; \
+       for i in $(ext_headers); do \
+        echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/"; \
+         $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/; \
+       done; \
+       for i in $(backward_headers); do \
+        echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/backward/"; \
+         $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/backward/; \
+       done; \
+       for i in $(c_base_headers); do \
+        echo "$(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/"; \
+         $(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/; \
+       done; \
        for i in $(std_headers); do \
-         echo "$(INSTALL_DATA) $(GLIBCPP_INCLUDE_DIR)/std/$$i $(myincludep)";\
-               $(INSTALL_DATA) $(GLIBCPP_INCLUDE_DIR)/std/$$i $(myincludep); \
+       echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep)";\
+         $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
        done; \
        for i in $(build_headers); do \
-          echo "$(INSTALL_DATA) $(top_builddir)/include/$$i $(myincludep)/bits/"; \
-            $(INSTALL_DATA) $(top_builddir)/include/$$i $(myincludep)/bits/; \
+        echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(myincludep)/bits/"; \
+         $(INSTALL_DATA) $(bld_incdir)/$$i $(myincludep)/bits/; \
        done; \
        libio_headers_install='$(libio_headers)'; \
        for i in $$libio_headers_install; do \
-          echo "$(INSTALL_DATA) $$i $(myincludep)"; \
-                $(INSTALL_DATA) $$i $(myincludep); \
+        echo "$(INSTALL_DATA) $$i $(myincludep)"; \
+          $(INSTALL_DATA) $$i $(myincludep); \
        done; \
        fi;
 
-$(headers:%=$(myincludep)/%): $(myincludep)/%: %
-       if test -z "$(MULTISUBDIR)"; then \
-       $(mkinstalldirs) $(@D); \
-       echo " $(INSTALL_DATA) $^ $@"; \
-       $(INSTALL_DATA) $^ $@; \
-       fi;
-
 # We have to handle misc-inst.cc and locale-inst.cc in a special way
 # since we cannot instantiate all classes due to missing definitions
 # for things like vptrs, type_info bits, etc. when using
@@ -551,14 +583,6 @@ wstring-inst.lo: string-inst.cc
 # Alexandre put this in here for some libtool-related reason.
 all: libstdc++.INC
 libstdc++.INC: Makefile
-       $(MAKE) \
-         top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
-         top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
-         tmp-$@
-       -rm -f $@
-       mv tmp-$@ $@
-
-tmp-libstdc++.INC: Makefile
        echo $(INCLUDES) > $@
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.