| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Licensed to the Apache Software Foundation (ASF) under one |
| 4 |
# or more contributor license agreements. See the NOTICE file |
| 5 |
# distributed with this work for additional information |
| 6 |
# regarding copyright ownership. The ASF licenses this file |
| 7 |
# to you under the Apache License, Version 2.0 (the |
| 8 |
# "License"); you may not use this file except in compliance |
| 9 |
# with the License. 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, |
| 14 |
# software distributed under the License is distributed on an |
| 15 |
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 |
# KIND, either express or implied. See the License for the |
| 17 |
# specific language governing permissions and limitations |
| 18 |
# under the License. |
| 19 |
|
| 20 |
set -e |
| 21 |
set -x |
| 22 |
|
| 23 |
scripts=$(cd $(dirname "$0") && pwd) |
| 24 |
|
| 25 |
. ${scripts}/setenv.sh |
| 26 |
|
| 27 |
${scripts}/mkramdisk.sh ${volume_name} ${ramconf} |
| 28 |
|
| 29 |
# These are the default APR and Serf config options |
| 30 |
serfconfig=" --with-serf=${SVNBB_SERF} --with-apxs=/usr/local/opt/httpd/bin/apxs" |
| 31 |
|
| 32 |
# An optional parameter tells build scripts which version of APR to use |
| 33 |
if [ ! -z "$1" ]; then |
| 34 |
aprdir=$(eval 'echo $SVNBB_'"$1") |
| 35 |
else |
| 36 |
aprconfig="--with-apr=${SVNBB_APR} --with-apr-util=${SVNBB_APRUTIL}" |
| 37 |
fi |
| 38 |
if [ ! -z "${aprdir}" -a -d "${aprdir}" ]; then |
| 39 |
aprconfig="--with-apr=${aprdir} --with-apr-util=${aprdir}" |
| 40 |
serfconfig=" --without-serf --without-apxs" |
| 41 |
fi |
| 42 |
|
| 43 |
# An optional parameter tells us if this is a warnings-only build. |
| 44 |
# We run the warnings build with a number of additional options. |
| 45 |
if [ "$2" = "warnings" ]; then |
| 46 |
parallel=1 |
| 47 |
maintainer_mode=' -q --enable-maintainer-mode' |
| 48 |
config_cflags="-Wno-deprecated-declarations" |
| 49 |
config_cflags="${config_cflags} -DPACK_AFTER_EVERY_COMMIT" |
| 50 |
config_cflags="${config_cflags} -DSVN_UNALIGNED_ACCESS_IS_OK=0" |
| 51 |
config_cflags="${config_cflags} -DSUFFIX_LINES_TO_KEEP=0" |
| 52 |
config_cflags="${config_cflags} -DSVN_DEPRECATED=" |
| 53 |
else |
| 54 |
parallel=${SVNBB_PARALLEL} |
| 55 |
fi |
| 56 |
|
| 57 |
# An optional parameter tells us if this build should use Python 3. |
| 58 |
if [ "$3" = "python3" ]; then |
| 59 |
test -n "${SVNBB_PYTHON3ENV}" \ |
| 60 |
&& . ${SVNBB_PYTHON3ENV}/bin/activate \ |
| 61 |
&& export PYTHON="$(which python)" |
| 62 |
fi |
| 63 |
|
| 64 |
# |
| 65 |
# Step 0: Create a directory for the test log files |
| 66 |
# |
| 67 |
if [ -d "${abssrc}/.test-logs" ]; then |
| 68 |
rm -fr "${abssrc}/.test-logs" |
| 69 |
fi |
| 70 |
mkdir "${abssrc}/.test-logs" || exit 1 |
| 71 |
|
| 72 |
# |
| 73 |
# Step 1: get the latest and greatest amalgamanted SQLite |
| 74 |
# |
| 75 |
|
| 76 |
echo "============ get-deps.sh sqlite" |
| 77 |
cd ${abssrc} |
| 78 |
rm -fr sqlite-amalgamation |
| 79 |
./get-deps.sh sqlite |
| 80 |
|
| 81 |
# |
| 82 |
# Step 2: Regenerate build scripts |
| 83 |
# |
| 84 |
|
| 85 |
echo "============ autogen.sh" |
| 86 |
cd ${abssrc} |
| 87 |
./autogen.sh |
| 88 |
|
| 89 |
svnminor=$(awk '/define *SVN_VER_MINOR/ { print $3 }' subversion/include/svn_version.h) |
| 90 |
|
| 91 |
# --enable-optimize adds -flto which breaks the 1.8 C tests because |
| 92 |
# they link main() from a library. |
| 93 |
if [ ${svnminor} -gt 8 ]; then |
| 94 |
optimizeconfig=' --enable-optimize' |
| 95 |
fi |
| 96 |
|
| 97 |
if [ ${svnminor} -ge 10 ]; then |
| 98 |
lz4config='--with-lz4=internal' |
| 99 |
utf8proconfig='--with-utf8proc=internal' |
| 100 |
fi |
| 101 |
|
| 102 |
# |
| 103 |
# Step 3: Configure |
| 104 |
# |
| 105 |
|
| 106 |
echo "============ configure" |
| 107 |
cd ${absbld} |
| 108 |
env CC=clang CFLAGS="${config_cflags}" \ |
| 109 |
CXX=clang++ CXXFLAGS="${config_cxxflags}" \ |
| 110 |
LDFLAGS='-Wl,-w' \ |
| 111 |
${abssrc}/configure${maintainer_mode} \ |
| 112 |
--prefix="${absbld}/.install-prefix" \ |
| 113 |
--enable-debug${optimizeconfig} \ |
| 114 |
--disable-nls \ |
| 115 |
--disable-mod-activation \ |
| 116 |
${aprconfig}${serfconfig} \ |
| 117 |
--with-swig="${SVNBB_SWIG}" \ |
| 118 |
--with-berkeley-db=db.h:"${SVNBB_BDB}/include":${SVNBB_BDB}/lib:db \ |
| 119 |
--enable-bdb6 \ |
| 120 |
--enable-javahl \ |
| 121 |
--without-jikes \ |
| 122 |
${lz4config} \ |
| 123 |
${utf8proconfig} \ |
| 124 |
--with-junit="${SVNBB_JUNIT}" |
| 125 |
|
| 126 |
test -f config.log && mv config.log "${abssrc}/.test-logs/config.log" |
| 127 |
|
| 128 |
# |
| 129 |
# Step 4: build |
| 130 |
# |
| 131 |
|
| 132 |
echo "============ make" |
| 133 |
cd ${absbld} |
| 134 |
make -j${parallel} |