bug-fileutils
[Top][All Lists]
Advanced

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

autoconf problem with large files on HP-UX?


From: Bob Proulx
Subject: autoconf problem with large files on HP-UX?
Date: Thu, 1 Feb 2001 01:03:36 -0700 (MST)

I have been trying to track down a couple of problems with the new
autoconf in general.  One of them is the large file checking.  It is
broken.  I can't quite figure it out.  This is on HP-UX.

fileutils-4.0.37:
./configure
[...]
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no

config.h:
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */

Huh?  Something is not right here.  That should be defined to be 64.
It looks to me like autoconf is not getting this right and large files
are not getting set up.  I went back to an older 4.0.27 and this is
what it used to say there.

fileutils-4.0.27:
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... 1
checking for _LARGE_FILES value needed for large files... no
checking for _XOPEN_SOURCE value needed for large files... no

config.h:
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */

/* Define to make ftello visible on some hosts (e.g. HP-UX 10.20). */
#define _LARGEFILE_SOURCE 1

That does not look completely right either.  It certainly is
different.  But perhaps it worked out somehow.  I crawled through the
system headers and on first pass it looks like _LARGEFILE_SOURCE is
only effective if _FILE_OFFSET_BITS is set too.  I think both
_FILE_OFFSET_BITS=64 and _LARGEFILE_SOURCE are needed.  Here is what
the docs (/usr/share/doc/lg_file.txt) say about these macros:

: _LARGEFILE_SOURCE
: 
: This compile option provides two new interfaces, ftello() and
: fseeko(), to the developer. ftello() and fseeko() will behave just as
: ftell() and fseek() except, ftello() will return an off_t instead of a
: long int and fseeko() will take an off_t as it's second parameter
: instead of a long int.

This only makes the 'o' versions available.  I checked the headers and
that is only if _FILE_OFFSET_BITS was previously defined to be 64.  So
this should not be enough just by itself.  you need
_FILE_OFFSET_BITS=64 and you need _LARGEFILE_SOURCE.

: _FILE_OFFSET_BITS
: 
: This compile option will specify what type of compile environment the
: developer will use. If the compile option is set to 64, then various
: data types, structures, and interfaces will be changed to their 64-bit
: equivalents. If the compile option is set to 32, then these items will
: be set to 32-bits (32 bits is the default).This compile option is used
: as _FILE_OFFSET_BITS=32 or _FILE_OFFSET_BITS=64.

I have always used the define _FILE_OFFSET_BITS=64 to enable large
files.  This is the one we want.  I think the test needs to test for
_FILE_OFFSET_BITS=64 first and then if _LARGEFILE_SOURCE second
because it has no effect if _FILE_OFFSET_BITS is not 64.

If I force _FILE_OFFSET_BITS=64 as part of CFLAGS when I configure
then everything works and I can access large files again.

Here is a snippet from the config.log file.  I don't see the define
happening and so of course it fails.

configure:2233: checking for _FILE_OFFSET_BITS value needed for large files
configure:2254: cc -c -g  conftest.c >&5
cc: "configure", line 2244: warning 602: Integer constant exceeds its storage.
cc: "configure", line 2244: warning 602: Integer constant exceeds its storage.
configure:2288: result: no

I was sure this used to work with the included largefile.m4 but the
built in one in autoconf-2.49c appears broken.  I don't have the brain
cells left tonight to dig into that part of it to figure that out.
Tag, you are it.

Bob



reply via email to

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