From 689f0ca95a74bc622223b0cf1997736d43af63d0 Mon Sep 17 00:00:00 2001 From: sof Date: Tue, 9 Jul 2002 18:02:48 +0000 Subject: [PATCH] [project @ 2002-07-09 18:02:48 by sof] gcc versionitis wrt gcc -E -MM .. usage: 2.95. is silent on stdout if -MM is used, 2.96 ain't (even when -o is used..hmm.) 2.95 (on mingw32) even fails if you try to redirect the output. So, be more accepting in first trying to run CPP with a redirect, and if that fails, try without. --- glafp-utils/mkdependC/mkdependC.prl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/glafp-utils/mkdependC/mkdependC.prl b/glafp-utils/mkdependC/mkdependC.prl index 26ce208..95ec39a 100644 --- a/glafp-utils/mkdependC/mkdependC.prl +++ b/glafp-utils/mkdependC/mkdependC.prl @@ -163,10 +163,18 @@ sub slurp_file { # follows an example in the `open' item in perl man page # ${CPP} better be 'gcc -E', or the -x option will fail... # ..and the -MM & -MMD. - $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname >/dev/null"); + $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname > /dev/null"); + if ($result != 0) { - unlink($tempfile); - exit($result); + # On the cheesy side..we do want to know what went wrong, so + # re-run the command. (This also has the beneficial effect + # of fixing a redirection problem with gcc-2.95 builds used with + # mingw32.) + $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname "); + if ($result != 0) { + unlink($tempfile); + exit($result); + } }; local($dep_contents)=''; -- 1.7.10.4