bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / buildconf
1 #!/bin/sh
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
8
9 #    http://www.apache.org/licenses/LICENSE-2.0
10 #
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.
16 #
17 #
18
19 # buildconf: Build the support scripts needed to compile from a
20 #            checked-out version of the source code.
21
22 # Verify that the builder has the right config tools installed
23 #
24 build/buildcheck.sh || exit 1
25
26 libtoolize=`build/PrintPath glibtoolize libtoolize`
27 if [ "x$libtoolize" = "x" ]; then
28     echo "libtoolize not found in path"
29     exit 1
30 fi
31
32 # Create the libtool helper files
33 #
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
37 #
38 echo "Copying libtool helper files ..."
39
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)
43
44 $libtoolize --copy --automake
45
46 ltpath=`dirname $libtoolize`
47 ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
48
49 if [ ! -f $ltfile ]; then
50     echo "$ltfile not found"
51     exit 1
52 fi
53
54 echo "buildconf: Using libtool.m4 at ${ltfile}."
55
56 cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
57
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.
60 rm -f aclocal.m4
61
62 #
63 # Generate the autoconf header and ./configure
64 #
65 echo "Creating include/arch/unix/apr_private.h.in ..."
66 ${AUTOHEADER:-autoheader}
67
68 echo "Creating configure ..."
69 ### do some work to toss config.cache?
70 ${AUTOCONF:-autoconf}
71
72 # Remove autoconf 2.5x's cache directory
73 rm -rf autom4te*.cache
74
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
82       VERSION=$REVISION
83       RELEASE=1
84     fi
85     cat ./build/rpm/apr.spec.in | \
86     sed -e "s/APR_VERSION/$VERSION/" \
87         -e "s/APR_RELEASE/$RELEASE/" \
88     > apr.spec )
89 fi
90
91 exit 0