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:
parent
2932769a9f
commit
b7231e130b
1 changed files with 50 additions and 35 deletions
|
@ -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
|
|
||||||
((null? libs) '())
|
(cond
|
||||||
|
((null? libs) '())
|
||||||
;; Turn any "FOO/libBAR.a" elements into "-lBAR".
|
|
||||||
((match-lib (car libs))
|
;; Turn any "FOO/libBAR.a" elements into "-lBAR".
|
||||||
=> (lambda (bar)
|
((match-lib (car libs))
|
||||||
(cons (string-append "-l" bar)
|
=> (lambda (bar)
|
||||||
(loop (cdr libs)))))
|
(cons (string-append "-l" bar)
|
||||||
|
(loop (cdr libs)))))
|
||||||
;; Remove any empty strings that may have seeped in there.
|
|
||||||
((string=? (car libs) "") (loop (cdr libs)))
|
;; Remove any empty strings that may have seeped in there.
|
||||||
|
((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
|
|
||||||
;; directory it was installed in.
|
;; Include libguile itself in the list, along with the directory
|
||||||
(flags (cons (string-append "-L" (get-build-info 'libdir))
|
;; it was installed in, but do *not* add /usr/lib since that may
|
||||||
(cons "-lguile" flags))))
|
;; prevent other programs from specifying non-/usr/lib versions
|
||||||
|
;; 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue