* HAVE_TIMEZONE and cygwin
@ 2002-05-01 21:21 Billinghurst, David (CRTS)
2002-05-02 13:34 ` Anthony Green
0 siblings, 1 reply; 7+ messages in thread
From: Billinghurst, David (CRTS) @ 2002-05-01 21:21 UTC (permalink / raw)
To: java
The cygwin patch for natSystem.cc
(http://gcc.gnu.org/ml/java-patches/2002-q2/msg00252.html)
probably should read something like
#elif HAVE_UNDERSCORE_TIMEZONE
tzoffset = _timezone;
#elif HAVE_TIMEZONE
// timezone is secs WEST of UTC.
tzoffset = timezone;
#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
a test something like
AC_TRY_COMPILE([#include <time.h>], [long z2 = _timezone;],
[AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])])
and preferably get the existing test
AC_TRY_COMPILE([#include <time.h>], [long z2 = timezone;],
[AC_DEFINE(HAVE_TIMEZONE)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])])
to fail for the cygwin <time.h> which has
char *_EXFUN(timezone, (void));
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: HAVE_TIMEZONE and cygwin
2002-05-01 21:21 HAVE_TIMEZONE and cygwin Billinghurst, David (CRTS)
@ 2002-05-02 13:34 ` Anthony Green
2002-05-03 8:54 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Anthony Green @ 2002-05-02 13:34 UTC (permalink / raw)
To: Billinghurst, David (CRTS); +Cc: java
On Wed, 2002-05-01 at 21:17, Billinghurst, David (CRTS) wrote:
> #elif HAVE_UNDERSCORE_TIMEZONE
> tzoffset = _timezone;
Looking at other uses of HAVE_*, this should probably be HAVE__TIMEZONE.
Just a minor nit I suppose...
Thanks,
AG
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: HAVE_TIMEZONE and cygwin
2002-05-02 13:34 ` Anthony Green
@ 2002-05-03 8:54 ` Tom Tromey
0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2002-05-03 8:54 UTC (permalink / raw)
To: Anthony Green; +Cc: Billinghurst, David (CRTS), java
>>>>> "Anthony" == Anthony Green <green@redhat.com> writes:
Anthony> Looking at other uses of HAVE_*, this should probably be
Anthony> HAVE__TIMEZONE.
Yeah. I'm going to leave it as HAVE_UNDERSCORE_TIMEZONE, though. The
`__'-vs-`_' seems a bit obscure.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: HAVE_TIMEZONE and cygwin
@ 2002-05-02 16:12 Billinghurst, David (CRTS)
0 siblings, 0 replies; 7+ messages in thread
From: Billinghurst, David (CRTS) @ 2002-05-02 16:12 UTC (permalink / raw)
To: tromey; +Cc: java
Thanks.
-----Original Message-----
From: Tom Tromey [mailto:tromey@redhat.com]
Sent: Friday, 3 May 2002 4:18
To: Billinghurst, David (CRTS)
Cc: java@gcc.gnu.org
Subject: Re: HAVE_TIMEZONE and cygwin
>>>>> "David" == Billinghurst, David (CRTS) <David.Billinghurst@riotinto.com> writes:
David> Here is an untested patch for configure.in (trunk). I have
David> autoconf version problems, so this will have to do at present.
David> The code fragments do the right thing.
Thanks. I'm testing this on my Linux box (not that great, but at
least we'll know it doesn't hurt other platforms). It does look ok.
I needed to update acconfig.h too.
If it all works out I'll check it in.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: HAVE_TIMEZONE and cygwin
2002-05-01 22:29 Billinghurst, David (CRTS)
2002-05-02 1:07 ` Jerome Marc
@ 2002-05-02 11:09 ` Tom Tromey
1 sibling, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2002-05-02 11:09 UTC (permalink / raw)
To: Billinghurst, David (CRTS); +Cc: java
>>>>> "David" == Billinghurst, David (CRTS) <David.Billinghurst@riotinto.com> writes:
David> Here is an untested patch for configure.in (trunk). I have
David> autoconf version problems, so this will have to do at present.
David> The code fragments do the right thing.
Thanks. I'm testing this on my Linux box (not that great, but at
least we'll know it doesn't hurt other platforms). It does look ok.
I needed to update acconfig.h too.
If it all works out I'll check it in.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: HAVE_TIMEZONE and cygwin
2002-05-01 22:29 Billinghurst, David (CRTS)
@ 2002-05-02 1:07 ` Jerome Marc
2002-05-02 11:09 ` Tom Tromey
1 sibling, 0 replies; 7+ messages in thread
From: Jerome Marc @ 2002-05-02 1:07 UTC (permalink / raw)
To: Billinghurst, David (CRTS); +Cc: java
Nice job David. Have to be tested now.
--- "Billinghurst, David (CRTS)"
<David.Billinghurst@riotinto.com> a écrit : > 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 right
> thing.
>
> Compiling this fails
> #include <time.h>
> void i(){long z2 = 2*timezone;}
>
> but this is OK
> #include <time.h>
> long z2 = _timezone;
>
> 2002-05-02 David Billinghurst
> <David.Billinghurst@riotinto.com>
>
> * configure.in: Adjust test for HAVE_TIMEZONE so it
> fails
> on cygwin. Add test HAVE_UNDERSCORE_TIMEZONE.
>
> Index: configure.in
>
===================================================================
> 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 <time.h>], [long z2 =
> timezone;],
> + dnl Don't find the win32 function timezone
> + AC_TRY_COMPILE([#include <time.h>], [void
> i(){long z2 = 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 <time.h>], [long z2
> = _timezone;],
> + [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
> + AC_MSG_RESULT(yes)],
> + [AC_MSG_RESULT(no)])])])
>
> AC_FUNC_ALLOCA
>
> -----Original Message-----
> From: Billinghurst, David (CRTS)
> Sent: Thursday, 2 May 2002 2:18
> 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)
>
> probably should read something like
>
> #elif HAVE_UNDERSCORE_TIMEZONE
> tzoffset = _timezone;
> #elif HAVE_TIMEZONE
> // timezone is secs WEST of UTC.
> tzoffset = timezone;
> #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
> a test something like
>
> AC_TRY_COMPILE([#include <time.h>], [long z2 =
> _timezone;],
> [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
> AC_MSG_RESULT(yes)],
> [AC_MSG_RESULT(no)])])
>
> and preferably get the existing test
>
> AC_TRY_COMPILE([#include <time.h>], [long z2 =
> timezone;],
> [AC_DEFINE(HAVE_TIMEZONE)
> AC_MSG_RESULT(yes)],
> [AC_MSG_RESULT(no)])])
>
> to fail for the cygwin <time.h> which has
> char *_EXFUN(timezone, (void));
>
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: HAVE_TIMEZONE and cygwin
@ 2002-05-01 22:29 Billinghurst, David (CRTS)
2002-05-02 1:07 ` Jerome Marc
2002-05-02 11:09 ` Tom Tromey
0 siblings, 2 replies; 7+ messages in thread
From: Billinghurst, David (CRTS) @ 2002-05-01 22:29 UTC (permalink / raw)
To: java
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 right
thing.
Compiling this fails
#include <time.h>
void i(){long z2 = 2*timezone;}
but this is OK
#include <time.h>
long z2 = _timezone;
2002-05-02 David Billinghurst <David.Billinghurst@riotinto.com>
* configure.in: Adjust test for HAVE_TIMEZONE so it fails
on cygwin. Add test HAVE_UNDERSCORE_TIMEZONE.
Index: configure.in
===================================================================
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 <time.h>], [long z2 = timezone;],
+ dnl Don't find the win32 function timezone
+ AC_TRY_COMPILE([#include <time.h>], [void i(){long z2 = 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 <time.h>], [long z2 = _timezone;],
+ [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])])])
AC_FUNC_ALLOCA
-----Original Message-----
From: Billinghurst, David (CRTS)
Sent: Thursday, 2 May 2002 2:18
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)
probably should read something like
#elif HAVE_UNDERSCORE_TIMEZONE
tzoffset = _timezone;
#elif HAVE_TIMEZONE
// timezone is secs WEST of UTC.
tzoffset = timezone;
#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
a test something like
AC_TRY_COMPILE([#include <time.h>], [long z2 = _timezone;],
[AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])])
and preferably get the existing test
AC_TRY_COMPILE([#include <time.h>], [long z2 = timezone;],
[AC_DEFINE(HAVE_TIMEZONE)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])])
to fail for the cygwin <time.h> which has
char *_EXFUN(timezone, (void));
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-05-03 15:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-01 21:21 HAVE_TIMEZONE and cygwin Billinghurst, David (CRTS)
2002-05-02 13:34 ` Anthony Green
2002-05-03 8:54 ` Tom Tromey
2002-05-01 22:29 Billinghurst, David (CRTS)
2002-05-02 1:07 ` Jerome Marc
2002-05-02 11:09 ` Tom Tromey
2002-05-02 16:12 Billinghurst, David (CRTS)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).