generate_libstdcxx_web_docs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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++*
  4. SRCDIR=${1}
  5. DOCSDIR=${2}
  6. if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
  7. then
  8. echo "Usage: $0 <gcc src dir> <doc output dir>" >&2
  9. exit 1
  10. fi
  11. set -e
  12. # Check we have some of the required tools
  13. for i in doxygen dot dblatex pdflatex makeindex
  14. do
  15. echo -n "Checking for $i... "
  16. which $i
  17. done
  18. start=$PWD
  19. WORKDIR=`mktemp -d $PWD/build.XXXXXX`
  20. DESTDIR=`mktemp -d $PWD/dest.XXXXXX`
  21. cd $WORKDIR
  22. disabled_libs=
  23. for dir in ${SRCDIR}/lib*
  24. do
  25. dir="${dir##*/}"
  26. [ $dir == 'libstdc++-v3' ] || disabled_libs="$disabled_libs --disable-$dir"
  27. done
  28. set -x
  29. ${SRCDIR}/configure --enable-languages=c,c++ --disable-gcc $disabled_libs --docdir=/docs
  30. eval `grep '^target=' config.log`
  31. make configure-target
  32. make -C $target/libstdc++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR=$DESTDIR
  33. cd $DESTDIR/docs
  34. mkdir libstdc++
  35. for which in api manual
  36. do
  37. if [ -f libstdc++-$which-single.xml ] # Only needed for GCC 4.7.x
  38. then
  39. mv libstdc++-$which-single.xml libstdc++-$which.xml
  40. fi
  41. gzip --best libstdc++-$which.xml
  42. gzip --best libstdc++-$which.pdf
  43. mv libstdc++-$which{.html,-html}
  44. tar czf libstdc++-$which-html.tar.gz libstdc++-$which-html
  45. mv libstdc++-$which-html libstdc++/$which
  46. done
  47. mv *.gz libstdc++ $DOCSDIR/
  48. cd $start
  49. rm -r $WORKDIR
  50. rm -r $DESTDIR