buildconf revision 1d13cbde60ace1b56ca57b9f0f74168bb1288174
97a9a944b5887e91042b019776c41d5dd74557aferikabele#!/bin/sh
97a9a944b5887e91042b019776c41d5dd74557aferikabele# ====================================================================
97a9a944b5887e91042b019776c41d5dd74557aferikabele# The Apache Software License, Version 1.1
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive#
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive# Copyright (c) 2000-2003 The Apache Software Foundation. All rights
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive# reserved.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# Redistribution and use in source and binary forms, with or without
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# modification, are permitted provided that the following conditions
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# are met:
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# 1. Redistributions of source code must retain the above copyright
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# notice, this list of conditions and the following disclaimer.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# 2. Redistributions in binary form must reproduce the above copyright
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz# notice, this list of conditions and the following disclaimer in
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# the documentation and/or other materials provided with the
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# distribution.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
4b5981e276e93df97c34e4da05ca5cf8bbd937dand# 3. The end-user documentation included with the redistribution,
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# if any, must include the following acknowledgment:
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# "This product includes software developed by the
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd# Apache Software Foundation (http://www.apache.org/)."
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd# Alternately, this acknowledgment may appear in the software itself,
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# if and wherever such third-party acknowledgments normally appear.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd#
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd# 4. The names "Apache" and "Apache Software Foundation" must
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# not be used to endorse or promote products derived from this
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# software without prior written permission. For written
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# permission, please contact apache@apache.org.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# 5. Products derived from this software may not be called "Apache",
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# nor may "Apache" appear in their name, without prior written
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# permission of the Apache Software Foundation.
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# SUCH DAMAGE.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# ====================================================================
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# This software consists of voluntary contributions made by many
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# individuals on behalf of the Apache Software Foundation. For more
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# information on the Apache Software Foundation, please see
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# <http://www.apache.org/>.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# buildconf: Build the support scripts needed to compile from a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# checked-out version of the source code.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# set a couple of defaults for where we should be looking for our support libs.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1csliveapr_src_dir=srclib/apr
06ba4a61654b3763ad65f52283832ebf058fdf1csliveapu_src_dir=srclib/apr-util
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndwhile test $# -gt 0
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nddo
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess # Normalize
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd case "$1" in
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd *) optarg= ;;
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd esac
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess case "$1" in
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess --with-apr=*)
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess apr_src_dir=$optarg
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess ;;
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess esac
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess case "$1" in
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess --with-apr-util=*)
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess apu_src_dir=$optarg
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess ;;
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess esac
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess shift
635e08c1d8332adc365b1c20bbe3577d59ebcd78kessdone
635e08c1d8332adc365b1c20bbe3577d59ebcd78kess
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# Check to be sure that we have the srclib dependencies checked-out
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndif [ ! -d "$apr_src_dir" -o ! -f "$apr_src_dir/build/apr_common.m4" ]; then
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo ""
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo "You don't have a copy of the apr source in $apr_src_dir. "
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo "Please get the source using the following instructions,"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo "or specify the location of the source with "
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo "--with-apr=[path to apr] :"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo ""
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo " cd srclib"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo " (password 'anoncvs')"
c985aca104389df30d6ec0a637ce0ccaac904362nd echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr"
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo ""
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd exit 1
06ba4a61654b3763ad65f52283832ebf058fdf1cslivefi
06ba4a61654b3763ad65f52283832ebf058fdf1csliveif [ ! -d "$apu_src_dir" -o ! -f "$apu_src_dir/Makefile.in" ]; then
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo ""
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo "You don't have a copy of the apr-util source in $apu_src_dir. "
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo "Please get one the source using the following instructions, "
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo "or specify the location of the source with "
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo "--with-apr-util=[path to apr-util]:"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo ""
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo " cd srclib"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo " (password 'anoncvs')"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr-util"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo ""
06ba4a61654b3763ad65f52283832ebf058fdf1cslive exit 1
06ba4a61654b3763ad65f52283832ebf058fdf1cslivefi
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# These are temporary until Roy finishes the other build changes
06ba4a61654b3763ad65f52283832ebf058fdf1cslive#
06ba4a61654b3763ad65f52283832ebf058fdf1cslivetouch .deps
06ba4a61654b3763ad65f52283832ebf058fdf1csliverm -f aclocal.m4
06ba4a61654b3763ad65f52283832ebf058fdf1csliverm -f generated_lists
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
b9b166bce28378f88ecba40c17f788f510b8357and# Remove autoconf 2.5x's cache directory
b9b166bce28378f88ecba40c17f788f510b8357andrm -rf autom4te*.cache
b9b166bce28378f88ecba40c17f788f510b8357and
b9b166bce28378f88ecba40c17f788f510b8357andcase "`uname`" in
b9b166bce28378f88ecba40c17f788f510b8357and*BSD/OS*)
b9b166bce28378f88ecba40c17f788f510b8357and ./build/bsd_makefile;;
b9b166bce28378f88ecba40c17f788f510b8357andesac
b9b166bce28378f88ecba40c17f788f510b8357and#
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd# end temporary stuff
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndapr_configure="$apr_src_dir/configure"
3b3b7fc78d1f5bfc2769903375050048ff41ff26ndaprutil_configure="$apu_src_dir/configure"
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7ndpcre_configure="srclib/pcre/configure"
a78048ccbdb6256da15e6b0e7e95355e480c2301ndconfig_h_in="include/ap_config_auto.h.in"
a78048ccbdb6256da15e6b0e7e95355e480c2301nd
3b3b7fc78d1f5bfc2769903375050048ff41ff26ndcross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndif [ -d srclib/apr ]; then
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd echo rebuilding $apr_configure
(cd srclib/apr && ./buildconf) || {
echo "./buildconf failed for apr"
exit 1
}
fi
if [ -d srclib/apr-util ]; then
echo rebuilding $aprutil_configure
(cd srclib/apr-util && ./buildconf) || {
echo "./buildconf failed for apr-util"
exit 1
}
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 $apu_src_dir/build/find_apu.m4 build
# 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 libtool.m4)
# 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 $pcre_configure
(cd srclib/pcre && ${AUTOCONF:-autoconf})
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"
if [ -f `which cut` ]; then
echo rebuilding rpm spec file
( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
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/" \
> httpd.spec )
fi
exit 0