gcc versionitis wrt gcc -E -MM .. usage:
2.95.<wurble> 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.
# ${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)='';