buildconf revision 53359f0fef553ad61e2d1e871dc007c542844f86
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#!/bin/sh
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Copyright 1999-2005 The Apache Software Foundation or its licensors, as
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# applicable.
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Licensed under the Apache License, Version 2.0 (the "License");
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# you may not use this file except in compliance with the License.
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# You may obtain a copy of the License at
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# http://www.apache.org/licenses/LICENSE-2.0
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Unless required by applicable law or agreed to in writing, software
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# distributed under the License is distributed on an "AS IS" BASIS,
0ce7569856cc7a366f58688f6b6a71610167fc76Johannes Kastl# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# See the License for the specific language governing permissions and
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# limitations under the License.
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# buildconf: Build the support scripts needed to compile from a
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# checked-out version of the source code.
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# set a couple of defaults for where we should be looking for our support libs.
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber# can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatapr_src_dir="srclib/apr ../apr"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatapu_src_dir="srclib/apr-util ../apr-util"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77Stéphane Graberwhile test $# -gt 0
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatdo
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber # Normalize
c63c04fcaf1c3a78c70500eae253d72fa9c8358aTAMUKI Shoichi case "$1" in
96283b546081e7ff709968378fca25cb44f1ab6cStéphane Graber -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
96283b546081e7ff709968378fca25cb44f1ab6cStéphane Graber *) optarg= ;;
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber esac
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber case "$1" in
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber --with-apr=*)
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber apr_src_dir=$optarg
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber ;;
207bf0e475f1dc6e9a2dac2cee3a209b56427855Stéphane Graber esac
207bf0e475f1dc6e9a2dac2cee3a209b56427855Stéphane Graber
207bf0e475f1dc6e9a2dac2cee3a209b56427855Stéphane Graber case "$1" in
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov --with-apr-util=*)
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov apu_src_dir=$optarg
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov ;;
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov esac
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov shift
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golovdone
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golov
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Check to be sure that we have the srclib dependencies checked-out
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatshould_exit=0
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfieldapr_found=0
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatapu_found=0
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfieldfor dir in $apr_src_dir
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatdo
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat if [ -d "${dir}" -a -f "${dir}/build/apr_common.m4" ]; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "found apr source: ${dir}"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat apr_src_dir=$dir
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat apr_found=1
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat break
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat fi
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatdone
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
ba4c42597399c72fbb0b8f99e6ded79f738a6ac3Frederic Crozatif [ $apr_found -lt 1 ]; then
ba4c42597399c72fbb0b8f99e6ded79f738a6ac3Frederic Crozat echo ""
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "You don't have a copy of the apr source in srclib/apr. "
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "Please get the source using the following instructions,"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "or specify the location of the source with "
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "--with-apr=[path to apr] :"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo ""
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo " svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo ""
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat should_exit=1
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatfi
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatfor dir in $apu_src_dir
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatdo
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat if [ -d "${dir}" -a -f "${dir}/Makefile.in" ]; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "found apr-util source: ${dir}"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat apu_src_dir=$dir
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat apu_found=1
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat break
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat fi
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozatdone
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif [ $apu_found -lt 1 ]; then
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat echo ""
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "You don't have a copy of the apr-util source in srclib/apr-util. "
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "Please get one the source using the following instructions, "
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "or specify the location of the source with "
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "--with-apr-util=[path to apr-util]:"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo ""
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo ""
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat should_exit=1
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatfi
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatif [ $should_exit -gt 0 ]; then
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn exit 1
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallynfi
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn# These are temporary until Roy finishes the other build changes
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn#
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyntouch .deps
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallynrm -f aclocal.m4
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallynrm -f generated_lists
98f5f7e2c54fc003f81b2164adf3c7bd8a104556Cedric Bosdonnatrm -f srclib/pcre/aclocal.m4
98f5f7e2c54fc003f81b2164adf3c7bd8a104556Cedric Bosdonnat
98f5f7e2c54fc003f81b2164adf3c7bd8a104556Cedric Bosdonnat# Remove autoconf 2.5x cache directories
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatrm -rf autom4te*.cache srclib/pcre/autom4te*.cache
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatcase "`uname`" in
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat*BSD/OS*)
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat ./build/bsd_makefile;;
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatesac
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat#
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# end temporary stuff
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatapr_configure="$apr_src_dir/configure"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozataprutil_configure="$apu_src_dir/configure"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatpcre_configure="srclib/pcre/configure"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatconfig_h_in="include/ap_config_auto.h.in"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat
a3ed64707fb71b6f2fcf603e755c5da07ab3aec5Evgeni Golovcross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozatif [ -d srclib/apr ]; then
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat echo rebuilding $apr_configure
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat (cd srclib/apr && ./buildconf) || {
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat echo "./buildconf failed for apr"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat exit 1
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat }
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat rm -f srclib/apr/apr.spec
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatfi
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graberif [ -d srclib/apr-util ]; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo rebuilding $aprutil_configure
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat (cd srclib/apr-util && ./buildconf) || {
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat echo "./buildconf failed for apr-util"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat exit 1
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat }
f4936bf19c56a688eec182e1916c8b660e3a0058Jiri Slaby rm -f srclib/apr-util/apr-util.spec
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguezfi
73fd697741d3fbe8ea9f0ee6ef303391e2c0cbb2Terzeus S. Dominguez
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguezecho copying build files
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguezcp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn# Remove any libtool files so one can switch between libtool 1.3
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat# and libtool 1.4 by simply rerunning the buildconf script.
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat(cd build ; rm -f ltconfig ltmain.sh)
cc33e055dd047af7b4cc8a226bb54b3b9c450152Jiri Slaby
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn# Optionally copy libtool-1.3.x files
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallynif [ -f $apr_src_dir/build/ltconfig ]; then
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat cp $apr_src_dir/build/ltconfig build
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozatfi
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatif [ -f $apr_src_dir/build/ltmain.sh ]; then
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat cp $apr_src_dir/build/ltmain.sh build
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozatfi
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozatecho rebuilding $pcre_configure
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat(cd srclib/pcre && ${AUTOCONF:-autoconf})
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatecho rebuilding $config_h_in
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatrm -f $config_h_in
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguezecho rebuilding configure
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallynrm -f config.cache
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat# Remove autoconf 2.5x cache directories
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozatrm -rf autom4te*.cache srclib/pcre/autom4te*.cache
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastlif [ -f `which cut` ]; then
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl echo rebuilding rpm spec file
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl VERSION=`echo $REVISION | cut -d- -s -f1`
73fd697741d3fbe8ea9f0ee6ef303391e2c0cbb2Terzeus S. Dominguez RELEASE=`echo $REVISION | cut -d- -s -f2`
73fd697741d3fbe8ea9f0ee6ef303391e2c0cbb2Terzeus S. Dominguez if [ "x$VERSION" = "x" ]; then
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez VERSION=$REVISION
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez RELEASE=1
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez fi
f2d63d7ac44cf8ebabf11cdc1a8b9ba39506167aTerzeus S. Dominguez cat ./build/rpm/httpd.spec.in | \
9a4fe12dc4944bb3a4d3a6c8b214c2d908206ae6Terzeus S. Dominguez sed -e "s/APACHE_VERSION/$VERSION/" \
73fd697741d3fbe8ea9f0ee6ef303391e2c0cbb2Terzeus S. Dominguez -e "s/APACHE_RELEASE/$RELEASE/" \
9a4fe12dc4944bb3a4d3a6c8b214c2d908206ae6Terzeus S. Dominguez -e "s/APACHE_MMN/$VMMN/" \
9a4fe12dc4944bb3a4d3a6c8b214c2d908206ae6Terzeus S. Dominguez > httpd.spec )
9a4fe12dc4944bb3a4d3a6c8b214c2d908206ae6Terzeus S. Dominguezfi
9a4fe12dc4944bb3a4d3a6c8b214c2d908206ae6Terzeus S. Dominguez
17abf2784de1047fb2904ff130ee5efe4ea7b598Elan Ruusamäe# ensure that the mod_ssl expression parser sources are never regenerated
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat# when running make
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatecho fixing timestamps for mod_ssl sources
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatcd modules/ssl
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozattouch ssl_expr_parse.y
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatsleep 1
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozattouch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatsleep 1
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfieldtouch ssl_expr_scan.c
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatcd ../..
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastlexit 0
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl