[patches] 'make install-headers' used the old way does too much work

To: patches@xxxxxxxxxx

Subject: [patches] 'make install-headers' used the old way does too much work

From: Jim Blandy <jimb@xxxxxxxxxxxxxxxx>

Date: Tue, 20 Feb 2007 15:38:00 -0800

It looks like my changes to 'make install-headers' broke old bootstrap
procedures when applied to new source trees.
The problem is in the gnu/stubs.h handling. Modern GLIBC generates
gnu/stubs.h by actually scanning all the object files for sections
named '.gnu.glibc-stub' (search for gawk in the error shown to see it
in action). This means that gnu/stubs.h depends on having the entire
library built.
My patch made install-headers unconditionally depend on gnu/stubs.h,
and then changed the way gnu/stubs.h is created, depending on
install-bootstrap-headers. This makes install-headers (try to)
rebuild the whole library when install-bootstrap-headers isn't set,
whereas previously it would just skip gnu/stubs.h altogether.
The following patch restores the original behavior of install-headers
when install-bootstrap-headers is not set.
2007-02-20 Jim Blandy <jimb@xxxxxxxxxxxxxxxx>
* Makefile (install-headers): Preserve old behavior: depend on
$(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers
is set; otherwise, place gnu/stubs.h on the 'install-others' list.
Index: Makefile
===================================================================
--- Makefile (revision 1523)
+++ Makefile (working copy)
@@ -78,9 +78,18 @@
vpath %.h $(subdir-dirs)
# What to install.
-install-headers: $(inst_includedir)/gnu/stubs.h
install-bin-script =
+# If we're bootstrapping, install a dummy gnu/stubs.h along with the
+# other headers, so 'make install-headers' produces a useable include
+# tree. Otherwise, install gnu/stubs.h later, after the rest of the
+# build is done.
+ifeq ($(install-bootstrap-headers),yes)
+install-headers: $(inst_includedir)/gnu/stubs.h
+else
+install-others = $(inst_includedir)/gnu/stubs.h
+endif
+
ifeq (yes,$(build-shared))
headers += gnu/lib-names.h
endif