annotate maintainer-scripts/generate_libstdcxx_web_docs @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
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}
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
6 DOCSDIR=${2}
111
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
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
10 if ! [ $# -eq 2 ]
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
11 then
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
12 echo "$0: Wrong number of arguments" >&2
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
13 elif ! [ -x "${SRCDIR}/configure" ]
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
14 then
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
15 echo "$0: No executable configure script found in $SRCDIR" >&2
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
16 elif ! [ -d "${DOCSDIR}" ]
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
17 then
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
18 echo "$0: Output directory does not exist: $DOCSDIR" >&2
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
19 fi
111
kono
parents:
diff changeset
20 echo "Usage: $0 <gcc src dir> <doc output dir>" >&2
kono
parents:
diff changeset
21 exit 1
kono
parents:
diff changeset
22 fi
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 set -e
kono
parents:
diff changeset
25
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
26 DOCSDIR=$(realpath ${DOCSDIR})
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
27
111
kono
parents:
diff changeset
28 # Check we have some of the required tools
kono
parents:
diff changeset
29 for i in doxygen dot dblatex pdflatex makeindex
kono
parents:
diff changeset
30 do
kono
parents:
diff changeset
31 echo -n "Checking for $i... "
kono
parents:
diff changeset
32 which $i
kono
parents:
diff changeset
33 done
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 start=$PWD
kono
parents:
diff changeset
36 WORKDIR=`mktemp -d $PWD/build.XXXXXX`
kono
parents:
diff changeset
37 DESTDIR=`mktemp -d $PWD/dest.XXXXXX`
kono
parents:
diff changeset
38 cd $WORKDIR
kono
parents:
diff changeset
39 disabled_libs=
kono
parents:
diff changeset
40 for dir in ${SRCDIR}/lib*
kono
parents:
diff changeset
41 do
kono
parents:
diff changeset
42 dir="${dir##*/}"
kono
parents:
diff changeset
43 [ $dir == 'libstdc++-v3' ] || disabled_libs="$disabled_libs --disable-$dir"
kono
parents:
diff changeset
44 done
kono
parents:
diff changeset
45 set -x
kono
parents:
diff changeset
46 ${SRCDIR}/configure --enable-languages=c,c++ --disable-gcc $disabled_libs --docdir=/docs
kono
parents:
diff changeset
47 eval `grep '^target=' config.log`
kono
parents:
diff changeset
48 make configure-target
kono
parents:
diff changeset
49 # If the following step fails with an error like
kono
parents:
diff changeset
50 # ! LaTeX Error: File `xtab.sty' not found.
kono
parents:
diff changeset
51 # then you need to install the relevant TeX package e.g. texlive-xtab
kono
parents:
diff changeset
52 make -C $target/libstdc++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR=$DESTDIR
kono
parents:
diff changeset
53 cd $DESTDIR/docs
kono
parents:
diff changeset
54 mkdir libstdc++
kono
parents:
diff changeset
55 for which in api manual
kono
parents:
diff changeset
56 do
kono
parents:
diff changeset
57 if [ -f libstdc++-$which-single.xml ] # Only needed for GCC 4.7.x
kono
parents:
diff changeset
58 then
kono
parents:
diff changeset
59 mv libstdc++-$which-single.xml libstdc++-$which.xml
kono
parents:
diff changeset
60 fi
kono
parents:
diff changeset
61 gzip --best libstdc++-$which.xml
kono
parents:
diff changeset
62 gzip --best libstdc++-$which.pdf
kono
parents:
diff changeset
63 mv libstdc++-$which{.html,-html}
kono
parents:
diff changeset
64 tar czf libstdc++-$which-html.tar.gz libstdc++-$which-html
kono
parents:
diff changeset
65 mv libstdc++-$which-html libstdc++/$which
kono
parents:
diff changeset
66 done
kono
parents:
diff changeset
67 mv *.gz libstdc++ $DOCSDIR/
kono
parents:
diff changeset
68 cd $start
kono
parents:
diff changeset
69 rm -r $WORKDIR
kono
parents:
diff changeset
70 rm -r $DESTDIR
kono
parents:
diff changeset
71