[previous] [up] [next]     [index]
Next: Index Up: Building a Stand-alone Executable Previous: Stand-Alone Executables from Scheme

Stand-Alone Executables from Native Code

Creating a stand-alone executable that embeds native code from mzc requires downloading the MzScheme source code and using a C compiler and linker directly.

To build an executable with an embedded MzScheme engine:

For example, under Unix, to create a standalone executable MyApp that is equivalent to

  mzscheme -mv -f file1.ss -f file2.ss
unpack the MzScheme source code and perform the following steps:
  cd plt/src/mzscheme
  ./mzmake
  ./mzmake ee-main
  mzc --object --embedded file1.ss 
  mzc --object --embedded file2.ss 
  mzc --link-glue --embedded file1.kp file1.o file2.kp file2.o 
  ./mzmake EEAPP=MyApp EEOBJECTS="file1.o file2.o _loader.o" ee-app 

To produce an executable that embeds the MrEd engine, the procedure is essentially the same. MrEd is compiled somewhat differently from MzScheme (e.g., there's no mzmake), and MrEd's main file is mred.cxx instead of main.c. See the compilation notes in the MrEd source code distribution for more information.


[previous] [up] [next]     [index]
Next: Index Up: Building a Stand-alone Executable Previous: Stand-Alone Executables from Scheme

PLT