X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-grovel%2Fdef-to-lisp.lisp;h=e1f54f006196283c7df17cdeb53fb1d49b7eb5d9;hb=c27ee1dba86042cb431c298699c19ed3fcd70026;hp=fe83f9c37c25f707276df665fcebe823bc413519;hpb=f51d3fd40bb44b518299f0ae626583a6899f7af2;p=sbcl.git diff --git a/contrib/sb-grovel/def-to-lisp.lisp b/contrib/sb-grovel/def-to-lisp.lisp index fe83f9c..e1f54f0 100644 --- a/contrib/sb-grovel/def-to-lisp.lisp +++ b/contrib/sb-grovel/def-to-lisp.lisp @@ -19,7 +19,7 @@ c-name c-el-name) ;; length (if distrust-length - (format stream "printf(\"nil\");") + (format stream "printf(\"|CL|:|NIL|\");") (format stream "{ ~A t;printf(\"%d\",(sizeof t.~A));}~%" c-name c-el-name)) (format stream "printf(\")\\n\");~%"))))) @@ -74,7 +74,7 @@ printf(\"(in-package ~S)\\\n\");~%" package-name) (format stream "exit(0);~%}~%"))) (defun c-constants-extract (filename output-file package) - (with-open-file (f output-file :direction :output) + (with-open-file (f output-file :direction :output :if-exists :supersede) (with-open-file (i filename :direction :input) (let* ((headers (read i)) (definitions (read i))) @@ -104,8 +104,12 @@ printf(\"(in-package ~S)\\\n\");~%" package-name) (funcall (intern "C-CONSTANTS-EXTRACT" (find-package "SB-GROVEL")) filename tmp-c-source (constants-package component)) (and - (= (run-shell-command "gcc -o ~S ~S" (namestring tmp-a-dot-out) - (namestring tmp-c-source)) 0) + (= (run-shell-command "gcc ~A -o ~S ~S" + (if (sb-ext:posix-getenv "EXTRA_CFLAGS") + (sb-ext:posix-getenv "EXTRA_CFLAGS") + "") + (namestring tmp-a-dot-out) + (namestring tmp-c-source)) 0) (= (run-shell-command "~A >~A" (namestring tmp-a-dot-out) (namestring tmp-constants)) 0)