[UNIX]Building modular VMs (was Re: floatAt: on Win2K vs Linux )

Tim Rowledge tim at sumeru.stanford.edu
Sat Oct 7 01:49:22 UTC 2000


Kevin Fisher <kgf at golden.net> is widely believed to have written:


> I think I'm missing a step somewhere...  In addition I couldn't figure out how 
> to build the UNIX VM in a modular way (just a big monolithic VM, Profiler.so 
> and System.so get built).
I've just been trying to figure that out as well. Ian seems to have got
a little confused and decided that there are two different things
relating to shared libraries 'modules' and 'plugins'. Ain't so - just
one thing that people refer to with both names.

However, you _can_ convince the current makefile stuff to build a unix
VM for you with various things externalised with a bit of fiddling.

How to make SoundPlugin as an external plugin
---------------------------------------------
Just as an example.
Edit the Interpreter class>translate... method to comment out
SoundPlugin from the list to added internally. I also cut out the asynch
file, serial &  midi plugins, which adds a little more work later.
Move your 'generated' directory to some safe place & make a new empty
one.

Do 'Interpreter translate:'interp.c' doInlining: true' as normal.
Do 'InterpreterSupportCode writeSupportFiles' as usual.
Move all the newly wirtten files to 'src/generated'

Now do 'SoundPlugin translate' and move the resulting FilePlugin
directory into src alongside the generated directory. Now comes the only
tricky bit for a tool do handle this automagically _move the
sqUnixSound.c file from the src/unix directory to the src/FilePlugin
directory_.

Since I didn't create the serial, midi and joystick plugins, I also had
to remove the sqUnix[AsynchFile|JoystickTablet|MIDI|Serial].c files out
of the src/unix directory so thet they wouldn't get wrongly compiled.

You also have to make some fixes to the src/unix/sqXWindow.c file:-
 - where #include "FilePlugin.h" & "JoystickTabletPlugin.h" sit, remove
them.
 - where USE_INTERNAL_IMAGE is #defined, remove it - some changes will be
needed for that stuff to work. #including 'stdio.h' would probablt be
enough, but I haven't bothered with it yet.

 - where sqFileInit & joystickInit are called, remove them; the plugin
 mechanism already handles this properly.

Once that lot is done, the normal make should do the job. Remember to
delete your previous 'i686-pc-linux-gnu' or whatever first. Also
remember to copy the newly built and shiny SoundPlugin.so to the right
directory or it won't be found.

It actually took longer to type than do. There may be some other plugins
that require more work; haven't tried them all yet.

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- All crown, no filling.





More information about the Squeak-dev mailing list