utils: Add as-for-target.
* guix/utils.scm (as-for-target): New function. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
		
							parent
							
								
									f9a267c6d2
								
							
						
					
					
						commit
						68edaf467f
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -15,6 +15,7 @@
 | 
				
			||||||
;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
 | 
					;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
 | 
				
			||||||
;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
 | 
					;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
 | 
				
			||||||
;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 | 
					;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 | 
				
			||||||
 | 
					;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 | 
				
			||||||
;;;
 | 
					;;;
 | 
				
			||||||
;;; This file is part of GNU Guix.
 | 
					;;; This file is part of GNU Guix.
 | 
				
			||||||
;;;
 | 
					;;;
 | 
				
			||||||
| 
						 | 
					@ -103,6 +104,7 @@
 | 
				
			||||||
            target-riscv64?
 | 
					            target-riscv64?
 | 
				
			||||||
            target-64bit?
 | 
					            target-64bit?
 | 
				
			||||||
            ar-for-target
 | 
					            ar-for-target
 | 
				
			||||||
 | 
					            as-for-target
 | 
				
			||||||
            cc-for-target
 | 
					            cc-for-target
 | 
				
			||||||
            cxx-for-target
 | 
					            cxx-for-target
 | 
				
			||||||
            ld-for-target
 | 
					            ld-for-target
 | 
				
			||||||
| 
						 | 
					@ -742,6 +744,11 @@ architecture (x86_64)?"
 | 
				
			||||||
      (string-append target "-ar")
 | 
					      (string-append target "-ar")
 | 
				
			||||||
      "ar"))
 | 
					      "ar"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define* (as-for-target #:optional (target (%current-target-system)))
 | 
				
			||||||
 | 
					  (if target
 | 
				
			||||||
 | 
					      (string-append target "-as")
 | 
				
			||||||
 | 
					      "as"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define* (cc-for-target #:optional (target (%current-target-system)))
 | 
					(define* (cc-for-target #:optional (target (%current-target-system)))
 | 
				
			||||||
  (if target
 | 
					  (if target
 | 
				
			||||||
      (string-append target "-gcc")
 | 
					      (string-append target "-gcc")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue