2 # Generate the libstdc++ onlinedocs for a GCC release
3 # i.e. http://gcc.gnu.org/onlinedocs/gcc-x.y.z/libstdc++*
6 DOCSDIR
=$
(realpath
${2})
8 if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
10 echo "Usage: $0 <gcc src dir> <doc output dir>" >&2
16 # Check we have some of the required tools
17 for i
in doxygen dot dblatex pdflatex makeindex
19 echo -n "Checking for $i... "
24 WORKDIR
=`mktemp -d $PWD/build.XXXXXX`
25 DESTDIR
=`mktemp -d $PWD/dest.XXXXXX`
28 for dir
in ${SRCDIR}/lib
*
31 [ $dir == 'libstdc++-v3' ] || disabled_libs
="$disabled_libs --disable-$dir"
34 ${SRCDIR}/configure
--enable-languages=c
,c
++ --disable-gcc $disabled_libs --docdir=/docs
35 eval `grep '^target=' config.log`
37 # If the following step fails with an error like
38 # ! LaTeX Error: File `xtab.sty' not found.
39 # then you need to install the relevant TeX package e.g. texlive-xtab
40 make -C $target/libstdc
++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR
=$DESTDIR
43 for which in api manual
45 if [ -f libstdc
++-$which-single.xml
] # Only needed for GCC 4.7.x
47 mv libstdc
++-$which-single.xml libstdc
++-$which.xml
49 gzip --best libstdc
++-$which.xml
50 gzip --best libstdc
++-$which.pdf
51 mv libstdc
++-$which{.html
,-html}
52 tar czf libstdc
++-$which-html.
tar.gz libstdc
++-$which-html
53 mv libstdc
++-$which-html libstdc
++/$which
55 mv *.gz libstdc
++ $DOCSDIR/