# This stub of perl assumes that the following two
# variables are prepended:
#
-# TMPDIR CPP
+# DEFAULT_TMPDIR CPP
#
# ToDo: strip out all the .h junk
#
if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
$Tmp_prefix = $ENV{'TMPDIR'} . "/mkdependC$$";
} else {
- $Tmp_prefix ="${TMPDIR}/mkdependC$$";
- $ENV{'TMPDIR'} = "${TMPDIR}"; # set the env var as well
+ $Tmp_prefix ="${DEFAULT_TMPDIR}/mkdependC$$";
+ $ENV{'TMPDIR'} = "${DEFAULT_TMPDIR}"; # set the env var as well
}
$tempfile = '';
if ( /^--$/ ) {
$Dashdashes_seen++;
- } elsif ( /^-D(.*)/ ) { # recognized wherever they occur
- push(@Defines, $_);
- } elsif ( /^-I/ ) {
- $Include_dirs .= " $_";
+ } elsif ( /^(-optc)?(-D.*)/ ) { # recognized wherever they occur
+ push(@Defines, $2);
+ } elsif ( /^(-optc)?(-I.*)/ ) {
+ $Include_dirs .= " $2";
} elsif ($Dashdashes_seen != 1) { # not between -- ... --
if ( /^-v$/ ) {
# ${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");
+ $result = system("${CPP} -MM -MMD $Include_dirs @Defines -x c $fname >/dev/null");
if ($result != 0) {
unlink($tempfile);
exit($result);
$dep_contents .= $_;
}
($deps = $dep_contents) =~ s|^[^:]+:(.*)$|$1|g;
- $deps =~ s|\\| |g;
+ $deps =~ s| \\| |g;
@Deps = split(/ +/, $deps);