From: Jan Nieuwenhuizen <jann...@gnu.org>

2011-02-04  Jan Nieuwenhuizen  <jann...@gnu.org>

    * module/system/base/compile.scm (compiled-file-name): Add
    directory separator and remove colon for Mingw.  Fixes
    compilation on Windows.
---
 module/system/base/compile.scm |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm
index 7d46713..8c72e54 100644
--- a/module/system/base/compile.scm
+++ b/module/system/base/compile.scm
@@ -100,11 +100,16 @@
            ".go")
           (else (car %load-compiled-extensions))))
   (and %compile-fallback-path
-       (let ((f (string-append
+       (let* ((c (canonicalize-path file))
+             (f (string-append
                  %compile-fallback-path
                  ;; no need for '/' separator here, canonicalize-path
                  ;; will give us an absolute path
-                 (canonicalize-path file)
+                (if (eq? (string-ref c 1) #\:)
+                    ;; on Mingw remove drive-letter separator `:' to
+                    ;; obtain valid file name
+                    (substring c 2)
+                    c)
                  (compiled-extension))))
          (and (false-if-exception (ensure-writable-dir (dirname f)))
               f))))
-- 
1.7.1

-- 
Jan Nieuwenhuizen <jann...@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

Reply via email to