Patch: normalize x86 os.arch for non-Windows platforms

Anthony Green green@redhat.com
Sun Feb 13 21:23:00 GMT 2005


The jogl build scripts expect to see an os.arch of "i386" for x86 Linux.
gcj is a little more specific than that (I get "i686" on my machine).
This patch normalizes x86 to "i386" for compatibility reasons.   Win32
ports keep "x86", as encoded in win32.cc.

Ok?

AG

-------------- next part --------------
2005-02-13  Anthony Green  <green@redhat.com>

	* java/lang/natRuntime.cc (insertSystemProperties): Normalize x86
	architecture names to "i386" for compatibility reasons.  Win32
	still uses "x86".


Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.45
diff -u -r1.45 natRuntime.cc
--- java/lang/natRuntime.cc	8 Feb 2005 17:44:13 -0000	1.45
+++ java/lang/natRuntime.cc	13 Feb 2005 20:21:48 -0000
@@ -436,8 +436,17 @@
   if (! uname (&u))
     {
       SET ("os.name", u.sysname);
-      SET ("os.arch", u.machine);
       SET ("os.version", u.release);
+
+      // Normalize x86 architecture names to "i386" (except on Windows, which 
+      // is handled in win32.cc).
+      if (u.machine[0] == 'i'
+	  && u.machine[2] == '8'
+	  && u.machine[3] == '6'
+	  && u.machine[4] == 0)
+	SET ("os.arch", "i386");
+      else
+	SET ("os.arch", u.machine);
     }
   else
     {


More information about the Java-patches mailing list