2017-11-08 14:37:53 +01:00
|
|
|
#! /bin/sh
|
2012-09-25 04:24:56 +02:00
|
|
|
#
|
|
|
|
# mkdoc
|
|
|
|
#
|
|
|
|
# Create reference documentation for a POCO release.
|
|
|
|
# This is a wrapper for mkdocumentation that syncs to the
|
|
|
|
# Perforce head revision, reads the current
|
|
|
|
# version from $POCO_BASE/VERSION and requires a release
|
|
|
|
# specification (loaded from $POCO_BASE/release/spec/*.release)
|
|
|
|
# as argument.
|
|
|
|
#
|
|
|
|
# usage: mkdoc [-l <perforce-label>] [<specfile>]
|
|
|
|
#
|
|
|
|
|
2017-11-08 07:46:18 +01:00
|
|
|
if [ "$POCO_BASE" = "" ] ; then
|
|
|
|
echo "Error: POCO_BASE not set."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-11-10 14:19:06 +01:00
|
|
|
osname=`uname -s | tr ' ' '_'`
|
|
|
|
osarch=`uname -m | tr ' ' '_'`
|
|
|
|
|
2017-11-08 15:12:58 +01:00
|
|
|
case `uname` in
|
|
|
|
CYGWIN*) osname="CYGWIN"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
spec=""
|
2021-03-02 12:08:28 +01:00
|
|
|
docConfig=""
|
2017-11-08 07:46:18 +01:00
|
|
|
while [ "$1" != "" ] ;
|
2012-09-25 04:24:56 +02:00
|
|
|
do
|
|
|
|
if [ "$1" = "-C" ] ; then
|
|
|
|
shift
|
2021-03-02 12:08:28 +01:00
|
|
|
docConfig="$docConfig -C $1"
|
2012-09-25 04:24:56 +02:00
|
|
|
shift
|
|
|
|
elif [ "$1" = "-v" ] ; then
|
|
|
|
shift
|
|
|
|
version=$1
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
spec=$1
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2021-03-02 12:08:28 +01:00
|
|
|
if [ -z "$docConfig" ] ; then
|
|
|
|
docConfig="-C $POCO_BASE/PocoDoc/cfg/mkdoc-poco.xml"
|
|
|
|
fi
|
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
if [ "$spec" != "" ] ; then
|
|
|
|
relspec="-f release/spec/${spec}.release"
|
|
|
|
tag="-$spec"
|
|
|
|
reltag="-t $spec"
|
|
|
|
else
|
|
|
|
relspec=""
|
|
|
|
reltag=""
|
|
|
|
tag=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $POCO_BASE
|
|
|
|
|
|
|
|
if [ ! -f VERSION ] ; then
|
|
|
|
echo "Error: No VERSION file found."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$version" = "" ] ; then
|
|
|
|
read version <$POCO_BASE/VERSION
|
|
|
|
fi
|
|
|
|
release=$version$tag
|
|
|
|
|
2015-11-10 14:19:06 +01:00
|
|
|
if [ ! -f libversion ] ; then
|
|
|
|
echo "Error: No libversion file found."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
if [ "$libversion" = "" ] ; then
|
|
|
|
read libversion <$POCO_BASE/libversion
|
|
|
|
fi
|
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
#
|
|
|
|
# Build release
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "Building tools"
|
|
|
|
|
|
|
|
tools=$POCO_BASE/stage/tools
|
|
|
|
rm -rf $tools
|
|
|
|
mkdir -p $tools
|
2024-12-01 11:27:01 +01:00
|
|
|
mkrelease -o $tools $version Data Data/SQLite CppParser PocoDoc
|
2012-09-25 04:24:56 +02:00
|
|
|
|
|
|
|
cd $tools
|
2016-03-06 11:10:25 +01:00
|
|
|
./configure --no-tests --no-samples --no-prefix
|
2017-11-10 13:12:12 +01:00
|
|
|
make -s -j8
|
2013-01-12 00:12:05 +01:00
|
|
|
|
2015-11-10 14:19:06 +01:00
|
|
|
if [ $osname = "CYGWIN" ] ; then
|
2017-11-08 07:46:18 +01:00
|
|
|
find $tools -type f -name "cyg*$libversion.dll" > $TMP/dlls
|
2015-11-10 14:19:06 +01:00
|
|
|
rebase -O -T $TMP/dlls
|
|
|
|
rm $TMP/dlls
|
|
|
|
fi
|
2013-01-12 00:12:05 +01:00
|
|
|
|
2015-11-10 14:19:06 +01:00
|
|
|
cd $POCO_BASE
|
2015-11-10 14:11:08 +01:00
|
|
|
|
2015-11-10 14:19:06 +01:00
|
|
|
if [ $osname = "CYGWIN" ] ; then
|
|
|
|
# Poco dlls must be on PATH for Cygwin
|
|
|
|
export PATH=$tools/lib/$osname/$osarch:$PATH
|
|
|
|
fi
|
|
|
|
|
2013-01-12 00:12:05 +01:00
|
|
|
export PATH=$tools/PocoDoc/bin/$osname/$osarch:$PATH
|
|
|
|
echo PATH=$PATH
|
|
|
|
|
2012-09-25 04:24:56 +02:00
|
|
|
echo "Building documentation $release (using $docConfig)"
|
2021-03-02 12:08:28 +01:00
|
|
|
mkdocumentation $reltag $relspec $docConfig -v $version
|