#! /bin/sh t=__wt.$$ trap 'rm -f $t /tmp/__doxy; exit 0' 0 1 2 3 13 15 # Skip this when building release packages: docs are built separately test -n "$WT_RELEASE_BUILD" && exit 0 # We require doxygen which may not be installed. type doxygen > /dev/null 2>&1 || { echo 'skipped: doxygen not found' exit 0 } . ../RELEASE_INFO e=0 changelog() { # convert the top-level NEWS file into a change log page in the docs (echo "WiredTiger Change Log" echo "=====================" echo cat ../NEWS) > ../src/docs/changelog.md } wtperf_config() { # The Linux ed command writes line numbers to stderr, redirect both # stdout and stderr to keep things quiet. cc -o /tmp/__doxy ../bench/wtperf/doxy.c && (echo '/START_AUTO_GENERATED_WTPERF_CONFIGURATION/+3,/STOP_AUTO_GENERATED_WTPERF_CONFIGURATION/-1d' echo 'i' echo '' echo '.' echo ".r !/tmp/__doxy" echo 'a' echo '' echo '.' echo 'w' echo 'q') | ed ../src/docs/wtperf.dox 1>/dev/null 2>/dev/null && rm -f /tmp/__doxy } structurechk() { # @page names should match the source file name (cd ../src/docs && grep @page *.dox | sed 's/\([^:]*\)\.dox:.*@page \([^ ]*\) .*/\1 \2/g' | sed 's/-/_/g' | awk '{ if ($1 != $2) { print $1 " != " $2; } }') > $t test -s $t && { echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" echo "@page references don't match source file names" sed -e 's/^/ /' < $t echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" e=1 } # sections are a global name space for doxygen, and must be uniquely # named or you can get the wrong results. For example, if you have # "@section foo ABC" and "@section foo DEF", they will both appear as # "ABC" or "DEF". (cd ../src/docs && sed -n 's/@section \([^ ]*\)/\1/p' *.dox | sort | uniq -d) > $t test -s $t && { echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" echo '@section references that are not uniquely named' sed -e 's/^/ /' < $t echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" e=1 } # we want a simple tree structure for navigation, otherwise # clicking in the navigation tree can jump to a different point in # the tree (cd ../src/docs && sed -n 's/@subpage \([^ ]*\)/\1/p' *.dox | sort | uniq -d) > $t test -s $t && { echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" echo 'multiple @subpage references for the same page' sed -e 's/^/ /' < $t echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" e=1 } } spellchk() { # If aspell has been installed, run a spell check. type aspell > /dev/null 2>&1 || return (cd ../src/docs && cat *.dox | aspell --lang=en --personal=./spell.ok list) | sort -u > $t test -s $t && { echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" echo 'Documentation spelling notes' echo 'Update src/docs/spell.ok to remove warnings.' sed -e 's/^/ /' < $t echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" e=1 } } valid_build() { # Complain if there are pages we don't reference directly. sed -n '/ /dev/null && { echo 'Unreferenced page: see docs/pages.html for the list.' e=1 } classf=`ls ../docs/struct___* 2>/dev/null` for c in $classf; do echo "$c: Need to add class to PREDEFINED in src/docs/Doxyfile" done } build() { # Build from scratch on demand. [ "$1" -eq 0 ] || (cd .. && rm -rf docs && mkdir docs) # Run doxygen to generate warnings for the base HTML documentation. # # We omit Python because warnings are expected there (the code generated # by swig does not have named arguments, but we want to document them # as if they do. (cd ../src/docs && (eval cat Doxyfile $filter ; cat < $t 2>&1 test -s $t && { cat $t e=1 } # Add optional extras EXTRAS="../lang/java/src/com/wiredtiger/db ../lang/python/wiredtiger.py" EXTRA_INPUT="" for f in $EXTRAS ; do [ -e "$f" ] && EXTRA_INPUT="$EXTRA_INPUT ../$f" done # Run again to generate the full doc set with Python and Java. [ "$additional_languages" -eq 1 ] && [ "x$EXTRA_INPUT" != "x" ] && ( cd ../src/docs && (eval cat Doxyfile $filter ; cat <