OSDN Git Service

* Added serf library.
[modchxj/mod_chxj.git] / src / serf / buildconf
1 #!/bin/sh
2 #
3 # Copyright 2005 Justin Erenkrantz and Greg Stein
4 # Copyright 2005 The Apache Software Foundation or its licensors, as
5 # applicable.
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #
20 # buildconf: Build the support scripts needed to compile from a
21 #            checked-out version of the source code.
22
23 # set a couple of defaults for where we should be looking for our support libs.
24 # can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
25
26 apr_src_dir="apr ../apr"
27 apu_src_dir="apr-util ../apr-util"
28
29 while test $# -gt 0 
30 do
31   # Normalize
32   case "$1" in
33   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
34   *) optarg= ;;
35   esac
36
37   case "$1" in
38   --with-apr=*)
39   apr_src_dir=$optarg
40   ;;
41   esac
42
43   case "$1" in
44   --with-apr-util=*)
45   apu_src_dir=$optarg
46   ;;
47   esac
48
49   shift
50 done
51
52 #
53 # Check to be sure that we have the srclib dependencies checked-out
54 #
55
56 should_exit=0
57 apr_found=0
58 apu_found=0
59
60 for dir in $apr_src_dir
61 do
62     if [ -d "${dir}" -a -f "${dir}/build/apr_common.m4" ]; then
63         echo "found apr source: ${dir}"
64         apr_src_dir=$dir
65         apr_found=1
66         break
67     fi
68 done
69
70 if [ $apr_found -lt 1 ]; then
71     echo ""
72     echo "You don't have a copy of the apr source in srclib/apr. "
73     echo "Please get the source using the following instructions," 
74     echo "or specify the location of the source with " 
75     echo "--with-apr=[path to apr] :"
76     echo ""
77     echo "   svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
78     echo ""
79     should_exit=1
80 fi
81
82 for dir in $apu_src_dir
83 do
84     if [ -d "${dir}" -a -f "${dir}/Makefile.in" ]; then
85         echo "found apr-util source: ${dir}"
86         apu_src_dir=$dir
87         apu_found=1
88         break
89     fi
90 done
91
92 if [ $apu_found -lt 1 ]; then
93     echo ""
94     echo "You don't have a copy of the apr-util source in srclib/apr-util. "
95     echo "Please get one the source using the following instructions, "
96     echo "or specify the location of the source with "
97     echo "--with-apr-util=[path to apr-util]:"
98     echo ""
99     echo "   svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
100     echo ""
101     should_exit=1
102 fi
103
104 if [ $should_exit -gt 0 ]; then
105     exit 1
106 fi
107
108 if [ ! -d build ]; then
109   $apr_src_dir/build/mkdir.sh build
110 fi
111
112 echo copying build files
113 cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
114    $apr_src_dir/build/install.sh $apr_src_dir/build/apr_common.m4 \
115    $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 \
116    $apr_src_dir/build/get-version.sh build
117
118 echo generating configure
119 ${AUTOCONF:-autoconf}
120
121 # Remove autoconf 2.5x's cache directory
122 rm -rf autom4te*.cache