Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 233 lines (199 sloc) 6.405 kB
55e52a2 @dirkx Just make 'buildconf' run on BSD (there is a space after the hash-ban…
dirkx authored
1 #!/bin/sh
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
2 #
e17a716 update license header text
Roy T. Fielding authored
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
9 #
24451eb begin relicensing httpd-2.1 to Apache License, Version 2.0
Andre Malo authored
10 # http://www.apache.org/licenses/LICENSE-2.0
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
11 #
24451eb begin relicensing httpd-2.1 to Apache License, Version 2.0
Andre Malo authored
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
17 #
18 #
19 # buildconf: Build the support scripts needed to compile from a
20 # checked-out version of the source code.
2e974cf Tru64 make uses the wrong directory for includes.
Ben Laurie authored
21
c6e6593 prevent an error message if an old autoconf without AC_PROG_CC_C99 is…
Stefan Fritsch authored
22 # version check for AC_PROG_CC_C99
23 ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
24 case "$ac_version" in
25 # versions older than 2.50 are denied by AC_PREREQ
26 2.5*)
27 echo WARNING: You are using an outdated version of autoconf.
28 echo WARNING: This may lead to less than optimal performance of httpd.
29 echo WARNING: You should use autoconf 2.60 or newer.
30 sleep 1
31 ;;
32 esac
33
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
34 # set a couple of defaults for where we should be looking for our support libs.
35 # can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
36
2dd45af @pquerna Test for APR and APR-Util one directory bellow httpd too. I like not…
pquerna authored
37 apr_src_dir="srclib/apr ../apr"
8a20c58 @wrowe Permit --with-apr=/path/to/apr alone, where the default path will
wrowe authored
38 apu_src_dir=""
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
39
40 while test $# -gt 0
41 do
42 # Normalize
43 case "$1" in
44 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
45 *) optarg= ;;
46 esac
47
48 case "$1" in
49 --with-apr=*)
50 apr_src_dir=$optarg
51 ;;
52 esac
53
54 case "$1" in
55 --with-apr-util=*)
56 apu_src_dir=$optarg
57 ;;
58 esac
59
60 shift
61 done
62
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
63 #
64 # Check to be sure that we have the srclib dependencies checked-out
65 #
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
66
ba7bf3e @pquerna Add some magic to buildconf so it will tell you to get both apr and a…
pquerna authored
67 should_exit=0
2dd45af @pquerna Test for APR and APR-Util one directory bellow httpd too. I like not…
pquerna authored
68 apr_found=0
69 apu_found=0
9b0a405 buildconf:
Takashi Sato authored
70 apr_major_version=2
ba7bf3e @pquerna Add some magic to buildconf so it will tell you to get both apr and a…
pquerna authored
71
2dd45af @pquerna Test for APR and APR-Util one directory bellow httpd too. I like not…
pquerna authored
72 for dir in $apr_src_dir
73 do
d32113c @wrowe Solaris build proposal; don't fail on missing .h files within
wrowe authored
74 if [ -f "${dir}/build/apr_common.m4" ]; then
2dd45af @pquerna Test for APR and APR-Util one directory bellow httpd too. I like not…
pquerna authored
75 echo "found apr source: ${dir}"
76 apr_src_dir=$dir
77 apr_found=1
78 break
79 fi
80 done
81
82 if [ $apr_found -lt 1 ]; then
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
83 echo ""
2d719ca @trawick consolidate hints/instructions about using APR (and maybe APR-util) w…
trawick authored
84 echo "APR could not be found automatically."
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
85 echo ""
2d719ca @trawick consolidate hints/instructions about using APR (and maybe APR-util) w…
trawick authored
86 echo "Please refer to the documentation on APR in the httpd INSTALL file."
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
87 echo ""
ba7bf3e @pquerna Add some magic to buildconf so it will tell you to get both apr and a…
pquerna authored
88 should_exit=1
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
89 else
90 apr_major_version=`grep "#define APR_MAJOR_VERSION" \
91 $apr_src_dir/include/apr_version.h | sed 's/[^0-9]//g'`
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
92 fi
2dd45af @pquerna Test for APR and APR-Util one directory bellow httpd too. I like not…
pquerna authored
93
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
94 if [ $apr_major_version -lt 2 ] ; then
95 if test -z "$apu_src_dir"; then
96 apu_src_dir=`echo $apr_src_dir | sed -e 's#/apr#/apr-util#g;'`
97 apu_src_dir="$apu_src_dir `echo $apr_src_dir | sed -e 's#/apr#/aprutil#;g'`"
98 apu_src_dir="$apu_src_dir srclib/apr-util ../apr-util"
2dd45af @pquerna Test for APR and APR-Util one directory bellow httpd too. I like not…
pquerna authored
99 fi
100
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
101 for dir in $apu_src_dir
102 do
103 if [ -f "${dir}/Makefile.in" ]; then
104 echo "found apr-util source: ${dir}"
105 apu_src_dir=$dir
106 apu_found=1
107 break
108 fi
109 done
110
111 if [ $apu_found -lt 1 ]; then
112 echo ""
2d719ca @trawick consolidate hints/instructions about using APR (and maybe APR-util) w…
trawick authored
113 echo "You are using APR 1.x but APR-util 1.x was not found."
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
114 echo ""
2d719ca @trawick consolidate hints/instructions about using APR (and maybe APR-util) w…
trawick authored
115 echo "Please refer to the documentation on APR in the httpd INSTALL file."
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
116 echo ""
117 should_exit=1
118 fi
ba7bf3e @pquerna Add some magic to buildconf so it will tell you to get both apr and a…
pquerna authored
119 fi
120
121 if [ $should_exit -gt 0 ]; then
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
122 exit 1
123 fi
124
125 # These are temporary until Roy finishes the other build changes
126 #
127 touch .deps
128 rm -f aclocal.m4
9e8e169 Always delete generated_lists. This should cure problems with makes
Sascha Schumann authored
129 rm -f generated_lists
130
9a12b7b @notroj * buildconf: Remove the autom4te cache from srclib/pcre too,
notroj authored
131 # Remove autoconf 2.5x cache directories
f582af4 @notroj * buildconf, configure.in: Don't attempt to configure the
notroj authored
132 rm -rf autom4te*.cache
bd667b0 Ensure that we toss the autom4te.cache directory before running autoc…
Justin Erenkrantz authored
133
3718aa8 We don't have config.guess until later in the build cycle, so change the
David Reid authored
134 case "`uname`" in
135 *BSD/OS*)
2d3f6b6 Add Convert-to-BSD-Makefiles-On-The-Fly system
Sascha Schumann authored
136 ./build/bsd_makefile;;
137 esac
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
138 #
139 # end temporary stuff
140
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
141 apr_configure="$apr_src_dir/configure"
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
142 if [ $apr_major_version -lt 2 ] ; then
143 aprutil_configure="$apu_src_dir/configure"
144 fi
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
145 config_h_in="include/ap_config_auto.h.in"
146
147 cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
148
d32113c @wrowe Solaris build proposal; don't fail on missing .h files within
wrowe authored
149 if [ "$apr_src_dir" = "srclib/apr" ]; then
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
150 echo rebuilding $apr_configure
151 (cd srclib/apr && ./buildconf) || {
152 echo "./buildconf failed for apr"
153 exit 1
154 }
e1fec85 @minfrin Fix the RPM spec file so that an RPM build now works. An RPM
minfrin authored
155 rm -f srclib/apr/apr.spec
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
156 fi
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
157
ad09bf4 @notroj * buildconf: Pass through APR source dir to apreq's buildconf.
notroj authored
158 apr_src_dir=`cd $apr_src_dir && pwd`
159
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
160 if [ $apr_major_version -lt 2 ] ; then
161 if [ "$apu_src_dir" = "srclib/apr-util" ]; then
162 echo rebuilding $aprutil_configure
163 (cd srclib/apr-util && ./buildconf --with-apr=$apr_src_dir) || {
164 echo "./buildconf failed for apr-util"
165 exit 1
166 }
167 rm -f srclib/apr-util/apr-util.spec
168 fi
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
169
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
170 apu_src_dir=`cd $apu_src_dir && pwd`
171 fi
d32113c @wrowe Solaris build proposal; don't fail on missing .h files within
wrowe authored
172
09b909e @wsanchez Changes to reduce dependency on in-tree apr and apr-util.
wsanchez authored
173 echo copying build files
70c161f Make buildconf work with out-of-tree apr and apr-util by adding --wit…
Justin Erenkrantz authored
174 cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
175 $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
f4fce01 * With APR 2.x we no longer have APR-UTIL. So don't care about it.
Ruediger Pluem authored
176 $apr_src_dir/build/find_apr.m4 build
177 if [ $apr_major_version -lt 2 ] ; then
178 cp $apu_src_dir/build/find_apu.m4 build
179 fi
09b909e @wsanchez Changes to reduce dependency on in-tree apr and apr-util.
wsanchez authored
180
a831ddf @trawick steal some code from APR intended to allow you to properly switch
trawick authored
181 # Remove any libtool files so one can switch between libtool 1.3
182 # and libtool 1.4 by simply rerunning the buildconf script.
5e9cbf7 @trawick fix oops in prior commit; we don't copy libtool.m4, so no
trawick authored
183 (cd build ; rm -f ltconfig ltmain.sh)
a831ddf @trawick steal some code from APR intended to allow you to properly switch
trawick authored
184
4c5220a PR:
Justin Erenkrantz authored
185 # Optionally copy libtool-1.3.x files
977d76d @trawick even users of libtool 1.3.x want out-of-tree apr builds to work
trawick authored
186 if [ -f $apr_src_dir/build/ltconfig ]; then
187 cp $apr_src_dir/build/ltconfig build
4c5220a PR:
Justin Erenkrantz authored
188 fi
977d76d @trawick even users of libtool 1.3.x want out-of-tree apr builds to work
trawick authored
189 if [ -f $apr_src_dir/build/ltmain.sh ]; then
190 cp $apr_src_dir/build/ltmain.sh build
4c5220a PR:
Justin Erenkrantz authored
191 fi
192
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
193 echo rebuilding $config_h_in
194 rm -f $config_h_in
1e6833e Add support for ${AUTOHEADER} and ${AUTOCONF} in buildconf
Justin Erenkrantz authored
195 ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
196
197 echo rebuilding configure
198 rm -f config.cache
1e6833e Add support for ${AUTOHEADER} and ${AUTOCONF} in buildconf
Justin Erenkrantz authored
199 ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
2d3f6b6 Add Convert-to-BSD-Makefiles-On-The-Fly system
Sascha Schumann authored
200
9a12b7b @notroj * buildconf: Remove the autom4te cache from srclib/pcre too,
notroj authored
201 # Remove autoconf 2.5x cache directories
f582af4 @notroj * buildconf, configure.in: Don't attempt to configure the
notroj authored
202 rm -rf autom4te*.cache
e3c536b @notroj * buildconf: Clean autoconf cache after running autoconf too.
notroj authored
203
bafdb0e @minfrin Add code to buildconf that produces an httpd.spec file from
minfrin authored
204 if [ -f `which cut` ]; then
205 echo rebuilding rpm spec file
206 ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
ffc0537 @minfrin Add support for an "epoch" in the RPM spec file. This epoch is a disc…
minfrin authored
207 EPOCH=`build/get-version.sh epoch include/ap_release.h AP_SERVER`
bafdb0e @minfrin Add code to buildconf that produces an httpd.spec file from
minfrin authored
208 REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
209 VERSION=`echo $REVISION | cut -d- -s -f1`
210 RELEASE=`echo $REVISION | cut -d- -s -f2`
211 if [ "x$VERSION" = "x" ]; then
212 VERSION=$REVISION
213 RELEASE=1
214 fi
215 cat ./build/rpm/httpd.spec.in | \
216 sed -e "s/APACHE_VERSION/$VERSION/" \
217 -e "s/APACHE_RELEASE/$RELEASE/" \
218 -e "s/APACHE_MMN/$VMMN/" \
ffc0537 @minfrin Add support for an "epoch" in the RPM spec file. This epoch is a disc…
minfrin authored
219 -e "s/APACHE_EPOCH/$EPOCH/" \
bafdb0e @minfrin Add code to buildconf that produces an httpd.spec file from
minfrin authored
220 > httpd.spec )
221 fi
222
d7507a5 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod…
Stefan Fritsch authored
223 # ensure that the ap_expr expression parser sources are never regenerated
674e7db @notroj * buildconf: Ensure that make never regenerates the mod_ssl expression
notroj authored
224 # when running make
d7507a5 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod…
Stefan Fritsch authored
225 echo fixing timestamps for ap_expr sources
226 cd server
37e5884 Change file touching order for util_expr to be in
Rainer Jung authored
227 touch util_expr_parse.y util_expr_scan.l
674e7db @notroj * buildconf: Ensure that make never regenerates the mod_ssl expression
notroj authored
228 sleep 1
37e5884 Change file touching order for util_expr to be in
Rainer Jung authored
229 touch util_expr_parse.c util_expr_parse.h util_expr_scan.c
d7507a5 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod…
Stefan Fritsch authored
230 cd ..
674e7db @notroj * buildconf: Ensure that make never regenerates the mod_ssl expression
notroj authored
231
a107e7b Untangled the buildconf script and eliminated the need for build's
Roy T. Fielding authored
232 exit 0
Something went wrong with that request. Please try again.