autoconf
[Top][All Lists]
Advanced

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

Re: Library that needs large file support


From: Guido Draheim
Subject: Re: Library that needs large file support
Date: Sun, 21 Dec 2003 23:49:41 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313



Bob Friesenhahn wrote:
On Sun, 21 Dec 2003, Jeff Sheinberg wrote:


Paul Eggert writes:
> Florian Weimer <address@hidden> writes:
>
> > I'm writing a library that will require large-file support on 32-bit GNU
                                                                  ^^^^^^^^^^
> > platforms (so that off_t and ino_t are 64 bits wide, otherwise data
> > structure layout would change).  What is the canonical way to enforce
> > this?
>
> AC_SYS_LARGEFILE

What about largefile support on a non-GNU system?

largefile support is _required_ according to unix98 specification (sus2),
you will find it in all system claiming unix-compatibility.



Posix uses various "getconf" calls for compilation flags, library
flags, and linking flags.  The values returned from the various

forget about `getconf`, quick! ;-)=)



While it is true that Posix compliant systems should support
"getconf", some systems do not.  Regardless, my experience
with AC_SYS_LARGEFILE on real-world systems is that it does produce
the correct results.

The LFS standard specifies a set of -Defines that the system headers
_will_ always react to. This is not just `from experience`, it is
real paper standard in the unix98 documents. The macro AC_SYS_LARGEFILE
will append these -Defines *if* it does notice them to have an effect
on your platform. The standard way is "-D_FILE_OFFSET_BITS=64", and the
macro checks also for a predecessor def used on AIX before LFS came about.
This _will_ shift the off_t into a 64bit entity and reroute some calls
to their *64 variants.


My configure script needs to have access to the values that
AC_SYS_LARGEFILE sets since including config.h is not sufficient for
all applications.  Sometimes the options *must* be specified on the
compiler command line to work.  Therefore I augment AC_SYS_LARGEFILE
as follows in order to define a LFS_CPPFLAGS variable which may be
used within the Makefile:

Can you specify why? I am always interested in additional info that
needs to be put at http://ac-archive.sf.net/largefile/ atleast for
a warning. Some `gcc -include xx`? Some aix magic `-Llib64`?

Anyway, I recommend to _always_ use AC_SYS_LARGEFILE _and_ the special
macro AC_FUNC_FSEEKO together - despite its innocent name, the latter
macro adds again a magic -Define if needed, and that one is again
specified int he LFS paper documents that had been included in the
unix98 spec later on.

cheers,
-- guido                                  http://AC-Archive.sf.net
GCS/E/S/P C++/++++$ ULHS L++w- N++@ s+:a d(+-) r+@>+++ y++ 5++X-





reply via email to

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