From: Guillermo J. Rozas Date: Sat, 13 Nov 1993 04:17:11 +0000 (+0000) Subject: Check cc and ld return codes, and delete .o file after producing the shared X-Git-Tag: 20090517-FFI~7513 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=548c15ca09afaff30cfaf1be92ebd6133859322b;p=mit-scheme.git Check cc and ld return codes, and delete .o file after producing the shared object. --- diff --git a/v7/src/compiler/machines/C/ctop.scm b/v7/src/compiler/machines/C/ctop.scm index feacf6007..383c8a50f 100644 --- a/v7/src/compiler/machines/C/ctop.scm +++ b/v7/src/compiler/machines/C/ctop.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: ctop.scm,v 1.4 1993/11/13 03:51:55 gjr Exp $ +$Id: ctop.scm,v 1.5 1993/11/13 04:17:11 gjr Exp $ Copyright (c) 1992-1993 Massachusetts Institute of Technology @@ -82,20 +82,27 @@ MIT in each case. |# (newline) (display ";Compiling ") (display source) - (apply call/cc - (append (c-compiler-switches) (list source))) + (let ((result + (apply call/cc + (append (c-compiler-switches) (list source))))) + (if (not (zero? result)) + (error "c-compile: C compiler failed" source))) (set! *call/cc-c-compiler* compiler:c-linker-name) (newline) (display ";Linking ") (display object) - (apply call/cc - (append (list "-o") - (list - (enough-namestring - (pathname-new-type pathname - (c-output-extension)))) - (c-linker-switches) - (list object)))))) + (let ((result + (apply call/cc + (append (list "-o") + (list + (enough-namestring + (pathname-new-type pathname + (c-output-extension)))) + (c-linker-switches) + (list object))))) + (if (not (zero? result)) + (error "c-compile: C linker failed" object))) + (delete-file object)))) (define (c-output-extension) (cond ((not (eq? compiler:c-linker-output-extension 'UNKNOWN))