consultationBuilding and Distributing Applications.
Assuming that the source code consists of two files. cap (a poem)
which
dependencies
. Below we compile it into a binary that can be distributed.
Convert source code to object file
In the REPL of Chez Scheme (below), enter
;; REPL
(compile-library "") ; by default it compiles to ""
(compile-program "") ; by default it compiles to ""
Notes:so
The suffix is an abbreviation for Scheme object rather than the shared object file on Linux systems, and although they are used for similar purposes, the file formats are different.
(Optional) Merge object file
;; REPL
(concatenate-object-files "" "" "")
expense or outlayscheme-start
Packaging program entry
exist in, with
scheme-start
Wrapper program entry, wherefns
Passing parameters to the command line
;;
(scheme-start
(lambda fns
#;(initialize-application)
#;(start-application fns)))
Convert object file to boot file
;; REPL
(make-boot-file "" '("scheme") "")
; (make-boot-file "" '("scheme") "" "")
Copy the Chez Scheme executable file and name it the name of the boot file
## bash
cp /usr/bin/scheme ./out
It's ready to run!
## bash
./out -b
# scheme -b
theoreticallySCHEMEHEAPDIRS="%x:" ./out
alsocanThe name of the boot file should be recognized automatically, but it didn't work for me...