Commit 01b02b11 by Tom Tromey Committed by Tom Tromey

acconfig.h (GCJVERSION): New undef.

	* acconfig.h (GCJVERSION): New undef.
	* java/lang/natSystem.cc (init_properties): Define java.version,
	java.class.version, os.name, os.arch, os.version.
	Include <sys/utsname.h> if required.
	* configure: Rebuilt.
	* configure.in: Compute and define GCJVERSION.
	* java/lang/natSystem.cc (default_file_encoding): Now static.

From-SVN: r26830
parent c59c5e9a
1999-05-07 Tom Tromey <tromey@cygnus.com> 1999-05-07 Tom Tromey <tromey@cygnus.com>
* acconfig.h (GCJVERSION): New undef.
* java/lang/natSystem.cc (init_properties): Define java.version,
java.class.version, os.name, os.arch, os.version.
Include <sys/utsname.h> if required.
* configure: Rebuilt.
* configure.in: Compute and define GCJVERSION.
* java/lang/natSystem.cc (default_file_encoding): Now static.
* java/lang/natCharacter.cc (isLowerCase): Use a binary search. * java/lang/natCharacter.cc (isLowerCase): Use a binary search.
* libtool-version: New file. * libtool-version: New file.
......
...@@ -92,6 +92,7 @@ THREADDEPS = @THREADDEPS@ ...@@ -92,6 +92,7 @@ THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@ THREADINCS = @THREADINCS@
THREADLIBS = @THREADLIBS@ THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@ THREADOBJS = @THREADOBJS@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@ VERSION = @VERSION@
here = @here@ here = @here@
libgcj_basedir = @libgcj_basedir@ libgcj_basedir = @libgcj_basedir@
......
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
/* Define if global `timezone' exists. */ /* Define if global `timezone' exists. */
#undef HAVE_TIMEZONE #undef HAVE_TIMEZONE
/* Define to version of GCJ in use. */
#undef GCJVERSION
/* Define if you have the appropriate function. */ /* Define if you have the appropriate function. */
#undef HAVE_ACCESS #undef HAVE_ACCESS
#undef HAVE_STAT #undef HAVE_STAT
......
...@@ -255,6 +255,9 @@ if test -n "${with_cross_host}"; then ...@@ -255,6 +255,9 @@ if test -n "${with_cross_host}"; then
if test "$build" != "$with_cross_host"; then if test "$build" != "$with_cross_host"; then
CANADIAN=yes CANADIAN=yes
EH_COMMON_INCLUDE= EH_COMMON_INCLUDE=
GCJ="${target_alias}/gcj"
else
GCJ=
fi fi
else else
# Some POSIX thread systems don't have pthread_mutexattr_settype. # Some POSIX thread systems don't have pthread_mutexattr_settype.
...@@ -314,18 +317,35 @@ else ...@@ -314,18 +317,35 @@ else
AC_MSG_ERROR([memcpy is required]) AC_MSG_ERROR([memcpy is required])
fi fi
test -d "$libgcj_basedir/../gcc/java" || { if test -d "$libgcj_basedir/../gcc/java"; then
GCJ=
else
CANADIAN=yes CANADIAN=yes
NULL_TARGET=yes NULL_TARGET=yes
} GCJ=gcj
fi
fi fi
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes) AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes) AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
AM_CONDITIONAL(NATIVE, test "$CANADIAN" = no || test "$NULL_TARGET" = yes) AM_CONDITIONAL(NATIVE, test "$CANADIAN" = no || test "$NULL_TARGET" = yes)
AC_SUBST(EH_COMMON_INCLUDE) AC_SUBST(EH_COMMON_INCLUDE)
# Determine gcj version number.
if test "$GCJ" = ""; then
if test -z "${with_multisubdir}"; then
builddotdot=.
else
builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
fi
dir="`cd ${builddotdot}/../../gcc && pwd`"
GCJ="$dir/gcj -B$dir/"
fi
changequote(<<,>>)
gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`"
changequote([,])
AC_DEFINE_UNQUOTED(GCJVERSION, "$gcjvers")
AC_SUBST(AM_RUNTESTFLAGS) AC_SUBST(AM_RUNTESTFLAGS)
dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there. dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
......
...@@ -88,6 +88,9 @@ ...@@ -88,6 +88,9 @@
/* Define if global `timezone' exists. */ /* Define if global `timezone' exists. */
#undef HAVE_TIMEZONE #undef HAVE_TIMEZONE
/* Define to version of GCJ in use. */
#undef GCJVERSION
/* Define if you have the appropriate function. */ /* Define if you have the appropriate function. */
#undef HAVE_ACCESS #undef HAVE_ACCESS
#undef HAVE_STAT #undef HAVE_STAT
......
...@@ -34,6 +34,10 @@ details. */ ...@@ -34,6 +34,10 @@ details. */
#endif #endif
#include <errno.h> #include <errno.h>
#ifdef HAVE_UNAME
#include <sys/utsname.h>
#endif
#include <cni.h> #include <cni.h>
#include <jvm.h> #include <jvm.h>
#include <java/lang/System.h> #include <java/lang/System.h>
...@@ -220,7 +224,7 @@ java::lang::System::identityHashCode (jobject obj) ...@@ -220,7 +224,7 @@ java::lang::System::identityHashCode (jobject obj)
#ifndef DEFAULT_FILE_ENCODING #ifndef DEFAULT_FILE_ENCODING
#define DEFAULT_FILE_ENCODING "8859_1" #define DEFAULT_FILE_ENCODING "8859_1"
#endif #endif
char *default_file_encoding = DEFAULT_FILE_ENCODING; static char *default_file_encoding = DEFAULT_FILE_ENCODING;
void void
java::lang::System::init_properties (void) java::lang::System::init_properties (void)
...@@ -237,16 +241,15 @@ java::lang::System::init_properties (void) ...@@ -237,16 +241,15 @@ java::lang::System::init_properties (void)
// A convenience define. // A convenience define.
#define SET(Prop,Val) \ #define SET(Prop,Val) \
properties->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val)) properties->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val))
SET ("java.version", "FIXME"); SET ("java.version", VERSION);
SET ("java.vendor", "Cygnus Solutions"); SET ("java.vendor", "Cygnus Solutions");
SET ("java.vendor.url", "http://www.cygnus.com/"); SET ("java.vendor.url", "http://www.cygnus.com/");
SET ("java.class.version", GCJVERSION);
// FIXME: how to set these given location-independence?
// SET ("java.home", "FIXME"); // SET ("java.home", "FIXME");
// SET ("java.class.version", "FIXME");
// SET ("java.class.path", "FIXME"); // SET ("java.class.path", "FIXME");
SET ("os.name", "FIXME");
SET ("os.arch", "FIXME");
SET ("os.version", "FIXME");
SET ("file.encoding", default_file_encoding); SET ("file.encoding", default_file_encoding);
#ifdef WIN32 #ifdef WIN32
SET ("file.separator", "\\"); SET ("file.separator", "\\");
SET ("path.separator", ";"); SET ("path.separator", ";");
...@@ -258,6 +261,22 @@ java::lang::System::init_properties (void) ...@@ -258,6 +261,22 @@ java::lang::System::init_properties (void)
SET ("line.separator", "\n"); SET ("line.separator", "\n");
#endif #endif
#ifdef HAVE_UNAME
struct utsname u;
if (! uname (&u))
{
SET ("os.name", u.sysname);
SET ("os.arch", u.machine);
SET ("os.version", u.release);
}
else
{
SET ("os.name", "unknown");
SET ("os.arch", "unknown");
SET ("os.version", "unknown");
}
#endif /* HAVE_UNAME */
#ifdef HAVE_PWD_H #ifdef HAVE_PWD_H
uid_t user_id = getuid (); uid_t user_id = getuid ();
struct passwd *pwd_entry; struct passwd *pwd_entry;
......
...@@ -94,6 +94,7 @@ THREADDEPS = @THREADDEPS@ ...@@ -94,6 +94,7 @@ THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@ THREADINCS = @THREADINCS@
THREADLIBS = @THREADLIBS@ THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@ THREADOBJS = @THREADOBJS@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@ VERSION = @VERSION@
here = @here@ here = @here@
libgcj_basedir = @libgcj_basedir@ libgcj_basedir = @libgcj_basedir@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment