summaryrefslogtreecommitdiffstats
path: root/rubbos/app/httpd-2.0.64/srclib/apr-util/buildconf
blob: ed346d0883dd696ebcc264a8ef3f76024e7800b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh

# Default place to look for apr source.  Can be overridden with 
#   --with-apr=[directory]
apr_src_dir=../apr

while test $# -gt 0 
do
  # Normalize
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case "$1" in
  --with-apr=*)
  apr_src_dir=$optarg
  ;;
  esac

  shift
done

if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
  echo ""
  echo "Looking for apr source in $apr_src_dir"
else
  echo ""
  echo "Problem finding apr source in $apr_src_dir."
  echo "Use:"
  echo "  --with-apr=[directory]" 
  exit 1
fi

# Remove some files, then copy them from apr source tree
rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
      build/config.guess build/config.sub build/get-version.sh
cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
      $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
      $apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
      build/

# Remove aclocal.m4 as it'll break some builds...
rm -rf aclocal.m4 autom4te*.cache

#
# Generate the autoconf header (include/apu_config.h) and ./configure
#
echo "Creating include/private/apu_config.h ..."
${AUTOHEADER:-autoheader}

echo "Creating configure ..."
### do some work to toss config.cache?
if ${AUTOCONF:-autoconf}; then
  :
else
  echo "autoconf failed"
  exit 1
fi

# Post autoconf cleanup...
rm -rf autom4te*.cache

#
# If Expat has been bundled, then go and configure the thing
# and then remove autoconf cache
#
if [ -f xml/expat/buildconf.sh ]; then
  echo "Invoking xml/expat/buildconf.sh ..."
  (cd xml/expat; ./buildconf.sh; rm -rf autom4te*.cache)
fi

# Create RPM Spec file
if [ -f `which cut` ]; then
  echo rebuilding rpm spec file
  REVISION=`build/get-version.sh all include/apu_version.h APU`
  VERSION=`echo $REVISION | cut -d- -s -f1`
  RELEASE=`echo $REVISION | cut -d- -s -f2`
  if [ "x$VERSION" = "x" ]; then
      VERSION=$REVISION
      RELEASE=1
  fi
  sed -e "s/APU_VERSION/$VERSION/" -e "s/APU_RELEASE/$RELEASE/" \
    ./build/rpm/apr-util.spec.in > apr-util.spec
fi