projects/aports·blob master · refs

43 lines · 1.6 KiB

1Description: Handle multiple LDFLAGS
2 Without this patch, building with LDFLAGS containing more than one flag results
3 in flags being dropped.
4Author: Graham Inggs <[email protected]>
5Bug-Debian: http://bugs.debian.org/847925
6
7--- a/src/maxima.system
8+++ b/src/maxima.system
9@@ -58,6 +58,19 @@
10 (and (apply #'compile-file file :output-file object-output args)
11 (c:build-fasl output :lisp-files (list object-output)))))
12
13+(defun split-string (string &key (item #\space) (test #'char=))
14+ ;; Splits the string into substrings at spaces.
15+ (let ((len (length string))
16+ (index 0) result)
17+ (dotimes (i len
18+ (progn (unless (= index len)
19+ (push (subseq string index) result))
20+ (reverse result)))
21+ (when (funcall test (char string i) item)
22+ (unless (= index i);; two spaces in a row
23+ (push (subseq string index i) result))
24+ (setf index (1+ i))))))
25+
26 #+ecl
27 (defun build-maxima-lib ()
28 (labels ((list-all-objects (module)
29@@ -79,12 +92,12 @@
30 :ld-flags
31 (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
32 (find-package "MAXIMA")))))
33- (if (and x (not (string= x ""))) (list x))))
34+ (if (and x (not (string= x ""))) (split-string x))))
35 (c::build-program "binary-ecl/maxima" :lisp-files obj
36 :ld-flags
37 (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
38 (find-package "MAXIMA")))))
39- (if (and x (not (string= x ""))) (list x)))
40+ (if (and x (not (string= x ""))) (split-string x)))
41 :epilogue-code '(progn (cl-user::run)))))))
42
43 (defun maxima-binary-pathname ()