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