[geos-devel] GEOS-3.0.0rc1 in a week, SWIG status ?

Michael Fuhr mike at fuhr.org
Thu Jul 6 16:00:55 EDT 2006

On Thu, Jul 06, 2006 at 07:55:46AM -0600, Michael Fuhr wrote:
> I'm still having a few problems on Solaris 9/sparc, though.  During
> the build I see a lot of the following warnings:
> warning: #warning "Could not find 64bit integer definition!"
> warning: right shift count >= width of type
> I'm also getting some test failures; see the attached file.

The problem finding a 64-bit integer type is due to an inability
to compile the PGAC_TYPE_64BIT_INT conftest program.  That program
includes <stdint.h>, which doesn't exist on Solaris 9, so the compile
fails, causing the test to fail for all candidate types.  I removed
<stdint.h> from the test program; configure then found a 64-bit type:

checking whether int64_t is 64 bits... no
checking whether long int is 64 bits... no
checking whether long long int is 64 bits... yes

The PGAC_TYPE_64BIT_INT definition in acsite.m4 appears to be
borrowed from PostgreSQL, although current releases of PostgreSQL
have slightly different code.  I've attached the latest definition as
found in config/c-compiler.m4 in the 8.1.4 source code.  I replaced
the GEOS acsite.m4 with this file; the build then succeeded and all
tests passed.

Michael Fuhr
-------------- next part --------------
# -------------------------
# Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to
# yes or no respectively, and define HAVE_TYPE_64 if yes.
[define([Ac_define], [translit([have_$1_64], [a-z *], [A-Z_P])])dnl
define([Ac_cachevar], [translit([pgac_cv_type_$1_64], [ *], [_p])])dnl
AC_CACHE_CHECK([whether $1 is 64 bits], [Ac_cachevar],
[typedef $1 ac_int64;

 * These are globals to discourage the compiler from folding all the
 * arithmetic tests down to compile-time constants.
ac_int64 a = 20000001;
ac_int64 b = 40000005;

int does_int64_work()
  ac_int64 c,d;

  if (sizeof(ac_int64) != 8)
    return 0;			/* definitely not the right size */

  /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
  c = a * b;
  d = (c + b) / b;
  if (d != a+1)
    return 0;
  return 1;
main() {
  exit(! does_int64_work());
[# If cross-compiling, check the size reported by the compiler and
# trust that the arithmetic works.

if test x"$Ac_cachevar" = xyes ; then
  AC_DEFINE(Ac_define,, [Define to 1 if `]$1[' works and is 64 bits.])

More information about the geos-devel mailing list