Skip to content
Snippets Groups Projects
Commit a1232d0c authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

gnu-build-system: Improve the `configure' and `check' phases.

* guix/build/gnu-build-system.scm (configure): Print the final list of
  flags.
  (check): Add `tests?' keyword parameter.
parent 18a8dad7
No related branches found
No related tags found
No related merge requests found
...@@ -57,27 +57,35 @@ (define* (unpack #:key source #:allow-other-keys) ...@@ -57,27 +57,35 @@ (define* (unpack #:key source #:allow-other-keys)
(chdir (first-subdirectory ".")))) (chdir (first-subdirectory "."))))
(define* (configure #:key outputs (configure-flags '()) #:allow-other-keys) (define* (configure #:key outputs (configure-flags '()) #:allow-other-keys)
(let ((prefix (assoc-ref outputs "out")) (let* ((prefix (assoc-ref outputs "out"))
(libdir (assoc-ref outputs "lib")) (libdir (assoc-ref outputs "lib"))
(includedir (assoc-ref outputs "include"))) (includedir (assoc-ref outputs "include"))
(format #t "configure flags: ~s~%" configure-flags) (flags `(,(string-append "--prefix=" prefix)
(zero? (apply system* "./configure" "--enable-fast-install" ; when using Libtool
"--enable-fast-install"
(string-append "--prefix=" prefix) ;; Produce multiple outputs when specific output names
`(,@(if libdir ;; are recognized.
(list (string-append "--libdir=" libdir "/lib")) ,@(if libdir
'()) (list (string-append "--libdir=" libdir "/lib"))
,@(if includedir '())
(list (string-append "--includedir=" ,@(if includedir
includedir "/include")) (list (string-append "--includedir="
'()) includedir "/include"))
,@configure-flags))))) '())
,@configure-flags)))
(format #t "configure flags: ~s~%" flags)
(zero? (apply system* "./configure" flags))))
(define* (build #:key (make-flags '()) #:allow-other-keys) (define* (build #:key (make-flags '()) #:allow-other-keys)
(zero? (apply system* "make" make-flags))) (zero? (apply system* "make" make-flags)))
(define* (check #:key (make-flags '()) #:allow-other-keys) (define* (check #:key (make-flags '()) (tests? #t) (test-target "check")
(zero? (apply system* "make" "check" make-flags))) #:allow-other-keys)
(if tests?
(zero? (apply system* "make" test-target make-flags))
(begin
(format #t "test suite not run~%")
#t)))
(define* (install #:key (make-flags '()) #:allow-other-keys) (define* (install #:key (make-flags '()) #:allow-other-keys)
(zero? (apply system* "make" "install" make-flags))) (zero? (apply system* "make" "install" make-flags)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment