When compiling SQLite, enable the SQLITE_OMIT_WAL compile-time option.
[svn/apache.git] / get-deps.sh
blobb499ff49cd392de7979f316b9e5f504e356513ed
1 #!/bin/sh
4 # Licensed to the Apache Software Foundation (ASF) under one
5 # or more contributor license agreements. See the NOTICE file
6 # distributed with this work for additional information
7 # regarding copyright ownership. The ASF licenses this file
8 # to you under the Apache License, Version 2.0 (the
9 # "License"); you may not use this file except in compliance
10 # with the License. You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing,
15 # software distributed under the License is distributed on an
16 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 # KIND, either express or implied. See the License for the
18 # specific language governing permissions and limitations
19 # under the License.
23 # get-deps.sh -- download the dependencies useful for building Subversion
26 # If changing this file please take care to try to make your changes as
27 # portable as possible. That means at a minimum only use POSIX supported
28 # features and functions. However, it may be desirable to use an even
29 # more narrow set of features than POSIX, e.g. Solaris /bin/sh only has
30 # a subset of the POSIX shell features. If in doubt, limit yourself to
31 # features already used in the file. Reviewing the history of changes
32 # may be useful as well.
34 APR_VERSION=${APR_VERSION:-"1.4.6"}
35 APU_VERSION=${APU_VERSION:-"1.5.1"}
36 SERF_VERSION=${SERF_VERSION:-"1.3.8"}
37 ZLIB_VERSION=${ZLIB_VERSION:-"1.2.8"}
38 SQLITE_VERSION=${SQLITE_VERSION:-"3.8.11.1"}
39 # Used to construct the SQLite download URL.
40 SQLITE_VERSION_REL_YEAR=2015
41 HTTPD_VERSION=${HTTPD_VERSION:-"2.4.10"}
42 APR_ICONV_VERSION=${APR_ICONV_VERSION:-"1.2.1"}
44 APR=apr-${APR_VERSION}
45 APR_UTIL=apr-util-${APU_VERSION}
46 SERF=serf-${SERF_VERSION}
47 ZLIB=zlib-${ZLIB_VERSION}
48 SQLITE_VERSION_LIST=`echo $SQLITE_VERSION | sed -e 's/\./ /g'`
49 SQLITE=sqlite-amalgamation-`printf %d%02d%02d%02d $SQLITE_VERSION_LIST`
51 HTTPD=httpd-${HTTPD_VERSION}
52 APR_ICONV=apr-iconv-${APR_ICONV_VERSION}
54 BASEDIR=`pwd`
55 TEMPDIR=$BASEDIR/temp
57 HTTP_FETCH=
58 [ -z "$HTTP_FETCH" ] && type wget >/dev/null 2>&1 && HTTP_FETCH="wget -q -nc"
59 [ -z "$HTTP_FETCH" ] && type curl >/dev/null 2>&1 && HTTP_FETCH="curl -sOL"
60 [ -z "$HTTP_FETCH" ] && type fetch >/dev/null 2>&1 && HTTP_FETCH="fetch -q"
62 # Need this uncommented if any of the specific versions of the ASF tarballs to
63 # be downloaded are no longer available on the general mirrors.
64 APACHE_MIRROR=https://archive.apache.org/dist
66 # helpers
67 usage() {
68 echo "Usage: $0"
69 echo "Usage: $0 [ apr | serf | zlib | sqlite ] ..."
70 exit $1
73 # getters
74 get_apr() {
75 cd $TEMPDIR
76 test -d $BASEDIR/apr || $HTTP_FETCH $APACHE_MIRROR/apr/$APR.tar.bz2
77 test -d $BASEDIR/apr-util || $HTTP_FETCH $APACHE_MIRROR/apr/$APR_UTIL.tar.bz2
78 cd $BASEDIR
80 test -d $BASEDIR/apr || bzip2 -dc $TEMPDIR/$APR.tar.bz2 | tar -xf -
81 test -d $BASEDIR/apr-util || bzip2 -dc $TEMPDIR/$APR_UTIL.tar.bz2 | tar -xf -
83 test -d $BASEDIR/apr || mv $APR apr
84 test -d $BASEDIR/apr-util || mv $APR_UTIL apr-util
87 get_serf() {
88 test -d $BASEDIR/serf && return
90 cd $TEMPDIR
91 $HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2
92 cd $BASEDIR
94 bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf -
96 mv $SERF serf
99 get_zlib() {
100 test -d $BASEDIR/zlib && return
102 cd $TEMPDIR
103 $HTTP_FETCH https://sourceforge.net/projects/libpng/files/zlib/$ZLIB_VERSION/$ZLIB.tar.gz
104 cd $BASEDIR
106 gzip -dc $TEMPDIR/$ZLIB.tar.gz | tar -xf -
108 mv $ZLIB zlib
111 get_sqlite() {
112 test -d $BASEDIR/sqlite-amalgamation && return
114 cd $TEMPDIR
115 $HTTP_FETCH https://www.sqlite.org/$SQLITE_VERSION_REL_YEAR/$SQLITE.zip
116 cd $BASEDIR
118 unzip -q $TEMPDIR/$SQLITE.zip
120 mv $SQLITE sqlite-amalgamation
124 # main()
125 get_deps() {
126 mkdir -p $TEMPDIR
128 for i in zlib serf sqlite-amalgamation apr apr-util; do
129 if [ -d $i ]; then
130 echo "Local directory '$i' already exists; the downloaded copy won't be used" >&2
132 done
134 if [ $# -gt 0 ]; then
135 for target in "$@"; do
136 if [ "$target" != "deps" ]; then
137 get_$target || usage
138 else
139 usage
141 done
142 else
143 get_apr
144 get_serf
145 get_zlib
146 get_sqlite
148 echo
149 echo "If you require mod_dav_svn, the recommended version of httpd is:"
150 echo " $APACHE_MIRROR/httpd/$HTTPD.tar.bz2"
152 echo
153 echo "If you require apr-iconv, its recommended version is:"
154 echo " $APACHE_MIRROR/apr/$APR_ICONV.tar.bz2"
157 rm -rf $TEMPDIR
160 get_deps "$@"