updated to 64bit crc version of ccan crc
[httpd-crcsyncproxy.git] / buildconf
blobb36d0579ae13a00f088c3aad65ca61f34bfd01fc
1 #!/bin/sh
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.
19 # buildconf: Build the support scripts needed to compile from a
20 # checked-out version of the source code.
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]
25 apr_src_dir="srclib/apr ../apr"
26 apu_src_dir=""
28 while test $# -gt 0
30 # Normalize
31 case "$1" in
32 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
33 *) optarg= ;;
34 esac
36 case "$1" in
37 --with-apr=*)
38 apr_src_dir=$optarg
40 esac
42 case "$1" in
43 --with-apr-util=*)
44 apu_src_dir=$optarg
46 esac
48 shift
49 done
52 # Check to be sure that we have the srclib dependencies checked-out
55 should_exit=0
56 apr_found=0
57 apu_found=0
59 for dir in $apr_src_dir
61 if [ -f "${dir}/build/apr_common.m4" ]; then
62 echo "found apr source: ${dir}"
63 apr_src_dir=$dir
64 apr_found=1
65 break
67 done
69 if [ $apr_found -lt 1 ]; then
70 echo ""
71 echo "You don't have a copy of the apr source in srclib/apr. "
72 echo "Please get the source using the following instructions,"
73 echo "or specify the location of the source with "
74 echo "--with-apr=[path to apr] :"
75 echo ""
76 echo " svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr"
77 echo ""
78 should_exit=1
81 if test -z "$apu_src_dir"; then
82 apu_src_dir=`echo $apr_src_dir | sed -e 's#/apr#/apr-util#g;'`
83 apu_src_dir="$apu_src_dir `echo $apr_src_dir | sed -e 's#/apr#/aprutil#;g'`"
84 apu_src_dir="$apu_src_dir srclib/apr-util ../apr-util"
87 for dir in $apu_src_dir
89 if [ -f "${dir}/Makefile.in" ]; then
90 echo "found apr-util source: ${dir}"
91 apu_src_dir=$dir
92 apu_found=1
93 break
95 done
97 if [ $apu_found -lt 1 ]; then
98 echo ""
99 echo "You don't have a copy of the apr-util source in srclib/apr-util. "
100 echo "Please get one the source using the following instructions, "
101 echo "or specify the location of the source with "
102 echo "--with-apr-util=[path to apr-util]:"
103 echo ""
104 echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
105 echo ""
106 should_exit=1
109 if [ $should_exit -gt 0 ]; then
110 exit 1
113 # These are temporary until Roy finishes the other build changes
115 touch .deps
116 rm -f aclocal.m4
117 rm -f generated_lists
119 # Remove autoconf 2.5x cache directories
120 rm -rf autom4te*.cache
122 case "`uname`" in
123 *BSD/OS*)
124 ./build/bsd_makefile;;
125 esac
127 # end temporary stuff
129 apr_configure="$apr_src_dir/configure"
130 aprutil_configure="$apu_src_dir/configure"
131 config_h_in="include/ap_config_auto.h.in"
133 cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
135 if [ "$apr_src_dir" = "srclib/apr" ]; then
136 echo rebuilding $apr_configure
137 (cd srclib/apr && ./buildconf) || {
138 echo "./buildconf failed for apr"
139 exit 1
141 rm -f srclib/apr/apr.spec
144 apr_src_dir=`cd $apr_src_dir && pwd`
146 if [ "$apu_src_dir" = "srclib/apr-util" ]; then
147 echo rebuilding $aprutil_configure
148 (cd srclib/apr-util && ./buildconf --with-apr=$apr_src_dir) || {
149 echo "./buildconf failed for apr-util"
150 exit 1
152 rm -f srclib/apr-util/apr-util.spec
155 apu_src_dir=`cd $apu_src_dir && pwd`
157 echo copying build files
158 cp $apr_src_dir/build/config.guess $apr_src_dir/build/config.sub \
159 $apr_src_dir/build/PrintPath $apr_src_dir/build/apr_common.m4 \
160 $apr_src_dir/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build
162 # Remove any libtool files so one can switch between libtool 1.3
163 # and libtool 1.4 by simply rerunning the buildconf script.
164 (cd build ; rm -f ltconfig ltmain.sh)
166 # Optionally copy libtool-1.3.x files
167 if [ -f $apr_src_dir/build/ltconfig ]; then
168 cp $apr_src_dir/build/ltconfig build
170 if [ -f $apr_src_dir/build/ltmain.sh ]; then
171 cp $apr_src_dir/build/ltmain.sh build
174 echo rebuilding $config_h_in
175 rm -f $config_h_in
176 ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
178 echo rebuilding configure
179 rm -f config.cache
180 ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
182 # Remove autoconf 2.5x cache directories
183 rm -rf autom4te*.cache
185 if [ -f `which cut` ]; then
186 echo rebuilding rpm spec file
187 ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER`
188 REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER`
189 VERSION=`echo $REVISION | cut -d- -s -f1`
190 RELEASE=`echo $REVISION | cut -d- -s -f2`
191 if [ "x$VERSION" = "x" ]; then
192 VERSION=$REVISION
193 RELEASE=1
195 cat ./build/rpm/httpd.spec.in | \
196 sed -e "s/APACHE_VERSION/$VERSION/" \
197 -e "s/APACHE_RELEASE/$RELEASE/" \
198 -e "s/APACHE_MMN/$VMMN/" \
199 > httpd.spec )
202 # ensure that the mod_ssl expression parser sources are never regenerated
203 # when running make
204 echo fixing timestamps for mod_ssl sources
205 cd modules/ssl
206 touch ssl_expr_parse.y
207 sleep 1
208 touch ssl_expr_parse.c ssl_expr_parse.h ssl_expr_scan.l
209 sleep 1
210 touch ssl_expr_scan.c
211 cd ../..
213 exit 0