1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 20:30:28 +02:00

* guile-config.in (build-link): don't output -L/usr/lib.

(build-compile): don't output -I/usr/include.
This commit is contained in:
Rob Browning 2002-03-03 20:36:42 +00:00
parent 2932769a9f
commit b7231e130b

View file

@ -140,35 +140,45 @@
(string-append program-name (string-append program-name
" link: arguments to subcommand not yet implemented"))) " link: arguments to subcommand not yet implemented")))
(let* ((flags (let ((libdir (get-build-info 'libdir))
(let loop ((libs (other-flags
;; Get the string of linker flags we used to build (let loop ((libs
;; Guile, and break it up into a list. ;; Get the string of linker flags we used to build
(separate-fields-discarding-char #\space ;; Guile, and break it up into a list.
(get-build-info 'LIBS) (separate-fields-discarding-char #\space
list))) (get-build-info 'LIBS)
list)))
(cond (cond
((null? libs) '()) ((null? libs) '())
;; Turn any "FOO/libBAR.a" elements into "-lBAR". ;; Turn any "FOO/libBAR.a" elements into "-lBAR".
((match-lib (car libs)) ((match-lib (car libs))
=> (lambda (bar) => (lambda (bar)
(cons (string-append "-l" bar) (cons (string-append "-l" bar)
(loop (cdr libs))))) (loop (cdr libs)))))
;; Remove any empty strings that may have seeped in there. ;; Remove any empty strings that may have seeped in there.
((string=? (car libs) "") (loop (cdr libs))) ((string=? (car libs) "") (loop (cdr libs)))
(else (cons (car libs) (loop (cdr libs))))))) (else (cons (car libs) (loop (cdr libs))))))))
;; Include libguile itself in the list, along with the ;; Include libguile itself in the list, along with the directory
;; directory it was installed in. ;; it was installed in, but do *not* add /usr/lib since that may
(flags (cons (string-append "-L" (get-build-info 'libdir)) ;; prevent other programs from specifying non-/usr/lib versions
(cons "-lguile" flags)))) ;; via their foo-config scripts. If *any* app puts -L/usr/lib in
;; the output of its foo-config script then it may prevent the use
;; a non-/usr/lib install of anything that also has a /usr/lib
;; install. For now we hard-code /usr/lib, but later maybe we can
;; do something more dynamic (i.e. what do we need.
;; Display the flags, separated by spaces. ;; Display the flags, separated by spaces.
(display-separated flags) (if (or (string=? libdir "/usr/lib")
(string=? libdir "/usr/lib/"))
(display-separated (cons "-lguile" other-flags))
(display-separated (cons
(string-append "-L" (get-build-info 'libdir))
(cons "-lguile" other-flags))))
(newline))) (newline)))
(define (help-link) (define (help-link)
@ -191,7 +201,12 @@
(error (error
(string-append program-name (string-append program-name
" compile: no arguments expected"))) " compile: no arguments expected")))
(display-line "-I" (get-build-info 'includedir)))
;; See gcc manual wrt fixincludes. Search for "Use of
;; `-I/usr/include' may cause trouble." For now we hard-code this.
;; Later maybe we can do something more dynamic.
(if (not (string=? (get-build-info 'includedir) "/usr/include"))
(display-line "-I" (get-build-info 'includedir))))
(define (help-compile) (define (help-compile)
(let ((dle display-line-error)) (let ((dle display-line-error))
@ -258,12 +273,12 @@
(newline port)) (newline port))
(define (display-separated args) (define (display-separated args)
(let loop ((args args)) (if (not (null? args))
(cond ((null? args)) (begin
((null? (cdr args)) (display (car args))) (display (car args))
(else (display (car args)) (for-each
(display " ") (lambda (arg) (display " ") (display arg))
(loop (cdr args)))))) (cdr args)))))
;;;; the command table ;;;; the command table