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 if [ "$1" = "--verbose" -o "$1" = "-v" ]; then
25 # Default place to look for apr source. Can be overridden with
26 # --with-apr=[directory]
33 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
46 if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
47 apr_src_dir=`cd $apr_src_dir; pwd`
49 echo "Looking for apr source in $apr_src_dir"
52 echo "Problem finding apr source in $apr_src_dir."
54 echo " --with-apr=[directory]"
60 # Remove some files, then copy them from apr source tree
61 rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
62 build/config.guess build/config.sub build/get-version.sh
63 cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
64 $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
65 $apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
68 # Remove aclocal.m4 as it'll break some builds...
69 rm -rf aclocal.m4 autom4te*.cache
72 # Generate the autoconf header (include/apu_config.h) and ./configure
74 echo "Creating include/private/apu_config.h ..."
75 ${AUTOHEADER:-autoheader} $verbose
77 echo "Creating configure ..."
78 ### do some work to toss config.cache?
79 if ${AUTOCONF:-autoconf} $verbose; then
82 echo "autoconf failed"
87 # Generate build-outputs.mk for the build system
89 echo "Generating 'make' outputs ..."
90 $apr_src_dir/build/gen-build.py $verbose make
93 # If Expat has been bundled, then go and configure the thing
95 if [ -f xml/expat/buildconf.sh ]; then
96 echo "Invoking xml/expat/buildconf.sh ..."
97 (cd xml/expat; ./buildconf.sh $verbose)
100 # Remove autoconf cache again
101 rm -rf autom4te*.cache
103 # Create RPM Spec file
104 if [ -f `which cut` ]; then
105 echo rebuilding rpm spec file
106 REVISION=`build/get-version.sh all include/apu_version.h APU`
107 VERSION=`echo $REVISION | cut -d- -s -f1`
108 RELEASE=`echo $REVISION | cut -d- -s -f2`
109 if [ "x$VERSION" = "x" ]; then
113 sed -e "s/APU_VERSION/$VERSION/" -e "s/APU_RELEASE/$RELEASE/" \
114 ./build/rpm/apr-util.spec.in > apr-util.spec