#!/bin/sh
if [ "$1" = "--verbose" -o "$1" = "-v" ]; then
verbose="--verbose"
shift
fi
apr_src_dir=../apr
while test $do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$1" in
--with-apr=*)
apr_src_dir=$optarg
;;
esac
shift
done
if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
apr_src_dir=`cd $apr_src_dir; pwd`
echo ""
echo "Looking for apr source in $apr_src_dir"
else
echo ""
echo "Problem finding apr source in $apr_src_dir."
echo "Use:"
echo " --with-apr=[directory]"
exit 1
fi
set -e
rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
build/config.guess build/config.sub build/get-version.sh
cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
$apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
$apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
build/
rm -rf aclocal.m4 autom4te*.cache
echo "Creating include/private/apu_config.h ..."
${AUTOHEADER:-autoheader} $verbose
echo "Creating configure ..."
if ${AUTOCONF:-autoconf} $verbose; then
:
else
echo "autoconf failed"
exit 1
fi
echo "Generating 'make' outputs ..."
$apr_src_dir/build/gen-build.py $verbose make
if [ -f xml/expat/buildconf.sh ]; then
echo "Invoking xml/expat/buildconf.sh ..."
(cd xml/expat; ./buildconf.sh $verbose)
fi
rm -rf autom4te*.cache
if [ -f `which cut` ]; then
echo rebuilding rpm spec file
REVISION=`build/get-version.sh all include/apu_version.h APU`
VERSION=`echo $REVISION | cut -d- -s -f1`
RELEASE=`echo $REVISION | cut -d- -s -f2`
if [ "x$VERSION" = "x" ]; then
VERSION=$REVISION
RELEASE=1
fi
sed -e "s/APU_VERSION/$VERSION/" -e "s/APU_RELEASE/$RELEASE/" \
./build/rpm/apr-util.spec.in > apr-util.spec
fi