[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 07/16: Fix 'absolute-file-name?' and others for cross-bu
From: |
Jan Nieuwenhuizen |
Subject: |
[Guile-commits] 07/16: Fix 'absolute-file-name?' and others for cross-build to MinGW. |
Date: |
Mon, 16 May 2022 14:23:37 -0400 (EDT) |
janneke pushed a commit to branch wip-mingw
in repository guile.
commit 0deacfe06e3c9ce848253cb23fcc77a28145d2f8
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 2323b1ec5..f9b92d6ed 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] 02/16: Link fix for MinGW., (continued)
- [Guile-commits] 02/16: Link fix for MinGW., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 05/16: Support for x86_64-w64-mingw32., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 14/16: REMOVEME mingw: Hardcode compile-time-file-name-convention to 'mingw., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 16/16: DEBUG guile.cmd, wine-guile.sh: Some Wine help., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 08/16: squash! Fix 'absolute-file-name?' and others for cross-build to MinGW., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 12/16: DRAFT Add partial `scm_fcntl' support for MinGW., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 13/16: guix: Add guile-patched, guile-mingw., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 15/16: REMOVEME guix: guile-mingw: Hardcode file-name-convention., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 09/16: Make `read-bytes' suspendable for socket reads on MinGW., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 11/16: Add `scm_sigaction_for_thread' stub for MinGW., Jan Nieuwenhuizen, 2022/05/16
- [Guile-commits] 07/16: Fix 'absolute-file-name?' and others for cross-build to MinGW.,
Jan Nieuwenhuizen <=