# DP: Build and install libstdc++_pic.a library.

--- a/src/libstdc++-v3/src/Makefile.am
+++ b/src/libstdc++-v3/src/Makefile.am
@@ -315,10 +315,12 @@ if GLIBCXX_BUILD_DEBUG
 STAMP_DEBUG = build-debug
 STAMP_INSTALL_DEBUG = install-debug
 CLEAN_DEBUG = debug
+STAMP_INSTALL_PIC = install-pic
 else
 STAMP_DEBUG =
 STAMP_INSTALL_DEBUG =
 CLEAN_DEBUG =
+STAMP_INSTALL_PIC =
 endif
 
 # Build a debug variant.
@@ -353,6 +355,7 @@ build-debug: stamp-debug
 	  mv Makefile Makefile.tmp; \
 	  sed -e 's,all-local: all-once,all-local:,' \
 	      -e 's,install-data-local: install-data-once,install-data-local:,' \
+	      -e 's,install-exec-local:.*,install-exec-local:,' \
 	      -e '/vpath/!s,src/c,src/debug/c,' \
 	  < Makefile.tmp > Makefile ; \
 	  rm -f Makefile.tmp ; \
@@ -363,3 +366,8 @@ build-debug: stamp-debug
 install-debug: build-debug
 	(cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ;
+
+install-exec-local: $(STAMP_INSTALL_PIC)
+$(STAMP_INSTALL_PIC):
+	$(MKDIR_P) $(DESTDIR)$(toolexeclibdir)
+	$(INSTALL_DATA) .libs/libstdc++convenience.a $(DESTDIR)$(toolexeclibdir)/libstdc++_pic.a
--- a/src/libstdc++-v3/src/Makefile.in
+++ b/src/libstdc++-v3/src/Makefile.in
@@ -620,6 +620,8 @@ CXXLINK = \
 @GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_DEBUG = install-debug
 @GLIBCXX_BUILD_DEBUG_FALSE@CLEAN_DEBUG = 
 @GLIBCXX_BUILD_DEBUG_TRUE@CLEAN_DEBUG = debug
+@GLIBCXX_BUILD_DEBUG_FALSE@STAMP_INSTALL_PIC = 
+@GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_PIC = install-pic
 
 # Build a debug variant.
 # Take care to fix all possibly-relative paths.
@@ -886,7 +888,7 @@ install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
-install-exec-am: install-toolexeclibLTLIBRARIES
+install-exec-am: install-exec-local install-toolexeclibLTLIBRARIES
 
 install-html: install-html-recursive
 
@@ -936,11 +938,11 @@ uninstall-am: uninstall-toolexeclibLTLIB
 	distclean-libtool distclean-tags dvi dvi-am html html-am info \
 	info-am install install-am install-data install-data-am \
 	install-data-local install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip \
-	install-toolexeclibLTLIBRARIES installcheck installcheck-am \
-	installdirs installdirs-am maintainer-clean \
+	install-exec-am install-exec-local install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-toolexeclibLTLIBRARIES installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am \
@@ -1076,6 +1078,7 @@ build-debug: stamp-debug
 	  mv Makefile Makefile.tmp; \
 	  sed -e 's,all-local: all-once,all-local:,' \
 	      -e 's,install-data-local: install-data-once,install-data-local:,' \
+	      -e 's,install-exec-local:.*,install-exec-local:,' \
 	      -e '/vpath/!s,src/c,src/debug/c,' \
 	  < Makefile.tmp > Makefile ; \
 	  rm -f Makefile.tmp ; \
@@ -1087,6 +1090,11 @@ install-debug: build-debug
 	(cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ;
 
+install-exec-local: $(STAMP_INSTALL_PIC)
+$(STAMP_INSTALL_PIC):
+	$(MKDIR_P) $(DESTDIR)$(toolexeclibdir)
+	$(INSTALL_DATA) .libs/libstdc++convenience.a $(DESTDIR)$(toolexeclibdir)/libstdc++_pic.a
+
 # 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:
