From 78cc1e0703bac20f6cf4eb2f0c1e26992f347afc Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Wed, 29 Apr 2015 15:15:57 +0100 Subject: [PATCH] Remove temporary files created during configuration tests. --- scripts/mk_util.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 547379aecee..e40a549a167 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -227,7 +227,13 @@ def test_openmp(cc): t.add('#include\nint main() { return omp_in_parallel() ? 1 : 0; }\n') t.commit() if IS_WINDOWS: - return exec_compiler_cmd([cc, CPPFLAGS, 'tstomp.cpp', LDFLAGS, '/openmp']) == 0 + r = exec_compiler_cmd([cc, CPPFLAGS, 'tstomp.cpp', LDFLAGS, '/openmp']) == 0 + try: + rmf('tstomp.obj') + rmf('tstomp.exe') + except: + pass + return r else: return exec_compiler_cmd([cc, CPPFLAGS, 'tstomp.cpp', LDFLAGS, '-fopenmp']) == 0 @@ -357,10 +363,14 @@ def check_ml(): r = exec_cmd([OCAMLOPT, '-o', 'a.out', 'hello.ml']) if r != 0: raise MKException('Failed testing ocamlopt compiler. Set environment variable OCAMLOPT with the path to the Ocaml native compiler. Note that ocamlopt may require flexlink to be in your path.') - rmf('hello.cmi') - rmf('hello.cmo') - rmf('hello.cmx') - rmf('a.out') + try: + rmf('hello.cmi') + rmf('hello.cmo') + rmf('hello.cmx') + rmf('a.out') + rmf('hello.o') + except: + pass find_ml_lib() find_ocaml_find()