]> granicus.if.org Git - apache/blob - buildconf
remove SSLMutex documentation
[apache] / buildconf
1 #!/bin/sh
2 #
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
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
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.
17 #
18 #
19 # buildconf: Build the support scripts needed to compile from a
20 #            checked-out version of the source code.
21
22 # set a couple of defaults for where we should be looking for our support libs.
23 # can be overridden with --with-apr=[dir] and --with-apr-util=[dir]
24
25 apr_src_dir="srclib/apr ../apr"
26 apu_src_dir=""
27
28 while test $# -gt 0 
29 do
30   # Normalize
31   case "$1" in
32   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
33   *) optarg= ;;
34   esac
35
36   case "$1" in
37   --with-apr=*)
38   apr_src_dir=$optarg
39   ;;
40   esac
41
42   case "$1" in
43   --with-apr-util=*)
44   apu_src_dir=$optarg
45   ;;
46   esac
47
48   shift
49 done
50
51 #
52 # Check to be sure that we have the srclib dependencies checked-out
53 #
54
55 should_exit=0
56 apr_found=0
57 apu_found=0
58 apr_major_version=2
59
60 for dir in $apr_src_dir
61 do
62     if [ -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 else
81     apr_major_version=`grep "#define APR_MAJOR_VERSION" \
82                       $apr_src_dir/include/apr_version.h | sed 's/[^0-9]//g'`
83 fi
84
85 if [ $apr_major_version -lt 2 ] ; then
86     if test -z "$apu_src_dir"; then
87         apu_src_dir=`echo $apr_src_dir | sed -e 's#/apr#/apr-util#g;'`
88         apu_src_dir="$apu_src_dir `echo $apr_src_dir | sed -e 's#/apr#/aprutil#;g'`"
89         apu_src_dir="$apu_src_dir srclib/apr-util ../apr-util"
90     fi
91
92     for dir in $apu_src_dir
93     do
94         if [ -f "${dir}/Makefile.in" ]; then
95             echo "found apr-util source: ${dir}"
96             apu_src_dir=$dir
97             apu_found=1
98             break
99         fi
100     done
101
102     if [ $apu_found -lt 1 ]; then
103         echo ""
104         echo "You don't have a copy of the apr-util source in srclib/apr-util. "
105         echo "Please get one the source using the following instructions, "
106         echo "or specify the location of the source with "
107         echo "--with-apr-util=[path to apr-util]:"
108         echo ""
109         echo "   svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
110         echo ""
111         should_exit=1
112     fi
113 fi
114
115 if [ $should_exit -gt 0 ]; then
116     exit 1
117 fi
118
119 # These are temporary until Roy finishes the other build changes
120 #
121 touch .deps
122 rm -f aclocal.m4
123 rm -f generated_lists
124
125 # Remove autoconf 2.5x cache directories
126 rm -rf autom4te*.cache
127
128 case "`uname`" in
129 *BSD/OS*)
130     ./build/bsd_makefile;;
131 esac
132 #
133 # end temporary stuff
134
135 apr_configure="$apr_src_dir/configure"
136 if [ $apr_major_version -lt 2 ] ; then
137     aprutil_configure="$apu_src_dir/configure"
138 fi
139 config_h_in="include/ap_config_auto.h.in"
140
141 cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
142
143 if [ "$apr_src_dir" = "srclib/apr" ]; then
144     echo rebuilding $apr_configure
145     (cd srclib/apr && ./buildconf) || {
146         echo "./buildconf failed for apr"
147         exit 1
148     }
149     rm -f srclib/apr/apr.spec
150 fi
151
152 apr_src_dir=`cd $apr_src_dir && pwd` 
153
154 if [ $apr_major_version -lt 2 ] ; then
155     if [ "$apu_src_dir" = "srclib/apr-util" ]; then
156         echo rebuilding $aprutil_configure
157         (cd srclib/apr-util && ./buildconf --with-apr=$apr_src_dir) || {
158             echo "./buildconf failed for apr-util" 
159             exit 1
160         }
161         rm -f srclib/apr-util/apr-util.spec
162     fi
163
164     apu_src_dir=`cd $apu_src_dir && pwd`
165 fi
166
167 echo copying build files
168 cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
169    $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
170    $apr_src_dir/build/find_apr.m4 build
171 if [ $apr_major_version -lt 2 ] ; then
172     cp $apu_src_dir/build/find_apu.m4 build
173 fi
174
175 # Remove any libtool files so one can switch between libtool 1.3
176 # and libtool 1.4 by simply rerunning the buildconf script.
177 (cd build ; rm -f ltconfig ltmain.sh)
178
179 # Optionally copy libtool-1.3.x files
180 if [ -f $apr_src_dir/build/ltconfig ]; then
181     cp $apr_src_dir/build/ltconfig build
182 fi
183 if [ -f $apr_src_dir/build/ltmain.sh ]; then
184     cp $apr_src_dir/build/ltmain.sh build
185 fi
186
187 echo rebuilding $config_h_in
188 rm -f $config_h_in
189 ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
190
191 echo rebuilding configure
192 rm -f config.cache
193 ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
194
195 # Remove autoconf 2.5x cache directories
196 rm -rf autom4te*.cache
197
198 if [ -f `which cut` ]; then
199   echo rebuilding rpm spec file
200   ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
201     EPOCH=`build/get-version.sh epoch include/ap_release.h AP_SERVER`
202     REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
203     VERSION=`echo $REVISION | cut -d- -s -f1`
204     RELEASE=`echo $REVISION | cut -d- -s -f2`
205     if [ "x$VERSION" = "x" ]; then
206       VERSION=$REVISION
207       RELEASE=1
208     fi
209     cat ./build/rpm/httpd.spec.in | \
210     sed -e "s/APACHE_VERSION/$VERSION/" \
211         -e "s/APACHE_RELEASE/$RELEASE/" \
212         -e "s/APACHE_MMN/$VMMN/" \
213         -e "s/APACHE_EPOCH/$EPOCH/" \
214     > httpd.spec )
215 fi
216
217 # ensure that the mod_ssl expression parser sources are never regenerated
218 # when running make
219 echo fixing timestamps for mod_ssl sources
220 cd modules/ssl
221 touch ssl_expr_parse.y
222 sleep 1
223 touch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
224 sleep 1
225 touch ssl_expr_scan.c
226 cd ../..
227
228 exit 0