The :prologue-code in cmp:builder is now executed after cl_boot() and it can be lisp code.

This commit is contained in:
Juan Jose Garcia Ripoll 2009-11-01 02:38:36 +01:00
parent 41c4586f65
commit 6e7caff184

View file

@ -261,8 +261,8 @@ void ~A(cl_object cblock)
int
main(int argc, char **argv)
{
~A
cl_boot(argc, argv);
~A
read_VV(OBJNULL, ~A);
~A
}")
@ -275,9 +275,9 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
{
char **argv;
int argc;
~A
ecl_get_commandline_args(&argc, &argv);
cl_boot(argc, argv);
~A
read_VV(OBJNULL, ~A);
~A
}")
@ -416,6 +416,22 @@ return 1;"
stream))
(princ #\} stream)
)))))
(cond ((null prologue-code)
(setf prologue-code ""))
((stringp prologue-code)
)
(t
(with-standard-io-syntax
(setq prologue-code
(with-output-to-string (stream)
(princ "{ const char *lisp_code = " stream)
(wt-filtered-data (write-to-string prologue-code) stream)
(princ ";
cl_object output;
si_select_package(make_simple_base_string(\"CL-USER\"));
output = si_safe_eval(3, ecl_read_from_cstring(lisp_code), Cnil, OBJNULL);
}" stream)
)))))
;;
;; When a module is built out of several object files, we have to
;; create an additional object file that initializes those ones.