This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

patch2 darwin & libgcj


Hi,

this is #2 to get libgcj 'compile' under darwin.
I'm not completely happy with, since I don't know the correct cast, see
below. Also, to apply this patch you have to run autoconf & autoheader
in gcc/libjava to get the new introduced AC_STRUCT_TIMEZONE propagated correctly.

This patch introduces a new configure.in check versus timezone. Darwin
doesn't know tzname so I tried to play.

The two patches make libgcj compile under darwin (ufs) although I have
some linking errors.
I send these patches to gcc-patches since it is noted so and they are
not mainly java related.

Comments welcome for improvements!!

Andreas

P.S, I don't send the configure diff since I'm not sure about it. Do I
have to provide this or is anyone else able to update it?
P.S2, here I'm completely unsure could someone help, I don't know the
definition of tzname:
tzinfo = &tim->tm_zone

---

2001-12-29 Andreas Tobler <a.tobler@schweiz.ch>

        	* libjava/configure.in
		add a timezone check
		* libjava/java/lang/natSystem.cc
		handle the above timezone check


diff -ur gccclean/gcc/libjava/configure.in gccsrc/gcc/libjava/configure.in
--- gccclean/gcc/libjava/configure.in   Sat Dec 29 12:43:01 2001
+++ gccsrc/gcc/libjava/configure.in     Sat Dec 29 11:30:31 2001
@@ -794,6 +794,8 @@

 AC_FUNC_ALLOCA

+AC_STRUCT_TIMEZONE
+
 AC_CHECK_PROGS(PERL, perl, false)

 SYSDEP_SOURCES=
diff -ur gccclean/gcc/libjava/java/lang/natSystem.cc gccsrc/gcc/libjava/java/lan
g/natSystem.cc
--- gccclean/gcc/libjava/java/lang/natSystem.cc Sat Dec 29 12:42:31 2001
+++ gccsrc/gcc/libjava/java/lang/natSystem.cc   Sat Dec 29 11:30:01 2001
@@ -263,7 +263,17 @@
   // issue exists in java/util/natGregorianCalendar.cc.
   tzoffset = 0L;
 #endif
+// check if a system has tzname or not. Not sure how to handle else
+// darwin does not have the tzname so I tried a hack, need help here
+// a.tobler@schweiz.ch 29122001
+#ifdef HAVE_TZNAME
   tzinfo = tzname;
+#elif HAVE_TM_ZONE
+  tzinfo = &tim->tm_zone;
+#else
+ //what to do else ? 
+#error neither tzname nor tm_zone defined
+#endif

   if ((tzoffset % 3600) == 0) 
     tzoffset = tzoffset / 3600;


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