From 3c7d023d6458669c6bfa23bc85e098c91f699892 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 13 Jul 2015 18:54:40 -0400 Subject: build-system/gnu: Pass --build= to configure by default. * guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build keyword argument. Pass it to 'gnu-build' on the build side. * guix/build/gnu-build-system.scm (configure): Accept #:build keyword argument. Unless it is false, pass --build to configure. --- guix/build-system/gnu.scm | 4 ++++ guix/build/gnu-build-system.scm | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 8702c6c915..1f302447c2 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -289,6 +289,7 @@ (define* (gnu-build store name input-drvs (phases '%standard-phases) (locale "en_US.UTF-8") (system (%current-system)) + (build (nix-system->gnu-triplet system)) (imported-modules %gnu-build-system-modules) (modules %default-modules) (substitutable? #t) @@ -333,6 +334,7 @@ (define builder (source source)) #:system ,system + #:build ,build #:outputs %outputs #:inputs %build-inputs #:search-paths ',(map search-path-specification->sexp @@ -422,6 +424,7 @@ (define* (gnu-cross-build store name (phases '%standard-phases) (locale "en_US.UTF-8") (system (%current-system)) + (build (nix-system->gnu-triplet system)) (imported-modules %gnu-build-system-modules) (modules %default-modules) (substitutable? #t) @@ -472,6 +475,7 @@ (define %build-target-inputs (source source)) #:system ,system + #:build ,build #:target ,target #:outputs %outputs #:inputs %build-target-inputs diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 5062479360..102207b022 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -184,7 +184,7 @@ (define (patch-generated-file-shebangs . rest) ;; Patch `SHELL' in generated makefiles. (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$"))) -(define* (configure #:key target native-inputs inputs outputs +(define* (configure #:key build target native-inputs inputs outputs (configure-flags '()) out-of-source? #:allow-other-keys) (define (package-name) @@ -234,6 +234,9 @@ (define (package-name) (list (string-append "--docdir=" docdir "/share/doc/" (package-name))) '()) + ,@(if build + (list (string-append "--build=" build)) + '()) ,@(if target ; cross building (list (string-append "--host=" target)) '()) -- cgit v1.2.3