3 # Copyright 1999-2005 The Apache Software Foundation or its licensors, as
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 # buildconf: Build the support scripts needed to compile from a
20 # checked-out version of the source code.
22 # set a couple of defaults for where we should be looking for our support libs.
23 # can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
25 apr_src_dir="srclib/apr ../apr"
26 apu_src_dir="srclib/apr-util ../apr-util"
32 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
52 # Check to be sure that we have the srclib dependencies checked-out
59 for dir in $apr_src_dir
61 if [ -d "${dir}" -a -f "${dir}/build/apr_common.m4" ]; then
62 echo "found apr source: ${dir}"
69 if [ $apr_found -lt 1 ]; then
71 echo "You don't have a copy of the apr source in srclib/apr. "
72 echo "Please get the source using the following instructions,"
73 echo "or specify the location of the source with "
74 echo "--with-apr=[path to apr] :"
76 echo " svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
81 for dir in $apu_src_dir
83 if [ -d "${dir}" -a -f "${dir}/Makefile.in" ]; then
84 echo "found apr-util source: ${dir}"
91 if [ $apu_found -lt 1 ]; then
93 echo "You don't have a copy of the apr-util source in srclib/apr-util. "
94 echo "Please get one the source using the following instructions, "
95 echo "or specify the location of the source with "
96 echo "--with-apr-util=[path to apr-util]:"
98 echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
103 if [ $should_exit -gt 0 ]; then
107 # These are temporary until Roy finishes the other build changes
111 rm -f generated_lists
112 rm -f srclib/pcre/aclocal.m4
114 # Remove autoconf 2.5x cache directories
115 rm -rf autom4te*.cache srclib/pcre/autom4te*.cache
119 ./build/bsd_makefile;;
122 # end temporary stuff
124 apr_configure="$apr_src_dir/configure"
125 aprutil_configure="$apu_src_dir/configure"
126 pcre_configure="srclib/pcre/configure"
127 config_h_in="include/ap_config_auto.h.in"
129 cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
131 if [ -d srclib/apr ]; then
132 echo rebuilding $apr_configure
133 (cd srclib/apr && ./buildconf) || {
134 echo "./buildconf failed for apr"
137 rm -f srclib/apr/apr.spec
140 if [ -d srclib/apr-util ]; then
141 echo rebuilding $aprutil_configure
142 (cd srclib/apr-util && ./buildconf) || {
143 echo "./buildconf failed for apr-util"
146 rm -f srclib/apr-util/apr-util.spec
149 echo copying build files
150 cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
151 $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
152 $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
154 # Remove any libtool files so one can switch between libtool 1.3
155 # and libtool 1.4 by simply rerunning the buildconf script.
156 (cd build ; rm -f ltconfig ltmain.sh)
158 # Optionally copy libtool-1.3.x files
159 if [ -f $apr_src_dir/build/ltconfig ]; then
160 cp $apr_src_dir/build/ltconfig build
162 if [ -f $apr_src_dir/build/ltmain.sh ]; then
163 cp $apr_src_dir/build/ltmain.sh build
166 echo rebuilding $pcre_configure
167 (cd srclib/pcre && ${AUTOCONF:-autoconf})
169 echo rebuilding $config_h_in
171 ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
173 echo rebuilding configure
175 ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
177 # Remove autoconf 2.5x cache directories
178 rm -rf autom4te*.cache srclib/pcre/autom4te*.cache
180 if [ -f `which cut` ]; then
181 echo rebuilding rpm spec file
182 ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
183 REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
184 VERSION=`echo $REVISION | cut -d- -s -f1`
185 RELEASE=`echo $REVISION | cut -d- -s -f2`
186 if [ "x$VERSION" = "x" ]; then
190 cat ./build/rpm/httpd.spec.in | \
191 sed -e "s/APACHE_VERSION/$VERSION/" \
192 -e "s/APACHE_RELEASE/$RELEASE/" \
193 -e "s/APACHE_MMN/$VMMN/" \
197 # ensure that the mod_ssl expression parser sources are never regenerated
199 echo fixing timestamps for mod_ssl sources
201 touch ssl_expr_parse.y
203 touch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
205 touch ssl_expr_scan.c