]> granicus.if.org Git - apache/blob - buildconf
6baa0fd13bc7759cf521cc9439eda816d499eebe
[apache] / buildconf
1 #!/bin/sh
2
3 # TODO - Steal the new PHP buildconf and build.mk.
4 # This will do for now, though
5
6 supplied_flag=$1
7
8 # do some version checking for the tools we use
9 if test "$1" = "--force"; then
10     shift
11 # this is a posix correct "test -nt"
12 elif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
13     :
14 else
15     echo "buildconf: checking installation..."
16
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."
24         exit 1
25     fi
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."
31         exit 1
32     else
33         echo "buildconf: automake version $am_version (ok)"
34     fi
35
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."
42         exit 1
43     fi
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"
47     then
48         echo "buildconf: libtool version $lt_pversion (ok)"
49     else
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."
53         exit 1
54     fi
55     touch buildconf.stamp
56 fi
57
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"
64 fi
65
66 if test "$supplied_flag" = "--copy"; then
67     automake_flags=--copy
68 fi
69
70 ./helpers/build-acconfig-header
71
72 mv aclocal.m4 aclocal.m4.old 2>/dev/null
73 aclocal
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."
80     exit 1
81 fi
82
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
86 else
87     echo "buildconf: created or modified aclocal.m4"
88 fi
89
90 autoheader
91
92 # find all Makefile.ams
93 files="Makefile `find ap lib main modules regex os -name Makefile.am | sed 's#\.am##' | tr '\n' ' '`"
94
95 # suppress stupid automake warning
96 automake --add-missing --include-deps $automake_flags $files 2>&1 | grep -v \$APACHE_OUTPUT_FILES >&2
97
98
99 mv configure configure.old 2>/dev/null
100 autoconf
101 if cmp configure.old configure > /dev/null 2>&1; then
102     echo "buildconf: keeping configure"
103     mv configure.old configure
104 else
105     echo "buildconf: created or modified configure"
106 fi
107
108 # Now do APR...
109
110 echo "buildconf: setting up APR"
111
112 cd lib/apr
113
114 mv configure configure.old 2>/dev/null
115 autoheader
116 autoconf
117 if cmp configure.old configure > /dev/null 2>&1; then
118     echo "buildconf: keeping configure"
119     mv configure.old configure
120 else
121     echo "buildconf: created or modified configure"
122 fi
123
124 cd ../..
125
126 # Now run the configs...
127
128 rm -f config.cache
129 ./configure
130