From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6944 invoked by alias); 2 May 2002 05:29:32 -0000 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org Received: (qmail 6936 invoked from network); 2 May 2002 05:29:31 -0000 Received: from unknown (HELO mail.riotinto.com.au) (57.70.13.254) by sources.redhat.com with SMTP; 2 May 2002 05:29:31 -0000 Received: from corehub1.ex.riotinto.org ([203.3.63.116]) by mail.riotinto.com.au with Microsoft SMTPSVC(5.0.2195.4821); Thu, 2 May 2002 15:27:23 +1000 Received: from tbspmail.corp.riotinto.org ([192.207.121.96]) by corehub1.ex.riotinto.org with Microsoft SMTPSVC(5.0.2195.4821); Thu, 2 May 2002 15:27:07 +1000 Received: from crtsmail.corp.riotinto.org ([203.4.72.10]) by tbspmail.corp.riotinto.org with Microsoft SMTPSVC(5.0.2195.2966); Thu, 2 May 2002 13:27:01 +0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: HAVE_TIMEZONE and cygwin Date: Wed, 01 May 2002 22:29:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Billinghurst, David (CRTS)" To: X-OriginalArrivalTime: 02 May 2002 05:27:01.0151 (UTC) FILETIME=[FC7E4AF0:01C1F199] X-SW-Source: 2002-05/txt/msg00009.txt.bz2 Here is an untested patch for configure.in (trunk). I have autoconf version problems, so this will have to do at present. The code fragments do the ri= ght=20 thing. Compiling this fails #include void i(){long z2 =3D 2*timezone;} but this is OK #include long z2 =3D _timezone; 2002-05-02 David Billinghurst * configure.in: Adjust test for HAVE_TIMEZONE so it fails on cygwin. Add test HAVE_UNDERSCORE_TIMEZONE. Index: configure.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/gcc/gcc/libjava/configure.in,v retrieving revision 1.129 diff -u -r1.129 configure.in --- configure.in 21 Apr 2002 09:37:48 -0000 1.129 +++ configure.in 2 May 2002 05:19:36 -0000 @@ -852,10 +852,17 @@ dnl FIXME: we don't want a link check here because that won't work dnl when cross-compiling. So instead we make an assumption that dnl the header file will mention timezone if it exists. - AC_TRY_COMPILE([#include ], [long z2 =3D timezone;], + dnl Don't find the win32 function timezone + AC_TRY_COMPILE([#include ], [void i(){long z2 =3D 2*timezone;}], [AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)])]) + [AC_MSG_RESULT(no) + AC_MSG_CHECKING([for global _timezone variable]) + dnl FIXME: As above, don't want link check + AC_TRY_COMPILE([#include ], [long z2 =3D _timezone;], + [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)])])]) AC_FUNC_ALLOCA -----Original Message----- From: Billinghurst, David (CRTS)=20 Sent: Thursday, 2 May 2002 2:18=20 To: java@gcc.gnu.org Subject: HAVE_TIMEZONE and cygwin The cygwin patch for natSystem.cc (http://gcc.gnu.org/ml/java-patches/2002-q2/msg00252.html)=20 probably should read something like #elif HAVE_UNDERSCORE_TIMEZONE tzoffset =3D _timezone; #elif HAVE_TIMEZONE // timezone is secs WEST of UTC. tzoffset =3D timezone;=09 #else // FIXME: there must be another global if neither tm_gmtoff nor timezone // is available, esp. if tzname is valid. To do this we need to add to libjava/configure.in=20 a test something like AC_TRY_COMPILE([#include ], [long z2 =3D _timezone;], [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) and preferably get the existing test=20=20=20=20 AC_TRY_COMPILE([#include ], [long z2 =3D timezone;], [AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) to fail for the cygwin which has char *_EXFUN(timezone, (void));