[plt-scheme] Creating Self-Contained Executable

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Mar 2 16:15:16 EST 2009

At Sun, 1 Mar 2009 18:45:10 +0000, Erich Rast wrote:
> Here is what I did:
> - Copied shared libraries from their respective places to a local  
> directory lib/
> [...]
> (define-runtime-path libcryptopath
>    (list 'so (case (system-type)
>      ((windows) "libeay32")
>      ((macosx) "lib/libcrypto")
>      (else "libcrypto"))))

By local directory, do you mean local relative to the source file?

The 'so mode of `define-runtime-path' is intended to refer to libraries
in a PLT Scheme "lib" directory---usually adjacent to the binaries. If
you put the libraries in a "lib" relative to the source that uses them,
then you want just the relative path, perhaps using `(system-type
'so-suffix)' to build the path.

Meanwhile, an 'so path works anyway if the shared library exists
relative to the current directory, due to the way that the
shared-library search path works. Also, `mzc' looks strictly in the PLT
shared-library directories to resolve 'so, and it doesn't complain when
it fails to find a library. That's a confusing combination that we
should at least fix on the `mzc' side.

Posted on the users mailing list.