This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libjava configuration problems



I'm trying to get libjava working on an arm-netbsd target and have run 
into the following problem whilst building libjava.

Autoconf has a test for a variable called timezone, which it tests with 

   AC_TRY_COMPILE([#include <time.h>], [long z2 = timezone;],
     [AC_DEFINE(HAVE_TIMEZONE)
      AC_MSG_RESULT(yes)],
     [AC_MSG_RESULT(no)])])


Unfortunately this test passes on NetBSD when it should fail.  timezone 
exists, but is a function not a variable.  When g++ comes to compile 
java/lang/natSystem.cc we then get a build failure

/home/rearnsha/gnusrc/egcs/libjava/java/lang/natSystem.cc: In static 
member
   function `static java::lang::String* 
   java::lang::System::getSystemTimeZone()':
/home/rearnsha/gnusrc/egcs/libjava/java/lang/natSystem.cc:251: cannot 
convert
   `char*()(int, int)' to `long int' in assignment


Any ideas how to fix the test for this?


$ man timezone

NAME
     timezone - return the timezone abbreviation

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     char *
     timezone(int zone, int dst);

DESCRIPTION
     This interface is available for compatibility; it is impossible to 
reli-
     ably map timezone's arguments to a time zone abbreviation.  See 
ctime(3).

     The timezone() function returns a pointer to a time zone abbreviation 
for
     the specified zone and dst values.  Zone is the number of minutes 
west of
     GMT and dst is non-zero if daylight savings time is in effect.

SEE ALSO
     ctime(3)

HISTORY
     A timezone() function appeared in Version 7 AT&T UNIX.

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]