Re: Severe regression in autoconf 2.61 - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Severe regression in autoconf 2.61
Date
Msg-id 200802190116.m1J1GcZ28086@momjian.us
Whole thread Raw
In response to Severe regression in autoconf 2.61  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Severe regression in autoconf 2.61  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> There seems to have been a bit of a brain cramp upstream :-(.
> Previously, AC_FUNC_FSEEKO did this to test if fseeko was available:
> 
>     return !fseeko;
> 
> Now it does this:
> 
>     return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
> 
> Unfortunately, that gives the compiler enough of a syntactic clue
> to guess that fseeko is probably an undeclared function, and therefore
> *it will not error out*, only generate a warning, if it's not seen
> a declaration for fseeko.
> 
> The proximate result of this in our HEAD is that configure fails to
> detect that _LARGEFILE_SOURCE is needed, resulting in a rather broken
> build on platforms where that really is needed.  I had mis-blamed this
> on Bruce's recent NetBSD/BSDi hack, but I think it's been there since
> we installed 2.61 autoconf.  I suspect that in fact the problem Bruce
> was seeing was due to this very bug, and that what we need to do is
> revert his BSD-specific patch and find a different solution.

I am not sure this explains the BSD case.  NetBSD/BSDi uses
fsetpos/fgetpos to implement fseeko/ftello.

What I found with autoconf 2.59 was that setting ac_cv_func_fseeko=yes
was enough so AC_FUNC_FSEEKO thought fseeko exists.  What I am finding
now is that the AC_FUNC_FSEEKO macro doesn't use ac_cv_func_fseeko in
the same way and I have to force HAVE_FSEEKO to 1, while in previous
versions of autoconf this was done for me.

The change that is causing me problems I think is:
if test $ac_cv_func_fseeko = yes; then  AC_DEFINE(HAVE_FSEEKO, 1,    [Define to 1 if fseeko (and presumably ftello)
existsand is declared.])fi
 

changed to:
if test $ac_cv_sys_largefile_source != unknown; then  AC_DEFINE(HAVE_FSEEKO, 1,    [Define to 1 if fseeko (and
presumablyftello) exists and is declared.])fi
 

I don't really understand why ac_cv_sys_largefile_source is now being
tested.

I put back the patch now that you are saying it isn't based on the BSD*
fix.

Once you find a more general fix I will test the BSD* cases again.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://postgres.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: "Stephen Denne"
Date:
Subject: Re: Ad Hoc Indexes
Next
From: Justin
Date:
Subject: Re: Ad Hoc Indexes