upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / buildconf
1 #!/bin/sh
2
3 # Default place to look for apr source.  Can be overridden with 
4 #   --with-apr=[directory]
5 apr_src_dir=../apr
6
7 while test $# -gt 0 
8 do
9   # Normalize
10   case "$1" in
11   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
12   *) optarg= ;;
13   esac
14
15   case "$1" in
16   --with-apr=*)
17   apr_src_dir=$optarg
18   ;;
19   esac
20
21   shift
22 done
23
24 if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
25   echo ""
26   echo "Looking for apr source in $apr_src_dir"
27 else
28   echo ""
29   echo "Problem finding apr source in $apr_src_dir."
30   echo "Use:"
31   echo "  --with-apr=[directory]" 
32   exit 1
33 fi
34
35 # Remove some files, then copy them from apr source tree
36 rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
37       build/config.guess build/config.sub build/get-version.sh
38 cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
39       $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
40       $apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
41       build/
42
43 # Remove aclocal.m4 as it'll break some builds...
44 rm -rf aclocal.m4 autom4te*.cache
45
46 #
47 # Generate the autoconf header (include/apu_config.h) and ./configure
48 #
49 echo "Creating include/private/apu_config.h ..."
50 ${AUTOHEADER:-autoheader}
51
52 echo "Creating configure ..."
53 ### do some work to toss config.cache?
54 if ${AUTOCONF:-autoconf}; then
55   :
56 else
57   echo "autoconf failed"
58   exit 1
59 fi
60
61 # Post autoconf cleanup...
62 rm -rf autom4te*.cache
63
64 #
65 # If Expat has been bundled, then go and configure the thing
66 # and then remove autoconf cache
67 #
68 if [ -f xml/expat/buildconf.sh ]; then
69   echo "Invoking xml/expat/buildconf.sh ..."
70   (cd xml/expat; ./buildconf.sh; rm -rf autom4te*.cache)
71 fi
72
73 # Create RPM Spec file
74 if [ -f `which cut` ]; then
75   echo rebuilding rpm spec file
76   REVISION=`build/get-version.sh all include/apu_version.h APU`
77   VERSION=`echo $REVISION | cut -d- -s -f1`
78   RELEASE=`echo $REVISION | cut -d- -s -f2`
79   if [ "x$VERSION" = "x" ]; then
80       VERSION=$REVISION
81       RELEASE=1
82   fi
83   sed -e "s/APU_VERSION/$VERSION/" -e "s/APU_RELEASE/$RELEASE/" \
84     ./build/rpm/apr-util.spec.in > apr-util.spec
85 fi
86