From e2944354a15a3753a050e4bbe65b6be4ec5be216 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 16 Oct 2000 19:34:57 +0000 Subject: [PATCH] * depcomp (msvisualcpp): New dependency tracking mode, for Microsoft Visual C++. --- ChangeLog | 5 +++++ depcomp | 46 ++++++++++++++++++++++++++++++++++++++++++---- lib/depcomp | 46 ++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 89 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91f163c2..fd2890cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-10-16 Morten Eriksen + + * depcomp (msvisualcpp): New dependency tracking mode, for + Microsoft Visual C++. + 2000-10-16 Morten Eriksen * depcomp: Fix a bug in SGI dependency tracking mode with source diff --git a/depcomp b/depcomp index b1a74e19..4779ed07 100755 --- a/depcomp +++ b/depcomp @@ -67,7 +67,7 @@ gcc) rm -f "$tmpdepfile" exit $stat fi - rm -f "$depfile" + rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. @@ -124,7 +124,7 @@ sgi) rm -f "$tmpdepfile" exit $stat fi - rm -f "$depfile" + rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" @@ -185,7 +185,7 @@ dashmstdout) stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi - rm -f "$depfile" + rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ @@ -229,7 +229,7 @@ makedepend) stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi - rm -f "$depfile" + rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tail +3 "$tmpdepfile" | tr ' ' ' ' | \ @@ -275,6 +275,44 @@ cpp) rm -f "$tmpdepfile" ;; +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + none) exec "$@" ;; diff --git a/lib/depcomp b/lib/depcomp index b1a74e19..4779ed07 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -67,7 +67,7 @@ gcc) rm -f "$tmpdepfile" exit $stat fi - rm -f "$depfile" + rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. @@ -124,7 +124,7 @@ sgi) rm -f "$tmpdepfile" exit $stat fi - rm -f "$depfile" + rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" @@ -185,7 +185,7 @@ dashmstdout) stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi - rm -f "$depfile" + rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ @@ -229,7 +229,7 @@ makedepend) stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi - rm -f "$depfile" + rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tail +3 "$tmpdepfile" | tr ' ' ' ' | \ @@ -275,6 +275,44 @@ cpp) rm -f "$tmpdepfile" ;; +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + none) exec "$@" ;; -- 2.43.5