構建 Buildapp

可以使用 buildapp 構建獨立的 Common Lisp 二進位制檔案。在我們使用它來生成二進位制檔案之前,我們需要安裝並構建它。

我知道如何使用 quicklisp 和 Common Lisp 這個最簡單的方法 (這個例子使用了[sbcl],但是它應該與你所擁有的不同)。

$ sbcl

This is SBCL 1.3.5.nixos, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.

* (ql:quickload :buildapp)
To load "buildapp":
  Load 1 ASDF system:
    buildapp
; Loading "buildapp"

(:BUILDAPP)

* (buildapp:build-buildapp)
;; loading system "buildapp"
[undoing binding stack and other enclosing state... done]
[saving current Lisp image into /home/inaimathi/buildapp:
writing 4800 bytes from the read-only space at 0x20000000
writing 3216 bytes from the static space at 0x20100000
writing 47349760 bytes from the dynamic space at 0x1000000000
done]
NIL

* (quit)

$ ls -lh buildapp 
-rwxr-xr-x 1 inaimathi inaimathi 46M Aug 13 20:12 buildapp
$

一旦構建了二進位制檔案,就可以使用它來構建 Common Lisp 程式的二進位制檔案。如果你打算這麼做,你也應該把它放在你的 PATH 上,這樣你就可以從任何目錄中使用 buildapp 執行它。