X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-grovel%2Fdef-to-lisp.lisp;h=1356609b204cf650ba2af846955baaabab286e50;hb=07d6dd986728e8ea781954f5a3c2799ff0418ecb;hp=e091d5968a4cd3cda778dced4cf858eecf9356dc;hpb=833f66a5363cf6c3a4082afcf9d76cec72e7cdf8;p=sbcl.git diff --git a/contrib/sb-grovel/def-to-lisp.lisp b/contrib/sb-grovel/def-to-lisp.lisp index e091d59..1356609 100644 --- a/contrib/sb-grovel/def-to-lisp.lisp +++ b/contrib/sb-grovel/def-to-lisp.lisp @@ -5,6 +5,15 @@ (defun escape-for-string (string) (c-escape string)) +(defun split-cflags (string) + (remove-if (lambda (flag) + (zerop (length flag))) + (loop + for start = 0 then (if end (1+ end) nil) + for end = (and start (position #\Space string :start start)) + while start + collect (subseq string start end)))) + (defun c-escape (string &optional (dangerous-chars '(#\")) (escape-char #\\)) "Escape DANGEROUS-CHARS in STRING, with ESCAPE-CHAR." (coerce (loop for c across string @@ -178,9 +187,7 @@ code: (sb-ext:run-program "gcc" (append - (let ((cf (sb-ext:posix-getenv "EXTRA_CFLAGS"))) - (when (plusp (length cf)) - (list cf))) + (split-cflags (sb-ext:posix-getenv "EXTRA_CFLAGS")) (list "-o" (namestring tmp-a-dot-out) (namestring tmp-c-source)))