 |
Squawk Build on Windows
Based on Rasmus' forum post These instructions have been tested on Windows XP SP2.
Installing
- Install TortoiseSVN from http://tortoisesvn.tigris.org/ . This provides Windows Explorer tools for subversion. You can also install a GUI client for svn, such as SmartSVN, or use the builtin svn support form your IDE.
- Install Visual C++ 2008 Express (http://www.microsoft.com/express/vc/). It includes the needed SDKs, so only one download is needed.Visual C++ 2005 Express works as well.
If you open a CMD prompt after the install and enter set then this environment variable must appear: VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\. If not, re-install...
- Make sure that your default java is Java 5 from a JDK (not a JRE). JDK 6.0 causes problems due to dependencies on some of the javac classes. If the default java (in
C:\WINDOWS\system32) is not from a JDK, then the builder may not find the file tools.jar.
- Safest way is to first remove old JDK and JREs. and install a Java 5 JDK (http://java.sun.com/javase/downloads/index_jdk5.jsp).
- Alternatively you can install a Java 5 JDK and PREpend your new JDKs bin directory to the head of your PATH (see below).
- In either case, do not let the JDK install in the default location (C:\Program Files\Java\jdk..), but instead install it in C:\Java\jdk.... This has to do with spaces in files names.
- Now you have to skip the next step in the JDK installer, which is the JRE installation, because it sets JAVAHOME (in the registry) to point to the JRE, but we want it to point to the JDK. This is because we later need tools.jar on the classpath. So press Cancel and go on to press Finish. _Still needed? The builder has code to deal with this case._
- Append (or prepend if prexisting JREs are still on your machine) to your Path environment variable (My Computer->View System Information->Advanced->Environment Variables) the path C:\Java\jdk1.5.VERSION\bin (pointing to java.exe and javac.exe that you installed)
- Create (or edit) the environment variable JAVA_HOME to be C:\Java\jdk1.5.VERSION. It is needed when squawk.exe runs.
Preparing
- Get squawk by entering https://squawk.dev.java.net/svn/squawk/trunk in the URL box in the SVN window that appears when right-clicking on a folder that you want to be squawk SVN root. See https://squawk.dev.java.net/servlets/ProjectSource for details.
Building/Running
Open a CMD prompt and change directory to the root of your squawk SVN repository. The file d.bat should be in this directory. Now you need to run a series of build commands to get to the point where squawk.exe runs on the host. Enter each of the following commands (the text in italics are comments):
- d.bat jvmenv Tells you what environment variable needs to be set. Once you set this variable permanently, you only need to do this once.
- d.bat copyphoneme Copies the cldc java files to the cldc folder. Only need to do this once.
- d.bat Compiles the java modules
- d.bat -prod -mac -o2 rom cldc Builds the VM squawk.exe
- squawk.exe com.sun.squawk.Test It takes a seconds to complete. Do not get scared about the nullpointer exception: it is part of the test.
Optional build steps:
- d.bat clean Removes classes files - both preverified and not, and preprocessed source files. Do only as needed, such as when changing builder properties.
- Builds the builder after changing the builder source.
- cd builder
- bld.bat
For more details on building and running Squawk, please see BuildingSquawk.
-- Main.derek_white - 09 Jul 2008
|