build-system/gnu: Pass --build=<triplet> 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.
This commit is contained in:
		
							parent
							
								
									f727ec5bc8
								
							
						
					
					
						commit
						3c7d023d64
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		|  | @ -289,6 +289,7 @@ standard packages used as implicit inputs of the GNU build system." | ||||||
|                     (phases '%standard-phases) |                     (phases '%standard-phases) | ||||||
|                     (locale "en_US.UTF-8") |                     (locale "en_US.UTF-8") | ||||||
|                     (system (%current-system)) |                     (system (%current-system)) | ||||||
|  |                     (build (nix-system->gnu-triplet system)) | ||||||
|                     (imported-modules %gnu-build-system-modules) |                     (imported-modules %gnu-build-system-modules) | ||||||
|                     (modules %default-modules) |                     (modules %default-modules) | ||||||
|                     (substitutable? #t) |                     (substitutable? #t) | ||||||
|  | @ -333,6 +334,7 @@ are allowed to refer to." | ||||||
|                               (source |                               (source | ||||||
|                                source)) |                                source)) | ||||||
|                   #:system ,system |                   #:system ,system | ||||||
|  |                   #:build ,build | ||||||
|                   #:outputs %outputs |                   #:outputs %outputs | ||||||
|                   #:inputs %build-inputs |                   #:inputs %build-inputs | ||||||
|                   #:search-paths ',(map search-path-specification->sexp |                   #:search-paths ',(map search-path-specification->sexp | ||||||
|  | @ -422,6 +424,7 @@ is one of `host' or `target'." | ||||||
|                           (phases '%standard-phases) |                           (phases '%standard-phases) | ||||||
|                           (locale "en_US.UTF-8") |                           (locale "en_US.UTF-8") | ||||||
|                           (system (%current-system)) |                           (system (%current-system)) | ||||||
|  |                           (build (nix-system->gnu-triplet system)) | ||||||
|                           (imported-modules %gnu-build-system-modules) |                           (imported-modules %gnu-build-system-modules) | ||||||
|                           (modules %default-modules) |                           (modules %default-modules) | ||||||
|                           (substitutable? #t) |                           (substitutable? #t) | ||||||
|  | @ -472,6 +475,7 @@ platform." | ||||||
|                                 (source |                                 (source | ||||||
|                                  source)) |                                  source)) | ||||||
|                     #:system ,system |                     #:system ,system | ||||||
|  |                     #:build ,build | ||||||
|                     #:target ,target |                     #:target ,target | ||||||
|                     #:outputs %outputs |                     #:outputs %outputs | ||||||
|                     #:inputs %build-target-inputs |                     #:inputs %build-target-inputs | ||||||
|  |  | ||||||
|  | @ -184,7 +184,7 @@ makefiles." | ||||||
|   ;; Patch `SHELL' in generated makefiles. |   ;; Patch `SHELL' in generated makefiles. | ||||||
|   (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$"))) |   (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? |                     (configure-flags '()) out-of-source? | ||||||
|                     #:allow-other-keys) |                     #:allow-other-keys) | ||||||
|   (define (package-name) |   (define (package-name) | ||||||
|  | @ -234,6 +234,9 @@ makefiles." | ||||||
|                              (list (string-append "--docdir=" docdir |                              (list (string-append "--docdir=" docdir | ||||||
|                                                   "/share/doc/" (package-name))) |                                                   "/share/doc/" (package-name))) | ||||||
|                              '()) |                              '()) | ||||||
|  |                        ,@(if build | ||||||
|  |                              (list (string-append "--build=" build)) | ||||||
|  |                              '()) | ||||||
|                        ,@(if target               ; cross building |                        ,@(if target               ; cross building | ||||||
|                              (list (string-append "--host=" target)) |                              (list (string-append "--host=" target)) | ||||||
|                              '()) |                              '()) | ||||||
|  |  | ||||||
		Reference in a new issue