[kaffe] CVS kaffe (guilhem): Various fixes for Mac OS X/Darwin/PPC.
Kaffe CVS
cvs-commits at kaffe.org
Fri Jul 16 09:35:48 PDT 2004
PatchSet 4977
Date: 2004/07/16 16:20:07
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Various fixes for Mac OS X/Darwin/PPC.
2004-07-16 Riccardo Mottola <rmottola at users.sf.net>
* config/powerpc/darwin/md.h:
Added definitions for signal handling
* kaffe/kaffevm/systems/unix-jthreads/jthread.h:
(jthread_attach_current_thread): Moved UNUSED to ease CPP work.
* libraries/clib/native/TimeZone.c
(java_util_TimeZone_getDefaultTimeZoneId):
Changed timezone mechanism to be ANSI compliant.
* libraries/clib/native/System.c: Use setlocale only if
LC_MESSAGES is defined.
* configure.ac: Check for sys/signal.h.
* config/config.h.in, configure: Regenerated.
Members:
ChangeLog:1.2541->1.2542
configure:1.353->1.354
configure.ac:1.51->1.52
config/config.h.in:1.116->1.117
config/powerpc/darwin/md.h:1.6->1.7
kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.59->1.60
libraries/clib/native/System.c:1.50->1.51
libraries/clib/native/TimeZone.c:1.1->1.2
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2541 kaffe/ChangeLog:1.2542
--- kaffe/ChangeLog:1.2541 Fri Jul 16 09:18:43 2004
+++ kaffe/ChangeLog Fri Jul 16 16:20:07 2004
@@ -1,3 +1,22 @@
+2004-07-16 Riccardo Mottola <rmottola at users.sf.net>
+
+ * config/powerpc/darwin/md.h:
+ Added definitions for signal handling
+
+ * kaffe/kaffevm/systems/unix-jthreads/jthread.h:
+ (jthread_attach_current_thread): Moved UNUSED to ease CPP work.
+
+ * libraries/clib/native/TimeZone.c
+ (java_util_TimeZone_getDefaultTimeZoneId):
+ Changed timezone mechanism to be ANSI compliant.
+
+ * libraries/clib/native/System.c: Use setlocale only if
+ LC_MESSAGES is defined.
+
+ * configure.ac: Check for sys/signal.h.
+
+ * config/config.h.in, configure: Regenerated.
+
2004-07-16 Jim Huang <jserv at kaffe.org>
* libraries/javalib/java/awt/MouseEvt.java
Index: kaffe/configure
diff -u kaffe/configure:1.353 kaffe/configure:1.354
--- kaffe/configure:1.353 Mon Jul 12 17:51:05 2004
+++ kaffe/configure Fri Jul 16 16:20:15 2004
@@ -41001,6 +41001,156 @@
done
+for ac_header in sys/signal.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to kaffe at kaffe.org ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
for ac_header in syslog.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.51 kaffe/configure.ac:1.52
--- kaffe/configure.ac:1.51 Mon Jul 12 17:51:16 2004
+++ kaffe/configure.ac Fri Jul 16 16:20:45 2004
@@ -1052,6 +1052,7 @@
AC_CHECK_HEADERS([sys/utsname.h])
AC_CHECK_HEADERS([sys/sysctl.h])
AC_CHECK_HEADERS([sys/param.h])
+AC_CHECK_HEADERS([sys/signal.h])
AC_CHECK_HEADERS([syslog.h])
AC_CHECK_HEADERS([time.h])
AC_CHECK_HEADERS([unistd.h])
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.116 kaffe/config/config.h.in:1.117
--- kaffe/config/config.h.in:1.116 Sun Jul 11 20:15:35 2004
+++ kaffe/config/config.h.in Fri Jul 16 16:20:51 2004
@@ -577,6 +577,9 @@
/* Define to 1 if you have the <sys/shm.h> header file. */
#undef HAVE_SYS_SHM_H
+/* Define to 1 if you have the <sys/signal.h> header file. */
+#undef HAVE_SYS_SIGNAL_H
+
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
Index: kaffe/config/powerpc/darwin/md.h
diff -u kaffe/config/powerpc/darwin/md.h:1.6 kaffe/config/powerpc/darwin/md.h:1.7
--- kaffe/config/powerpc/darwin/md.h:1.6 Mon Jun 7 19:14:22 2004
+++ kaffe/config/powerpc/darwin/md.h Fri Jul 16 16:20:54 2004
@@ -28,7 +28,6 @@
#include <sys/resource.h>
#endif
-
#undef SP_OFFSET
#define SP_OFFSET 0
@@ -39,9 +38,19 @@
#define SIGNAL_PC(scp) 0
#define STACK_POINTER(scp) ((scp)->si_addr)
#else
-#warning Some exceptions may not work properly.
-#define SIGNAL_ARGS(sig, sc) int sig
+
#undef HAVE_SIGALTSTACK
+#if defined(HAVE_SYS_SIGNAL_H)
+#include <sys/signal.h>
+typedef struct sigcontext sigcontext_t;
+#endif
+
+typedef struct sigaltstack stack_t;
+#define SIGNAL_ARGS(sig, sc) int sig, sigcontext_t *sc
+#define SIGNAL_CONTEXT_POINTER(scp) sigcontext_t *scp
+#define GET_SIGNAL_CONTEXT_POINTER(sc) (sc)
+#define SIGNAL_PC(scp) ((scp)->sc_ir)
+#define STACK_POINTER(scp) ((scp)->sc_sp)
#endif
#include "kaffe-unix-stack.h"
Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h
diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.59 kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.60
--- kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.59 Wed May 26 21:33:44 2004
+++ kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h Fri Jul 16 16:21:00 2004
@@ -353,7 +353,7 @@
void jthread_exit_when_done(void) NONRETURNING;
static inline
-bool jthread_attach_current_thread(UNUSED bool isDaemon)
+bool jthread_attach_current_thread(bool isDaemon UNUSED)
{
return false;
}
Index: kaffe/libraries/clib/native/System.c
diff -u kaffe/libraries/clib/native/System.c:1.50 kaffe/libraries/clib/native/System.c:1.51
--- kaffe/libraries/clib/native/System.c:1.50 Thu Jul 8 10:00:12 2004
+++ kaffe/libraries/clib/native/System.c Fri Jul 16 16:21:04 2004
@@ -334,10 +334,13 @@
char *locale;
char lang[3];
+#if defined(HAVE_LC_MESSAGES)
locale = setlocale (LC_MESSAGES, "");
tmp = strchr (locale, '_');
-
+#else
+ tmp = NULL;
+#endif
if (tmp != NULL) {
lang[2] = '\0';
Index: kaffe/libraries/clib/native/TimeZone.c
diff -u kaffe/libraries/clib/native/TimeZone.c:1.1 kaffe/libraries/clib/native/TimeZone.c:1.2
--- kaffe/libraries/clib/native/TimeZone.c:1.1 Sat Aug 16 11:03:41 2003
+++ kaffe/libraries/clib/native/TimeZone.c Fri Jul 16 16:21:04 2004
@@ -16,13 +16,15 @@
java_util_TimeZone_getDefaultTimeZoneId(void)
{
#ifdef HAVE_TIME_H
- static int called_tzset = 0;
+ struct tm *tempTimeStruct;
+ time_t tempTimeArithm;
+ char *tempZoneName;
- if (!called_tzset)
- {
- tzset();
- }
- return stringC2Java(tzname[0]);
+ tempTimeArithm = 0;
+ tempTimeStruct = localtime (&tempTimeArithm);
+ tempZoneName = tempTimeStruct->tm_zone;
+ assert(tempZoneName != NULL);
+ return stringC2Java(tempZoneName);
#else
return NULL;
#endif
More information about the kaffe
mailing list