Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Building a plugin in MPW
Last updated at 2:02 pm UTC on 16 January 2006
To build a plugin on Macintosh:

(1) Install MPW (or other suitable development system);
(2) Translate the Plugin class to a C code file;
(3) Generate the Plugin include files;
(4) Compile and link the C code file to a Shared Library
(5) Install the Shared Library
(6) Confirm that the plugin is working

(1) Install MPW:

Go to http://developer.apple.com/tools/mpw-tools/, and download the latest Golden Master from the ftp server. Double-click the disk image file to make a metadisk, and copy the MPW folder to your hard disk. [This takes a bit of doing with the current build. I found that making the two top level directories and copying the files inside those directories works OK.]

(2) Translate the Plugin class to a C code file;

Startup Squeak. In a workspace, type and execute the DoIt:

StarSqueakPlugin translate

This will create a folder containing your plugin c-language file.

(3) Generate the Plugin include files;

Startup Squeak (if not already up). In a workspace, type and execute the DoIt:

InterpreterSupportCode writePluginSupportFiles

This will create a number of .h files in your default Squeak directory. Copy those files to the plugin folder.

(4) Compile and link the C code file to a Shared Library

Open MPW Shell. From the Build Menu, select "Create Build Commands..." Click the "Source Files" button, navigate to the c file in your plugin folder, and add it to the project. Set the Program Name to "StarSqueakPlugin." In the Program Type options click on the "Shared Library" radio button. In the Target options, click on "PowerPC Only" If you are inclined to do so, click on the "General Options" and select the optimize for speed option, but you don't have to do that. Then, click the CreateMake button. Finally, from the Build menu, select "Build..."

If all went well, the MPW directory should contain a file entitled StarSqueakPlugin, your plugin shared library.

(5) Install the Shared Code Library.

Rename the StarSqueakPlugin folder to something else, and copy the Shared Code Library to the default squeak folder.