summaryrefslogtreecommitdiff
path: root/xdelta3/run_release.sh
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/run_release.sh')
-rwxr-xr-xxdelta3/run_release.sh73
1 files changed, 45 insertions, 28 deletions
diff --git a/xdelta3/run_release.sh b/xdelta3/run_release.sh
index 1b9dc8c..f38c44d 100755
--- a/xdelta3/run_release.sh
+++ b/xdelta3/run_release.sh
@@ -12,8 +12,8 @@ MAKEFLAGS="-j 10"
12BUILDDIR=${SRCDIR}/build 12BUILDDIR=${SRCDIR}/build
13LZMASRC=${BUILDDIR}/${LZMA} 13LZMASRC=${BUILDDIR}/${LZMA}
14 14
15MINGW_CFLAGS="-DEXTERNAL_COMPRESSION=0 -DVCDIFF_TOOLS=0" 15NONWIN_CFLAGS=""
16MINGW_CFLAGS="${MINGW_CFLAGS} -DXD3_WIN32=1 -DSHELL_TESTS=0" 16MINGW_CFLAGS="-DEXTERNAL_COMPRESSION=0 -DXD3_WIN32=1 -DSHELL_TESTS=0"
17 17
18MYOS=`uname` 18MYOS=`uname`
19DATE=`date` 19DATE=`date`
@@ -40,15 +40,15 @@ if [ "${TMPDIR}" != "" ]; then
40 XTMP="${TMPDIR}" 40 XTMP="${TMPDIR}"
41fi 41fi
42 42
43find build -type f 2> /dev/null | xargs rm 43find build -type f 2> /dev/null | xargs rm -f
44 44
45function setup { 45function setup {
46 mkdir -p ${BUILDDIR} 46 libtoolize
47 automake --add-missing
47 aclocal -I m4 48 aclocal -I m4
48 autoheader 49 autoheader
49 libtoolize
50 automake 50 automake
51 automake --add-missing 51 autoheader
52 autoconf 52 autoconf
53} 53}
54 54
@@ -57,7 +57,7 @@ function try {
57 shift 57 shift
58 local dir=$1 58 local dir=$1
59 shift 59 shift
60 echo -n " ${w} ..." 60 echo -n " ${w} ... "
61 (cd "${dir}" && "$@" >${w}.stdout 2>${w}.stderr) 61 (cd "${dir}" && "$@" >${w}.stdout 2>${w}.stderr)
62 local s=$? 62 local s=$?
63 if [ ${s} -eq 0 ]; then 63 if [ ${s} -eq 0 ]; then
@@ -91,11 +91,11 @@ function buildlzma {
91 91
92 try build-lzma ${target} make ${MAKEFLAGS} 92 try build-lzma ${target} make ${MAKEFLAGS}
93 if [ $? -ne 0 ]; then 93 if [ $? -ne 0 ]; then
94 return 94 return
95 fi 95 fi
96 try install-lzma ${target} make install 96 try install-lzma ${target} make install
97 if [ $? -ne 0 ]; then 97 if [ $? -ne 0 ]; then
98 return 98 return
99 fi 99 fi
100} 100}
101 101
@@ -105,14 +105,26 @@ function buildit {
105 local usizebits=$3 105 local usizebits=$3
106 local offsetbits=$4 106 local offsetbits=$4
107 local cargs=$5 107 local cargs=$5
108 local largs=$6 108 local afl=$6
109 local BM="${host}${march}" 109 local BM="${host}${march}"
110 local USECC="${CC}"
111 local USECXX="${CXX}"
112 local LIBBM="${BM}"
113
114 if [ "${afl}" = "1" ]; then
115 USECC="afl-gcc"
116 USECXX="afl-g++"
117 BM="${BM}-afl"
118 fi
119
110 local D="build/${BM}/usize${usizebits}/xoff${offsetbits}" 120 local D="build/${BM}/usize${usizebits}/xoff${offsetbits}"
111 local BMD="${BM}-${usizebits}-${offsetbits}" 121 local BMD="${BM}-${usizebits}-${offsetbits}"
122
112 local FULLD="${SRCDIR}/${D}" 123 local FULLD="${SRCDIR}/${D}"
113 local CFLAGS="${march} ${cargs} -g -I${SRCDIR}/build/lib-${BM}/include" 124 local CFLAGS="${march} ${cargs} -I${SRCDIR}/build/lib-${LIBBM}/include"
114 local CXXFLAGS="${march} ${cargs} -g -I${SRCDIR}/build/lib-${BM}/include" 125 local CXXFLAGS="${march} ${cargs} -I${SRCDIR}/build/lib-${LIBBM}/include"
115 local LDFLAGS="${largs} ${march} -L${SRCDIR}/build/lib-${BM}/lib" 126 local LDFLAGS="${march} -L${SRCDIR}/build/lib-${LIBBM}/lib"
127
116 mkdir -p ${D} 128 mkdir -p ${D}
117 129
118 echo " ... ${BMD}" 130 echo " ... ${BMD}"
@@ -123,7 +135,7 @@ function buildit {
123# ${CFLAGS} 135# ${CFLAGS}
124.PHONY: build-${BMD} 136.PHONY: build-${BMD}
125build-${BMD}: 137build-${BMD}:
126 (cd ${D} && make all) 138 (cd ${D} && make all && make install)
127 139
128.PHONY: clean-${BMD} 140.PHONY: clean-${BMD}
129clean-${BMD}: 141clean-${BMD}:
@@ -167,22 +179,24 @@ EOF
167 --enable-debug-symbols \ 179 --enable-debug-symbols \
168 "CFLAGS=${CFLAGS}" \ 180 "CFLAGS=${CFLAGS}" \
169 "CXXFLAGS=${CXXFLAGS}" \ 181 "CXXFLAGS=${CXXFLAGS}" \
170 "LDFLAGS=${LDFLAGS}" 182 "LDFLAGS=${LDFLAGS}" \
183 "CC=${USECC}" \
184 "CXX=${USECXX}"
171 if [ $? -ne 0 ]; then 185 if [ $? -ne 0 ]; then
172 return 186 return
173 fi 187 fi
174 188
175 try build-xdelta ${FULLD} make ${MAKEFLAGS} all 189 # try build-xdelta ${FULLD} make ${MAKEFLAGS} all
176 if [ $? -ne 0 ]; then 190 # if [ $? -ne 0 ]; then
177 return 191 # return
178 fi 192 # fi
179 193
180 try install-xdelta ${FULLD} make install 194 # try install-xdelta ${FULLD} make install
181} 195}
182 196
183function buildall { 197function buildall {
184 echo "" 198 echo ""
185 echo "Host $1$2" 199 echo "Host $1$2 afl=$4"
186 echo "" 200 echo ""
187 201
188 buildlzma "$1" "$2" 202 buildlzma "$1" "$2"
@@ -202,28 +216,31 @@ cat > Makefile.test <<EOF
202# Auto-generated ${DATE} -*- Mode: Makefile -*- 216# Auto-generated ${DATE} -*- Mode: Makefile -*-
203TMP = ${XTMP} 217TMP = ${XTMP}
204 218
219all: linux windows apple
220
205EOF 221EOF
206 222
207# Native compiles 223# Native compiles
208if [ "${MYOS}" == "Linux" ]; then 224if [ "${MYOS}" == "Linux" ]; then
209 # Linux 225 # Linux
210 buildall x86_64-pc-linux-gnu -m32 226 buildall x86_64-pc-linux-gnu -m32 "${NONWIN_CFLAGS}" "0"
211 buildall x86_64-pc-linux-gnu -m64 227 buildall x86_64-pc-linux-gnu -m32 "${NONWIN_CFLAGS}" "1"
228 buildall x86_64-pc-linux-gnu -m64 "${NONWIN_CFLAGS}" "0"
229 buildall x86_64-pc-linux-gnu -m64 "${NONWIN_CFLAGS}" "1"
212fi 230fi
213 231
214if [ "${MYOS}" == "Darwin" ]; then 232if [ "${MYOS}" == "Darwin" ]; then
215 # OS X 233 # OS X
216 buildall x86_64-apple-darwin -m32 234 buildall x86_64-apple-darwin -m32 "${NONWIN_CFLAGS}" "0"
217 buildall x86_64-apple-darwin -m64 235 buildall x86_64-apple-darwin -m64 "${NONWIN_CFLAGS}" "0"
218fi 236fi
219 237
220# Cross compile 238# Cross compile
221buildall i686-w64-mingw32 -mconsole "${MINGW_CFLAGS}" 239buildall i686-w64-mingw32 -mconsole "${MINGW_CFLAGS}" "0"
222buildall x86_64-w64-mingw32 -mconsole "${MINGW_CFLAGS}" 240buildall x86_64-w64-mingw32 -mconsole "${MINGW_CFLAGS}" "0"
223 241
224cat >> Makefile.test <<EOF 242cat >> Makefile.test <<EOF
225 243
226all: linux windows apple
227clean: ${CLEAN} 244clean: ${CLEAN}
228 245
229.PHONY: linux windows apple 246.PHONY: linux windows apple