diff options
author | sof <unknown> | 2002-07-09 18:02:48 +0000 |
---|---|---|
committer | sof <unknown> | 2002-07-09 18:02:48 +0000 |
commit | 689f0ca95a74bc622223b0cf1997736d43af63d0 (patch) | |
tree | b5014c9dc5c06498095c514429e58e99a6748959 /glafp-utils | |
parent | d89f0e2d2adf5ebce15984d08b1d00de60db6d78 (diff) | |
download | haskell-689f0ca95a74bc622223b0cf1997736d43af63d0.tar.gz |
[project @ 2002-07-09 18:02:48 by sof]
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.
Diffstat (limited to 'glafp-utils')
-rw-r--r-- | glafp-utils/mkdependC/mkdependC.prl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/glafp-utils/mkdependC/mkdependC.prl b/glafp-utils/mkdependC/mkdependC.prl index 26ce208a6d..95ec39ac01 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)=''; |