annotate maintainer-scripts/generate_libstdcxx_web_docs @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 #!/bin/bash
kono
parents:
diff changeset
2 # Generate the libstdc++ onlinedocs for a GCC release
kono
parents:
diff changeset
3 # i.e. http://gcc.gnu.org/onlinedocs/gcc-x.y.z/libstdc++*
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 SRCDIR=${1}
kono
parents:
diff changeset
6 DOCSDIR=$(realpath ${2})
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
kono
parents:
diff changeset
9 then
kono
parents:
diff changeset
10 echo "Usage: $0 <gcc src dir> <doc output dir>" >&2
kono
parents:
diff changeset
11 exit 1
kono
parents:
diff changeset
12 fi
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 set -e
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 # Check we have some of the required tools
kono
parents:
diff changeset
17 for i in doxygen dot dblatex pdflatex makeindex
kono
parents:
diff changeset
18 do
kono
parents:
diff changeset
19 echo -n "Checking for $i... "
kono
parents:
diff changeset
20 which $i
kono
parents:
diff changeset
21 done
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 start=$PWD
kono
parents:
diff changeset
24 WORKDIR=`mktemp -d $PWD/build.XXXXXX`
kono
parents:
diff changeset
25 DESTDIR=`mktemp -d $PWD/dest.XXXXXX`
kono
parents:
diff changeset
26 cd $WORKDIR
kono
parents:
diff changeset
27 disabled_libs=
kono
parents:
diff changeset
28 for dir in ${SRCDIR}/lib*
kono
parents:
diff changeset
29 do
kono
parents:
diff changeset
30 dir="${dir##*/}"
kono
parents:
diff changeset
31 [ $dir == 'libstdc++-v3' ] || disabled_libs="$disabled_libs --disable-$dir"
kono
parents:
diff changeset
32 done
kono
parents:
diff changeset
33 set -x
kono
parents:
diff changeset
34 ${SRCDIR}/configure --enable-languages=c,c++ --disable-gcc $disabled_libs --docdir=/docs
kono
parents:
diff changeset
35 eval `grep '^target=' config.log`
kono
parents:
diff changeset
36 make configure-target
kono
parents:
diff changeset
37 # If the following step fails with an error like
kono
parents:
diff changeset
38 # ! LaTeX Error: File `xtab.sty' not found.
kono
parents:
diff changeset
39 # then you need to install the relevant TeX package e.g. texlive-xtab
kono
parents:
diff changeset
40 make -C $target/libstdc++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR=$DESTDIR
kono
parents:
diff changeset
41 cd $DESTDIR/docs
kono
parents:
diff changeset
42 mkdir libstdc++
kono
parents:
diff changeset
43 for which in api manual
kono
parents:
diff changeset
44 do
kono
parents:
diff changeset
45 if [ -f libstdc++-$which-single.xml ] # Only needed for GCC 4.7.x
kono
parents:
diff changeset
46 then
kono
parents:
diff changeset
47 mv libstdc++-$which-single.xml libstdc++-$which.xml
kono
parents:
diff changeset
48 fi
kono
parents:
diff changeset
49 gzip --best libstdc++-$which.xml
kono
parents:
diff changeset
50 gzip --best libstdc++-$which.pdf
kono
parents:
diff changeset
51 mv libstdc++-$which{.html,-html}
kono
parents:
diff changeset
52 tar czf libstdc++-$which-html.tar.gz libstdc++-$which-html
kono
parents:
diff changeset
53 mv libstdc++-$which-html libstdc++/$which
kono
parents:
diff changeset
54 done
kono
parents:
diff changeset
55 mv *.gz libstdc++ $DOCSDIR/
kono
parents:
diff changeset
56 cd $start
kono
parents:
diff changeset
57 rm -r $WORKDIR
kono
parents:
diff changeset
58 rm -r $DESTDIR
kono
parents:
diff changeset
59