1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## ne_lfs.dpatch by Sebastian Harl <sh@tokkee.org>
3 ##
4 ## DP: Fix the use of neon's built-in large file support on 64bit
5 ## DP: architectures.
7 @DPATCH@
9 diff -uNr a/configure b/configure
10 --- a/configure 2007-01-23 14:57:16.000000000 +0100
11 +++ b/configure 2007-01-23 15:02:39.000000000 +0100
12 @@ -4867,6 +4867,413 @@
16 +echo "$as_me:$LINENO: checking for off_t" >&5
17 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6
18 +if test "${ac_cv_type_off_t+set}" = set; then
19 + echo $ECHO_N "(cached) $ECHO_C" >&6
20 +else
21 + cat >conftest.$ac_ext <<_ACEOF
22 +/* confdefs.h. */
23 +_ACEOF
24 +cat confdefs.h >>conftest.$ac_ext
25 +cat >>conftest.$ac_ext <<_ACEOF
26 +/* end confdefs.h. */
27 +$ac_includes_default
28 +int
29 +main ()
30 +{
31 +if ((off_t *) 0)
32 + return 0;
33 +if (sizeof (off_t))
34 + return 0;
35 + ;
36 + return 0;
37 +}
38 +_ACEOF
39 +rm -f conftest.$ac_objext
40 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
41 + (eval $ac_compile) 2>conftest.er1
42 + ac_status=$?
43 + grep -v '^ *+' conftest.er1 >conftest.err
44 + rm -f conftest.er1
45 + cat conftest.err >&5
46 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
47 + (exit $ac_status); } &&
48 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
49 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
50 + (eval $ac_try) 2>&5
51 + ac_status=$?
52 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
53 + (exit $ac_status); }; } &&
54 + { ac_try='test -s conftest.$ac_objext'
55 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
56 + (eval $ac_try) 2>&5
57 + ac_status=$?
58 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
59 + (exit $ac_status); }; }; then
60 + ac_cv_type_off_t=yes
61 +else
62 + echo "$as_me: failed program was:" >&5
63 +sed 's/^/| /' conftest.$ac_ext >&5
64 +
65 +ac_cv_type_off_t=no
66 +fi
67 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
68 +fi
69 +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
70 +echo "${ECHO_T}$ac_cv_type_off_t" >&6
71 +
72 +echo "$as_me:$LINENO: checking size of off_t" >&5
73 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6
74 +if test "${ac_cv_sizeof_off_t+set}" = set; then
75 + echo $ECHO_N "(cached) $ECHO_C" >&6
76 +else
77 + if test "$ac_cv_type_off_t" = yes; then
78 + # The cast to unsigned long works around a bug in the HP C Compiler
79 + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
80 + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
81 + # This bug is HP SR number 8606223364.
82 + if test "$cross_compiling" = yes; then
83 + # Depending upon the size, compute the lo and hi bounds.
84 +cat >conftest.$ac_ext <<_ACEOF
85 +/* confdefs.h. */
86 +_ACEOF
87 +cat confdefs.h >>conftest.$ac_ext
88 +cat >>conftest.$ac_ext <<_ACEOF
89 +/* end confdefs.h. */
90 +$ac_includes_default
91 +int
92 +main ()
93 +{
94 +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)];
95 +test_array [0] = 0
96 +
97 + ;
98 + return 0;
99 +}
100 +_ACEOF
101 +rm -f conftest.$ac_objext
102 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
103 + (eval $ac_compile) 2>conftest.er1
104 + ac_status=$?
105 + grep -v '^ *+' conftest.er1 >conftest.err
106 + rm -f conftest.er1
107 + cat conftest.err >&5
108 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
109 + (exit $ac_status); } &&
110 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
111 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
112 + (eval $ac_try) 2>&5
113 + ac_status=$?
114 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
115 + (exit $ac_status); }; } &&
116 + { ac_try='test -s conftest.$ac_objext'
117 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
118 + (eval $ac_try) 2>&5
119 + ac_status=$?
120 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
121 + (exit $ac_status); }; }; then
122 + ac_lo=0 ac_mid=0
123 + while :; do
124 + cat >conftest.$ac_ext <<_ACEOF
125 +/* confdefs.h. */
126 +_ACEOF
127 +cat confdefs.h >>conftest.$ac_ext
128 +cat >>conftest.$ac_ext <<_ACEOF
129 +/* end confdefs.h. */
130 +$ac_includes_default
131 +int
132 +main ()
133 +{
134 +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
135 +test_array [0] = 0
136 +
137 + ;
138 + return 0;
139 +}
140 +_ACEOF
141 +rm -f conftest.$ac_objext
142 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
143 + (eval $ac_compile) 2>conftest.er1
144 + ac_status=$?
145 + grep -v '^ *+' conftest.er1 >conftest.err
146 + rm -f conftest.er1
147 + cat conftest.err >&5
148 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
149 + (exit $ac_status); } &&
150 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
151 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
152 + (eval $ac_try) 2>&5
153 + ac_status=$?
154 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
155 + (exit $ac_status); }; } &&
156 + { ac_try='test -s conftest.$ac_objext'
157 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
158 + (eval $ac_try) 2>&5
159 + ac_status=$?
160 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
161 + (exit $ac_status); }; }; then
162 + ac_hi=$ac_mid; break
163 +else
164 + echo "$as_me: failed program was:" >&5
165 +sed 's/^/| /' conftest.$ac_ext >&5
166 +
167 +ac_lo=`expr $ac_mid + 1`
168 + if test $ac_lo -le $ac_mid; then
169 + ac_lo= ac_hi=
170 + break
171 + fi
172 + ac_mid=`expr 2 '*' $ac_mid + 1`
173 +fi
174 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
175 + done
176 +else
177 + echo "$as_me: failed program was:" >&5
178 +sed 's/^/| /' conftest.$ac_ext >&5
179 +
180 +cat >conftest.$ac_ext <<_ACEOF
181 +/* confdefs.h. */
182 +_ACEOF
183 +cat confdefs.h >>conftest.$ac_ext
184 +cat >>conftest.$ac_ext <<_ACEOF
185 +/* end confdefs.h. */
186 +$ac_includes_default
187 +int
188 +main ()
189 +{
190 +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)];
191 +test_array [0] = 0
192 +
193 + ;
194 + return 0;
195 +}
196 +_ACEOF
197 +rm -f conftest.$ac_objext
198 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
199 + (eval $ac_compile) 2>conftest.er1
200 + ac_status=$?
201 + grep -v '^ *+' conftest.er1 >conftest.err
202 + rm -f conftest.er1
203 + cat conftest.err >&5
204 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
205 + (exit $ac_status); } &&
206 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
207 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
208 + (eval $ac_try) 2>&5
209 + ac_status=$?
210 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
211 + (exit $ac_status); }; } &&
212 + { ac_try='test -s conftest.$ac_objext'
213 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
214 + (eval $ac_try) 2>&5
215 + ac_status=$?
216 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
217 + (exit $ac_status); }; }; then
218 + ac_hi=-1 ac_mid=-1
219 + while :; do
220 + cat >conftest.$ac_ext <<_ACEOF
221 +/* confdefs.h. */
222 +_ACEOF
223 +cat confdefs.h >>conftest.$ac_ext
224 +cat >>conftest.$ac_ext <<_ACEOF
225 +/* end confdefs.h. */
226 +$ac_includes_default
227 +int
228 +main ()
229 +{
230 +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)];
231 +test_array [0] = 0
232 +
233 + ;
234 + return 0;
235 +}
236 +_ACEOF
237 +rm -f conftest.$ac_objext
238 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
239 + (eval $ac_compile) 2>conftest.er1
240 + ac_status=$?
241 + grep -v '^ *+' conftest.er1 >conftest.err
242 + rm -f conftest.er1
243 + cat conftest.err >&5
244 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
245 + (exit $ac_status); } &&
246 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
247 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
248 + (eval $ac_try) 2>&5
249 + ac_status=$?
250 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
251 + (exit $ac_status); }; } &&
252 + { ac_try='test -s conftest.$ac_objext'
253 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
254 + (eval $ac_try) 2>&5
255 + ac_status=$?
256 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
257 + (exit $ac_status); }; }; then
258 + ac_lo=$ac_mid; break
259 +else
260 + echo "$as_me: failed program was:" >&5
261 +sed 's/^/| /' conftest.$ac_ext >&5
262 +
263 +ac_hi=`expr '(' $ac_mid ')' - 1`
264 + if test $ac_mid -le $ac_hi; then
265 + ac_lo= ac_hi=
266 + break
267 + fi
268 + ac_mid=`expr 2 '*' $ac_mid`
269 +fi
270 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
271 + done
272 +else
273 + echo "$as_me: failed program was:" >&5
274 +sed 's/^/| /' conftest.$ac_ext >&5
275 +
276 +ac_lo= ac_hi=
277 +fi
278 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
279 +fi
280 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
281 +# Binary search between lo and hi bounds.
282 +while test "x$ac_lo" != "x$ac_hi"; do
283 + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
284 + cat >conftest.$ac_ext <<_ACEOF
285 +/* confdefs.h. */
286 +_ACEOF
287 +cat confdefs.h >>conftest.$ac_ext
288 +cat >>conftest.$ac_ext <<_ACEOF
289 +/* end confdefs.h. */
290 +$ac_includes_default
291 +int
292 +main ()
293 +{
294 +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
295 +test_array [0] = 0
296 +
297 + ;
298 + return 0;
299 +}
300 +_ACEOF
301 +rm -f conftest.$ac_objext
302 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
303 + (eval $ac_compile) 2>conftest.er1
304 + ac_status=$?
305 + grep -v '^ *+' conftest.er1 >conftest.err
306 + rm -f conftest.er1
307 + cat conftest.err >&5
308 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
309 + (exit $ac_status); } &&
310 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
311 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
312 + (eval $ac_try) 2>&5
313 + ac_status=$?
314 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
315 + (exit $ac_status); }; } &&
316 + { ac_try='test -s conftest.$ac_objext'
317 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
318 + (eval $ac_try) 2>&5
319 + ac_status=$?
320 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
321 + (exit $ac_status); }; }; then
322 + ac_hi=$ac_mid
323 +else
324 + echo "$as_me: failed program was:" >&5
325 +sed 's/^/| /' conftest.$ac_ext >&5
326 +
327 +ac_lo=`expr '(' $ac_mid ')' + 1`
328 +fi
329 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
330 +done
331 +case $ac_lo in
332 +?*) ac_cv_sizeof_off_t=$ac_lo;;
333 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
334 +See \`config.log' for more details." >&5
335 +echo "$as_me: error: cannot compute sizeof (off_t), 77
336 +See \`config.log' for more details." >&2;}
337 + { (exit 1); exit 1; }; } ;;
338 +esac
339 +else
340 + if test "$cross_compiling" = yes; then
341 + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
342 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
343 + { (exit 1); exit 1; }; }
344 +else
345 + cat >conftest.$ac_ext <<_ACEOF
346 +/* confdefs.h. */
347 +_ACEOF
348 +cat confdefs.h >>conftest.$ac_ext
349 +cat >>conftest.$ac_ext <<_ACEOF
350 +/* end confdefs.h. */
351 +$ac_includes_default
352 +long longval () { return (long) (sizeof (off_t)); }
353 +unsigned long ulongval () { return (long) (sizeof (off_t)); }
354 +#include <stdio.h>
355 +#include <stdlib.h>
356 +int
357 +main ()
358 +{
359 +
360 + FILE *f = fopen ("conftest.val", "w");
361 + if (! f)
362 + exit (1);
363 + if (((long) (sizeof (off_t))) < 0)
364 + {
365 + long i = longval ();
366 + if (i != ((long) (sizeof (off_t))))
367 + exit (1);
368 + fprintf (f, "%ld\n", i);
369 + }
370 + else
371 + {
372 + unsigned long i = ulongval ();
373 + if (i != ((long) (sizeof (off_t))))
374 + exit (1);
375 + fprintf (f, "%lu\n", i);
376 + }
377 + exit (ferror (f) || fclose (f) != 0);
378 +
379 + ;
380 + return 0;
381 +}
382 +_ACEOF
383 +rm -f conftest$ac_exeext
384 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
385 + (eval $ac_link) 2>&5
386 + ac_status=$?
387 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
388 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
389 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
390 + (eval $ac_try) 2>&5
391 + ac_status=$?
392 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
393 + (exit $ac_status); }; }; then
394 + ac_cv_sizeof_off_t=`cat conftest.val`
395 +else
396 + echo "$as_me: program exited with status $ac_status" >&5
397 +echo "$as_me: failed program was:" >&5
398 +sed 's/^/| /' conftest.$ac_ext >&5
399 +
400 +( exit $ac_status )
401 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
402 +See \`config.log' for more details." >&5
403 +echo "$as_me: error: cannot compute sizeof (off_t), 77
404 +See \`config.log' for more details." >&2;}
405 + { (exit 1); exit 1; }; }
406 +fi
407 +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
408 +fi
409 +fi
410 +rm -f conftest.val
411 +else
412 + ac_cv_sizeof_off_t=0
413 +fi
414 +fi
415 +echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
416 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6
417 +cat >>confdefs.h <<_ACEOF
418 +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
419 +_ACEOF
420 +
421 +
422 +
423 # Checks for library functions.
425 for ac_header in stdlib.h
426 diff -uNr a/configure.ac b/configure.ac
427 --- a/configure.ac 2007-01-23 14:57:16.000000000 +0100
428 +++ b/configure.ac 2007-01-23 15:02:30.000000000 +0100
429 @@ -103,6 +103,8 @@
430 AC_TYPE_SIZE_T
431 AC_STRUCT_ST_BLOCKS
433 +AC_CHECK_SIZEOF(off_t)
434 +
435 # Checks for library functions.
436 AC_FUNC_MALLOC
437 AC_CHECK_FUNCS([ftruncate memset strdup strerror strrchr memchr strchr strcspn])
438 diff -uNr a/src/filecache.c b/src/filecache.c
439 --- a/src/filecache.c 2007-01-23 14:57:16.000000000 +0100
440 +++ b/src/filecache.c 2007-01-23 15:22:53.000000000 +0100
441 @@ -47,6 +47,11 @@
442 #include "fusedav.h"
443 #include "session.h"
445 +#if (SIZEOF_OFF_T >= 8)
446 +# define ne_content_range64 ne_content_range
447 +# define ne_get_range64 ne_get_range
448 +#endif
449 +
450 struct file_info {
451 char *filename;
452 int fd;
453 diff -uNr a/src/fusedav.c b/src/fusedav.c
454 --- a/src/fusedav.c 2007-01-23 14:57:16.000000000 +0100
455 +++ b/src/fusedav.c 2007-01-23 15:20:32.000000000 +0100
456 @@ -1386,8 +1386,11 @@
457 }
459 if (!ne_has_support(NE_FEATURE_SSL) ||
460 - !ne_has_support(NE_FEATURE_TS_SSL) ||
461 - !ne_has_support(NE_FEATURE_LFS)) {
462 + !ne_has_support(NE_FEATURE_TS_SSL)
463 +#if (SIZEOF_OFF_T < 8)
464 + || !ne_has_support(NE_FEATURE_LFS)
465 +#endif
466 + ) {
467 fprintf(stderr, "fusedav requires libneon built with SSL, SSL thread safety and LFS enabled.\n");
468 goto finish;
469 }