buildconf revision 8392e425758c8ae014db7b37108032cb646fbd13
2796N/A#!/bin/sh
2796N/A
2796N/A# TODO - Steal the new PHP buildconf and build.mk.
2796N/A# This will do for now, though
2796N/A
2796N/Asupplied_flag=$1
2796N/A
2796N/A# do some version checking for the tools we use
2796N/Aif test "$1" = "--force"; then
2796N/A shift
2796N/A# this is a posix correct "test -nt"
2796N/Aelif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
2796N/A :
2796N/Aelse
2796N/A echo "buildconf: checking installation..."
2796N/A
2796N/A # autoconf will check for the version itself
2796N/A # automake 1.4 or newer
2796N/A am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
2796N/A if test "$am_version" = ""; then
2796N/A echo "buildconf: automake not found."
2796N/A echo " You need automake version 1.4 or newer installed"
2796N/A echo " to build APACHE from CVS."
2796N/A exit 1
2796N/A fi
2796N/A IFS=.; set $am_version; IFS=' '
2796N/A if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
2796N/A echo "buildconf: automake version $am_version found."
2796N/A echo " You need automake version 1.4 or newer installed"
2796N/A echo " to build APACHE from CVS."
2796N/A exit 1
2796N/A else
2796N/A echo "buildconf: automake version $am_version (ok)"
2796N/A fi
2796N/A
2796N/A # libtool 1.3.3 or newer
2796N/A lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
2796N/A if test "$lt_pversion" = ""; then
2796N/A echo "buildconf: libtool not found."
2796N/A echo " You need libtool version 1.3 or newer installed"
2796N/A echo " to build APACHE from CVS."
2796N/A exit 1
2796N/A fi
2796N/A lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
2796N/A IFS=.; set $lt_version; IFS=' '
2796N/A if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3"
2796N/A then
2796N/A echo "buildconf: libtool version $lt_pversion (ok)"
2796N/A else
2796N/A echo "buildconf: libtool version $lt_pversion found."
2796N/A echo " You need libtool version 1.3.3 or newer installed"
2796N/A echo " to build APACHE from CVS."
2796N/A exit 1
2796N/A fi
2796N/A touch buildconf.stamp
2796N/Afi
2796N/A
2796N/Aam_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'`
2796N/Alt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'`
2796N/Aif test "$am_prefix" != "$lt_prefix"; then
2796N/A echo "buildconf: WARNING: automake and libtool are installed in different"
2796N/A echo " directories. This may cause aclocal to fail."
2796N/A echo "buildconf: continuing anyway"
2796N/Afi
2796N/A
2796N/Aif test "$supplied_flag" = "--copy"; then
2796N/A automake_flags=--copy
2796N/Afi
2796N/A
2796N/Amv aclocal.m4 aclocal.m4.old 2>/dev/null
2796N/Aaclocal
2796N/Aif test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then
2796N/A echo "buildconf: ERROR: aclocal failed, probably because automake and"
2796N/A echo " libtool are installed with different prefixes;"
2796N/A echo " automake is installed in $am_prefix, but libtool in $lt_prefix."
2796N/A echo " Please re-install automake and/or libtool with a common prefix"
2796N/A echo " and try again."
2796N/A exit 1
2796N/Afi
2796N/A
2796N/Aif cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
2796N/A echo "buildconf: keeping aclocal.m4"
2796N/A mv aclocal.m4.old aclocal.m4
2796N/Aelse
2796N/A echo "buildconf: created or modified aclocal.m4"
2796N/Afi
2796N/A
2796N/Aautoheader
2796N/A
2796N/A# find all Makefile.ams
2796N/Afiles="Makefile `find ap lib main modules regex os -name Makefile.am | sed 's#\.am##' | tr '\n' ' '`"
2796N/A
2796N/A# suppress stupid automake warning
2796N/Aautomake --add-missing --include-deps $automake_flags $files 2>&1 | grep -v \$APACHE_OUTPUT_FILES >&2
2796N/A
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping configure"
mv configure.old configure
else
echo "buildconf: created or modified configure"
fi
# Now do APR...
echo "buildconf: setting up APR"
cd lib/apr
mv configure configure.old 2>/dev/null
autoheader
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping configure"
mv configure.old configure
else
echo "buildconf: created or modified configure"
fi
cd ../..
# Remove cached config data
rm -f config.cache