buildconf revision 4028d805f3ab215e39bae405d35e001a538bc50e
0N/A#!/bin/sh
2362N/A# ====================================================================
0N/A# The Apache Software License, Version 1.1
0N/A#
0N/A# Copyright (c) 2000-2003 The Apache Software Foundation. All rights
0N/A# reserved.
2362N/A#
0N/A# Redistribution and use in source and binary forms, with or without
2362N/A# modification, are permitted provided that the following conditions
0N/A# are met:
0N/A#
0N/A# 1. Redistributions of source code must retain the above copyright
0N/A# notice, this list of conditions and the following disclaimer.
0N/A#
0N/A# 2. Redistributions in binary form must reproduce the above copyright
0N/A# notice, this list of conditions and the following disclaimer in
0N/A# the documentation and/or other materials provided with the
0N/A# distribution.
0N/A#
0N/A# 3. The end-user documentation included with the redistribution,
2362N/A# if any, must include the following acknowledgment:
2362N/A# "This product includes software developed by the
2362N/A# Apache Software Foundation (http://www.apache.org/)."
0N/A# Alternately, this acknowledgment may appear in the software itself,
0N/A# if and wherever such third-party acknowledgments normally appear.
0N/A#
0N/A# 4. The names "Apache" and "Apache Software Foundation" must
0N/A# not be used to endorse or promote products derived from this
1859N/A# software without prior written permission. For written
1859N/A# permission, please contact apache@apache.org.
0N/A#
0N/A# 5. Products derived from this software may not be called "Apache",
0N/A# nor may "Apache" appear in their name, without prior written
0N/A# permission of the Apache Software Foundation.
0N/A#
0N/A# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
0N/A# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0N/A# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0N/A# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
0N/A# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0N/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0N/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
0N/A# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0N/A# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0N/A# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
0N/A# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0N/A# SUCH DAMAGE.
0N/A# ====================================================================
0N/A#
0N/A# This software consists of voluntary contributions made by many
0N/A# individuals on behalf of the Apache Software Foundation. For more
0N/A# information on the Apache Software Foundation, please see
0N/A# <http://www.apache.org/>.
0N/A#
0N/A
0N/A# buildconf: Build the support scripts needed to compile from a
0N/A# checked-out version of the source code.
1859N/A
0N/A# set a couple of defaults for where we should be looking for our support libs.
0N/A# can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
0N/A
0N/Aapr_src_dir=srclib/apr
0N/Aapu_src_dir=srclib/apr-util
0N/A
0N/Awhile test $# -gt 0
0N/Ado
0N/A # Normalize
0N/A case "$1" in
0N/A -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
1859N/A *) optarg= ;;
1859N/A esac
1859N/A
1859N/A case "$1" in
1859N/A --with-apr=*)
1859N/A apr_src_dir=$optarg
1859N/A ;;
0N/A esac
0N/A
0N/A case "$1" in
0N/A --with-apr-util=*)
0N/A apu_src_dir=$optarg
0N/A ;;
0N/A esac
0N/A
0N/A shift
0N/Adone
0N/A
0N/A#
0N/A# Check to be sure that we have the srclib dependencies checked-out
0N/A#
0N/A
0N/Aif [ ! -d "$apr_src_dir" -o ! -f "$apr_src_dir/build/apr_common.m4" ]; then
0N/A echo ""
0N/A echo "You don't have a copy of the apr source in $apr_src_dir. "
0N/A echo "Please get the source using the following instructions,"
0N/A echo "or specify the location of the source with "
0N/A echo "--with-apr=[path to apr] :"
0N/A echo ""
0N/A echo " cd srclib"
0N/A echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
0N/A echo " (password 'anoncvs')"
0N/A echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr"
0N/A echo ""
0N/A exit 1
0N/Afi
0N/Aif [ ! -d "$apu_src_dir" -o ! -f "$apu_src_dir/Makefile.in" ]; then
0N/A echo ""
0N/A echo "You don't have a copy of the apr-util source in $apu_src_dir. "
0N/A echo "Please get one the source using the following instructions, "
0N/A echo "or specify the location of the source with "
0N/A echo "--with-apr-util=[path to apr-util]:"
0N/A echo ""
0N/A echo " cd srclib"
0N/A echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
0N/A echo " (password 'anoncvs')"
0N/A echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr-util"
0N/A echo ""
0N/A exit 1
0N/Afi
0N/A
0N/A# These are temporary until Roy finishes the other build changes
0N/A#
0N/Atouch .deps
0N/Arm -f aclocal.m4
0N/Arm -f generated_lists
0N/A
0N/A# Remove autoconf 2.5x's cache directory
0N/Arm -rf autom4te*.cache
0N/A
0N/Acase "`uname`" in
0N/A*BSD/OS*)
0N/A ./build/bsd_makefile;;
0N/Aesac
0N/A#
0N/A# end temporary stuff
0N/A
0N/Aapr_configure="$apr_src_dir/configure"
0N/Aaprutil_configure="$apu_src_dir/configure"
0N/Apcre_configure="srclib/pcre/configure"
0N/Aconfig_h_in="include/ap_config_auto.h.in"
0N/A
0N/Across_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
0N/A
0N/Aif [ -d srclib/apr ]; then
0N/A echo rebuilding $apr_configure
0N/A (cd srclib/apr && ./buildconf) || {
0N/A echo "./buildconf failed for apr"
0N/A exit 1
0N/A }
0N/Afi
0N/A
0N/Aif [ -d srclib/apr-util ]; then
0N/A echo rebuilding $aprutil_configure
0N/A (cd srclib/apr-util && ./buildconf) || {
0N/A echo "./buildconf failed for apr-util"
0N/A exit 1
0N/A }
0N/Afi
0N/A
0N/Aecho copying build files
0N/Acp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
0N/A $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
0N/A $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
0N/A
0N/A# Optionally copy libtool-1.3.x files
0N/Aif [ -f $apr_src_dir/build/ltconfig ]; then
0N/A cp $apr_src_dir/build/ltconfig build
0N/Afi
0N/Aif [ -f $apr_src_dir/build/ltmain.sh ]; then
0N/A cp $apr_src_dir/build/ltmain.sh build
0N/Afi
0N/A
0N/Aecho rebuilding $pcre_configure
0N/A(cd srclib/pcre && ${AUTOCONF:-autoconf})
0N/A
614N/Aecho rebuilding $config_h_in
0N/Arm -f $config_h_in
614N/A${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
0N/A
0N/Aecho rebuilding configure
614N/Arm -f config.cache
0N/A${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
0N/A
614N/Aif [ -f `which cut` ]; then
0N/A echo rebuilding rpm spec file
0N/A ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
0N/A REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
0N/A VERSION=`echo $REVISION | cut -d- -s -f1`
0N/A RELEASE=`echo $REVISION | cut -d- -s -f2`
0N/A if [ "x$VERSION" = "x" ]; then
0N/A VERSION=$REVISION
0N/A RELEASE=1
0N/A fi
0N/A cat ./build/rpm/httpd.spec.in | \
0N/A sed -e "s/APACHE_VERSION/$VERSION/" \
0N/A -e "s/APACHE_RELEASE/$RELEASE/" \
0N/A -e "s/APACHE_MMN/$VMMN/" \
0N/A > httpd.spec )
0N/Afi
0N/A
0N/Aexit 0
0N/A