Saves a universal binary LispWorks image using a script designed for saving a mono-architecture image.
The function
save-universal-from-script
provides a convenient way to create a universal binary on an Intel Macintosh, using a script designed for saving a mono-architecture image.
The
script-name
is the name of a Common Lisp build script for saving or delivering an image, as would be used to create a mono-architecture image. It should load the application and then call either
deliver
or
save-image
as appropriate.
The function
save-universal-from-script
runs the current LispWorks image in two subprocesses, once for the PowerPC architecture (under Rosetta) and once for the native Intel architecture, passing
-build
script-name
on the command line. The script is evaluated as normal, except that the filename that is passed to any call to
save-image
or
deliver
is ignored and a temporary filename is used instead. If these two subprocesses are successful, then the temporary images are combined to make a universal binary
target-name
in the same way as
create-universal-binary
.
The command line arguments of the images run by the subprocesses will include the command line arguments that were passed to the current image. In addition, various undocumented command line arguments will be prepended, which control how
deliver
or
save-image
work in the script.
Any output generated by the subprocesses is written to
output-stream
. If this is
nil
, then the output is discarded. If this is
t
(the default), then the output is written to the standard output.
Note: The function
save-universal-from-script
can only be called from a LispWorks for Macintosh image that is itself a universal binary, such as the distributed image.
Suppose the file
my-build-script.lisp
contains
(load-all-patches)
(load "my-application-defsys")
(compile-system 'my-application-system :load t)
(deliver 'my-application-function "my-application" 5)
Then, the following call creates a universal binary
my-application
using this script:
(save-universal-from-script "my-application"
"my-build-script.lisp")