~ chicken-core (chicken-5) 33fcdb3a5eb3e25b25a28059c5c86c742179ca25


commit 33fcdb3a5eb3e25b25a28059c5c86c742179ca25
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Mon Aug 24 21:45:39 2015 +0200
Commit:     Moritz Heidkamp <moritz.heidkamp@bevuta.com>
CommitDate: Sun Sep 6 20:26:48 2015 +0200

    Ensure "try-compile" from setup-api cleans up tempfiles.
    
    It now creates the file with a controlled name, which can then
    be cleaned up.  Fixes #1213
    
    Signed-off-by: Moritz Heidkamp <moritz.heidkamp@bevuta.com>

diff --git a/NEWS b/NEWS
index 79519da5..f77eb857 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,9 @@
 
 4.10.1
 
+- Core libraries
+  - try-compile from setup-api cleans up temporary output files (#1213).
+
 - Runtime system:
   - The calling convention of CPS procedures has been changed to
     use "argument vectors" instead of C calling convention.
diff --git a/setup-api.scm b/setup-api.scm
index a2f8ca3d..a995d6cd 100644
--- a/setup-api.scm
+++ b/setup-api.scm
@@ -541,7 +541,7 @@
 			   cc " "
 			   (if compile-only "-c" "") " "
 			   cflags " " *target-cflags* " "
-			   fname " "
+			   (shellpath fname) " -o " (shellpath oname) " "
 			   (if compile-only
 			       "" 
 			       (conc "-L" *target-lib-home* " " ldflags " " *target-libs*) )
@@ -551,6 +551,7 @@
 		 cmd) ) ) ) )
     (when verb (print (if (zero? r) "succeeded." "failed.")))
     (ignore-errors ($system (sprintf "~A ~A" *remove-command* (shellpath fname))))
+    (ignore-errors ($system (sprintf "~A ~A" *remove-command* (shellpath oname))))
     (zero? r) ) )
 
 (define test-compile try-compile)
Trap