| 1 |
|
#! /bin/sh |
| 2 |
|
# depcomp - compile a program generating dependencies as side-effects |
| 3 |
|
|
| 4 |
< |
scriptversion=2009-04-28.21; # UTC |
| 4 |
> |
scriptversion=2011-12-04.11; # UTC |
| 5 |
|
|
| 6 |
< |
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free |
| 7 |
< |
# Software Foundation, Inc. |
| 6 |
> |
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, |
| 7 |
> |
# 2011 Free Software Foundation, Inc. |
| 8 |
|
|
| 9 |
|
# This program is free software; you can redistribute it and/or modify |
| 10 |
|
# it under the terms of the GNU General Public License as published by |
| 44 |
|
object Object file output by `PROGRAMS ARGS'. |
| 45 |
|
DEPDIR directory where to store dependencies. |
| 46 |
|
depfile Dependency file to output. |
| 47 |
< |
tmpdepfile Temporary file to use when outputing dependencies. |
| 47 |
> |
tmpdepfile Temporary file to use when outputting dependencies. |
| 48 |
|
libtool Whether libtool is used (yes/no). |
| 49 |
|
|
| 50 |
|
Report bugs to <bug-automake@gnu.org>. |
| 90 |
|
# This is just like msvisualcpp but w/o cygpath translation. |
| 91 |
|
# Just convert the backslash-escaped backslashes to single forward |
| 92 |
|
# slashes to satisfy depend.m4 |
| 93 |
< |
cygpath_u="sed s,\\\\\\\\,/,g" |
| 93 |
> |
cygpath_u='sed s,\\\\,/,g' |
| 94 |
|
depmode=msvisualcpp |
| 95 |
|
fi |
| 96 |
|
|
| 97 |
+ |
if test "$depmode" = msvc7msys; then |
| 98 |
+ |
# This is just like msvc7 but w/o cygpath translation. |
| 99 |
+ |
# Just convert the backslash-escaped backslashes to single forward |
| 100 |
+ |
# slashes to satisfy depend.m4 |
| 101 |
+ |
cygpath_u='sed s,\\\\,/,g' |
| 102 |
+ |
depmode=msvc7 |
| 103 |
+ |
fi |
| 104 |
+ |
|
| 105 |
|
case "$depmode" in |
| 106 |
|
gcc3) |
| 107 |
|
## gcc 3 implements dependency tracking that does exactly what |
| 166 |
|
' < "$tmpdepfile" | |
| 167 |
|
## Some versions of gcc put a space before the `:'. On the theory |
| 168 |
|
## that the space means something, we add a space to the output as |
| 169 |
< |
## well. |
| 169 |
> |
## well. hp depmode also adds that space, but also prefixes the VPATH |
| 170 |
> |
## to the object. Take care to not repeat it in the output. |
| 171 |
|
## Some versions of the HPUX 10.20 sed can't process this invocation |
| 172 |
|
## correctly. Breaking it into two sed invocations is a workaround. |
| 173 |
< |
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
| 173 |
> |
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ |
| 174 |
> |
| sed -e 's/$/ :/' >> "$depfile" |
| 175 |
|
rm -f "$tmpdepfile" |
| 176 |
|
;; |
| 177 |
|
|
| 415 |
|
rm -f "$tmpdepfile" |
| 416 |
|
;; |
| 417 |
|
|
| 418 |
+ |
msvc7) |
| 419 |
+ |
if test "$libtool" = yes; then |
| 420 |
+ |
showIncludes=-Wc,-showIncludes |
| 421 |
+ |
else |
| 422 |
+ |
showIncludes=-showIncludes |
| 423 |
+ |
fi |
| 424 |
+ |
"$@" $showIncludes > "$tmpdepfile" |
| 425 |
+ |
stat=$? |
| 426 |
+ |
grep -v '^Note: including file: ' "$tmpdepfile" |
| 427 |
+ |
if test "$stat" = 0; then : |
| 428 |
+ |
else |
| 429 |
+ |
rm -f "$tmpdepfile" |
| 430 |
+ |
exit $stat |
| 431 |
+ |
fi |
| 432 |
+ |
rm -f "$depfile" |
| 433 |
+ |
echo "$object : \\" > "$depfile" |
| 434 |
+ |
# The first sed program below extracts the file names and escapes |
| 435 |
+ |
# backslashes for cygpath. The second sed program outputs the file |
| 436 |
+ |
# name when reading, but also accumulates all include files in the |
| 437 |
+ |
# hold buffer in order to output them again at the end. This only |
| 438 |
+ |
# works with sed implementations that can handle large buffers. |
| 439 |
+ |
sed < "$tmpdepfile" -n ' |
| 440 |
+ |
/^Note: including file: *\(.*\)/ { |
| 441 |
+ |
s//\1/ |
| 442 |
+ |
s/\\/\\\\/g |
| 443 |
+ |
p |
| 444 |
+ |
}' | $cygpath_u | sort -u | sed -n ' |
| 445 |
+ |
s/ /\\ /g |
| 446 |
+ |
s/\(.*\)/ \1 \\/p |
| 447 |
+ |
s/.\(.*\) \\/\1:/ |
| 448 |
+ |
H |
| 449 |
+ |
$ { |
| 450 |
+ |
s/.*/ / |
| 451 |
+ |
G |
| 452 |
+ |
p |
| 453 |
+ |
}' >> "$depfile" |
| 454 |
+ |
rm -f "$tmpdepfile" |
| 455 |
+ |
;; |
| 456 |
+ |
|
| 457 |
+ |
msvc7msys) |
| 458 |
+ |
# This case exists only to let depend.m4 do its work. It works by |
| 459 |
+ |
# looking at the text of this script. This case will never be run, |
| 460 |
+ |
# since it is checked for above. |
| 461 |
+ |
exit 1 |
| 462 |
+ |
;; |
| 463 |
+ |
|
| 464 |
|
#nosideeffect) |
| 465 |
|
# This comment above is used by automake to tell side-effect |
| 466 |
|
# dependency tracking mechanisms from slower ones. |
| 559 |
|
touch "$tmpdepfile" |
| 560 |
|
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" |
| 561 |
|
rm -f "$depfile" |
| 562 |
< |
cat < "$tmpdepfile" > "$depfile" |
| 562 |
> |
# makedepend may prepend the VPATH from the source file name to the object. |
| 563 |
> |
# No need to regex-escape $object, excess matching of '.' is harmless. |
| 564 |
> |
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" |
| 565 |
|
sed '1,2d' "$tmpdepfile" | tr ' ' ' |
| 566 |
|
' | \ |
| 567 |
|
## Some versions of the HPUX 10.20 sed can't process this invocation |