
> > configure somehow thinks it needs to #define _LARGE_FILES though, which
> > then clashes with pg_config.h's _LARGE_FILES. I think the test needs to
> > #include unistd.h .
> 
> _LARGE_FILES is defined because it's necessary to make off_t 64 bits.  If
> you disagree, please post compiler output.

Ah, if we want off_t to be 64 bits, then we need _LARGE_FILES.
The problem is, that scan.c includes unistd.h before postgres.h
and thus unistd.h defines _LARGE_FILE_API which is not allowed 
together with _LARGE_FILES. Do you know an answer ?
Offhand I can only think of using -D_LARGE_FILES as a compiler flag :-(

Do we really want a general 64 bit off_t or would it be sufficient in the
two places that use fseeko ?

Andreas

Thu, 26 Sep 2002 12:53:15 +0200
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: AIX compilation problems (was Re: Proposal ...)
Zeugswetter Andreas SB SD writes:

> The problem is, that scan.c includes unistd.h before postgres.h
> and thus unistd.h defines _LARGE_FILE_API which is not allowed
> together with _LARGE_FILES. Do you know an answer ?
> Offhand I can only think of using -D_LARGE_FILES as a compiler flag :-(

That would be pretty tricky to arrange, since the macro that detects all
this is bundled with Autoconf.  Also, it would only fix one particular
manifestation of the overall problem, namely that pg_config.h needs to
come first, period.

I can see two ways to fix this properly:

1. Change the flex call to something like

(echo '#include "postgres.h"'; $(FLEX) -t -o$@) >$@

This would throw off all #line references by one.

2. Direct the flex output to another file, say scan2.c, and create a new
scan.c like this:

#include "postgres.h"
#include "scan2.c"

and create the object file from that.

We have half a dozen flex calls in our tree, so either fix would propagate
a great deal of ugliness around.

> Do we really want a general 64 bit off_t or would it be sufficient in the
> two places that use fseeko ?

It affects all the I/O functions.  If we want to access large files we
need to use the large-file capable function interface.

-- 
Peter Eisentraut   peter_e@gmx.net


Fri, 27 Sep 2002 00:28:18 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: AIX compilation problems (was Re: Proposal ...)
Zeugswetter Andreas SB SD writes:

> The problem is, that scan.c includes unistd.h before postgres.h
> and thus unistd.h defines _LARGE_FILE_API which is not allowed
> together with _LARGE_FILES. Do you know an answer ?

Actually, a better idea I just had is to include scan.c at the end of
gram.c and compile them both into one object file.

-- 
Peter Eisentraut   peter_e@gmx.net


Sat, 28 Sep 2002 13:10:53 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: AIX compilation problems (was Re: Proposal ...)