3 # Copyright 1999-2004 The Apache Software Foundation
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
18 # buildconf: Build the support scripts needed to compile from a
19 # checked-out version of the source code.
21 # set a couple of defaults for where we should be looking for our support libs.
22 # can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
24 apr_src_dir=srclib/apr
25 apu_src_dir=srclib/apr-util
31 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
51 # Check to be sure that we have the srclib dependencies checked-out
56 if [ ! -d "$apr_src_dir" -o ! -f "$apr_src_dir/build/apr_common.m4" ]; then
58 echo "You don't have a copy of the apr source in $apr_src_dir. "
59 echo "Please get the source using the following instructions,"
60 echo "or specify the location of the source with "
61 echo "--with-apr=[path to apr] :"
63 echo " svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
67 if [ ! -d "$apu_src_dir" -o ! -f "$apu_src_dir/Makefile.in" ]; then
69 echo "You don't have a copy of the apr-util source in $apu_src_dir. "
70 echo "Please get one the source using the following instructions, "
71 echo "or specify the location of the source with "
72 echo "--with-apr-util=[path to apr-util]:"
74 echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
79 if [ $should_exit -gt 0 ]; then
83 # These are temporary until Roy finishes the other build changes
88 rm -f srclib/pcre/aclocal.m4
90 # Remove autoconf 2.5x cache directories
91 rm -rf autom4te*.cache srclib/pcre/autom4te*.cache
95 ./build/bsd_makefile;;
100 apr_configure="$apr_src_dir/configure"
101 aprutil_configure="$apu_src_dir/configure"
102 pcre_configure="srclib/pcre/configure"
103 config_h_in="include/ap_config_auto.h.in"
105 cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
107 if [ -d srclib/apr ]; then
108 echo rebuilding $apr_configure
109 (cd srclib/apr && ./buildconf) || {
110 echo "./buildconf failed for apr"
113 rm -f srclib/apr/apr.spec
116 if [ -d srclib/apr-util ]; then
117 echo rebuilding $aprutil_configure
118 (cd srclib/apr-util && ./buildconf) || {
119 echo "./buildconf failed for apr-util"
122 rm -f srclib/apr-util/apr-util.spec
125 echo copying build files
126 cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
127 $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
128 $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
130 # Remove any libtool files so one can switch between libtool 1.3
131 # and libtool 1.4 by simply rerunning the buildconf script.
132 (cd build ; rm -f ltconfig ltmain.sh)
134 # Optionally copy libtool-1.3.x files
135 if [ -f $apr_src_dir/build/ltconfig ]; then
136 cp $apr_src_dir/build/ltconfig build
138 if [ -f $apr_src_dir/build/ltmain.sh ]; then
139 cp $apr_src_dir/build/ltmain.sh build
142 echo rebuilding $pcre_configure
143 (cd srclib/pcre && ${AUTOCONF:-autoconf})
145 echo rebuilding $config_h_in
147 ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
149 echo rebuilding configure
151 ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
153 # Remove autoconf 2.5x cache directories
154 rm -rf autom4te*.cache srclib/pcre/autom4te*.cache
156 if [ -f `which cut` ]; then
157 echo rebuilding rpm spec file
158 ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
159 REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
160 VERSION=`echo $REVISION | cut -d- -s -f1`
161 RELEASE=`echo $REVISION | cut -d- -s -f2`
162 if [ "x$VERSION" = "x" ]; then
166 cat ./build/rpm/httpd.spec.in | \
167 sed -e "s/APACHE_VERSION/$VERSION/" \
168 -e "s/APACHE_RELEASE/$RELEASE/" \
169 -e "s/APACHE_MMN/$VMMN/" \
173 # ensure that the mod_ssl expression parser sources are never regenerated
175 echo fixing timestamps for mod_ssl sources
177 touch ssl_expr_parse.y
179 touch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
181 touch ssl_expr_scan.c