buildconf revision f14fe1f44cb7018927ee0e31eb959cba8dc3700b
d3ed5b56cb6b58f87ffd125bed48f7668f13de1edirkx#!/bin/sh
893328ef6ff86d0ca27774778d84410353789fb0fielding#
6de8046f8f7e07cd83895a528df25d977e502c76nd# Copyright 1999-2004 The Apache Software Foundation
893328ef6ff86d0ca27774778d84410353789fb0fielding#
0202d2114cc6d7042995100519cce45c808c153bnd# Licensed under the Apache License, Version 2.0 (the "License");
0202d2114cc6d7042995100519cce45c808c153bnd# you may not use this file except in compliance with the License.
0202d2114cc6d7042995100519cce45c808c153bnd# You may obtain a copy of the License at
893328ef6ff86d0ca27774778d84410353789fb0fielding#
0202d2114cc6d7042995100519cce45c808c153bnd# http://www.apache.org/licenses/LICENSE-2.0
893328ef6ff86d0ca27774778d84410353789fb0fielding#
0202d2114cc6d7042995100519cce45c808c153bnd# Unless required by applicable law or agreed to in writing, software
0202d2114cc6d7042995100519cce45c808c153bnd# distributed under the License is distributed on an "AS IS" BASIS,
0202d2114cc6d7042995100519cce45c808c153bnd# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0202d2114cc6d7042995100519cce45c808c153bnd# See the License for the specific language governing permissions and
0202d2114cc6d7042995100519cce45c808c153bnd# limitations under the License.
893328ef6ff86d0ca27774778d84410353789fb0fielding#
893328ef6ff86d0ca27774778d84410353789fb0fielding#
893328ef6ff86d0ca27774778d84410353789fb0fielding# buildconf: Build the support scripts needed to compile from a
893328ef6ff86d0ca27774778d84410353789fb0fielding# checked-out version of the source code.
0d50a692ff2ac7bdb42e417737ed86ebf0a41671ben
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz# set a couple of defaults for where we should be looking for our support libs.
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz# can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzapr_src_dir=srclib/apr
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzapu_src_dir=srclib/apr-util
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzwhile test $# -gt 0
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzdo
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz # Normalize
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz case "$1" in
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz *) optarg= ;;
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz esac
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz case "$1" in
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz --with-apr=*)
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz apr_src_dir=$optarg
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz ;;
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz esac
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz case "$1" in
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz --with-apr-util=*)
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz apu_src_dir=$optarg
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz ;;
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz esac
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz shift
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzdone
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
893328ef6ff86d0ca27774778d84410353789fb0fielding#
893328ef6ff86d0ca27774778d84410353789fb0fielding# Check to be sure that we have the srclib dependencies checked-out
893328ef6ff86d0ca27774778d84410353789fb0fielding#
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquernashould_exit=0
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquerna
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzif [ ! -d "$apr_src_dir" -o ! -f "$apr_src_dir/build/apr_common.m4" ]; then
893328ef6ff86d0ca27774778d84410353789fb0fielding echo ""
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "You don't have a copy of the apr source in $apr_src_dir. "
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "Please get the source using the following instructions,"
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "or specify the location of the source with "
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "--with-apr=[path to apr] :"
893328ef6ff86d0ca27774778d84410353789fb0fielding echo ""
f14fe1f44cb7018927ee0e31eb959cba8dc3700bjorton echo " svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
893328ef6ff86d0ca27774778d84410353789fb0fielding echo ""
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquerna should_exit=1
893328ef6ff86d0ca27774778d84410353789fb0fieldingfi
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzif [ ! -d "$apu_src_dir" -o ! -f "$apu_src_dir/Makefile.in" ]; then
893328ef6ff86d0ca27774778d84410353789fb0fielding echo ""
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "You don't have a copy of the apr-util source in $apu_src_dir. "
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "Please get one the source using the following instructions, "
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "or specify the location of the source with "
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "--with-apr-util=[path to apr-util]:"
893328ef6ff86d0ca27774778d84410353789fb0fielding echo ""
f14fe1f44cb7018927ee0e31eb959cba8dc3700bjorton echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
893328ef6ff86d0ca27774778d84410353789fb0fielding echo ""
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquerna should_exit=1
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquernafi
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquerna
0b7037d0efc1cd510ee12e8a35c982c3f2da0353pquernaif [ $should_exit -gt 0 ]; then
893328ef6ff86d0ca27774778d84410353789fb0fielding exit 1
893328ef6ff86d0ca27774778d84410353789fb0fieldingfi
893328ef6ff86d0ca27774778d84410353789fb0fielding
893328ef6ff86d0ca27774778d84410353789fb0fielding# These are temporary until Roy finishes the other build changes
893328ef6ff86d0ca27774778d84410353789fb0fielding#
893328ef6ff86d0ca27774778d84410353789fb0fieldingtouch .deps
893328ef6ff86d0ca27774778d84410353789fb0fieldingrm -f aclocal.m4
623882f55701a4c5a6bded180f60d86a524ac341sascharm -f generated_lists
623882f55701a4c5a6bded180f60d86a524ac341sascha
c066cdcb75ca262e424345b347b86e7ce2285869jerenkrantz# Remove autoconf 2.5x's cache directory
c066cdcb75ca262e424345b347b86e7ce2285869jerenkrantzrm -rf autom4te*.cache
c066cdcb75ca262e424345b347b86e7ce2285869jerenkrantz
c15906bab97b9b71b6dc08c1aa2f5c0b72b5ca4edreidcase "`uname`" in
c15906bab97b9b71b6dc08c1aa2f5c0b72b5ca4edreid*BSD/OS*)
96e6cafca226a8a2a64a7bbdc634b5b2679c9e0csascha ./build/bsd_makefile;;
96e6cafca226a8a2a64a7bbdc634b5b2679c9e0csaschaesac
893328ef6ff86d0ca27774778d84410353789fb0fielding#
893328ef6ff86d0ca27774778d84410353789fb0fielding# end temporary stuff
893328ef6ff86d0ca27774778d84410353789fb0fielding
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzapr_configure="$apr_src_dir/configure"
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzaprutil_configure="$apu_src_dir/configure"
893328ef6ff86d0ca27774778d84410353789fb0fieldingpcre_configure="srclib/pcre/configure"
893328ef6ff86d0ca27774778d84410353789fb0fieldingconfig_h_in="include/ap_config_auto.h.in"
893328ef6ff86d0ca27774778d84410353789fb0fielding
893328ef6ff86d0ca27774778d84410353789fb0fieldingcross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
893328ef6ff86d0ca27774778d84410353789fb0fielding
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzif [ -d srclib/apr ]; then
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo rebuilding $apr_configure
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz (cd srclib/apr && ./buildconf) || {
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "./buildconf failed for apr"
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz exit 1
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz }
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzfi
893328ef6ff86d0ca27774778d84410353789fb0fielding
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzif [ -d srclib/apr-util ]; then
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo rebuilding $aprutil_configure
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz (cd srclib/apr-util && ./buildconf) || {
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz echo "./buildconf failed for apr-util"
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz exit 1
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz }
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzfi
893328ef6ff86d0ca27774778d84410353789fb0fielding
1e5333ef1a0edb888d75c0cdd90b33fa7e89fc31wsanchezecho copying build files
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantzcp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
99d360dcbb5ac2be27694be74cc6124dbadf3315jerenkrantz $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
1e5333ef1a0edb888d75c0cdd90b33fa7e89fc31wsanchez
1d13cbde60ace1b56ca57b9f0f74168bb1288174trawick# Remove any libtool files so one can switch between libtool 1.3
1d13cbde60ace1b56ca57b9f0f74168bb1288174trawick# and libtool 1.4 by simply rerunning the buildconf script.
80b1e2ff2e3515fdab14675684b2640ceb6ce1c7trawick(cd build ; rm -f ltconfig ltmain.sh)
1d13cbde60ace1b56ca57b9f0f74168bb1288174trawick
9045837071eae7a4b55204a21f31ccee17749af3jerenkrantz# Optionally copy libtool-1.3.x files
ab44eb80e084a02a66a58336d6fcfbbe48310439trawickif [ -f $apr_src_dir/build/ltconfig ]; then
ab44eb80e084a02a66a58336d6fcfbbe48310439trawick cp $apr_src_dir/build/ltconfig build
9045837071eae7a4b55204a21f31ccee17749af3jerenkrantzfi
ab44eb80e084a02a66a58336d6fcfbbe48310439trawickif [ -f $apr_src_dir/build/ltmain.sh ]; then
ab44eb80e084a02a66a58336d6fcfbbe48310439trawick cp $apr_src_dir/build/ltmain.sh build
9045837071eae7a4b55204a21f31ccee17749af3jerenkrantzfi
9045837071eae7a4b55204a21f31ccee17749af3jerenkrantz
893328ef6ff86d0ca27774778d84410353789fb0fieldingecho rebuilding $pcre_configure
544c23d79a3a7596a3612224ed3ac9fa8372929djerenkrantz(cd srclib/pcre && ${AUTOCONF:-autoconf})
893328ef6ff86d0ca27774778d84410353789fb0fielding
893328ef6ff86d0ca27774778d84410353789fb0fieldingecho rebuilding $config_h_in
893328ef6ff86d0ca27774778d84410353789fb0fieldingrm -f $config_h_in
544c23d79a3a7596a3612224ed3ac9fa8372929djerenkrantz${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
893328ef6ff86d0ca27774778d84410353789fb0fielding
893328ef6ff86d0ca27774778d84410353789fb0fieldingecho rebuilding configure
893328ef6ff86d0ca27774778d84410353789fb0fieldingrm -f config.cache
544c23d79a3a7596a3612224ed3ac9fa8372929djerenkrantz${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
96e6cafca226a8a2a64a7bbdc634b5b2679c9e0csascha
0464cb46220c1025cbfe1365a6bd352e67d2e766jorton# Remove autoconf 2.5x's cache directory
0464cb46220c1025cbfe1365a6bd352e67d2e766jortonrm -rf autom4te*.cache
0464cb46220c1025cbfe1365a6bd352e67d2e766jorton
4028d805f3ab215e39bae405d35e001a538bc50eminfrinif [ -f `which cut` ]; then
4028d805f3ab215e39bae405d35e001a538bc50eminfrin echo rebuilding rpm spec file
4028d805f3ab215e39bae405d35e001a538bc50eminfrin ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
4028d805f3ab215e39bae405d35e001a538bc50eminfrin REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
4028d805f3ab215e39bae405d35e001a538bc50eminfrin VERSION=`echo $REVISION | cut -d- -s -f1`
4028d805f3ab215e39bae405d35e001a538bc50eminfrin RELEASE=`echo $REVISION | cut -d- -s -f2`
4028d805f3ab215e39bae405d35e001a538bc50eminfrin if [ "x$VERSION" = "x" ]; then
4028d805f3ab215e39bae405d35e001a538bc50eminfrin VERSION=$REVISION
4028d805f3ab215e39bae405d35e001a538bc50eminfrin RELEASE=1
4028d805f3ab215e39bae405d35e001a538bc50eminfrin fi
4028d805f3ab215e39bae405d35e001a538bc50eminfrin cat ./build/rpm/httpd.spec.in | \
4028d805f3ab215e39bae405d35e001a538bc50eminfrin sed -e "s/APACHE_VERSION/$VERSION/" \
4028d805f3ab215e39bae405d35e001a538bc50eminfrin -e "s/APACHE_RELEASE/$RELEASE/" \
4028d805f3ab215e39bae405d35e001a538bc50eminfrin -e "s/APACHE_MMN/$VMMN/" \
4028d805f3ab215e39bae405d35e001a538bc50eminfrin > httpd.spec )
4028d805f3ab215e39bae405d35e001a538bc50eminfrinfi
4028d805f3ab215e39bae405d35e001a538bc50eminfrin
f0528865c2e6c22ecc51eeecc496251489029bddjorton# ensure that the mod_ssl expression parser sources are never regenerated
f0528865c2e6c22ecc51eeecc496251489029bddjorton# when running make
f0528865c2e6c22ecc51eeecc496251489029bddjortonecho fixing timestamps for mod_ssl sources
f0528865c2e6c22ecc51eeecc496251489029bddjortoncd modules/ssl
f0528865c2e6c22ecc51eeecc496251489029bddjortontouch ssl_expr_parse.y
f0528865c2e6c22ecc51eeecc496251489029bddjortonsleep 1
f0528865c2e6c22ecc51eeecc496251489029bddjortontouch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
f0528865c2e6c22ecc51eeecc496251489029bddjortonsleep 1
f0528865c2e6c22ecc51eeecc496251489029bddjortontouch ssl_expr_scan.c
f0528865c2e6c22ecc51eeecc496251489029bddjortoncd ../..
f0528865c2e6c22ecc51eeecc496251489029bddjorton
893328ef6ff86d0ca27774778d84410353789fb0fieldingexit 0