MAINTAINERS: Add myself as arc port maintainer
[official-gcc.git] / maintainer-scripts / generate_libstdcxx_web_docs
blob74886356bc74f7811eb3d65f279d21bdc7e03a45
1 #!/bin/bash
2 # Generate the libstdc++ onlinedocs for a GCC release
3 # i.e. http://gcc.gnu.org/onlinedocs/gcc-x.y.z/libstdc++*
5 SRCDIR=${1}
6 DOCSDIR=${2}
8 if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
9 then
10 if ! [ $# -eq 2 ]
11 then
12 echo "$0: Wrong number of arguments" >&2
13 elif ! [ -x "${SRCDIR}/configure" ]
14 then
15 echo "$0: No executable configure script found in $SRCDIR" >&2
16 elif ! [ -d "${DOCSDIR}" ]
17 then
18 echo "$0: Output directory does not exist: $DOCSDIR" >&2
20 echo "Usage: $0 <gcc src dir> <doc output dir>" >&2
21 exit 1
24 set -e
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... "
32 which $i
33 done
35 start=$PWD
36 WORKDIR=`mktemp -d $PWD/build.XXXXXX`
37 DESTDIR=`mktemp -d $PWD/dest.XXXXXX`
38 cd $WORKDIR
39 disabled_libs=
40 for dir in ${SRCDIR}/lib*
42 dir="${dir##*/}"
43 [ $dir == 'libstdc++-v3' ] || disabled_libs="$disabled_libs --disable-$dir"
44 done
45 set -x
46 ${SRCDIR}/configure --enable-languages=c,c++ --disable-gcc $disabled_libs --docdir=/docs
47 eval `grep '^target=' config.log`
48 make configure-target
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
53 cd $DESTDIR/docs
54 mkdir libstdc++
55 for which in api manual
57 if [ -f libstdc++-$which-single.xml ] # Only needed for GCC 4.7.x
58 then
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
66 done
67 mv *.gz libstdc++ $DOCSDIR/
68 cd $start
69 rm -r $WORKDIR
70 rm -r $DESTDIR