SWT, GCC 3.3 and os.name/arch

Øyvind Harboe oyvind.harboe@zylin.com
Sun Feb 16 14:41:00 GMT 2003


I've taken GCC 3.3 for a quick spin after I found this 
excellent page http://www.thisiscool.com/gcc33_mingw.htm on
GCJ and SWT. My compliments!

Findings:

- os.arch is still "i586" under Windows. SWT deals with this, 
but it does rummage the harddrive for lots of motif, gtk, 
dlls, etc. See filemon.exe output extract at bottom of posting. 
Perhaps the 1-2 second startup delay(between printing os.arch 
and os.name) and the hello world window showing could be removed.

- os.arch, os.name no longer change when "gcj -Os" option is used. 

I love the instantaneous compile times, now that swt is 
already compiled. :-) (I had some pagefaults when I tried this 
to get this to work with GCJ 3.2, so I've been compiling swt.jar 
from scratch each time.)

My test program:

// compile with gcj --classpath=swt.jar --main=Test -o test.exe test.class -lswt 
import org.eclipse.swt.SWT; 
import org.eclipse.swt.layout.RowLayout; 
import org.eclipse.swt.widgets.Display; 
import org.eclipse.swt.widgets.Label; 
import org.eclipse.swt.widgets.Shell;

public class Test
{

	public static void main(String[] args)
	{
		System.out.println(System.getProperty("os.name"));
		System.out.println(System.getProperty("os.arch"));
		Display display = new Display();
	  final Shell shell = new Shell(display);
	  RowLayout layout = new RowLayout();
	  layout.justify = true;
	  layout.pack = true;
	  shell.setLayout(layout);
	  shell.setText("Hello, World!");
	  Label label = new Label(shell, SWT.CENTER);
	  label.setText("Hello, World!");
	  shell.pack();
	  shell.open ();
	  while (!shell.isDisposed()) {
		  if (!display.readAndDispatch()) display.sleep ();
	  }
	 display.dispose ();
}

}


Output from filemon.exe:

....
15:34:11	rtvscan.exe:1168	IRP_MJ_QUERY_INFORMATION	C:\m4\workspace\Silly\test.exe	BUFFER OVERFLOW	FileNameInformation	
15:34:11	rtvscan.exe:1168	IRP_MJ_QUERY_INFORMATION	C:\m4\workspace\Silly\test.exe	SUCCESS	FileNameInformation	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\m4\workspace\Silly	SUCCESS	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	FASTIO_QUERY_BASIC_INFO	C:\m4\workspace\Silly	SUCCESS	Attributes: D	
15:34:11	test.exe:2284	IRP_MJ_CLEANUP	C:\m4\workspace\Silly	SUCCESS		
15:34:11	test.exe:2284	IRP_MJ_CLOSE 	C:\m4\workspace\Silly	SUCCESS		
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\m4\workspace\Silly\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\WINDOWS\System32\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\WINDOWS\system\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\WINDOWS\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\m4\workspace\Silly\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\PROGRA~1\MICROS~3\Common\msdev98\BIN\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\PROGRA~1\MICROS~3\VC98\BIN\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\PROGRA~1\MICROS~3\Common\TOOLS\WINNT\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\PROGRA~1\MICROS~3\Common\TOOLS\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\WINDOWS\system32\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
15:34:11	test.exe:2284	IRP_MJ_CREATE	C:\WINDOWS\lib-org-eclipse-swt-internal-motif-OS	FILE NOT FOUND	Attributes: Any Options: Open 	
	
.....



More information about the Java mailing list