2 # Generate the libstdc++ onlinedocs for a GCC release
3 # i.e. http://gcc.gnu.org/onlinedocs/gcc-x.y.z/libstdc++*
8 if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
12 echo "$0: Wrong number of arguments" >&2
13 elif ! [ -x "${SRCDIR}/configure" ]
15 echo "$0: No executable configure script found in $SRCDIR" >&2
16 elif ! [ -d "${DOCSDIR}" ]
18 echo "$0: Output directory does not exist: $DOCSDIR" >&2
20 echo "Usage: $0 <gcc src dir> <doc output dir>" >&2
26 DOCSDIR
=$
(realpath
${DOCSDIR})
28 # Check we have some of the required tools
29 for i
in doxygen dot dblatex pdflatex makeindex
31 echo -n "Checking for $i... "
36 WORKDIR
=`mktemp -d $PWD/build.XXXXXX`
37 DESTDIR
=`mktemp -d $PWD/dest.XXXXXX`
40 for dir
in ${SRCDIR}/lib
*
43 [ $dir == 'libstdc++-v3' ] || disabled_libs
="$disabled_libs --disable-$dir"
46 ${SRCDIR}/configure
--enable-languages=c
,c
++ --disable-gcc $disabled_libs --docdir=/docs
47 eval `grep '^target=' config.log`
49 # If the following step fails with an error like
50 # ! LaTeX Error: File `xtab.sty' not found.
51 # then you need to install the relevant TeX package e.g. texlive-xtab
52 make -C $target/libstdc
++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR
=$DESTDIR
55 for which in api manual
57 if [ -f libstdc
++-$which-single.xml
] # Only needed for GCC 4.7.x
59 mv libstdc
++-$which-single.xml libstdc
++-$which.xml
61 gzip --best libstdc
++-$which.xml
62 gzip --best libstdc
++-$which.pdf
63 mv libstdc
++-$which{.html
,-html}
64 tar czf libstdc
++-$which-html.
tar.gz libstdc
++-$which-html
65 mv libstdc
++-$which-html libstdc
++/$which
67 mv *.gz libstdc
++ $DOCSDIR/