Add FOP support to setup script

[SVN r26672]
This commit is contained in:
Douglas Gregor 2005-01-11 03:34:15 +00:00
parent f792022871
commit 263318c898

View File

@ -3,6 +3,8 @@
# User configuration
DOCBOOK_XSL_VERSION=1.67.2
DOCBOOK_DTD_VERSION=4.2
FOP_VERSION=0.20.5
FOP_MIRROR=http://www.ibiblio.org/pub/mirrors/apache/xml/fop/
SOURCEFORGE_MIRROR=http://dl.sourceforge.net
HTTP_GET_CMD="curl -O"
@ -42,7 +44,8 @@ if test ! -d docbook-dtd-$DOCBOOK_DTD_VERSION; then
echo "done."
fi
# Find xsltproc and doxygen
# Find xsltproc, doxygen, and java
OLD_IFS=$IFS
IFS=:
for dir in $PATH; do
if test -f $dir/xsltproc && test -x $dir/xsltproc; then
@ -51,28 +54,66 @@ for dir in $PATH; do
if test -f $dir/doxygen && test -x $dir/doxygen; then
DOXYGEN="$dir/doxygen"
fi
if test -f $dir/java && test -x $dir/java; then
JAVA="$dir/java"
JAVA_HOME=`dirname $dir`
fi
done
IFS=$OLD_IFS
# Make sure we have xsltproc
if test ! -f "$XSLTPROC" && test ! -x "$XSLTPROC"; then
echo "Searching for xsltproc... NOT FOUND.";
echo "ERROR: Unable to find xsltproc executable."
echo "If you have already installed xsltproc, please set the environment"
echo "variable XSLTPROC to the xsltproc executable. If you do not have"
echo "xsltproc, you may download it from http://xmlsoft.org/XSLT/."
exit 0;
else
echo "Searching for xsltproc... $XSLTPROC.";
fi
# Just notify the user if we haven't found doxygen.
if test ! -f "$DOXYGEN" && test ! -x "$DOXYGEN"; then
echo "Searching for Doxygen... not found.";
echo "Warning: unable to find Doxygen executable. You will not be able to"
echo " use Doxygen to generate BoostBook documentation. If you have Doxygen,"
echo " please set the DOXYGEN environment variable to the path of the doxygen"
echo " executable."
HAVE_DOXYGEN="no"
else
echo "Searching for Doxygen... $DOXYGEN.";
HAVE_DOXYGEN="yes"
fi
# Just notify the user if we haven't found Java. Otherwise, go get FOP.
if test ! -f "$JAVA" && test ! -x "$JAVA"; then
echo "Searching for Java... not found.";
echo "Warning: unable to find Java executable. You will not be able to"
echo " generate PDF documentation. If you have Java, please set the JAVA"
echo " environment variable to the path of the java executable."
HAVE_FOP="no"
else
echo "Searching for Java... $JAVA.";
FOP_TARBALL="fop-$FOP_VERSION-bin.tar.gz"
FOP_URL="$FOP_MIRROR/$FOP_TARBALL"
FOP_DIR="$PWD/fop-$FOP_VERSION"
FOP="$FOP_DIR/fop.sh"
if test -f $FOP_TARBALL; then
echo "Using existing FOP distribution (version $FOP_VERSION)."
else
echo "Downloading FOP distribution version $FOP_VERSION..."
$HTTP_GET_CMD $FOP_URL
fi
if test ! -d $FOP_DIR; then
echo -n "Expanding FOP distribution into $FOP_DIR... ";
gunzip -cd $FOP_TARBALL | tar xf -
echo "done.";
fi
HAVE_FOP="yes"
fi
# Find the input jamfile to configure
JAM_CONFIG_OUT="$HOME/user-config.jam"
if test -r "$HOME/user-config.jam"; then
@ -107,6 +148,7 @@ using_boostbook==1 { eaten=1 }
/^\s*using xsltproc.*$/ { eaten=1 }
/^\s*using doxygen.*$/ { eaten=1 }
/^\s*using fop.*$/ { eaten=1 }
/^.*$/ { if (eaten == 0) print; eaten=0 }
@ -119,6 +161,7 @@ END {
}
print "using xsltproc : $XSLTPROC ;"
if ("$HAVE_DOXYGEN" == "yes") print "using doxygen : $DOXYGEN ;";
if ("$HAVE_FOP" == "yes") print "using fop : $FOP : : $JAVA ;";
}
EOF