diff --git a/gnu/local.mk b/gnu/local.mk
index 0ffbc0755f..ce850c9f7e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1233,6 +1233,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-5-fix-powerpc64le-build.patch	\
   %D%/packages/patches/gcc-5-source-date-epoch-1.patch		\
   %D%/packages/patches/gcc-5-source-date-epoch-2.patch		\
+  %D%/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch	\
   %D%/packages/patches/gcc-6-arm-none-eabi-multilib.patch	\
   %D%/packages/patches/gcc-6-cross-environment-variables.patch	\
   %D%/packages/patches/gcc-6-source-date-epoch-1.patch		\
@@ -1251,6 +1252,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-12-cross-environment-variables.patch \
   %D%/packages/patches/gcc-10-tree-sra-union-handling.patch	\
   %D%/packages/patches/gcc-11-libstdc++-powerpc.patch           \
+  %D%/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch	\
+  %D%/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch	\
   %D%/packages/patches/gcolor3-update-libportal-usage.patch	\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-brect-bounds.patch			\
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 2bb76c0a02..a983fd040a 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -498,6 +498,9 @@ (define-public gcc-5
                                        "gcc-5.0-libvtv-runpath.patch"
                                        "gcc-5-source-date-epoch-1.patch"
                                        "gcc-5-source-date-epoch-2.patch"
+                                       "gcc-5.5.0-libstdc++-xmlcatalog.patch"
+                                       "gcc-13.2.0-libstdc++-docbook-xsl-uri.patch"
+                                       "gcc-13.2.0-libstdc++-info-install-fix.patch"
                                        "gcc-6-libsanitizer-mode-size.patch"
                                        "gcc-fix-texi2pod.patch"
                                        "gcc-5-hurd.patch"
@@ -682,7 +685,9 @@ (define-public gcc-9
             (sha256
              (base32
               "13ygjmd938m0wmy946pxdhz9i1wq7z4w10l6pvidak0xxxj9yxi7"))
-            (patches (search-patches "gcc-9-strmov-store-file-names.patch"
+            (patches (search-patches "gcc-13.2.0-libstdc++-docbook-xsl-uri.patch"
+                                     "gcc-13.2.0-libstdc++-info-install-fix.patch"
+                                     "gcc-9-strmov-store-file-names.patch"
                                      "gcc-9-asan-fix-limits-include.patch"
                                      "gcc-5.0-libvtv-runpath.patch"))
             (modules '((guix build utils)))
@@ -1325,6 +1330,7 @@ (define (make-libstdc++-doc gcc)
                          libxslt
                          docbook-xml
                          docbook-xsl
+                         docbook2x
                          graphviz)) ;for 'dot', invoked by 'doxygen'
     (inputs '())
     (propagated-inputs '())
@@ -1337,28 +1343,18 @@ (define (make-libstdc++-doc gcc)
           (add-before 'configure 'chdir
             (lambda _
               (chdir "libstdc++-v3")))
-          (add-before 'configure 'set-xsl-directory
-            (lambda _
-              (substitute* (find-files "doc"
-                                       "^Makefile\\.in$")
-                (("@XSL_STYLE_DIR@")
-                 (string-append #$(this-package-native-input "docbook-xsl")
-                                "/xml/xsl/"
-                                (strip-store-file-name docbook))))))
           (replace 'build
-            (lambda _
-              ;; XXX: There's also a 'doc-info' target, but it
-              ;; relies on docbook2X, which itself relies on
-              ;; DocBook 4.1.2, which is not really usable
-              ;; (lacks a catalog.xml.)
-              (invoke "make"
-                      "doc-html"
-                      "doc-man")))
+            (lambda* (#:key make-flags #:allow-other-keys)
+              (apply invoke `("make" ,@make-flags
+                              "doc-info"
+                              "doc-html"
+                              "doc-man"))))
           (replace 'install
-            (lambda _
-              (invoke "make"
-                      "doc-install-html"
-                      "doc-install-man"))))))
+            (lambda* (#:key make-flags #:allow-other-keys)
+              (apply invoke `("make" ,@make-flags
+                              "doc-install-info"
+                              "doc-install-html"
+                              "doc-install-man")))))))
     (properties (alist-delete 'hidden? (package-properties gcc)))))
 
 (define-public libstdc++-doc-5
diff --git a/gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch b/gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch
new file mode 100644
index 0000000000..9252b6920a
--- /dev/null
+++ b/gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch
@@ -0,0 +1,50 @@
+# Upstreamed <https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628047.html>
+
+From 2748b8df7a241c5fd6a7c2de6621c5cc56bb6ae1 Mon Sep 17 00:00:00 2001
+Message-Id: <2748b8df7a241c5fd6a7c2de6621c5cc56bb6ae1.1692808412.git.mirai@makinata.eu>
+In-Reply-To: <2db0606adfdb800f3fcc95f2cb6c13ff76246e5f.1692808412.git.mirai@makinata.eu>
+References: <2db0606adfdb800f3fcc95f2cb6c13ff76246e5f.1692808412.git.mirai@makinata.eu>
+From: Bruno Victal <mirai@makinata.eu>
+Date: Mon, 21 Aug 2023 20:58:43 +0100
+Subject: [PATCH 2/2] libstdc++: Update docbook xsl URI.
+
+The URI for namespaced docbook-xsl was updated to reflect the current
+DocBook upstream at <https://cdn.docbook.org/>.
+
+libstdc++-v3/Changelog:
+        * acinclude.m4: Update docbook xsl URI.
+	* configure: Regenerate.
+---
+ libstdc++-v3/acinclude.m4 | 2 +-
+ libstdc++-v3/configure    | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index b25378eaace..152811fd00d 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -604,7 +604,7 @@ dnl  XSL_STYLE_DIR
+ dnl
+ AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [
+ 
+-glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
++glibcxx_docbook_url=http://cdn.docbook.org/release/xsl/current/
+ 
+ AC_MSG_CHECKING([for local stylesheet directory])
+ glibcxx_local_stylesheets=no
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index c4da56c3042..d967b137ea1 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -73923,7 +73923,7 @@ fi
+ 
+ 
+ 
+-glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
++glibcxx_docbook_url=http://cdn.docbook.org/release/xsl/current/
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local stylesheet directory" >&5
+ $as_echo_n "checking for local stylesheet directory... " >&6; }
+-- 
+2.40.1
+
diff --git a/gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch b/gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch
new file mode 100644
index 0000000000..abc4cc877f
--- /dev/null
+++ b/gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch
@@ -0,0 +1,70 @@
+# Upstreamed <https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628047.html>
+
+From 2db0606adfdb800f3fcc95f2cb6c13ff76246e5f Mon Sep 17 00:00:00 2001
+Message-Id: <2db0606adfdb800f3fcc95f2cb6c13ff76246e5f.1692808412.git.mirai@makinata.eu>
+From: Bruno Victal <mirai@makinata.eu>
+Date: Mon, 21 Aug 2023 20:58:22 +0100
+Subject: [PATCH 1/2] libstdc++: Fix 'doc-install-info' rule.
+
+The info manual isn't moved to the expected location after
+generation which causes the install rule for it to fail.
+
+libstdc++-v3/Changelog:
+
+	* doc/Makefile.in: Regenerate.
+	* doc/Makefile.am: Fix 'doc-install-info' rule.
+	Fix typo in commment.
+---
+ libstdc++-v3/doc/Makefile.am | 4 ++--
+ libstdc++-v3/doc/Makefile.in | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
+index 8371441c62e..373522d593d 100644
+--- a/libstdc++-v3/doc/Makefile.am
++++ b/libstdc++-v3/doc/Makefile.am
+@@ -598,7 +598,7 @@ stamp-pdf-docbook: doc-pdf-docbook-pre doc-xml-single-docbook
+ doc-pdf-docbook: stamp-pdf-docbook
+ 
+ # TEXINFO, via docbook2X
+-# NB: Both experimental and tempermental
++# NB: Both experimental and temperamental
+ manual_texi = ${docbook_outdir}/texinfo/libstdc++-manual.texi
+ manual_info = ${docbook_outdir}/texinfo/libstdc++-manual.info
+ DB2TEXI_FLAGS = \
+@@ -615,7 +615,7 @@ stamp-texinfo-docbook: stamp-xml-single-docbook ${docbook_outdir}/texinfo
+ 
+ stamp-info-docbook: stamp-texinfo-docbook
+ 	@echo "Generating info files..."
+-	$(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi}
++	$(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi} -o ${manual_info}
+ 	$(STAMP) stamp-info-docbook
+ 
+ doc-texinfo-docbook: stamp-texinfo-docbook
+diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
+index 21ad8557f7a..c19e3e3044c 100644
+--- a/libstdc++-v3/doc/Makefile.in
++++ b/libstdc++-v3/doc/Makefile.in
+@@ -645,7 +645,7 @@ manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
+ DBLATEX_FLAGS = --verbose --pdf --dump --debug --tmpdir=${docbook_outdir}/latex
+ 
+ # TEXINFO, via docbook2X
+-# NB: Both experimental and tempermental
++# NB: Both experimental and temperamental
+ manual_texi = ${docbook_outdir}/texinfo/libstdc++-manual.texi
+ manual_info = ${docbook_outdir}/texinfo/libstdc++-manual.info
+ DB2TEXI_FLAGS = \
+@@ -1096,7 +1096,7 @@ stamp-texinfo-docbook: stamp-xml-single-docbook ${docbook_outdir}/texinfo
+ 
+ stamp-info-docbook: stamp-texinfo-docbook
+ 	@echo "Generating info files..."
+-	$(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi}
++	$(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi} -o ${manual_info}
+ 	$(STAMP) stamp-info-docbook
+ 
+ doc-texinfo-docbook: stamp-texinfo-docbook
+
+base-commit: f9ff6fa58217294d63f255dd02abfcc8a074f509
+-- 
+2.40.1
+
diff --git a/gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch b/gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch
new file mode 100644
index 0000000000..473e08e240
--- /dev/null
+++ b/gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch
@@ -0,0 +1,402 @@
+From 7f792d2acc0d3eeb95c6f8e0acd72ae304cec9be Mon Sep 17 00:00:00 2001
+Message-Id: <7f792d2acc0d3eeb95c6f8e0acd72ae304cec9be.1692813549.git.mirai@makinata.eu>
+From: Jonathan Wakely <jwakely@redhat.com>
+Date: Wed, 27 Feb 2019 11:25:44 +0000
+Subject: [PATCH] PR libstdc++/89466 avoid slow xsltproc command in configure
+
+Note: Backported from a4395a846a9343960714568e7cf8af4425e63a50.
+
+Certain broken versions of xsltproc ignore the --nonet option and will
+attempt to fetch the docbook stylesheet from the WWW when it isn't in
+the local XML catalog.
+
+This patch checks for the local stylesheet directory first, and doesn't
+use xsltproc if no local stylesheets are found. Checking for the local
+directory is done using xmlcatalog if available, only checking the
+hardcoded list of directories if xmlcatalog fails. The right directory
+for Suse is added to the hardcoded list.
+
+This should avoid doing an xsltproc check that would need to download
+the stylesheet, so no network connection is made even if a broken
+xsltproc is present.
+
+	PR libstdc++/89466
+	* acinclude.m4 (GLIBCXX_CONFIGURE_DOCBOOK): Reorder check for local
+	stylesheet directories before check for xsltproc. Try to use
+	xmlcatalog to find local stylesheet directory before trying hardcoded
+	paths. Add path used by suse to hardcoded paths. Adjust xsltproc
+	check to look for the same stylesheet as doc/Makefile.am uses. Don't
+	use xsltproc if xmlcatalog fails to find a local stylesheet.
+	* configure.ac: Check for xmlcatalog.
+	* Makefile.in: Regenerate.
+	* configure: Likewise.
+	* doc/Makefile.in: Likewise.
+	* include/Makefile.in: Likewise.
+	* libsupc++/Makefile.in: Likewise.
+	* po/Makefile.in: Likewise.
+	* python/Makefile.in: Likewise.
+	* src/Makefile.in: Likewise.
+	* src/c++11/Makefile.in: Likewise.
+	* src/c++98/Makefile.in: Likewise.
+	* src/filesystem/Makefile.in: Likewise.
+	* testsuite/Makefile.in: Likewise.
+
+From-SVN: r269249
+Modified-by: Bruno Victal <mirai@makinata.eu>
+---
+ libstdc++-v3/Makefile.in                |  1 +
+ libstdc++-v3/acinclude.m4               | 47 +++++++------
+ libstdc++-v3/configure                  | 90 +++++++++++++++++++------
+ libstdc++-v3/configure.ac               |  1 +
+ libstdc++-v3/doc/Makefile.in            |  1 +
+ libstdc++-v3/include/Makefile.in        |  1 +
+ libstdc++-v3/libsupc++/Makefile.in      |  1 +
+ libstdc++-v3/po/Makefile.in             |  1 +
+ libstdc++-v3/python/Makefile.in         |  1 +
+ libstdc++-v3/src/Makefile.in            |  1 +
+ libstdc++-v3/src/c++11/Makefile.in      |  1 +
+ libstdc++-v3/src/c++98/Makefile.in      |  1 +
+ libstdc++-v3/src/filesystem/Makefile.in |  1 +
+ libstdc++-v3/testsuite/Makefile.in      |  1 +
+ 14 files changed, 109 insertions(+), 40 deletions(-)
+
+diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
+index a9451e19a96..6aee8281f77 100644
+--- a/libstdc++-v3/Makefile.in
++++ b/libstdc++-v3/Makefile.in
+@@ -230,6 +230,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 18b7b6638ec..fde3fb6da6e 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -674,34 +674,43 @@ dnl  XSL_STYLE_DIR
+ dnl
+ AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [
+ 
+-AC_MSG_CHECKING([for docbook stylesheets for documentation creation])
+-glibcxx_stylesheets=no
+-if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then
+-  glibcxx_stylesheets=yes
+-fi
+-AC_MSG_RESULT($glibcxx_stylesheets)
++glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
+ 
+ AC_MSG_CHECKING([for local stylesheet directory])
+ glibcxx_local_stylesheets=no
+-if test x"$glibcxx_stylesheets" = x"yes"; then
+-  if test -d /usr/share/sgml/docbook/xsl-ns-stylesheets; then
+-    glibcxx_local_stylesheets=yes
+-    XSL_STYLE_DIR=/usr/share/sgml/docbook/xsl-ns-stylesheets
+-  fi
+-  if test -d /usr/share/xml/docbook/stylesheet/docbook-xsl-ns; then
+-    glibcxx_local_stylesheets=yes
+-    XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns
+-  fi
+-  if test -d /usr/share/xml/docbook/stylesheet/nwalsh5/current; then
+-    glibcxx_local_stylesheets=yes
+-    XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/nwalsh5/current
+-  fi
++if test x${XMLCATALOG} = xyes && xsl_style_dir=`xmlcatalog "" $glibcxx_docbook_url 2>/dev/null`
++then
++  XSL_STYLE_DIR=`echo $xsl_style_dir | sed -n 's;^file://;;p'`
++  glibcxx_local_stylesheets=yes
++else
++  for dir in \
++    /usr/share/sgml/docbook/xsl-ns-stylesheets \
++    /usr/share/xml/docbook/stylesheet/docbook-xsl-ns \
++    /usr/share/xml/docbook/stylesheet/nwalsh5/current \
++    /usr/share/xml/docbook/stylesheet/nwalsh/current
++  do
++    if test -d $dir; then
++      glibcxx_local_stylesheets=yes
++      XSL_STYLE_DIR=$dir
++      break
++    fi
++  done
+ fi
+ AC_MSG_RESULT($glibcxx_local_stylesheets)
+ 
+ if test x"$glibcxx_local_stylesheets" = x"yes"; then
+   AC_SUBST(XSL_STYLE_DIR)
+   AC_MSG_NOTICE($XSL_STYLE_DIR)
++
++  AC_MSG_CHECKING([for docbook stylesheets for documentation creation])
++  glibcxx_stylesheets=no
++  if test x${XMLCATALOG} = xno || xmlcatalog "" $glibcxx_docbook_url/xhtml/docbook.xsl >/dev/null 2>&1; then
++    if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude $glibcxx_docbook_url/xhtml/docbook.xsl - 2>/dev/null; then
++      glibcxx_stylesheets=yes
++    fi
++  fi
++  AC_MSG_RESULT($glibcxx_stylesheets)
++
+ else
+   glibcxx_stylesheets=no
+ fi
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index a51dfe6eb13..0c462490b81 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -634,6 +634,7 @@ BUILD_EPUB_TRUE
+ XSL_STYLE_DIR
+ XMLLINT
+ XSLTPROC
++XMLCATALOG
+ DOT
+ DOXYGEN
+ BUILD_INFO_FALSE
+@@ -79678,6 +79679,44 @@ fi
+ 
+ 
+ # Check for docbook
++# Extract the first word of "xmlcatalog", so it can be a program name with args.
++set dummy xmlcatalog; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_XMLCATALOG+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$XMLCATALOG"; then
++  ac_cv_prog_XMLCATALOG="$XMLCATALOG" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_XMLCATALOG="yes"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_prog_XMLCATALOG" && ac_cv_prog_XMLCATALOG="no"
++fi
++fi
++XMLCATALOG=$ac_cv_prog_XMLCATALOG
++if test -n "$XMLCATALOG"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLCATALOG" >&5
++$as_echo "$XMLCATALOG" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
+ # Extract the first word of "xsltproc", so it can be a program name with args.
+ set dummy xsltproc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+@@ -79756,31 +79795,28 @@ fi
+ 
+ 
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for docbook stylesheets for documentation creation" >&5
+-$as_echo_n "checking for docbook stylesheets for documentation creation... " >&6; }
+-glibcxx_stylesheets=no
+-if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then
+-  glibcxx_stylesheets=yes
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_stylesheets" >&5
+-$as_echo "$glibcxx_stylesheets" >&6; }
++glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local stylesheet directory" >&5
+ $as_echo_n "checking for local stylesheet directory... " >&6; }
+ glibcxx_local_stylesheets=no
+-if test x"$glibcxx_stylesheets" = x"yes"; then
+-  if test -d /usr/share/sgml/docbook/xsl-ns-stylesheets; then
+-    glibcxx_local_stylesheets=yes
+-    XSL_STYLE_DIR=/usr/share/sgml/docbook/xsl-ns-stylesheets
+-  fi
+-  if test -d /usr/share/xml/docbook/stylesheet/docbook-xsl-ns; then
+-    glibcxx_local_stylesheets=yes
+-    XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns
+-  fi
+-  if test -d /usr/share/xml/docbook/stylesheet/nwalsh5/current; then
+-    glibcxx_local_stylesheets=yes
+-    XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/nwalsh5/current
+-  fi
++if test x${XMLCATALOG} = xyes && xsl_style_dir=`xmlcatalog "" $glibcxx_docbook_url 2>/dev/null`
++then
++  XSL_STYLE_DIR=`echo $xsl_style_dir | sed -n 's;^file://;;p'`
++  glibcxx_local_stylesheets=yes
++else
++  for dir in \
++    /usr/share/sgml/docbook/xsl-ns-stylesheets \
++    /usr/share/xml/docbook/stylesheet/docbook-xsl-ns \
++    /usr/share/xml/docbook/stylesheet/nwalsh5/current \
++    /usr/share/xml/docbook/stylesheet/nwalsh/current
++  do
++    if test -d $dir; then
++      glibcxx_local_stylesheets=yes
++      XSL_STYLE_DIR=$dir
++      break
++    fi
++  done
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_local_stylesheets" >&5
+ $as_echo "$glibcxx_local_stylesheets" >&6; }
+@@ -79789,6 +79825,18 @@ if test x"$glibcxx_local_stylesheets" = x"yes"; then
+ 
+   { $as_echo "$as_me:${as_lineno-$LINENO}: $XSL_STYLE_DIR" >&5
+ $as_echo "$as_me: $XSL_STYLE_DIR" >&6;}
++
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for docbook stylesheets for documentation creation" >&5
++$as_echo_n "checking for docbook stylesheets for documentation creation... " >&6; }
++  glibcxx_stylesheets=no
++  if test x${XMLCATALOG} = xno || xmlcatalog "" $glibcxx_docbook_url/xhtml/docbook.xsl >/dev/null 2>&1; then
++    if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude $glibcxx_docbook_url/xhtml/docbook.xsl - 2>/dev/null; then
++      glibcxx_stylesheets=yes
++    fi
++  fi
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_stylesheets" >&5
++$as_echo "$glibcxx_stylesheets" >&6; }
++
+ else
+   glibcxx_stylesheets=no
+ fi
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 580fb8b2eb8..92a18b88135 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -422,6 +422,7 @@ AC_CHECK_PROG([DOXYGEN], doxygen, yes, no)
+ AC_CHECK_PROG([DOT], dot, yes, no)
+ 
+ # Check for docbook
++AC_CHECK_PROG([XMLCATALOG], xmlcatalog, yes, no)
+ AC_CHECK_PROG([XSLTPROC], xsltproc, yes, no)
+ AC_CHECK_PROG([XMLLINT], xmllint, yes, no)
+ GLIBCXX_CONFIGURE_DOCBOOK
+diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
+index 4690fad8ac6..522a96c681d 100644
+--- a/libstdc++-v3/doc/Makefile.in
++++ b/libstdc++-v3/doc/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ 
+ # Validate existing XML structure.
+ XMLLINT = xmllint
+diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
+index 591301add5f..c28b1f4504f 100644
+--- a/libstdc++-v3/include/Makefile.in
++++ b/libstdc++-v3/include/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
+index 8f627c6bcd3..5f63c6c0f72 100644
+--- a/libstdc++-v3/libsupc++/Makefile.in
++++ b/libstdc++-v3/libsupc++/Makefile.in
+@@ -273,6 +273,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
+index 5bcf4da7fa5..cabd3f3368c 100644
+--- a/libstdc++-v3/po/Makefile.in
++++ b/libstdc++-v3/po/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
+index 26eb2abfb19..c1f46c02ea1 100644
+--- a/libstdc++-v3/python/Makefile.in
++++ b/libstdc++-v3/python/Makefile.in
+@@ -232,6 +232,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
+index 5221a5d5c29..e0c7bab1e78 100644
+--- a/libstdc++-v3/src/Makefile.in
++++ b/libstdc++-v3/src/Makefile.in
+@@ -265,6 +265,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/Makefile.in
+index 4f92d71d19c..88a2dd5c7a0 100644
+--- a/libstdc++-v3/src/c++11/Makefile.in
++++ b/libstdc++-v3/src/c++11/Makefile.in
+@@ -235,6 +235,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in
+index 8dca17f360e..58ea47a9db6 100644
+--- a/libstdc++-v3/src/c++98/Makefile.in
++++ b/libstdc++-v3/src/c++98/Makefile.in
+@@ -236,6 +236,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/filesystem/Makefile.in b/libstdc++-v3/src/filesystem/Makefile.in
+index f8f0180f9ba..c7c997686cb 100644
+--- a/libstdc++-v3/src/filesystem/Makefile.in
++++ b/libstdc++-v3/src/filesystem/Makefile.in
+@@ -244,6 +244,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
+index 4f67a37966d..d7417fe5a1f 100644
+--- a/libstdc++-v3/testsuite/Makefile.in
++++ b/libstdc++-v3/testsuite/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+-- 
+2.40.1
+
