buildapp 生成獨立可執行lisp程式

babyyellow發表於2012-06-28
buildapp 是一個開源lisp專案, BSD 協議  把sbcl 的lisp 程式碼編譯成獨立可執行程式。可以把lisp 指令碼編譯成一個二進位制的執行檔案由於他需要把所有的引用到的package 都會混進去,還有sbcl 的imag

。所以出來的包有點大一個hellow-world 也有4,50m

安裝:

 sbcl(ql:quickload "buildapp")

 (buildapp:build-buildapp)

windows 下就生成了 windows/system32/buildapp.exe

linux 下/usr/local/bin/buildapp

vim  a.lisp

 (defun main(argv)          
 (format t "hellow world"))
(main 1)

uildapp.exe  --output  hellow   --load a.lisp  --entry main C:\Windows\system32>buildapp.exe --output hellow --load a.lisp --entry maThis is experimental prerelease support for the Windows platform. useat your own risk. "Your Kitten of Death awaits!"This is experimental prerelease support for the Windows platform. useat your own risk. "Your Kitten of Death awaits!";; loading file #P"C:/Windows/system32/a.lisp"; file: C:/Windows/system32/a.lisp; in: DEFUN MAIN; (DEFUN MAIN (ARGV) (FORMAT T "hellow world")); --&gt PROGN SB-INT:NAMED-LAMBDA; ==>; #'(SB-INT:NAMED-LAMBDA MAIN; (ARGV); (BLOCK MAIN (FORMAT T "hellow world")));; caught STYLE-WARNING:; The variable ARGV is defined but never used.;; compilation unit finished; caught 1 STYLE-WARNING condition[undoing binding stack and other enclosing state... done][saving current Lisp image into hellow.exe:writing 2888 bytes from the read-only space at 0x22000000writing 1712 bytes from the static space at 0x22100000writing 27717632 bytes from the dynamic space at 0x22300000done]



C:\Windows\system32>hellow.exe

This is experimental prerelease support for the Windows platform. useat your own risk. "Your Kitten of Death awaits!

hellow world


C:\Windows\system32>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/133735/viewspace-734067/,如需轉載,請註明出處,否則將追究法律責任。

相關文章