Hi,
this patch implements support for extracting dependency tracking
information by using the preprocessor mode of the Microsoft Visual
C/C++ compiler.
Regards,
Morten
Index: ChangeLog
===
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.891
diff -u -r1.891 ChangeLog
--- ChangeLog 2000/10/06 22:49:14 1.891
+++ ChangeLog 2000/10/09 17:46:26
@@ -1,3 +1,8 @@
+2000-10-09 Morten Eriksen <[EMAIL PROTECTED]>
+
+ * depcomp (msvisualcpp): New dependency tracking mode, this one
+ works with Microsoft Visual C++.
+
2000-10-06 Alexandre Duret-Lutz <[EMAIL PROTECTED]>
* aclocal.in (add_file): Strip comments while scanning for
Index: depcomp
===
RCS file: /cvs/automake/automake/depcomp,v
retrieving revision 1.8
diff -u -r1.8 depcomp
--- depcomp 2000/08/20 15:58:45 1.8
+++ depcomp 2000/10/09 17:46:27
@@ -263,6 +272,44 @@
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed < "$tmpdepfile" -e 's/^[^:]*: //' -e 's/$/ :/' >> "$depfile"
+ 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"
;;