patches/gcc/4.2.4/160-libstdc++-pic.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Thu Jul 28 22:09:31 2011 +0200 (2011-07-28)
changeset 2573 424fa2092ace
parent 687 b2b6b1d46aa1
permissions -rw-r--r--
scripts/libc: do not build add-ons by default

Currently, no --enable-add-ons option is passed to libc configure when
"$(do_libc_add_ons_list ,)" is empty, which makes configure automatically search
for present add-ons. In that case, all present add-ons are built, although
no add-on was selected by the user in the config. Moreover, this can make the
configure fail if some non-standard add-ons like eglibc-localedef are present.

This behavior also leads to an inconsistency from a user point of view between
the following cases:
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS="none" in the config,
which makes "$(do_libc_add_ons_list ,)" return "", so all present add-ons
are built.
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS!="none" in the
config, which makes "$(do_libc_add_ons_list ,)" return the add-on supporting
the chosen threading implementation, e.g. "nptl", so only this add-on is
built.

This patch disables the building of all add-ons in that case.

It is still possible to build all present add-ons by adding --enable-add-ons to
LIBC_GLIBC_EXTRA_CONFIG_ARRAY.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
yann@687
     1
diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
yann@687
     2
--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
yann@687
     3
+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
yann@687
     4
@@ -257,6 +257,12 @@
yann@687
     5
 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
yann@687
     6
 
yann@687
     7
 
yann@687
     8
+install-exec-local:
yann@687
     9
+ifeq ($(enable_shared),yes)
yann@687
    10
+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
yann@687
    11
+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
yann@687
    12
+endif
yann@687
    13
+
yann@687
    14
 # Added bits to build debug library.
yann@687
    15
 if GLIBCXX_BUILD_DEBUG
yann@687
    16
 all-local: build_debug
yann@687
    17
diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
yann@687
    18
--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
yann@687
    19
+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
yann@687
    20
@@ -657,7 +657,7 @@
yann@687
    21
 
yann@687
    22
 install-data-am: install-data-local
yann@687
    23
 
yann@687
    24
-install-exec-am: install-toolexeclibLTLIBRARIES
yann@687
    25
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
yann@687
    26
 
yann@687
    27
 install-info: install-info-am
yann@687
    28
 
yann@687
    29
@@ -690,6 +690,7 @@
yann@687
    30
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
yann@687
    31
 	html-am info info-am install install-am install-data \
yann@687
    32
 	install-data-am install-data-local install-exec \
yann@687
    33
+	install-exec-local \
yann@687
    34
 	install-exec-am install-info install-info-am install-man \
yann@687
    35
 	install-strip install-toolexeclibLTLIBRARIES installcheck \
yann@687
    36
 	installcheck-am installdirs maintainer-clean \
yann@687
    37
@@ -799,6 +800,13 @@
yann@687
    38
 install_debug:
yann@687
    39
 	(cd ${debugdir} && $(MAKE) \
yann@687
    40
 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
yann@687
    41
+
yann@687
    42
+install-exec-local:
yann@687
    43
+ifeq ($(enable_shared),yes)
yann@687
    44
+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
yann@687
    45
+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
yann@687
    46
+endif
yann@687
    47
+
yann@687
    48
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
yann@687
    49
 # Otherwise a system limit (for SysV at least) may be exceeded.
yann@687
    50
 .NOEXPORT: