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