CVSROOT:	/cvsroot
Module name:	pgsql-server
Changes by:	petere@postgresql.org	03/01/28 16:57:12

Modified files:
	.              : configure configure.in 
	config         : c-compiler.m4 c-library.m4 

Log message:
	Factor out the code that detects the long long int snprintf format into a
	separate macro.  Also add support for %I64d which is the way on Windows.
	
	The code that checks for the 64-bit int type now gives more reasonable
	results when cross-compiling: In that case we just take the compiler's
	information and trust that the arithmetic works.  Disabling int64 is too
	pessimistic.


Tue, 28 Jan 2003 16:57:12 -0500 (EST)
petere@postgresql.org (Peter Eisentraut - PostgreSQL)
pgsql-server/ /configure /configure.in onfig/c ...
petere@postgresql.org (Peter Eisentraut - PostgreSQL) writes:
> 	The code that checks for the 64-bit int type now gives more reasonable
> 	results when cross-compiling: In that case we just take the compiler's
> 	information and trust that the arithmetic works.  Disabling int64 is too
> 	pessimistic.

It's not so much that we can't trust the arithmetic as that we shouldn't
trust that the platform's s(n)printf supports int64.  This situation
used to be a reality on older machines with gcc but no int64 type in the
native compiler, and I suspect there are still some of them out there.

I think a reasonable choice in cross-compiling situations would be to
assume int64 works if we have a long long int datatype, but to force use
of our own snprintf rather than trusting to luck with the platform's.

(It didn't look like that's what happens right now, but I might be
missing something in the autoconf spaghetti.)

			regards, tom lane

Tue, 28 Jan 2003 20:50:58 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Testing for int64 (was Re: [COMMITTERS] pgsql-server/ /configure
	/configure.in...)
Tom Lane writes:

> I think a reasonable choice in cross-compiling situations would be to
> assume int64 works if we have a long long int datatype, but to force use
> of our own snprintf rather than trusting to luck with the platform's.

That's approximately what's happening.  Formerly it insisted on doing a
run check to detect the int64 type.  Now it does a compile check when
cross-compiling.

For the snprintf format detection we obviously don't have that chance.  I
just refactored the code a little and added a cache variable so the
advanced cross-compiling user can override the check with known values.

-- 
Peter Eisentraut   peter_e@gmx.net


Wed, 29 Jan 2003 18:59:30 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: Testing for int64 (was Re: [COMMITTERS] pgsql-server/ /configure