Compiling the Win32 VM


This page describes the steps necessary to build a Squeak VM on Windows.

Tool Setup

Download the Squeak-Win32-Tools package. This package contains the entire too chain that I am using to compile Squeak for Win32. It is provided as REFERENCE so that you don't have to dig the entire web for exactly this version of (for instance) the MINGW headers and libs or where to find the headers and libs for DirectX (etc etc etc).The package contains:

To install the package, extract everything you have into C:\ (make sure the directory structure stays intact) or to another convenient place (I strongly recommend putting everything into C:\ as this will avoid needless changes further down the road).

Add "C:\GNUTools\bin" to your PATH environment variable in autoexec.bat by going to the control panel, open the "system" panel, click on the "Advanced" tab, and on the "Environment variables" button. You can change the PATH environment variable from there.

Source Code Setup

Grab the Squeak-Win32 source release from the release directory. Source releases are packaged for easy recompilation and plugin development - using the SVN sources directly runs the risk of it not being in sync with some of the latest modifications in other areas.

If you want to do some of your own development you may instead check out the platform tree from SqueakVM.org via

  svn co http://squeakvm.org/svn/squeak/trunk platforms
and work from there. If you do this be advised of the following

WARNING: Working from the HEAD of the SVN repository will almost certainly require additional work. That's because the VM maintainers work at different schedules and one maintainer's modification at HEAD may break another VM. If you want to make sure the VM compiles out of the box, USE A FILE RELEASE.

Regenerating the Source

To regenerate the entire VM you will have to get aquainted to VMMaker and VMMakerTool.

If you just want to rebuild the VM use the build location provided by the file release you are using. If you do your own development you need to decide where to put the build files. You have two choices:

  1. Use the platforms/win32/build directory. The advantage is that the location is what is being used by the Makefiles and will work out of the box. The disadvantage is that this directory is backed by the squeakvm.org repository (as is the entire path) and may be problematic if you need to maintain your own repository.

  2. Use your own build directory outside of the platforms tree. This is the approach that is used for all of the release builds, simply because it makes a clear separation between the (static) platforms tree and the generated and build tree. To set this up you should:

Once you have decided to set up your build environment, open VMMaker from the world menu and provide it with the path to the platforms code. Assuming you've put the platforms tree into C:\SqueakVM\ this would be C:\SqueakVM\platforms. You also need to provide the path to the generated sources, which should be the src directory inside your build directory, e.g., either

  C:\SqueakVM\platforms\win32\build\src (default build location)
  C:\SqueakVM\mybuild\src (custom build location in C:\SqueakVM\mybuild)
NOTE: If you can't seem to change the path to the generated sources, make sure you've got the right version of Win32VMMaker.

Next, customize VMMaker for the plugins you'd like to have internal vs. external. Generally, the release builds have "everything builtin" except from the FFI plugin (SqueakFFIPrims). Some plugins (as of this time of writing FileCopyPlugin, InternetConfigPlugin, MacMenuBarPlugin, and TestOSAPlugin) cannot be built on Windows. If you have a large number of plugins that can't be made either internal or external, your paths are most likely incorrect.

Finally, generate the entire sources for the build.

Sanity Check

Make sure you have a sane build setup before going on. Your directories should look roughly like this (assuming C:\SqueakVM\ is the root of the installation):

C:\SqueakVM\platforms - the platform tree originating from squeakvm.org
C:\SqueakVM\platforms\Cross - the cross platform files (required)
C:\SqueakVM\platforms\win32 - the win32 platform files (required)

C:\SqueakVM\mybuild - the build tree (may differ if you use another location)
C:\SqueakVM\mybuild\src - the place for generated sources
C:\SqueakVM\mybuild\vm - the core vm sources
C:\SqueakVM\mybuild\XYZPlugin - the sources for XYZPlugin

Customization

If you need a custom VM, the build process is also a great place to add a few customizations.

To change the name of the VM edit the Makefile (in your build directory) and change the VM definition to, e.g.,

  VM = MyCustomVM
This will change various VM related settings to use your name, including titles for quit messages etc. It will also require you to provide a MyCustomVM.rc file which you can use to provide custom icons and other resources. Have a look at Squeak.rc and Croquet.rc to see examples.

Compiling

After following the above steps, cd into the build directory and invoke make. If you've followed the above instructions, you should be rewarded with a brand new VM.