From 548c15ca09afaff30cfaf1be92ebd6133859322b Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Sat, 13 Nov 1993 04:17:11 +0000 Subject: [PATCH] Check cc and ld return codes, and delete .o file after producing the shared object. --- v7/src/compiler/machines/C/ctop.scm | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) 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)) -- 2.25.1