guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: build/zig: Adjust the build triplets for some systems.


From: guix-commits
Subject: 01/04: build/zig: Adjust the build triplets for some systems.
Date: Sat, 16 Nov 2024 16:40:13 -0500 (EST)

efraim pushed a commit to branch wip-zig-bootstrap
in repository guix.

commit dabaf5fcc90cae9c2569c54e890f2d496a0a9ca3
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sat Nov 16 23:16:36 2024 +0200

    build/zig: Adjust the build triplets for some systems.
    
    * guix/build/zig-build-system.scm (zig-target): New procedure.
    (build): Use it to set the target when cross-compiling.
    
    Change-Id: Ic82253ce899055526e894a0cb67738ddbb476574
---
 guix/build/zig-build-system.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/guix/build/zig-build-system.scm b/guix/build/zig-build-system.scm
index 1971a3be65..869fe641b9 100644
--- a/guix/build/zig-build-system.scm
+++ b/guix/build/zig-build-system.scm
@@ -59,6 +59,17 @@ gcc_dir=")
      port)
     (close-port port)))
 
+(define (zig-target target)
+  (cond ((string=? "i686-linux-gnu" target)
+         "x86-linux-gnu")
+        ((string=? "i586-pc-gnu" target)
+         "x86-hurd-gnu")
+        ((string=? "x86_64-w64-mingw32" target)
+         "x86_64-windows-gnu")
+        ((string=? "i686-w64-mingw32" target)
+         "x86-windows-gnu")
+        (else target)))
+
 (define* (build #:key
                 zig-build-flags
                 zig-release-type       ;; "safe", "fast" or "small" empty for a
@@ -74,7 +85,7 @@ gcc_dir=")
                      "--prefix-exe-dir"     "bin"
                      "--prefix-include-dir" "include"
                      ,@(if target
-                         (list (string-append "-Dtarget=" target))
+                         (list (string-append "-Dtarget=" (zig-target target)))
                          '())
                      ,@(if zig-release-type
                          (list (string-append "-Drelease-" zig-release-type))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]