Squeak for Mac OS X almost builds

Eric Scharff Eric.Scharff at Colorado.EDU
Thu Jul 19 17:49:51 UTC 2001


Normally I'd not post until I got this working, but hopefully there is a
smarter person out there who may be able to help diagnose problems. :)

Perhaps I'm the only one who is interested in this, but I felt I'd share
my experiences with porting the Carbon Squeak to ProjectBuilder for Mac OS
X.

1. Started with a fully updated 3.1a image and generated source with the
standard:
  InterpreterSupportCode writeMacSourceFiles
  Interpreter translate: 'interp.c' doInlining: true.

QUESTION: Is this the most recent Mac source?  It doesn't seem to be,
since the last ChangeSet talks about the 3.0.7 VM, not the 3.0.18 VM.

2. Made an empty ProjectBuilder project and added all the source code that
was in the CodeWarrior Carbon project.

3. Changed the headers somewhat.  Mac OS X supports precompiled headers
which dramatically improve performance.  To do this, I added

#include <Carbon/Carbon.h>

to sqPlatformSpecific.h and removed all the other Mac include statements
that appear in the various Mac specific files.

QUESTION:  Some of the Mac include filenames use odd upper and lower case.
Is there a reason for this?  OS X tends to be more case sensitive

4. #define macintosh wasn't defined, so I also added that to
sqPlatformSpecific.h

5. Start building.  There are tons of warnings, mostly in the plugins,
where functions are declared int but return void (or don't return
anything)

QUESTION:  Does Squeak ignore the return type for functions?  If so, how
hard would it be to change the CCodeGenerator to add the return types?  It
is better to generate proper C code so you don't have to ignore all
warnings, including meaningful ones.

6. Using a GNU awk to turn interp.c into ginterp.c because it might be
more GNU compiler friendly.  Copied appropriate files from the Unix source
distribution.

This was a mistake.  I ended up switching back to the dynamically
generated interp.c which seemed to compile fine and worked better.

QUESTION: Is there a significant advantage to using the gnuify script?
It seems to add some register variables for efficiency and create a jump
table that didn't work properly.  Do these make a much better VM on a PPC?

7. Copied the resources from a standard carbon VM because ProjectBuilder
doesn't properly handle older resource files.  Grrr.

8. Got everything built and running!  When I started the VM, things where
somewhat working.  I could see some graphics and the eyes on the Squeak
logo were moving about.  But, it complained it couldn't find the sources
or changes files, even though I launched the app from the directory
containing those files.

QUESTION:  There is probably a simple fix for this.  Where would I look to
specify the current directory and to look there for the support files?

Almost there, but not quite.  Thanks for listening through the diaries of
a madman. :)

-Eric





More information about the Squeak-dev mailing list