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
This commit is contained in:
Tom Tromey 1999-05-07 18:44:38 +00:00 committed by Tom Tromey
parent c59c5e9a65
commit 01b02b11de
9 changed files with 1020 additions and 237 deletions

View file

@ -34,6 +34,10 @@ details. */
#endif
#include <errno.h>
#ifdef HAVE_UNAME
#include <sys/utsname.h>
#endif
#include <cni.h>
#include <jvm.h>
#include <java/lang/System.h>
@ -220,7 +224,7 @@ java::lang::System::identityHashCode (jobject obj)
#ifndef DEFAULT_FILE_ENCODING
#define DEFAULT_FILE_ENCODING "8859_1"
#endif
char *default_file_encoding = DEFAULT_FILE_ENCODING;
static char *default_file_encoding = DEFAULT_FILE_ENCODING;
void
java::lang::System::init_properties (void)
@ -237,16 +241,15 @@ java::lang::System::init_properties (void)
// A convenience define.
#define SET(Prop,Val) \
properties->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val))
SET ("java.version", "FIXME");
SET ("java.version", VERSION);
SET ("java.vendor", "Cygnus Solutions");
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.class.version", "FIXME");
// SET ("java.class.path", "FIXME");
SET ("os.name", "FIXME");
SET ("os.arch", "FIXME");
SET ("os.version", "FIXME");
SET ("file.encoding", default_file_encoding);
#ifdef WIN32
SET ("file.separator", "\\");
SET ("path.separator", ";");
@ -258,6 +261,22 @@ java::lang::System::init_properties (void)
SET ("line.separator", "\n");
#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
uid_t user_id = getuid ();
struct passwd *pwd_entry;