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