Revert change to testdate.c (commited by accident)
[apr-util.git] / buildconf
blobcb4ae46b9d35c9b5b79e1717bd7d27318e70ba79
1 #!/bin/sh
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
20 # Default place to look for apr source. Can be overridden with
21 # --with-apr=[directory]
22 apr_src_dir=../apr
24 while test $# -gt 0
26 # Normalize
27 case "$1" in
28 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
29 *) optarg= ;;
30 esac
32 case "$1" in
33 --with-apr=*)
34 apr_src_dir=$optarg
36 esac
38 shift
39 done
41 if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
42 apr_src_dir=`cd $apr_src_dir; pwd`
43 echo ""
44 echo "Looking for apr source in $apr_src_dir"
45 else
46 echo ""
47 echo "Problem finding apr source in $apr_src_dir."
48 echo "Use:"
49 echo " --with-apr=[directory]"
50 exit 1
53 set -e
55 # Remove some files, then copy them from apr source tree
56 rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
57 build/config.guess build/config.sub build/get-version.sh
58 cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
59 $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
60 $apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
61 build/
63 # Remove aclocal.m4 as it'll break some builds...
64 rm -rf aclocal.m4 autom4te*.cache
67 # Generate the autoconf header (include/apu_config.h) and ./configure
69 echo "Creating include/private/apu_config.h ..."
70 ${AUTOHEADER:-autoheader}
72 echo "Creating configure ..."
73 ### do some work to toss config.cache?
74 if ${AUTOCONF:-autoconf}; then
76 else
77 echo "autoconf failed"
78 exit 1
82 # Generate build-outputs.mk for the build system
84 echo "Generating 'make' outputs ..."
85 $apr_src_dir/build/gen-build.py make
88 # If Expat has been bundled, then go and configure the thing
90 if [ -f xml/expat/buildconf.sh ]; then
91 echo "Invoking xml/expat/buildconf.sh ..."
92 (cd xml/expat; ./buildconf.sh)
95 # Remove autoconf cache again
96 rm -rf autom4te*.cache
98 # Create RPM Spec file
99 if [ -f `which cut` ]; then
100 echo rebuilding rpm spec file
101 REVISION=`build/get-version.sh all include/apu_version.h APU`
102 VERSION=`echo $REVISION | cut -d- -s -f1`
103 RELEASE=`echo $REVISION | cut -d- -s -f2`
104 if [ "x$VERSION" = "x" ]; then
105 VERSION=$REVISION
106 RELEASE=1
108 sed -e "s/APU_VERSION/$VERSION/" -e "s/APU_RELEASE/$RELEASE/" \
109 ./build/rpm/apr-util.spec.in > apr-util.spec