1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tools/pcre/depcomp Tue Jul 28 17:51:34 2009 -0400
1.3 @@ -0,0 +1,589 @@
1.4 +#! /bin/sh
1.5 +# depcomp - compile a program generating dependencies as side-effects
1.6 +
1.7 +scriptversion=2007-03-29.01
1.8 +
1.9 +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
1.10 +# Foundation, Inc.
1.11 +
1.12 +# This program is free software; you can redistribute it and/or modify
1.13 +# it under the terms of the GNU General Public License as published by
1.14 +# the Free Software Foundation; either version 2, or (at your option)
1.15 +# any later version.
1.16 +
1.17 +# This program is distributed in the hope that it will be useful,
1.18 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 +# GNU General Public License for more details.
1.21 +
1.22 +# You should have received a copy of the GNU General Public License
1.23 +# along with this program; if not, write to the Free Software
1.24 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1.25 +# 02110-1301, USA.
1.26 +
1.27 +# As a special exception to the GNU General Public License, if you
1.28 +# distribute this file as part of a program that contains a
1.29 +# configuration script generated by Autoconf, you may include it under
1.30 +# the same distribution terms that you use for the rest of that program.
1.31 +
1.32 +# Originally written by Alexandre Oliva <[email protected]>.
1.33 +
1.34 +case $1 in
1.35 + '')
1.36 + echo "$0: No command. Try \`$0 --help' for more information." 1>&2
1.37 + exit 1;
1.38 + ;;
1.39 + -h | --h*)
1.40 + cat <<\EOF
1.41 +Usage: depcomp [--help] [--version] PROGRAM [ARGS]
1.42 +
1.43 +Run PROGRAMS ARGS to compile a file, generating dependencies
1.44 +as side-effects.
1.45 +
1.46 +Environment variables:
1.47 + depmode Dependency tracking mode.
1.48 + source Source file read by `PROGRAMS ARGS'.
1.49 + object Object file output by `PROGRAMS ARGS'.
1.50 + DEPDIR directory where to store dependencies.
1.51 + depfile Dependency file to output.
1.52 + tmpdepfile Temporary file to use when outputing dependencies.
1.53 + libtool Whether libtool is used (yes/no).
1.54 +
1.55 +Report bugs to <[email protected]>.
1.56 +EOF
1.57 + exit $?
1.58 + ;;
1.59 + -v | --v*)
1.60 + echo "depcomp $scriptversion"
1.61 + exit $?
1.62 + ;;
1.63 +esac
1.64 +
1.65 +if test -z "$depmode" || test -z "$source" || test -z "$object"; then
1.66 + echo "depcomp: Variables source, object and depmode must be set" 1>&2
1.67 + exit 1
1.68 +fi
1.69 +
1.70 +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
1.71 +depfile=${depfile-`echo "$object" |
1.72 + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
1.73 +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
1.74 +
1.75 +rm -f "$tmpdepfile"
1.76 +
1.77 +# Some modes work just like other modes, but use different flags. We
1.78 +# parameterize here, but still list the modes in the big case below,
1.79 +# to make depend.m4 easier to write. Note that we *cannot* use a case
1.80 +# here, because this file can only contain one case statement.
1.81 +if test "$depmode" = hp; then
1.82 + # HP compiler uses -M and no extra arg.
1.83 + gccflag=-M
1.84 + depmode=gcc
1.85 +fi
1.86 +
1.87 +if test "$depmode" = dashXmstdout; then
1.88 + # This is just like dashmstdout with a different argument.
1.89 + dashmflag=-xM
1.90 + depmode=dashmstdout
1.91 +fi
1.92 +
1.93 +case "$depmode" in
1.94 +gcc3)
1.95 +## gcc 3 implements dependency tracking that does exactly what
1.96 +## we want. Yay! Note: for some reason libtool 1.4 doesn't like
1.97 +## it if -MD -MP comes after the -MF stuff. Hmm.
1.98 +## Unfortunately, FreeBSD c89 acceptance of flags depends upon
1.99 +## the command line argument order; so add the flags where they
1.100 +## appear in depend2.am. Note that the slowdown incurred here
1.101 +## affects only configure: in makefiles, %FASTDEP% shortcuts this.
1.102 + for arg
1.103 + do
1.104 + case $arg in
1.105 + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
1.106 + *) set fnord "$@" "$arg" ;;
1.107 + esac
1.108 + shift # fnord
1.109 + shift # $arg
1.110 + done
1.111 + "$@"
1.112 + stat=$?
1.113 + if test $stat -eq 0; then :
1.114 + else
1.115 + rm -f "$tmpdepfile"
1.116 + exit $stat
1.117 + fi
1.118 + mv "$tmpdepfile" "$depfile"
1.119 + ;;
1.120 +
1.121 +gcc)
1.122 +## There are various ways to get dependency output from gcc. Here's
1.123 +## why we pick this rather obscure method:
1.124 +## - Don't want to use -MD because we'd like the dependencies to end
1.125 +## up in a subdir. Having to rename by hand is ugly.
1.126 +## (We might end up doing this anyway to support other compilers.)
1.127 +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
1.128 +## -MM, not -M (despite what the docs say).
1.129 +## - Using -M directly means running the compiler twice (even worse
1.130 +## than renaming).
1.131 + if test -z "$gccflag"; then
1.132 + gccflag=-MD,
1.133 + fi
1.134 + "$@" -Wp,"$gccflag$tmpdepfile"
1.135 + stat=$?
1.136 + if test $stat -eq 0; then :
1.137 + else
1.138 + rm -f "$tmpdepfile"
1.139 + exit $stat
1.140 + fi
1.141 + rm -f "$depfile"
1.142 + echo "$object : \\" > "$depfile"
1.143 + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
1.144 +## The second -e expression handles DOS-style file names with drive letters.
1.145 + sed -e 's/^[^:]*: / /' \
1.146 + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
1.147 +## This next piece of magic avoids the `deleted header file' problem.
1.148 +## The problem is that when a header file which appears in a .P file
1.149 +## is deleted, the dependency causes make to die (because there is
1.150 +## typically no way to rebuild the header). We avoid this by adding
1.151 +## dummy dependencies for each header file. Too bad gcc doesn't do
1.152 +## this for us directly.
1.153 + tr ' ' '
1.154 +' < "$tmpdepfile" |
1.155 +## Some versions of gcc put a space before the `:'. On the theory
1.156 +## that the space means something, we add a space to the output as
1.157 +## well.
1.158 +## Some versions of the HPUX 10.20 sed can't process this invocation
1.159 +## correctly. Breaking it into two sed invocations is a workaround.
1.160 + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
1.161 + rm -f "$tmpdepfile"
1.162 + ;;
1.163 +
1.164 +hp)
1.165 + # This case exists only to let depend.m4 do its work. It works by
1.166 + # looking at the text of this script. This case will never be run,
1.167 + # since it is checked for above.
1.168 + exit 1
1.169 + ;;
1.170 +
1.171 +sgi)
1.172 + if test "$libtool" = yes; then
1.173 + "$@" "-Wp,-MDupdate,$tmpdepfile"
1.174 + else
1.175 + "$@" -MDupdate "$tmpdepfile"
1.176 + fi
1.177 + stat=$?
1.178 + if test $stat -eq 0; then :
1.179 + else
1.180 + rm -f "$tmpdepfile"
1.181 + exit $stat
1.182 + fi
1.183 + rm -f "$depfile"
1.184 +
1.185 + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
1.186 + echo "$object : \\" > "$depfile"
1.187 +
1.188 + # Clip off the initial element (the dependent). Don't try to be
1.189 + # clever and replace this with sed code, as IRIX sed won't handle
1.190 + # lines with more than a fixed number of characters (4096 in
1.191 + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
1.192 + # the IRIX cc adds comments like `#:fec' to the end of the
1.193 + # dependency line.
1.194 + tr ' ' '
1.195 +' < "$tmpdepfile" \
1.196 + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
1.197 + tr '
1.198 +' ' ' >> $depfile
1.199 + echo >> $depfile
1.200 +
1.201 + # The second pass generates a dummy entry for each header file.
1.202 + tr ' ' '
1.203 +' < "$tmpdepfile" \
1.204 + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
1.205 + >> $depfile
1.206 + else
1.207 + # The sourcefile does not contain any dependencies, so just
1.208 + # store a dummy comment line, to avoid errors with the Makefile
1.209 + # "include basename.Plo" scheme.
1.210 + echo "#dummy" > "$depfile"
1.211 + fi
1.212 + rm -f "$tmpdepfile"
1.213 + ;;
1.214 +
1.215 +aix)
1.216 + # The C for AIX Compiler uses -M and outputs the dependencies
1.217 + # in a .u file. In older versions, this file always lives in the
1.218 + # current directory. Also, the AIX compiler puts `$object:' at the
1.219 + # start of each line; $object doesn't have directory information.
1.220 + # Version 6 uses the directory in both cases.
1.221 + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
1.222 + test "x$dir" = "x$object" && dir=
1.223 + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
1.224 + if test "$libtool" = yes; then
1.225 + tmpdepfile1=$dir$base.u
1.226 + tmpdepfile2=$base.u
1.227 + tmpdepfile3=$dir.libs/$base.u
1.228 + "$@" -Wc,-M
1.229 + else
1.230 + tmpdepfile1=$dir$base.u
1.231 + tmpdepfile2=$dir$base.u
1.232 + tmpdepfile3=$dir$base.u
1.233 + "$@" -M
1.234 + fi
1.235 + stat=$?
1.236 +
1.237 + if test $stat -eq 0; then :
1.238 + else
1.239 + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
1.240 + exit $stat
1.241 + fi
1.242 +
1.243 + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
1.244 + do
1.245 + test -f "$tmpdepfile" && break
1.246 + done
1.247 + if test -f "$tmpdepfile"; then
1.248 + # Each line is of the form `foo.o: dependent.h'.
1.249 + # Do two passes, one to just change these to
1.250 + # `$object: dependent.h' and one to simply `dependent.h:'.
1.251 + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
1.252 + # That's a tab and a space in the [].
1.253 + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
1.254 + else
1.255 + # The sourcefile does not contain any dependencies, so just
1.256 + # store a dummy comment line, to avoid errors with the Makefile
1.257 + # "include basename.Plo" scheme.
1.258 + echo "#dummy" > "$depfile"
1.259 + fi
1.260 + rm -f "$tmpdepfile"
1.261 + ;;
1.262 +
1.263 +icc)
1.264 + # Intel's C compiler understands `-MD -MF file'. However on
1.265 + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
1.266 + # ICC 7.0 will fill foo.d with something like
1.267 + # foo.o: sub/foo.c
1.268 + # foo.o: sub/foo.h
1.269 + # which is wrong. We want:
1.270 + # sub/foo.o: sub/foo.c
1.271 + # sub/foo.o: sub/foo.h
1.272 + # sub/foo.c:
1.273 + # sub/foo.h:
1.274 + # ICC 7.1 will output
1.275 + # foo.o: sub/foo.c sub/foo.h
1.276 + # and will wrap long lines using \ :
1.277 + # foo.o: sub/foo.c ... \
1.278 + # sub/foo.h ... \
1.279 + # ...
1.280 +
1.281 + "$@" -MD -MF "$tmpdepfile"
1.282 + stat=$?
1.283 + if test $stat -eq 0; then :
1.284 + else
1.285 + rm -f "$tmpdepfile"
1.286 + exit $stat
1.287 + fi
1.288 + rm -f "$depfile"
1.289 + # Each line is of the form `foo.o: dependent.h',
1.290 + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
1.291 + # Do two passes, one to just change these to
1.292 + # `$object: dependent.h' and one to simply `dependent.h:'.
1.293 + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
1.294 + # Some versions of the HPUX 10.20 sed can't process this invocation
1.295 + # correctly. Breaking it into two sed invocations is a workaround.
1.296 + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
1.297 + sed -e 's/$/ :/' >> "$depfile"
1.298 + rm -f "$tmpdepfile"
1.299 + ;;
1.300 +
1.301 +hp2)
1.302 + # The "hp" stanza above does not work with aCC (C++) and HP's ia64
1.303 + # compilers, which have integrated preprocessors. The correct option
1.304 + # to use with these is +Maked; it writes dependencies to a file named
1.305 + # 'foo.d', which lands next to the object file, wherever that
1.306 + # happens to be.
1.307 + # Much of this is similar to the tru64 case; see comments there.
1.308 + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
1.309 + test "x$dir" = "x$object" && dir=
1.310 + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
1.311 + if test "$libtool" = yes; then
1.312 + tmpdepfile1=$dir$base.d
1.313 + tmpdepfile2=$dir.libs/$base.d
1.314 + "$@" -Wc,+Maked
1.315 + else
1.316 + tmpdepfile1=$dir$base.d
1.317 + tmpdepfile2=$dir$base.d
1.318 + "$@" +Maked
1.319 + fi
1.320 + stat=$?
1.321 + if test $stat -eq 0; then :
1.322 + else
1.323 + rm -f "$tmpdepfile1" "$tmpdepfile2"
1.324 + exit $stat
1.325 + fi
1.326 +
1.327 + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
1.328 + do
1.329 + test -f "$tmpdepfile" && break
1.330 + done
1.331 + if test -f "$tmpdepfile"; then
1.332 + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
1.333 + # Add `dependent.h:' lines.
1.334 + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
1.335 + else
1.336 + echo "#dummy" > "$depfile"
1.337 + fi
1.338 + rm -f "$tmpdepfile" "$tmpdepfile2"
1.339 + ;;
1.340 +
1.341 +tru64)
1.342 + # The Tru64 compiler uses -MD to generate dependencies as a side
1.343 + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
1.344 + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
1.345 + # dependencies in `foo.d' instead, so we check for that too.
1.346 + # Subdirectories are respected.
1.347 + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
1.348 + test "x$dir" = "x$object" && dir=
1.349 + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
1.350 +
1.351 + if test "$libtool" = yes; then
1.352 + # With Tru64 cc, shared objects can also be used to make a
1.353 + # static library. This mechanism is used in libtool 1.4 series to
1.354 + # handle both shared and static libraries in a single compilation.
1.355 + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
1.356 + #
1.357 + # With libtool 1.5 this exception was removed, and libtool now
1.358 + # generates 2 separate objects for the 2 libraries. These two
1.359 + # compilations output dependencies in $dir.libs/$base.o.d and
1.360 + # in $dir$base.o.d. We have to check for both files, because
1.361 + # one of the two compilations can be disabled. We should prefer
1.362 + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
1.363 + # automatically cleaned when .libs/ is deleted, while ignoring
1.364 + # the former would cause a distcleancheck panic.
1.365 + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
1.366 + tmpdepfile2=$dir$base.o.d # libtool 1.5
1.367 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
1.368 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
1.369 + "$@" -Wc,-MD
1.370 + else
1.371 + tmpdepfile1=$dir$base.o.d
1.372 + tmpdepfile2=$dir$base.d
1.373 + tmpdepfile3=$dir$base.d
1.374 + tmpdepfile4=$dir$base.d
1.375 + "$@" -MD
1.376 + fi
1.377 +
1.378 + stat=$?
1.379 + if test $stat -eq 0; then :
1.380 + else
1.381 + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
1.382 + exit $stat
1.383 + fi
1.384 +
1.385 + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
1.386 + do
1.387 + test -f "$tmpdepfile" && break
1.388 + done
1.389 + if test -f "$tmpdepfile"; then
1.390 + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
1.391 + # That's a tab and a space in the [].
1.392 + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
1.393 + else
1.394 + echo "#dummy" > "$depfile"
1.395 + fi
1.396 + rm -f "$tmpdepfile"
1.397 + ;;
1.398 +
1.399 +#nosideeffect)
1.400 + # This comment above is used by automake to tell side-effect
1.401 + # dependency tracking mechanisms from slower ones.
1.402 +
1.403 +dashmstdout)
1.404 + # Important note: in order to support this mode, a compiler *must*
1.405 + # always write the preprocessed file to stdout, regardless of -o.
1.406 + "$@" || exit $?
1.407 +
1.408 + # Remove the call to Libtool.
1.409 + if test "$libtool" = yes; then
1.410 + while test $1 != '--mode=compile'; do
1.411 + shift
1.412 + done
1.413 + shift
1.414 + fi
1.415 +
1.416 + # Remove `-o $object'.
1.417 + IFS=" "
1.418 + for arg
1.419 + do
1.420 + case $arg in
1.421 + -o)
1.422 + shift
1.423 + ;;
1.424 + $object)
1.425 + shift
1.426 + ;;
1.427 + *)
1.428 + set fnord "$@" "$arg"
1.429 + shift # fnord
1.430 + shift # $arg
1.431 + ;;
1.432 + esac
1.433 + done
1.434 +
1.435 + test -z "$dashmflag" && dashmflag=-M
1.436 + # Require at least two characters before searching for `:'
1.437 + # in the target name. This is to cope with DOS-style filenames:
1.438 + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
1.439 + "$@" $dashmflag |
1.440 + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
1.441 + rm -f "$depfile"
1.442 + cat < "$tmpdepfile" > "$depfile"
1.443 + tr ' ' '
1.444 +' < "$tmpdepfile" | \
1.445 +## Some versions of the HPUX 10.20 sed can't process this invocation
1.446 +## correctly. Breaking it into two sed invocations is a workaround.
1.447 + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
1.448 + rm -f "$tmpdepfile"
1.449 + ;;
1.450 +
1.451 +dashXmstdout)
1.452 + # This case only exists to satisfy depend.m4. It is never actually
1.453 + # run, as this mode is specially recognized in the preamble.
1.454 + exit 1
1.455 + ;;
1.456 +
1.457 +makedepend)
1.458 + "$@" || exit $?
1.459 + # Remove any Libtool call
1.460 + if test "$libtool" = yes; then
1.461 + while test $1 != '--mode=compile'; do
1.462 + shift
1.463 + done
1.464 + shift
1.465 + fi
1.466 + # X makedepend
1.467 + shift
1.468 + cleared=no
1.469 + for arg in "$@"; do
1.470 + case $cleared in
1.471 + no)
1.472 + set ""; shift
1.473 + cleared=yes ;;
1.474 + esac
1.475 + case "$arg" in
1.476 + -D*|-I*)
1.477 + set fnord "$@" "$arg"; shift ;;
1.478 + # Strip any option that makedepend may not understand. Remove
1.479 + # the object too, otherwise makedepend will parse it as a source file.
1.480 + -*|$object)
1.481 + ;;
1.482 + *)
1.483 + set fnord "$@" "$arg"; shift ;;
1.484 + esac
1.485 + done
1.486 + obj_suffix="`echo $object | sed 's/^.*\././'`"
1.487 + touch "$tmpdepfile"
1.488 + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
1.489 + rm -f "$depfile"
1.490 + cat < "$tmpdepfile" > "$depfile"
1.491 + sed '1,2d' "$tmpdepfile" | tr ' ' '
1.492 +' | \
1.493 +## Some versions of the HPUX 10.20 sed can't process this invocation
1.494 +## correctly. Breaking it into two sed invocations is a workaround.
1.495 + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
1.496 + rm -f "$tmpdepfile" "$tmpdepfile".bak
1.497 + ;;
1.498 +
1.499 +cpp)
1.500 + # Important note: in order to support this mode, a compiler *must*
1.501 + # always write the preprocessed file to stdout.
1.502 + "$@" || exit $?
1.503 +
1.504 + # Remove the call to Libtool.
1.505 + if test "$libtool" = yes; then
1.506 + while test $1 != '--mode=compile'; do
1.507 + shift
1.508 + done
1.509 + shift
1.510 + fi
1.511 +
1.512 + # Remove `-o $object'.
1.513 + IFS=" "
1.514 + for arg
1.515 + do
1.516 + case $arg in
1.517 + -o)
1.518 + shift
1.519 + ;;
1.520 + $object)
1.521 + shift
1.522 + ;;
1.523 + *)
1.524 + set fnord "$@" "$arg"
1.525 + shift # fnord
1.526 + shift # $arg
1.527 + ;;
1.528 + esac
1.529 + done
1.530 +
1.531 + "$@" -E |
1.532 + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
1.533 + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
1.534 + sed '$ s: \\$::' > "$tmpdepfile"
1.535 + rm -f "$depfile"
1.536 + echo "$object : \\" > "$depfile"
1.537 + cat < "$tmpdepfile" >> "$depfile"
1.538 + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
1.539 + rm -f "$tmpdepfile"
1.540 + ;;
1.541 +
1.542 +msvisualcpp)
1.543 + # Important note: in order to support this mode, a compiler *must*
1.544 + # always write the preprocessed file to stdout, regardless of -o,
1.545 + # because we must use -o when running libtool.
1.546 + "$@" || exit $?
1.547 + IFS=" "
1.548 + for arg
1.549 + do
1.550 + case "$arg" in
1.551 + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
1.552 + set fnord "$@"
1.553 + shift
1.554 + shift
1.555 + ;;
1.556 + *)
1.557 + set fnord "$@" "$arg"
1.558 + shift
1.559 + shift
1.560 + ;;
1.561 + esac
1.562 + done
1.563 + "$@" -E |
1.564 + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
1.565 + rm -f "$depfile"
1.566 + echo "$object : \\" > "$depfile"
1.567 + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
1.568 + echo " " >> "$depfile"
1.569 + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
1.570 + rm -f "$tmpdepfile"
1.571 + ;;
1.572 +
1.573 +none)
1.574 + exec "$@"
1.575 + ;;
1.576 +
1.577 +*)
1.578 + echo "Unknown depmode $depmode" 1>&2
1.579 + exit 1
1.580 + ;;
1.581 +esac
1.582 +
1.583 +exit 0
1.584 +
1.585 +# Local Variables:
1.586 +# mode: shell-script
1.587 +# sh-indentation: 2
1.588 +# eval: (add-hook 'write-file-hooks 'time-stamp)
1.589 +# time-stamp-start: "scriptversion="
1.590 +# time-stamp-format: "%:y-%02m-%02d.%02H"
1.591 +# time-stamp-end: "$"
1.592 +# End: