[plt-scheme] Creating Self-Contained Executable

From: Erich Rast (erich at snafu.de)
Date: Sun Mar 1 13:45:10 EST 2009

Hi,

I'm trying to create a completely self-contained executable from a  
module-based MrEd application using mzc, but it doesn't seem to work.

Here is what I did:

- Copied shared libraries from their respective places to a local  
directory lib/
- Downloaded external Scheme libraries/collections that use the shared  
library (crypto.plt and gzip.plt in this case) and modified them as in  
the following example:

(define-runtime-path libcryptopath
   (list 'so (case (system-type)
     ((windows) "libeay32")
     ((macosx) "lib/libcrypto")
     (else "libcrypto"))))

(define libcrypto
   (ffi-lib libcryptopath))

- All other external files are declared with define-runtime-path too.

- Tried the following:

mzc --gui-exe MyApp init.scm

where init.scm is the first module that starts the application. The  
resulting MyApp.app works on my machine, but doesn't contain any  
shared library in the OS X package/bundle.

- Then tried:

mzc --exe-dir Distro MyApp

This creates a Distro directory containing a larger MyApp.app that  
includes the framework but still doesn't include any shared library.

How can I include shared libraries such that the end package/bundle on  
OS X contains them in a lib subdirectory and all FFI calls use the  
library stored within the application bundle on the end-user machine  
instead of using a respective existing system library (if the latter  
is available at all)?

Best regards,

Erich



Posted on the users mailing list.