diff options
-rwxr-xr-x | xdelta3/run_release.sh | 74 | ||||
-rw-r--r-- | xdelta3/xdelta3-test.h | 4 |
2 files changed, 66 insertions, 12 deletions
diff --git a/xdelta3/run_release.sh b/xdelta3/run_release.sh index 64da774..5b9906b 100755 --- a/xdelta3/run_release.sh +++ b/xdelta3/run_release.sh | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # TODO build liblzma for each host | ||
4 | |||
3 | # Place C/C++ common flags here | 5 | # Place C/C++ common flags here |
4 | COMMON="-g" | 6 | COMMON="-g" |
5 | 7 | ||
@@ -7,8 +9,15 @@ export CFLAGS | |||
7 | export CXXFLAGS | 9 | export CXXFLAGS |
8 | export LDFLAGS | 10 | export LDFLAGS |
9 | 11 | ||
12 | # TODO replace w/ wget | ||
13 | LZMA="xz-5.2.1" | ||
14 | LZMA_FILE="/volume/home/jmacd/src/xdelta-devel/xz-5.2.1.tar.xz" | ||
15 | |||
10 | MYOS=`uname` | 16 | MYOS=`uname` |
11 | 17 | ||
18 | BUILDDIR=${PWD}/build | ||
19 | LZMASRC=${BUILDDIR}/${LZMA} | ||
20 | |||
12 | LIBBASE=$HOME/lib | 21 | LIBBASE=$HOME/lib |
13 | 22 | ||
14 | MINGW_CFLAGS="-DEXTERNAL_COMPRESSION=0 -DVCDIFF_TOOLS=0 -DXD3_WIN32=1 -DSHELL_TESTS=0" | 23 | MINGW_CFLAGS="-DEXTERNAL_COMPRESSION=0 -DVCDIFF_TOOLS=0 -DXD3_WIN32=1 -DSHELL_TESTS=0" |
@@ -34,18 +43,52 @@ function setup { | |||
34 | function try { | 43 | function try { |
35 | local w=$1 | 44 | local w=$1 |
36 | shift | 45 | shift |
37 | echo -n "Running $w in $D ..." | 46 | local dir=$1 |
38 | (cd $FULLD && "$@" >$w.stdout 2>$w.stderr) | 47 | shift |
48 | echo -n "Running ${w} in ${dir}" | ||
49 | (cd "${dir}" && "$@" >$w.stdout 2>$w.stderr) | ||
39 | local s=$? | 50 | local s=$? |
40 | if [ $s -eq 0 ]; then | 51 | if [ $s -eq 0 ]; then |
41 | echo " success" | 52 | echo " success" |
42 | else | 53 | else |
43 | echo " failed!" | 54 | echo " failed!" |
44 | echo "Error $1 in $D" >&2 | 55 | echo "Error $1 in ${dir}" >&2 |
45 | fi | 56 | fi |
46 | return $s | 57 | return $s |
47 | } | 58 | } |
48 | 59 | ||
60 | try untar-xz ${BUILDDIR} tar -xvf "${LZMA_FILE}" | ||
61 | if [ $? -ne 0 ]; then | ||
62 | return | ||
63 | fi | ||
64 | |||
65 | function buildlzma { | ||
66 | host=$1 | ||
67 | march=$2 | ||
68 | local target="${BUILDDIR}/lib-${host}${march}" | ||
69 | |||
70 | mkdir -p $target | ||
71 | |||
72 | try configure ${target} ${LZMASRC}/configure \ | ||
73 | --host=${host} \ | ||
74 | --prefix=${target} \ | ||
75 | "CFLAGS=${march}" \ | ||
76 | "CXXFLAGS=${march}" \ | ||
77 | "LDFLAGS=${march}" | ||
78 | if [ $? -ne 0 ]; then | ||
79 | return | ||
80 | fi | ||
81 | |||
82 | try build-xz ${target} make | ||
83 | if [ $? -ne 0 ]; then | ||
84 | return | ||
85 | fi | ||
86 | try install-xz ${target} make install | ||
87 | if [ $? -ne 0 ]; then | ||
88 | return | ||
89 | fi | ||
90 | } | ||
91 | |||
49 | function buildit { | 92 | function buildit { |
50 | host=$1 | 93 | host=$1 |
51 | march=$2 | 94 | march=$2 |
@@ -55,9 +98,9 @@ function buildit { | |||
55 | BM="${host}${march}" | 98 | BM="${host}${march}" |
56 | D="build/$BM/xoff${offsetbits}" | 99 | D="build/$BM/xoff${offsetbits}" |
57 | FULLD="$PWD/$D" | 100 | FULLD="$PWD/$D" |
58 | CFLAGS="${COMMON} ${march} ${cargs} -I$LIBBASE/$BM/include" | 101 | CFLAGS="${COMMON} ${march} ${cargs} -I${PWD}/build/lib-${BM}/include" |
59 | CXXFLAGS="${COMMON} ${march} ${cargs} -I$LIBBASE/$BM/include" | 102 | CXXFLAGS="${COMMON} ${march} ${cargs} -I${PWD}/build/lib-${BM}/include" |
60 | LDFLAGS="${largs} -L$LIBBASE/$BM/lib" | 103 | LDFLAGS="${largs} ${march} -L${PWD}/build/lib-${BM}/lib" |
61 | #echo CFLAGS=$CFLAGS | 104 | #echo CFLAGS=$CFLAGS |
62 | #echo CXXFLAGS=$CXXFLAGS | 105 | #echo CXXFLAGS=$CXXFLAGS |
63 | #echo LDFLAGS=$LDFLAGS | 106 | #echo LDFLAGS=$LDFLAGS |
@@ -65,9 +108,9 @@ function buildit { | |||
65 | 108 | ||
66 | echo "For ${BM}-xoff${offsetbits}" | 109 | echo "For ${BM}-xoff${offsetbits}" |
67 | 110 | ||
68 | try configure $SRCDIR/configure \ | 111 | try configure $FULLD $SRCDIR/configure \ |
69 | --host=${host} \ | 112 | --host=${host} \ |
70 | --prefix=$FULLD \ | 113 | --prefix=${FULLD} \ |
71 | --enable-static \ | 114 | --enable-static \ |
72 | --disable-shared \ | 115 | --disable-shared \ |
73 | --enable-debug-symbols | 116 | --enable-debug-symbols |
@@ -75,13 +118,13 @@ function buildit { | |||
75 | return | 118 | return |
76 | fi | 119 | fi |
77 | 120 | ||
78 | try build make all | 121 | try build $FULLD make all |
79 | if [ $? -ne 0 ]; then | 122 | if [ $? -ne 0 ]; then |
80 | return | 123 | return |
81 | fi | 124 | fi |
82 | 125 | ||
83 | if echo "$host" | grep -i "$MYOS" >/dev/null; then | 126 | if echo "$host" | grep -i "$MYOS" >/dev/null; then |
84 | try install make install | 127 | try install $FULLD make install |
85 | if [ $? -ne 0 ]; then | 128 | if [ $? -ne 0 ]; then |
86 | return | 129 | return |
87 | fi | 130 | fi |
@@ -95,8 +138,19 @@ function buildit { | |||
95 | } | 138 | } |
96 | 139 | ||
97 | function buildall { | 140 | function buildall { |
141 | echo "Building for $1 $2 ..." | ||
142 | buildlzma "$1" "$2" | ||
143 | if [ $? -ne 0 ]; then | ||
144 | return | ||
145 | fi | ||
98 | buildit "$1" "$2" 32 "-DXD3_USE_LARGEFILE64=0 $3" "$4" | 146 | buildit "$1" "$2" 32 "-DXD3_USE_LARGEFILE64=0 $3" "$4" |
147 | if [ $? -ne 0 ]; then | ||
148 | return | ||
149 | fi | ||
99 | buildit "$1" "$2" 64 "-DXD3_USE_LARGEFILE64=1 $3" "$4" | 150 | buildit "$1" "$2" 64 "-DXD3_USE_LARGEFILE64=1 $3" "$4" |
151 | if [ $? -ne 0 ]; then | ||
152 | return | ||
153 | fi | ||
100 | } | 154 | } |
101 | 155 | ||
102 | # Linux | 156 | # Linux |
diff --git a/xdelta3/xdelta3-test.h b/xdelta3/xdelta3-test.h index 8114820..97330bb 100644 --- a/xdelta3/xdelta3-test.h +++ b/xdelta3/xdelta3-test.h | |||
@@ -1083,9 +1083,9 @@ test_decompress_single_bit_error (xd3_stream *stream, int expected_non_failures) | |||
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | /* Check expected non-failures */ | 1085 | /* Check expected non-failures */ |
1086 | if (non_failures != expected_non_failures) | 1086 | if (non_failures > expected_non_failures) |
1087 | { | 1087 | { |
1088 | XPR(NT "non-failures %u; expected %u", | 1088 | XPR(NT "non-failures %u > expected %u", |
1089 | non_failures, expected_non_failures); | 1089 | non_failures, expected_non_failures); |
1090 | stream->msg = "incorrect"; | 1090 | stream->msg = "incorrect"; |
1091 | return XD3_INTERNAL; | 1091 | return XD3_INTERNAL; |