3 # TODO - Steal the new PHP buildconf and build.mk.
4 # This will do for now, though
8 # do some version checking for the tools we use
9 if test "$1" = "--force"; then
11 # this is a posix correct "test -nt"
12 elif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
15 echo "buildconf: checking installation..."
17 # autoconf will check for the version itself
18 # automake 1.4 or newer
19 am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
20 if test "$am_version" = ""; then
21 echo "buildconf: automake not found."
22 echo " You need automake version 1.4 or newer installed"
23 echo " to build APACHE from CVS."
26 IFS=.; set $am_version; IFS=' '
27 if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
28 echo "buildconf: automake version $am_version found."
29 echo " You need automake version 1.4 or newer installed"
30 echo " to build APACHE from CVS."
33 echo "buildconf: automake version $am_version (ok)"
36 # libtool 1.3.3 or newer
37 lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
38 if test "$lt_pversion" = ""; then
39 echo "buildconf: libtool not found."
40 echo " You need libtool version 1.3 or newer installed"
41 echo " to build APACHE from CVS."
44 lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
45 IFS=.; set $lt_version; IFS=' '
46 if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3"
48 echo "buildconf: libtool version $lt_pversion (ok)"
50 echo "buildconf: libtool version $lt_pversion found."
51 echo " You need libtool version 1.3.3 or newer installed"
52 echo " to build APACHE from CVS."
58 am_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'`
59 lt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'`
60 if test "$am_prefix" != "$lt_prefix"; then
61 echo "buildconf: WARNING: automake and libtool are installed in different"
62 echo " directories. This may cause aclocal to fail."
63 echo "buildconf: continuing anyway"
66 if test "$supplied_flag" = "--copy"; then
70 ./helpers/build-acconfig-header
72 mv aclocal.m4 aclocal.m4.old 2>/dev/null
74 if test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then
75 echo "buildconf: ERROR: aclocal failed, probably because automake and"
76 echo " libtool are installed with different prefixes;"
77 echo " automake is installed in $am_prefix, but libtool in $lt_prefix."
78 echo " Please re-install automake and/or libtool with a common prefix"
79 echo " and try again."
83 if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
84 echo "buildconf: keeping aclocal.m4"
85 mv aclocal.m4.old aclocal.m4
87 echo "buildconf: created or modified aclocal.m4"
92 # find all Makefile.ams
93 files="Makefile `find ap lib main modules regex os -name Makefile.am | sed 's#\.am##' | tr '\n' ' '`"
95 # suppress stupid automake warning
96 automake --add-missing --include-deps $automake_flags $files 2>&1 | grep -v \$APACHE_OUTPUT_FILES >&2
99 mv configure configure.old 2>/dev/null
101 if cmp configure.old configure > /dev/null 2>&1; then
102 echo "buildconf: keeping configure"
103 mv configure.old configure
105 echo "buildconf: created or modified configure"