autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Largefile tests


From: Joerg Schilling
Subject: Re: Largefile tests
Date: Thu, 28 Dec 2000 22:36:22 +0100 (MET)

>From address@hidden Thu Dec 28 22:01:08 2000

>> Date: Thu, 28 Dec 2000 16:26:45 +0100 (MET)
>> From: Joerg Schilling <address@hidden>

>> I propose to ommit the last test:
>> 
>>      AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500, 
>>        ac_cv_sys_xopen_source, 
>>        [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).], 
>>        [#include <stdio.h>], [return !ftello;]) 
>> 
>> and rather tell people with glibc-2.1.3 that they need to upgrade
>> if they like to use large file programs instead.

>I proposed something like that earlier this year, and I hope that it's
>been incorporated into the latest autoconf sources.

>Here is my latest version of largefile.m4, in a format that is
>suitable for autoconf 2.13.  Look for the comment about _XOPEN_SOURCE
>in it; it pretty much echoes what you proposed.

I did it this way and added a test for large file ability at all.
This was needed because I now cannot just check for _LFS_LARGEFILE
as the standard proposes.

AC_DEFUN(AC_SYS_LARGEFILE, 
  [AC_ARG_ENABLE(largefile, 
     [  --disable-largefile     omit support for large files]) 
   if test "$enable_largefile" != no; then 
 
     AC_CACHE_CHECK([for special C compiler options needed for large files], 
       ac_cv_sys_largefile_CC, 
       [ac_cv_sys_largefile_CC=no 
        if test "$GCC" != yes; then 
          # IRIX 6.2 and later do not support large files by default, 
          # so use the C compiler's -n32 option if that helps. 
          AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , , 
            [ac_save_CC="${CC-cc}" 
             CC="$CC -n32" 
             AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , 
               ac_cv_sys_largefile_CC=' -n32') 
             CC="$ac_save_CC"]) 
        fi]) 
     if test "$ac_cv_sys_largefile_CC" != no; then 
       CC="$CC$ac_cv_sys_largefile_CC" 
     fi 
 
     AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, 
       ac_cv_sys_file_offset_bits, 
       [Number of bits in a file offset, on hosts where this is settable.]) 
     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, 
       ac_cv_sys_largefile_source, 
       [Define to make ftello visible on some hosts (e.g. HP-UX 10.20).], 
       [#include <stdio.h>], [return !ftello;]) 
     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, 
       ac_cv_sys_large_files, 
       [Define for large files, on AIX-style hosts.]) 
dnl 
dnl XXX never because glibc-2.1.3 is bad anyway 
dnl 
dnl     AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500, 
dnl       ac_cv_sys_xopen_source, 
dnl       [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).], 
dnl       [#include <stdio.h>], [return !ftello;]) 
 
     AC_CACHE_CHECK([if system supports Large Files at all], ac_cv_largefiles, 
        [AC_TRY_COMPILE([#include <stdio.h> 
#include <sys/types.h>], 
                [ 
int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1]; 
return !ftello;], 
                [ac_cv_largefiles=yes], 
                [ac_cv_largefiles=no])]) 
        if test $ac_cv_largefiles = yes; then 
                AC_DEFINE(HAVE_LARGEFILES) 
        fi 
 
   fi 
  ]) 
Jörg

 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden           (uni)  If you don't have iso-8859-1
       address@hidden           (work) chars I am J"org Schilling
 URL:  http://www.fokus.gmd.de/usr/schilling   ftp://ftp.fokus.gmd.de/pub/unix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]