projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Be less noisy in a debug trace (Arity decrease)
[ghc-hetmet.git]
/
utils
/
mkdependC
/
mkdependC.prl
diff --git
a/utils/mkdependC/mkdependC.prl
b/utils/mkdependC/mkdependC.prl
index
f7af53a
..
e1f8f39
100644
(file)
--- a/
utils/mkdependC/mkdependC.prl
+++ b/
utils/mkdependC/mkdependC.prl
@@
-6,6
+6,9
@@
#
# ToDo: strip out all the .h junk
#
#
# ToDo: strip out all the .h junk
#
+
+use File::Temp qw/ tempfile tempdir /;;
+
($Pgm = $0) =~ s/.*\/([^\/]+)$/\1/;
$Usage = "usage: $Pgm: not done yet\n";
($Pgm = $0) =~ s/.*\/([^\/]+)$/\1/;
$Usage = "usage: $Pgm: not done yet\n";
@@
-122,6
+125,8
@@
sub mangle_command_line_args {
push(@Defines, $2);
} elsif ( /^(-optc)?(-I.*)/ ) {
$Include_dirs .= " $2";
push(@Defines, $2);
} elsif ( /^(-optc)?(-I.*)/ ) {
$Include_dirs .= " $2";
+ } elsif ( /^(-optc)?(-isystem.*)/ ) {
+ $Include_dirs .= " $2";
} elsif ($Dashdashes_seen != 1) { # not between -- ... --
if ( /^-v$/ ) {
} elsif ($Dashdashes_seen != 1) { # not between -- ... --
if ( /^-v$/ ) {
@@
-176,17
+181,17
@@
sub slurp_file { # follows an example in the `open' item in perl man page
$fname = &tidy_dir_names($fname);
$fname = &tidy_dir_names($fname);
- ($tempfile = $fname) =~ s/\.[^\.]*$/\.d/;
- $tempfile =~ s|.*/([^/]+)$|$1|g;
+ ($fh, $tempfile) = tempfile(DIR => '.', SUFFIX => '.d');
+ close $fh;
# ${CPP} better be 'gcc -E', or the -x option will fail...
# ..and the -MM & -MMD.
# ${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 $ignore_output");
+ $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname -o $tempfile $ignore_output");
if ($result != 0) {
# On the cheesy side..we do want to know what went wrong, so
# re-run the command.
if ($result != 0) {
# On the cheesy side..we do want to know what went wrong, so
# re-run the command.
- $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname ");
+ $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname -o $tempfile");
if ($result != 0) {
unlink($tempfile);
exit($result);
if ($result != 0) {
unlink($tempfile);
exit($result);