buildconf revision 6c7c4bf3d26c01cce4d26526db94f17eb5a44396
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj#!/bin/sh
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj# TODO - Steal the new PHP buildconf and build.mk.
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj# This will do for now, though
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojsupplied_flag=$1
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj# do some version checking for the tools we use
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojif test "$1" = "--force"; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj shift
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj# this is a posix correct "test -nt"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojelif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj :
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojelse
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: checking installation..."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj # autoconf will check for the version itself
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj # automake 1.4 or newer
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj if test "$am_version" = ""; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: automake not found."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " You need automake version 1.4 or newer installed"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " to build APACHE from CVS."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj exit 1
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj fi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj IFS=.; set $am_version; IFS=' '
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: automake version $am_version found."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " You need automake version 1.4 or newer installed"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " to build APACHE from CVS."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj exit 1
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj else
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: automake version $am_version (ok)"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj fi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj # libtool 1.3.3 or newer
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj if test "$lt_pversion" = ""; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: libtool not found."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " You need libtool version 1.3 or newer installed"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " to build APACHE from CVS."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj exit 1
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj fi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj IFS=.; set $lt_version; IFS=' '
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: libtool version $lt_pversion (ok)"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj else
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: libtool version $lt_pversion found."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " You need libtool version 1.3.3 or newer installed"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " to build APACHE from CVS."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj exit 1
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj fi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj touch buildconf.stamp
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojam_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'`
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojlt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'`
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojif test "$am_prefix" != "$lt_prefix"; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: WARNING: automake and libtool are installed in different"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " directories. This may cause aclocal to fail."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: continuing anyway"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojif test "$supplied_flag" = "--copy"; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj automake_flags=--copy
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj./helpers/build-acconfig-header
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojmv aclocal.m4 aclocal.m4.old 2>/dev/null
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojaclocal
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojif test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: ERROR: aclocal failed, probably because automake and"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " libtool are installed with different prefixes;"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " automake is installed in $am_prefix, but libtool in $lt_prefix."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " Please re-install automake and/or libtool with a common prefix"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo " and try again."
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj exit 1
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojif cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: keeping aclocal.m4"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj mv aclocal.m4.old aclocal.m4
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojelse
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: created or modified aclocal.m4"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojautoheader
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj# find all Makefile.ams
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfiles="Makefile `find ap lib main modules regex os -name Makefile.am | sed 's#\.am##' | tr '\n' ' '`"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj# suppress stupid automake warning
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojautomake --add-missing --include-deps $automake_flags $files 2>&1 | grep -v \$APACHE_OUTPUT_FILES >&2
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojmv configure configure.old 2>/dev/null
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojautoconf
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojif cmp configure.old configure > /dev/null 2>&1; then
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: keeping configure"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj mv configure.old configure
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojelse
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj echo "buildconf: created or modified configure"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojfi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben# Now do APR...
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benecho "buildconf: setting up APR"
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396bencd lib/apr
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benmv configure configure.old 2>/dev/null
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benautoconf
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benif cmp configure.old configure > /dev/null 2>&1; then
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben echo "buildconf: keeping configure"
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben mv configure.old configure
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benelse
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben echo "buildconf: created or modified configure"
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benfi
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396bencd ../..
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben# Now run the configs...
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benrm config.cache
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben./configure
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben
6c7c4bf3d26c01cce4d26526db94f17eb5a44396bencd lib/apr
6c7c4bf3d26c01cce4d26526db94f17eb5a44396benrm config.cache
6c7c4bf3d26c01cce4d26526db94f17eb5a44396ben./configure