#! /bin/sh -e

# DP: adjust hrefs to point to the local documentation

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        #cd ${dir}gcc && autoconf
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        #rm ${dir}gcc/configure
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- libstdc++-v3/docs/doxygen/mainpage.html~	2004-02-21 13:49:31.000000000 +0100
+++ libstdc++-v3/docs/doxygen/mainpage.html	2004-02-21 13:59:02.000000000 +0100
@@ -30,8 +30,8 @@
 <p>There are two types of documentation for libstdc++-v3.  One is the
    distribution documentation, which can be read online at
    <a href="http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html">http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html</a>
-   or offline from docs/html/documentation.html in the library source
-   directory.
+   or offline from
+   <a href="/usr/share/doc/gcc-3.4/libstdc++/html/documentation.html">/usr/share/doc/gcc-3.4/libstdc++/html/documentation.html</a>.
 </p>
 
 <p>The other type is the source documentation, of which this is the first page.
@@ -78,7 +78,7 @@
 
 <h2>License, Copyright, and Other Lawyerly Verbosity</h2>
 <p>The libstdc++-v3 documentation is released under
-   <a href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/license.html">
+   <a href="../17_intro/license.html">
    these terms</a>.
 </p>
 <p>Part of the generated documentation involved comments and notes from
