More portability.
- The location of openssl development files got customizable. - The location of iconv development files got customizable. - Pass $TAR down to t5000 test so that the user can override with 'gmake TAR=gtar'. - Solaris 'bc' does not seem to grok "define abs()". There is no reason to use bc there -- expr would do. Signed-off-by: Junio C Hamano <junio@twinsun.com>
Junio C Hamano committed
Sep 30, 2005 at 13:31 UTC
455a7f3275d264f6e66045b92c83747ec461dda5
4 files changed
+34
-22
Makefile
+17
-3
@@ -200,18 +200,32 @@ endif
200
ifndef NO_OPENSSL
201
LIB_OBJS += epoch.o
202
OPENSSL_LIBSSL = -lssl
203
+ ifdef OPENSSLDIR
204
+ # Again this may be problematic -- gcc does not always want -R.
205
+ CFLAGS += -I$(OPENSSLDIR)/include
206
+ OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib
207
+ else
208
+ OPENSSL_LINK =
209
+ endif
210
else
211
DEFINES += '-DNO_OPENSSL'
212
MOZILLA_SHA1 = 1
213
OPENSSL_LIBSSL =
214
endif
215
ifdef NEEDS_SSL_WITH_CRYPTO
209
- LIB_4_CRYPTO = -lcrypto -lssl
216
+ LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
217
else
211
- LIB_4_CRYPTO = -lcrypto
218
+ LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
219
endif
220
ifdef NEEDS_LIBICONV
214
- LIB_4_ICONV = -liconv
221
+ ifdef ICONVDIR
222
+ # Again this may be problematic -- gcc does not always want -R.
223
+ CFLAGS += -I$(ICONVDIR)/include
224
+ ICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib
225
+ else
226
+ ICONV_LINK =
227
+ endif
228
+ LIB_4_ICONV = $(ICONV_LINK) -liconv
229
else
230
LIB_4_ICONV =
231
endif
t/Makefile
+1
@@ -5,6 +5,7 @@
5
6
#GIT_TEST_OPTS=--verbose --debug
7
SHELL_PATH ?= $(SHELL)
8
+TAR ?= $(TAR)
9
10
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
11
t/t5000-tar-tree.sh
+3
-3
@@ -50,7 +50,7 @@ test_expect_success \
50
51
test_expect_success \
52
'validate file modification time' \
53
- 'TZ=GMT tar tvf b.tar a/a |
53
+ 'TZ=GMT $TAR tvf b.tar a/a |
54
awk \{print\ \$4,\ \(length\(\$5\)\<7\)\ ?\ \$5\":00\"\ :\ \$5\} \
55
>b.mtime &&
56
echo "2005-05-27 22:00:00" >expected.mtime &&
@@ -63,7 +63,7 @@ test_expect_success \
63
64
test_expect_success \
65
'extract tar archive' \
66
- '(cd b && tar xf -) <b.tar'
66
+ '(cd b && $TAR xf -) <b.tar'
67
68
test_expect_success \
69
'validate filenames' \
@@ -80,7 +80,7 @@ test_expect_success \
80
81
test_expect_success \
82
'extract tar archive with prefix' \
83
- '(cd c && tar xf -) <c.tar'
83
+ '(cd c && $TAR xf -) <c.tar'
84
85
test_expect_success \
86
'validate filenames with prefix' \
t/t6002-rev-list-bisect.sh
+13
-16
@@ -7,20 +7,6 @@ test_description='Tests git-rev-list --bisect functionality'
7
. ./test-lib.sh
8
. ../t6000lib.sh # t6xxx specific functions
9
10
-bc_expr()
11
-{
12
-bc <<EOF
13
-scale=1
14
-define abs(x) {
15
- if (x>=0) { return (x); } else { return (-x); }
16
-}
17
-define floor(x) {
18
- save=scale; scale=0; result=x/1; scale=save; return (result);
19
-}
20
-$*
21
-EOF
22
-}
23
-
10
# usage: test_bisection max-diff bisect-option head ^prune...
11
#
12
# e.g. test_bisection 1 --bisect l1 ^l0
@@ -35,8 +21,19 @@ test_bisection_diff()
21
_head=$1
22
shift 1
23
_bisection_size=$(git-rev-list $_bisection "$@" | wc -l)
38
- [ -n "$_list_size" -a -n "$_bisection_size" ] || error "test_bisection_diff failed"
39
- test_expect_success "bisection diff $_bisect_option $_head $* <= $_max_diff" "[ $(bc_expr "floor(abs($_list_size/2)-$_bisection_size)") -le $_max_diff ]"
24
+ [ -n "$_list_size" -a -n "$_bisection_size" ] ||
25
+ error "test_bisection_diff failed"
26
+
27
+ # Test if bisection size is close to half of list size within
28
+ # tolerance.
29
+ #
30
+ _bisect_err=`expr $_list_size - $_bisection_size \* 2`
31
+ test "$_bisect_err" -lt 0 && _bisect_err=`expr 0 - $_bisect_err`
32
+ _bisect_err=`expr $_bisect_err / 2` ; # floor
33
+
34
+ test_expect_success \
35
+ "bisection diff $_bisect_option $_head $* <= $_max_diff" \
36
+ 'test $_bisect_err -le $_max_diff'
37
}
38
39
date >path0