#
-# This stub of perl assumes that the following two
-# variables are prepended:
+# This perl script template assumes that definitions for
+# the following variables are prepended:
#
-# DEFAULT_TMPDIR CPP
+# DEFAULT_TMPDIR CPP BUILDPLATFORM
#
# ToDo: strip out all the .h junk
#
@Src_files = ();
@File_suffix = ();
$baseName='';
+$ignore_output='> /dev/null';
+
+if ( ${BUILDPLATFORM} eq "i386-unknown-mingw32" ) {
+ # Assuming the underlying perl uses cmd to exec system() calls.
+ $ignore_output = ">nul";
+}
if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
$Tmp_prefix = $ENV{'TMPDIR'} . "/mkdependC$$";
# and adding the new
open(OMKF,"< $Makefile.bak") || die "$Pgm: can't open $Makefile.bak: $!\n";
open(NMKF,"> $Makefile") || die "$Pgm: can't open $Makefile: $!\n";
+binmode(OMKF); # Do not add stupid ^M's to the output on Win32
+binmode(NMKF); # Do not add stupid ^M's to the output on Win32
+
select(NMKF);
$_ = <OMKF>;
while ($_ && $_ ne $Begin_magic_str) { # copy through, 'til Begin_magic_str
# ${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 $ignore_output");
+
if ($result != 0) {
- unlink($tempfile);
- exit($result);
+ # 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 ");
+ if ($result != 0) {
+ unlink($tempfile);
+ exit($result);
+ }
};
local($dep_contents)='';