buildconf revision 4cb8bb9049d1643295ebda12c76dad441ddc2228
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#!/bin/sh
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# Licensed to the Apache Software Foundation (ASF) under one or more
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# contributor license agreements. See the NOTICE file distributed with
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# this work for additional information regarding copyright ownership.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# The ASF licenses this file to You under the Apache License, Version 2.0
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# (the "License"); you may not use this file except in compliance with
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# the License. You may obtain a copy of the License at
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# http://www.apache.org/licenses/LICENSE-2.0
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# Unless required by applicable law or agreed to in writing, software
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# distributed under the License is distributed on an "AS IS" BASIS,
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# See the License for the specific language governing permissions and
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# limitations under the License.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# buildconf: Build the support scripts needed to compile from a
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# checked-out version of the source code.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# version check for AC_PROG_CC_C99
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsynccase "$ac_version" in
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# versions older than 2.50 are denied by AC_PREREQ
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync2.5*)
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo WARNING: You are using an outdated version of autoconf.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo WARNING: This may lead to less than optimal performance of httpd.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo WARNING: You should use autoconf 2.60 or newer.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync sleep 1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync ;;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncesac
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# set a couple of defaults for where we should be looking for our support libs.
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapr_src_dir="srclib/apr ../apr"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapu_src_dir=""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncwhile test $# -gt 0
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncdo
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync # Normalize
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync case "$1" in
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync *) optarg= ;;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync esac
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync case "$1" in
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync --with-apr=*)
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apr_src_dir=$optarg
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync ;;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync esac
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync case "$1" in
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync --with-apr-util=*)
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apu_src_dir=$optarg
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync ;;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync esac
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync shift
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncdone
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# Check to be sure that we have the srclib dependencies checked-out
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncshould_exit=0
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapr_found=0
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapu_found=0
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapr_major_version=2
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncfor dir in $apr_src_dir
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncdo
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync if [ -f "${dir}/build/apr_common.m4" ]; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "found apr source: ${dir}"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apr_src_dir=$dir
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apr_found=1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync break
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync fi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncdone
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncif [ $apr_found -lt 1 ]; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo ""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "APR could not be found automatically."
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo ""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "Please refer to the documentation on APR in the httpd INSTALL file."
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo ""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync should_exit=1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncelse
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apr_major_version=`grep "#define APR_MAJOR_VERSION" \
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync $apr_src_dir/include/apr_version.h | sed 's/[^0-9]//g'`
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncfi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncif [ $apr_major_version -lt 2 ] ; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync if test -z "$apu_src_dir"; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apu_src_dir=`echo $apr_src_dir | sed -e 's#/apr#/apr-util#g;'`
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apu_src_dir="$apu_src_dir `echo $apr_src_dir | sed -e 's#/apr#/aprutil#;g'`"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apu_src_dir="$apu_src_dir srclib/apr-util ../apr-util"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync fi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync for dir in $apu_src_dir
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync do
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync if [ -f "${dir}/Makefile.in" ]; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "found apr-util source: ${dir}"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apu_src_dir=$dir
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync apu_found=1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync break
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync fi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync done
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync if [ $apu_found -lt 1 ]; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo ""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "You are using APR 1.x but APR-util 1.x was not found."
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo ""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "Please refer to the documentation on APR in the httpd INSTALL file."
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo ""
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync should_exit=1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync fi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncfi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncif [ $should_exit -gt 0 ]; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync exit 1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncfi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# These are temporary until Roy finishes the other build changes
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsynctouch .deps
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncrm -f aclocal.m4
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncrm -f generated_lists
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# Remove autoconf 2.5x cache directories
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncrm -rf autom4te*.cache
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsynccase "`uname`" in
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync*BSD/OS*)
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync ./build/bsd_makefile;;
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncesac
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync#
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync# end temporary stuff
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapr_configure="$apr_src_dir/configure"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncif [ $apr_major_version -lt 2 ] ; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync aprutil_configure="$apu_src_dir/configure"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncfi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncconfig_h_in="include/ap_config_auto.h.in"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsynccross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncif [ "$apr_src_dir" = "srclib/apr" ]; then
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo rebuilding $apr_configure
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync (cd srclib/apr && ./buildconf) || {
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync echo "./buildconf failed for apr"
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync exit 1
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync }
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync rm -f srclib/apr/apr.spec
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncfi
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsync
f4db180328f833f9fc9cb07a1a4a0bc948a47afevboxsyncapr_src_dir=`cd $apr_src_dir && pwd`
if [ $apr_major_version -lt 2 ] ; then
if [ "$apu_src_dir" = "srclib/apr-util" ]; then
echo rebuilding $aprutil_configure
(cd srclib/apr-util && ./buildconf --with-apr=$apr_src_dir) || {
echo "./buildconf failed for apr-util"
exit 1
}
rm -f srclib/apr-util/apr-util.spec
fi
apu_src_dir=`cd $apu_src_dir && pwd`
fi
echo copying build files
cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
$apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
$apr_src_dir/build/find_apr.m4 build
if [ $apr_major_version -lt 2 ] ; then
cp $apu_src_dir/build/find_apu.m4 build
fi
# Remove any libtool files so one can switch between libtool 1.3
# and libtool 1.4 by simply rerunning the buildconf script.
(cd build ; rm -f ltconfig ltmain.sh)
# Optionally copy libtool-1.3.x files
if [ -f $apr_src_dir/build/ltconfig ]; then
cp $apr_src_dir/build/ltconfig build
fi
if [ -f $apr_src_dir/build/ltmain.sh ]; then
cp $apr_src_dir/build/ltmain.sh build
fi
echo rebuilding $config_h_in
rm -f $config_h_in
${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
echo rebuilding configure
rm -f config.cache
${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
# Remove autoconf 2.5x cache directories
rm -rf autom4te*.cache
# Remove possible bsd_converted file
rm -rf bsd_converted
if [ -f `which cut` ]; then
echo rebuilding rpm spec file
( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
EPOCH=`build/get-version.sh epoch include/ap_release.h AP_SERVER`
REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
VERSION=`echo $REVISION | cut -d- -s -f1`
RELEASE=`echo $REVISION | cut -d- -s -f2`
if [ "x$VERSION" = "x" ]; then
VERSION=$REVISION
RELEASE=1
fi
cat ./build/rpm/httpd.spec.in | \
sed -e "s/APACHE_VERSION/$VERSION/" \
-e "s/APACHE_RELEASE/$RELEASE/" \
-e "s/APACHE_MMN/$VMMN/" \
-e "s/APACHE_EPOCH/$EPOCH/" \
> httpd.spec )
fi
# ensure that the ap_expr expression parser sources are never regenerated
# when running make
echo fixing timestamps for ap_expr sources
cd server
touch util_expr_parse.y util_expr_scan.l
sleep 1
touch util_expr_parse.c util_expr_parse.h util_expr_scan.c
cd ..
exit 0