natSystem.cc (getSystemTimeZone): Use HAVE_UNDERSCORE_TIMEZONE.

2002-05-03  David Billinghurst  <David.Billinghurst@riotinto.com>
	    Tom Tromey  <tromey@redhat.com>

	* java/lang/natSystem.cc (getSystemTimeZone): Use
	HAVE_UNDERSCORE_TIMEZONE.
	* include/config.h.in: Rebuilt.
	* acconfig.h (HAVE_UNDERSCORE_TIMEZONE, HAVE_BACKTRACE): Undef.
	* aclocal.m4, configure: Rebuilt.
	* acinclude.m4: Run AC_EXEEXT.
	* configure.in: Adjust test for `timezone' so it fails on Cygwin.
	Add test for `_timezone'.

Co-Authored-By: Tom Tromey <tromey@redhat.com>

From-SVN: r53117
This commit is contained in:
David Billinghurst 2002-05-03 20:17:48 +00:00 committed by Tom Tromey
parent 5833ab666f
commit 0659e0e3df
8 changed files with 340 additions and 325 deletions

View File

@ -1,3 +1,15 @@
2002-05-03 David Billinghurst <David.Billinghurst@riotinto.com>
Tom Tromey <tromey@redhat.com>
* java/lang/natSystem.cc (getSystemTimeZone): Use
HAVE_UNDERSCORE_TIMEZONE.
* include/config.h.in: Rebuilt.
* acconfig.h (HAVE_UNDERSCORE_TIMEZONE, HAVE_BACKTRACE): Undef.
* aclocal.m4, configure: Rebuilt.
* acinclude.m4: Run AC_EXEEXT.
* configure.in: Adjust test for `timezone' so it fails on Cygwin.
Add test for `_timezone'.
2002-05-03 Alexandre Oliva <aoliva@redhat.com> 2002-05-03 Alexandre Oliva <aoliva@redhat.com>
Suggested by Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> Suggested by Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>

View File

@ -156,3 +156,9 @@
/* Define if you are using JVMPI. */ /* Define if you are using JVMPI. */
#undef ENABLE_JVMPI #undef ENABLE_JVMPI
/* Define if your platform has a working backtrace() function. */
#undef HAVE_BACKTRACE
/* Define if your platform has the global _timezone variable. */
#undef HAVE_UNDERSCORE_TIMEZONE

View File

@ -144,20 +144,7 @@ AC_PROG_INSTALL
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
# We need AC_EXEEXT to keep automake happy in cygnus mode. However, AC_EXEEXT
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we don't execute it, since we don't care about
# the result.
if false; then
# autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
# to nothing, so nothing would remain between `then' and `fi' if it
# were not for the `:' below.
:
AC_EXEEXT
fi
# configure.host sets the following important variables # configure.host sets the following important variables
# libgcj_cflags - host specific C compiler flags # libgcj_cflags - host specific C compiler flags

15
libjava/aclocal.m4 vendored
View File

@ -156,20 +156,7 @@ AC_PROG_INSTALL
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
# We need AC_EXEEXT to keep automake happy in cygnus mode. However, AC_EXEEXT
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we don't execute it, since we don't care about
# the result.
if false; then
# autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
# to nothing, so nothing would remain between `then' and `fi' if it
# were not for the `:' below.
:
AC_EXEEXT
fi
# configure.host sets the following important variables # configure.host sets the following important variables
# libgcj_cflags - host specific C compiler flags # libgcj_cflags - host specific C compiler flags

595
libjava/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -852,10 +852,17 @@ AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
dnl FIXME: we don't want a link check here because that won't work 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 when cross-compiling. So instead we make an assumption that
dnl the header file will mention timezone if it exists. 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_DEFINE(HAVE_TIMEZONE)
AC_MSG_RESULT(yes)], 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 AC_FUNC_ALLOCA

View File

@ -174,12 +174,15 @@
/* Define if you are using JVMPI. */ /* Define if you are using JVMPI. */
#undef ENABLE_JVMPI #undef ENABLE_JVMPI
/* Define if your platform has a working backtrace() function. */
#undef HAVE_BACKTRACE
/* Define if your platform has the global _timezone variable. */
#undef HAVE_UNDERSCORE_TIMEZONE
/* Define if you have the access function. */ /* Define if you have the access function. */
#undef HAVE_ACCESS #undef HAVE_ACCESS
/* Define if you have the backtrace function. */
#undef HAVE_BACKTRACE
/* Define if you have the chmod function. */ /* Define if you have the chmod function. */
#undef HAVE_CHMOD #undef HAVE_CHMOD

View File

@ -250,6 +250,8 @@ java::lang::System::getSystemTimeZone (void)
#ifdef STRUCT_TM_HAS_GMTOFF #ifdef STRUCT_TM_HAS_GMTOFF
// tm_gmtoff is secs EAST of UTC. // tm_gmtoff is secs EAST of UTC.
tzoffset = -(tim->tm_gmtoff) + tim->tm_isdst * 3600L; tzoffset = -(tim->tm_gmtoff) + tim->tm_isdst * 3600L;
#elif HAVE_UNDERSCORE_TIMEZONE
tzoffset = _timezone;
#elif HAVE_TIMEZONE #elif HAVE_TIMEZONE
// timezone is secs WEST of UTC. // timezone is secs WEST of UTC.
tzoffset = timezone; tzoffset = timezone;