buildconf revision 753fdde6734149ee551065c7c3cd74838dc27cc3
749N/A#!/bin/sh
749N/A#
749N/A# Copyright 1999-2004 The Apache Software Foundation
749N/A#
749N/A# Licensed under the Apache License, Version 2.0 (the "License");
749N/A# you may not use this file except in compliance with the License.
749N/A# You may obtain a copy of the License at
749N/A#
749N/A# http://www.apache.org/licenses/LICENSE-2.0
749N/A#
749N/A# Unless required by applicable law or agreed to in writing, software
749N/A# distributed under the License is distributed on an "AS IS" BASIS,
749N/A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749N/A# See the License for the specific language governing permissions and
749N/A# limitations under the License.
749N/A#
749N/A#
749N/A# buildconf: Build the support scripts needed to compile from a
749N/A# checked-out version of the source code.
749N/A
749N/A# set a couple of defaults for where we should be looking for our support libs.
749N/A# can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
749N/A
749N/Aapr_src_dir=srclib/apr
749N/Aapu_src_dir=srclib/apr-util
749N/A
749N/Awhile test $# -gt 0
749N/Ado
749N/A # Normalize
749N/A case "$1" in
749N/A -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
749N/A *) optarg= ;;
749N/A esac
749N/A
749N/A case "$1" in
749N/A --with-apr=*)
749N/A apr_src_dir=$optarg
749N/A ;;
749N/A esac
749N/A
749N/A case "$1" in
749N/A --with-apr-util=*)
749N/A apu_src_dir=$optarg
749N/A ;;
749N/A esac
749N/A
749N/A shift
749N/Adone
749N/A
749N/A#
749N/A# Check to be sure that we have the srclib dependencies checked-out
749N/A#
749N/A
749N/Ashould_exit=0
749N/A
749N/Aif [ ! -d "$apr_src_dir" -o ! -f "$apr_src_dir/build/apr_common.m4" ]; then
749N/A echo ""
749N/A echo "You don't have a copy of the apr source in $apr_src_dir. "
749N/A echo "Please get the source using the following instructions,"
749N/A echo "or specify the location of the source with "
749N/A echo "--with-apr=[path to apr] :"
749N/A echo ""
749N/A echo " svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
749N/A echo ""
749N/A should_exit=1
749N/Afi
749N/Aif [ ! -d "$apu_src_dir" -o ! -f "$apu_src_dir/Makefile.in" ]; then
749N/A echo ""
749N/A echo "You don't have a copy of the apr-util source in $apu_src_dir. "
749N/A echo "Please get one the source using the following instructions, "
749N/A echo "or specify the location of the source with "
749N/A echo "--with-apr-util=[path to apr-util]:"
749N/A echo ""
749N/A echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
749N/A echo ""
749N/A should_exit=1
749N/Afi
749N/A
749N/Aif [ $should_exit -gt 0 ]; then
749N/A exit 1
749N/Afi
749N/A
749N/A# These are temporary until Roy finishes the other build changes
749N/A#
749N/Atouch .deps
749N/Arm -f aclocal.m4
749N/Arm -f generated_lists
749N/Arm -f srclib/pcre/aclocal.m4
749N/A
749N/A# Remove autoconf 2.5x cache directories
749N/Arm -rf autom4te*.cache srclib/pcre/autom4te*.cache
749N/A
749N/Acase "`uname`" in
749N/A*BSD/OS*)
749N/A ./build/bsd_makefile;;
749N/Aesac
749N/A#
749N/A# end temporary stuff
749N/A
749N/Aapr_configure="$apr_src_dir/configure"
749N/Aaprutil_configure="$apu_src_dir/configure"
749N/Apcre_configure="srclib/pcre/configure"
749N/Aconfig_h_in="include/ap_config_auto.h.in"
749N/A
749N/Across_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
749N/A
749N/Aif [ -d srclib/apr ]; then
749N/A echo rebuilding $apr_configure
749N/A (cd srclib/apr && ./buildconf) || {
749N/A echo "./buildconf failed for apr"
749N/A exit 1
749N/A }
749N/Afi
749N/A
749N/Aif [ -d srclib/apr-util ]; then
749N/A echo rebuilding $aprutil_configure
749N/A (cd srclib/apr-util && ./buildconf) || {
749N/A echo "./buildconf failed for apr-util"
749N/A exit 1
749N/A }
749N/Afi
749N/A
749N/Aecho copying build files
749N/Acp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
749N/A $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
749N/A $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
749N/A
749N/A# Remove any libtool files so one can switch between libtool 1.3
749N/A# and libtool 1.4 by simply rerunning the buildconf script.
749N/A(cd build ; rm -f ltconfig ltmain.sh)
749N/A
749N/A# Optionally copy libtool-1.3.x files
749N/Aif [ -f $apr_src_dir/build/ltconfig ]; then
749N/A cp $apr_src_dir/build/ltconfig build
749N/Afi
749N/Aif [ -f $apr_src_dir/build/ltmain.sh ]; then
749N/A cp $apr_src_dir/build/ltmain.sh build
749N/Afi
749N/A
749N/Aecho rebuilding $pcre_configure
749N/A(cd srclib/pcre && ${AUTOCONF:-autoconf})
749N/A
749N/Aecho rebuilding $config_h_in
749N/Arm -f $config_h_in
749N/A${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
749N/A
749N/Aecho rebuilding configure
749N/Arm -f config.cache
749N/A${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
749N/A
749N/A# Remove autoconf 2.5x cache directories
749N/Arm -rf autom4te*.cache srclib/pcre/autom4te*.cache
749N/A
749N/Aif [ -f `which cut` ]; then
749N/A echo rebuilding rpm spec file
749N/A ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
749N/A REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
749N/A VERSION=`echo $REVISION | cut -d- -s -f1`
749N/A RELEASE=`echo $REVISION | cut -d- -s -f2`
749N/A if [ "x$VERSION" = "x" ]; then
749N/A VERSION=$REVISION
749N/A RELEASE=1
749N/A fi
749N/A cat ./build/rpm/httpd.spec.in | \
749N/A sed -e "s/APACHE_VERSION/$VERSION/" \
749N/A -e "s/APACHE_RELEASE/$RELEASE/" \
749N/A -e "s/APACHE_MMN/$VMMN/" \
749N/A > httpd.spec )
749N/Afi
749N/A
749N/A# ensure that the mod_ssl expression parser sources are never regenerated
749N/A# when running make
749N/Aecho fixing timestamps for mod_ssl sources
749N/Acd modules/ssl
touch ssl_expr_parse.y
sleep 1
touch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
sleep 1
touch ssl_expr_scan.c
cd ../..
exit 0