[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 07/25: Fix 'absolute-file-name?' and others for cross-bu
From: |
Mike Gran |
Subject: |
[Guile-commits] 07/25: Fix 'absolute-file-name?' and others for cross-build to MinGW. |
Date: |
Thu, 10 Nov 2022 18:06:17 -0500 (EST) |
mike121 pushed a commit to branch wip-mingw
in repository guile.
commit 96597fa21df14c82eeb3bdb685499caf46c729df
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Thu Mar 18 07:46:49 2021 +0100
Fix 'absolute-file-name?' and others for cross-build to MinGW.
* module/ice-9/boot-9.scm (compile-time-file-name-convention): New
procedure, defined only when loading.
(compile-time-case): Use it to correctly determine system file name
convention while compiling.
---
module/ice-9/boot-9.scm | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index a46145ed5..d4a7d2327 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2060,6 +2060,16 @@ non-locally, that exit determines the continuation."
;;; {Load Paths}
;;;
+(eval-when (eval)
+ (define (compile-time-file-name-convention)
+ (let ((target ((@ (system base target) target-type))))
+ (cond ((equal? target %host-type)
+ (system-file-name-convention))
+ ((string-contains-ci target "mingw")
+ 'windows)
+ (else
+ 'posix)))))
+
(let-syntax ((compile-time-case
(lambda (stx)
(syntax-case stx ()
@@ -2077,7 +2087,9 @@ non-locally, that exit determines the continuation."
#'(begin form ...)
(next-clause #'(clauses ...))))))))))))
;; emacs: (put 'compile-time-case 'scheme-indent-function 1)
- (compile-time-case (system-file-name-convention)
+ (compile-time-case (or (and (defined? 'compile-time-file-name-convention)
+ (compile-time-file-name-convention))
+ 'posix)
((posix)
(define (file-name-separator? c)
(char=? c #\/))
- [Guile-commits] 04/25: Add 'set-port-binary/text-mode!' procedure for MinGW., (continued)
- [Guile-commits] 04/25: Add 'set-port-binary/text-mode!' procedure for MinGW., Mike Gran, 2022/11/10
- [Guile-commits] 03/25: mingw: canonicalize-path: Also canonicalize drive letter and '/'., Mike Gran, 2022/11/10
- [Guile-commits] 02/25: Link fix for MinGW., Mike Gran, 2022/11/10
- [Guile-commits] 09/25: Make `read-bytes' suspendable for socket reads on MinGW., Mike Gran, 2022/11/10
- [Guile-commits] 11/25: Add `scm_sigaction_for_thread' stub for MinGW., Mike Gran, 2022/11/10
- [Guile-commits] 12/25: DRAFT Add partial `scm_fcntl' support for MinGW., Mike Gran, 2022/11/10
- [Guile-commits] 14/25: REMOVEME mingw: Hardcode compile-time-file-name-convention to 'mingw., Mike Gran, 2022/11/10
- [Guile-commits] 15/25: REMOVEME guix: guile-mingw: Hardcode file-name-convention., Mike Gran, 2022/11/10
- [Guile-commits] 16/25: DEBUG guile.cmd, wine-guile.sh: Some Wine help., Mike Gran, 2022/11/10
- [Guile-commits] 05/25: Support for x86_64-w64-mingw32., Mike Gran, 2022/11/10
- [Guile-commits] 07/25: Fix 'absolute-file-name?' and others for cross-build to MinGW.,
Mike Gran <=
- [Guile-commits] 13/25: guix: Add guile-patched, guile-mingw., Mike Gran, 2022/11/10
- [Guile-commits] 19/25: For MinGW, use native signal func in sigaction, Mike Gran, 2022/11/10
- [Guile-commits] 22/25: Revert "Fix 'absolute-file-name?' and others for cross-build to MinGW.", Mike Gran, 2022/11/10
- [Guile-commits] 17/25: MinGW 64: fixes hash out-of-range error for 64-bit negative numbers, Mike Gran, 2022/11/10
- [Guile-commits] 18/25: More long integer fixes for x86_64-w64-mingw32, Mike Gran, 2022/11/10
- [Guile-commits] 20/25: Revert "REMOVEME mingw: Hardcode compile-time-file-name-convention to 'mingw.", Mike Gran, 2022/11/10
- [Guile-commits] 24/25: Avoids sign extension error in bytevector construction, Mike Gran, 2022/11/10
- [Guile-commits] 25/25: Avoid mysterious "error no error" message in pipe, Mike Gran, 2022/11/10