@@ -58,6 +58,19 @@ namespace: gxc
58
58
(cond-expand (darwin " -Wl,-rpath," ) (else " -Wl,-rpath=" ))
59
59
gerbil-libdir))
60
60
61
+ (def compiler-obj-suffix
62
+ (cond-expand
63
+ (visualc " .obj" )
64
+ (else " .o" )))
65
+
66
+ (def (path->string-literal path)
67
+ (string-append
68
+ " \" "
69
+ (string-map
70
+ (lambda (c ) (if (char=? c #\\ ) #\/ c))
71
+ path)
72
+ " \" " ))
73
+
61
74
(def gerbil-runtime-modules
62
75
' (" gerbil/runtime/gambit"
63
76
" gerbil/runtime/util"
@@ -222,23 +235,23 @@ namespace: gxc
222
235
(libgerbil-scm (map find-static-module-file libgerbil-deps))
223
236
(libgerbil-scm (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm))
224
237
(libgerbil-c (map (cut replace-extension <> " .c" ) libgerbil-scm))
225
- (libgerbil-o (map (cut replace-extension <> " .o " ) libgerbil-scm))
238
+ (libgerbil-o (map (cut replace-extension <> compiler-obj-suffix ) libgerbil-scm))
226
239
(src-deps (filter userlib-module? deps))
227
240
(src-deps-scm (map find-static-module-file src-deps))
228
241
(src-deps-scm (filter not-file-empty? src-deps-scm))
229
242
(src-deps-scm (map path-expand src-deps-scm))
230
243
(src-deps-c (map (cut replace-extension <> " .c" ) src-deps-scm))
231
- (src-deps-o (map (cut replace-extension <> " .o " ) src-deps-scm))
244
+ (src-deps-o (map (cut replace-extension <> compiler-obj-suffix ) src-deps-scm))
232
245
(src-bin-scm (find-static-module-file ctx))
233
246
(src-bin-scm (path-expand src-bin-scm))
234
247
(src-bin-c (replace-extension src-bin-scm " .c" ))
235
- (src-bin-o (replace-extension src-bin-scm " .o " ))
248
+ (src-bin-o (replace-extension src-bin-scm compiler-obj-suffix ))
236
249
(output-bin (path-expand output-bin))
237
250
(output-scm (path-expand output-scm))
238
251
(output-c (replace-extension output-scm " .c" ))
239
- (output-o (replace-extension output-scm " .o " ))
252
+ (output-o (replace-extension output-scm compiler-obj-suffix ))
240
253
(output_-c (replace-extension output-scm " _.c" ))
241
- (output_-o (replace-extension output-scm " _.o " ))
254
+ (output_-o (replace-extension output-scm (string-append " _ " compiler-obj-suffix) ))
242
255
(gsc-link-opts (gsc-link-options))
243
256
(gsc-cc-opts (gsc-cc-options static: #t ))
244
257
(gsc-static-opts (gsc-static-include-options gerbil-staticdir))
@@ -252,7 +265,7 @@ namespace: gxc
252
265
(cons ctx deps))))))
253
266
254
267
(def (compile-obj scm-path c-path)
255
- (let (o-path (replace-extension c-path " .o " ))
268
+ (let (o-path (replace-extension c-path compiler-obj-suffix ))
256
269
(let* ((lock (string-append o-path " .lock" ))
257
270
(locked #f )
258
271
(unlock
@@ -393,17 +406,17 @@ namespace: gxc
393
406
(gerbil-libdir (path-expand " lib" gerbil-home))
394
407
(runtime (map find-static-module-file gerbil-runtime-modules))
395
408
(gambit-sharp (path-expand " lib/_gambit#.scm" gerbil-home))
396
- (include-gambit-sharp (string-append " (include \" " gambit-sharp " \ " )" ))
409
+ (include-gambit-sharp (string-append " (include " (path->string-literal gambit-sharp) " )" ))
397
410
(bin-scm (find-static-module-file ctx))
398
411
(deps (find-runtime-module-deps ctx))
399
412
(deps (map find-static-module-file deps))
400
413
(deps (filter (? (not file-empty?)) deps))
401
414
(deps (filter (lambda (f ) (not (member f runtime))) deps))
402
415
(output-base (string-append (path-strip-extension output-scm)))
403
416
(output-c (string-append output-base " .c" ))
404
- (output-o (string-append output-base " .o " ))
417
+ (output-o (string-append output-base compiler-obj-suffix ))
405
418
(output-c_ (string-append output-base " _.c" ))
406
- (output-o_ (string-append output-base " _.o " ))
419
+ (output-o_ (string-append output-base (string-append " _ " compiler-obj-suffix) ))
407
420
(gsc-link-opts (gsc-link-options))
408
421
(gsc-cc-opts (gsc-cc-options static: #t ))
409
422
(gsc-static-opts (gsc-static-include-options (path-expand " static" gerbil-libdir)))
0 commit comments