summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxdelta3/run_release.sh119
1 files changed, 79 insertions, 40 deletions
diff --git a/xdelta3/run_release.sh b/xdelta3/run_release.sh
index 5b9906b..96cb7a0 100755
--- a/xdelta3/run_release.sh
+++ b/xdelta3/run_release.sh
@@ -13,6 +13,8 @@ export LDFLAGS
13LZMA="xz-5.2.1" 13LZMA="xz-5.2.1"
14LZMA_FILE="/volume/home/jmacd/src/xdelta-devel/xz-5.2.1.tar.xz" 14LZMA_FILE="/volume/home/jmacd/src/xdelta-devel/xz-5.2.1.tar.xz"
15 15
16MAKEFLAGS="-j 10"
17
16MYOS=`uname` 18MYOS=`uname`
17 19
18BUILDDIR=${PWD}/build 20BUILDDIR=${PWD}/build
@@ -31,7 +33,12 @@ MINGW_BASE="/volume/home/jmacd/src/mingwb"
31# Run from the source dir. 33# Run from the source dir.
32SRCDIR=$PWD 34SRCDIR=$PWD
33 35
34rm -rf build/*/*/* 36LINUXTEST1=""
37LINUXTEST2=""
38WINTEST1=""
39WINTEST2=""
40
41find build -type f 2> /dev/null | xargs rm
35 42
36function setup { 43function setup {
37 aclocal -I m4 44 aclocal -I m4
@@ -45,7 +52,7 @@ function try {
45 shift 52 shift
46 local dir=$1 53 local dir=$1
47 shift 54 shift
48 echo -n "Running ${w} in ${dir}" 55 echo -n " ${w} ..."
49 (cd "${dir}" && "$@" >$w.stdout 2>$w.stderr) 56 (cd "${dir}" && "$@" >$w.stdout 2>$w.stderr)
50 local s=$? 57 local s=$?
51 if [ $s -eq 0 ]; then 58 if [ $s -eq 0 ]; then
@@ -57,7 +64,7 @@ function try {
57 return $s 64 return $s
58} 65}
59 66
60try untar-xz ${BUILDDIR} tar -xvf "${LZMA_FILE}" 67try untar-lzma ${BUILDDIR} tar -xvf "${LZMA_FILE}"
61if [ $? -ne 0 ]; then 68if [ $? -ne 0 ]; then
62 return 69 return
63fi 70fi
@@ -67,11 +74,14 @@ function buildlzma {
67 march=$2 74 march=$2
68 local target="${BUILDDIR}/lib-${host}${march}" 75 local target="${BUILDDIR}/lib-${host}${march}"
69 76
77 echo " ... liblzma"
78
70 mkdir -p $target 79 mkdir -p $target
71 80
72 try configure ${target} ${LZMASRC}/configure \ 81 try configure-lzma ${target} ${LZMASRC}/configure \
73 --host=${host} \ 82 --host=${host} \
74 --prefix=${target} \ 83 --prefix=${target} \
84 --disable-shared \
75 "CFLAGS=${march}" \ 85 "CFLAGS=${march}" \
76 "CXXFLAGS=${march}" \ 86 "CXXFLAGS=${march}" \
77 "LDFLAGS=${march}" 87 "LDFLAGS=${march}"
@@ -79,11 +89,11 @@ function buildlzma {
79 return 89 return
80 fi 90 fi
81 91
82 try build-xz ${target} make 92 try build-lzma ${target} make ${MAKEFLAGS}
83 if [ $? -ne 0 ]; then 93 if [ $? -ne 0 ]; then
84 return 94 return
85 fi 95 fi
86 try install-xz ${target} make install 96 try install-lzma ${target} make install
87 if [ $? -ne 0 ]; then 97 if [ $? -ne 0 ]; then
88 return 98 return
89 fi 99 fi
@@ -96,49 +106,64 @@ function buildit {
96 cargs=$4 106 cargs=$4
97 largs=$5 107 largs=$5
98 BM="${host}${march}" 108 BM="${host}${march}"
99 D="build/$BM/xoff${offsetbits}" 109 D="build/${BM}/xoff${offsetbits}"
110 BMD="${BM}-${offsetbits}"
100 FULLD="$PWD/$D" 111 FULLD="$PWD/$D"
101 CFLAGS="${COMMON} ${march} ${cargs} -I${PWD}/build/lib-${BM}/include" 112 CFLAGS="${COMMON} ${march} ${cargs} -I${PWD}/build/lib-${BM}/include"
102 CXXFLAGS="${COMMON} ${march} ${cargs} -I${PWD}/build/lib-${BM}/include" 113 CXXFLAGS="${COMMON} ${march} ${cargs} -I${PWD}/build/lib-${BM}/include"
103 LDFLAGS="${largs} ${march} -L${PWD}/build/lib-${BM}/lib" 114 LDFLAGS="${largs} ${march} -L${PWD}/build/lib-${BM}/lib"
104 #echo CFLAGS=$CFLAGS 115 mkdir -p ${D}
105 #echo CXXFLAGS=$CXXFLAGS 116
106 #echo LDFLAGS=$LDFLAGS 117 echo " ... ${BMD}"
107 mkdir -p $D 118
108 119 cat >> Makefile.test <<EOF
109 echo "For ${BM}-xoff${offsetbits}" 120
110 121# ${BMD}
111 try configure $FULLD $SRCDIR/configure \ 122.PHONY: regtest-${BMD}
112 --host=${host} \ 123regtest-${BMD}:
113 --prefix=${FULLD} \ 124 (cd ${D} && ./xdelta3regtest 1> /tmp/regtest.stdout 2> /tmp/regtest.stderr)
114 --enable-static \ 125
115 --disable-shared \ 126.PHONY: selftest-${BMD}
116 --enable-debug-symbols 127selftest-${BMD}:
128 (cd ${D} && ./bin/xdelta3 test 1> /tmp/selftest.stdout 2> /tmp/selftest.stderr)
129
130
131EOF
132
133 case ${host} in
134 *linux*)
135 LINUXTEST1="${LINUXTEST1} selftest-${BMD}"
136 LINUXTEST2="${LINUXTEST2} regtest-${BMD}"
137 ;;
138 *mingw*)
139 WINTEST1="${WINTEST1} selftest-${BMD}"
140 WINTEST2="${WINTEST2} regtest-${BMD}"
141 ;;
142 esac
143
144 try configure-xdelta $FULLD $SRCDIR/configure \
145 --host=${host} \
146 --prefix=${FULLD} \
147 --enable-static \
148 --disable-shared \
149 --enable-debug-symbols
117 if [ $? -ne 0 ]; then 150 if [ $? -ne 0 ]; then
118 return 151 return
119 fi 152 fi
120 153
121 try build $FULLD make all 154 try build-xdelta $FULLD make ${MAKEFLAGS} all
122 if [ $? -ne 0 ]; then 155 if [ $? -ne 0 ]; then
123 return 156 return
124 fi 157 fi
125 158
126 if echo "$host" | grep -i "$MYOS" >/dev/null; then 159 try install-xdelta $FULLD make install
127 try install $FULLD make install
128 if [ $? -ne 0 ]; then
129 return
130 fi
131
132 (cd $D && ./xdelta3regtest 1> regtest.stdout 2> regtest.stderr&)
133 (cd $D && ./bin/xdelta3 test 1> selftest.stdout 2> selftest.stderr&)
134 else
135 echo "To test:"
136 echo "cd ${FULLD} && ./xdelta3 test"
137 fi
138} 160}
139 161
140function buildall { 162function buildall {
141 echo "Building for $1 $2 ..." 163 echo ""
164 echo "Host $1$2"
165 echo ""
166
142 buildlzma "$1" "$2" 167 buildlzma "$1" "$2"
143 if [ $? -ne 0 ]; then 168 if [ $? -ne 0 ]; then
144 return 169 return
@@ -153,14 +178,28 @@ function buildall {
153 fi 178 fi
154} 179}
155 180
181DATE=`date`
182cat > Makefile.test <<EOF
183# Auto-generated ${DATE} -*- Mode: Makefile -*-
184EOF
185
156# Linux 186# Linux
157buildall x86_64-pc-linux-gnu -m32 187buildall x86_64-pc-linux-gnu -m32
158buildall x86_64-pc-linux-gnu -m64 188buildall x86_64-pc-linux-gnu -m64
159 189
160# Windows 190# Windows
161buildall i686-w64-mingw32 -mconsole \ 191buildall i686-w64-mingw32 -mconsole "${MINGW_CFLAGS}" ""
162 "${MINGW_CFLAGS}" \ 192buildall x86_64-w64-mingw32 -mconsole "${MINGW_CFLAGS}" ""
163 "-L${MINGW_BASE}/mingw-w64-i686/lib ${MINGW_LDFLAGS}" 193
164buildall x86_64-w64-mingw32 -mconsole \ 194cat >> Makefile.test <<EOF
165 "${MINGW_CFLAGS}" \ 195
166 "-L${MINGW_BASE}/mingw-w64-x86_64/lib ${MINGW_LDFLAGS}" 196linux: linux-selftest linux-regtest
197windows: windows-selftest windows-regtest
198
199linux-selftest: ${LINUXTEST1}
200linux-regtest: ${LINUXTEST2}
201
202windows-selftest: ${WINTEST1}
203windows-regtest: ${WINTEST2}
204
205EOF