2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements. See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 # buildconf: Build the support scripts needed to compile from a
20 # checked-out version of the source code.
22 # Verify that the builder has the right config tools installed
24 build/buildcheck.sh || exit 1
26 libtoolize=`build/PrintPath glibtoolize libtoolize`
27 if [ "x$libtoolize" = "x" ]; then
28 echo "libtoolize not found in path"
32 # Create the libtool helper files
34 # Note: we copy (rather than link) them to simplify distribution.
35 # Note: APR supplies its own config.guess and config.sub -- we do not
36 # rely on libtool's versions
38 echo "Copying libtool helper files ..."
40 # Remove any libtool files so one can switch between libtool 1.3
41 # and libtool 1.4 by simply rerunning the buildconf script.
42 (cd build ; rm -f ltconfig ltmain.sh libtool.m4)
44 $libtoolize --copy --automake
46 ltpath=`dirname $libtoolize`
47 ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
49 if [ ! -f $ltfile ]; then
50 echo "$ltfile not found"
54 echo "buildconf: Using libtool.m4 at ${ltfile}."
56 cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
58 # This is just temporary until people's workspaces are cleared -- remove
59 # any old aclocal.m4 left over from prior build so it doesn't cause errors.
63 # Generate the autoconf header and ./configure
65 echo "Creating include/arch/unix/apr_private.h.in ..."
66 ${AUTOHEADER:-autoheader}
68 echo "Creating configure ..."
69 ### do some work to toss config.cache?
72 # Remove autoconf 2.5x's cache directory
73 rm -rf autom4te*.cache
75 # Create RPM Spec file
76 if [ -f `which cut` ]; then
77 echo rebuilding rpm spec file
78 ( REVISION=`build/get-version.sh all include/apr_version.h APR`
79 VERSION=`echo $REVISION | cut -d- -s -f1`
80 RELEASE=`echo $REVISION | cut -d- -s -f2`
81 if [ "x$VERSION" = "x" ]; then
85 cat ./build/rpm/apr.spec.in | \
86 sed -e "s/APR_VERSION/$VERSION/" \
87 -e "s/APR_RELEASE/$RELEASE/" \