1 |
On 27/03/11 16:50, Mike Frysinger wrote: |
2 |
> On Sun, Mar 27, 2011 at 10:34 AM, justin wrote: |
3 |
>> So I need one last hint, how to correct following correctly? |
4 |
>> |
5 |
>> |
6 |
>> #if defined (HAVE64) && !defined(AJ_MACOSXLF) && !defined(AJ_HPUXLF) && |
7 |
>> !defined(AJ_FreeBSDLF) && !defined(AJ_AIXLF) |
8 |
>> struct dirent64 *dp; |
9 |
>> #else |
10 |
>> struct dirent *dp; |
11 |
>> #endif |
12 |
>> |
13 |
>> #if defined (HAVE64) && !defined(AJ_MACOSXLF) && !defined(AJ_HPUXLF) && |
14 |
>> !defined(AJ_FreeBSDLF) && !defined(AJ_AIXLF) |
15 |
>> struct stat64 sbuf; |
16 |
>> #else |
17 |
>> struct stat sbuf; |
18 |
>> #endif |
19 |
> |
20 |
> neither should be necessary with LFS. if you call |
21 |
> AC_USE_SYSTEM_EXTENSIONS or AC_SYS_LARGEFILE, the system will take |
22 |
> care of translating stat into stat64 as needed. |
23 |
> |
24 |
> but in practice, i guess what they'll want to do is: |
25 |
> - call AC_USE_SYSTEM_EXTENSIONS at top of configure script |
26 |
> - add some AC_TRY_COMPILE's: |
27 |
> AC_CACHE_CHECK([for stat64], ac_cv_struct_stat64, |
28 |
> [AC_TRY_COMPILE([#include <sys/stat.h>], |
29 |
> [struct stat64 st], |
30 |
> ac_cv_struct_stat64=yes, ac_cv_struct_stat64=no)]) |
31 |
> if test "x$ac_cv_struct_stat64" = xyes; then |
32 |
> AC_DEFINE(HAVE_STRUCT_STAT64) |
33 |
> fi |
34 |
> - change the code to look at HAVE_STRUCT_STAT64 instead of random |
35 |
> system defines |
36 |
> |
37 |
> (largely untested :P) |
38 |
> -mike |
39 |
> |
40 |
|
41 |
Thanks Mike, |
42 |
|
43 |
compiletime and runtime tests are fine. I really owe you one! |