xref: /netbsd-src/external/gpl2/diffutils/dist/config/depcomp (revision 75f6d617e282811cb173c2ccfbf5df0dd71f7045)
1*75f6d617Schristos#! /bin/sh
2*75f6d617Schristos
3*75f6d617Schristos# depcomp - compile a program generating dependencies as side-effects
4*75f6d617Schristos# Copyright 1999, 2000 Free Software Foundation, Inc.
5*75f6d617Schristos
6*75f6d617Schristos# This program is free software; you can redistribute it and/or modify
7*75f6d617Schristos# it under the terms of the GNU General Public License as published by
8*75f6d617Schristos# the Free Software Foundation; either version 2, or (at your option)
9*75f6d617Schristos# any later version.
10*75f6d617Schristos
11*75f6d617Schristos# This program is distributed in the hope that it will be useful,
12*75f6d617Schristos# but WITHOUT ANY WARRANTY; without even the implied warranty of
13*75f6d617Schristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*75f6d617Schristos# GNU General Public License for more details.
15*75f6d617Schristos
16*75f6d617Schristos# You should have received a copy of the GNU General Public License
17*75f6d617Schristos# along with this program; if not, write to the Free Software
18*75f6d617Schristos# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19*75f6d617Schristos# 02111-1307, USA.
20*75f6d617Schristos
21*75f6d617Schristos# As a special exception to the GNU General Public License, if you
22*75f6d617Schristos# distribute this file as part of a program that contains a
23*75f6d617Schristos# configuration script generated by Autoconf, you may include it under
24*75f6d617Schristos# the same distribution terms that you use for the rest of that program.
25*75f6d617Schristos
26*75f6d617Schristos# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27*75f6d617Schristos
28*75f6d617Schristosif test -z "$depmode" || test -z "$source" || test -z "$object"; then
29*75f6d617Schristos  echo "depcomp: Variables source, object and depmode must be set" 1>&2
30*75f6d617Schristos  exit 1
31*75f6d617Schristosfi
32*75f6d617Schristos# `libtool' can also be set to `yes' or `no'.
33*75f6d617Schristos
34*75f6d617Schristosif test -z "$depfile"; then
35*75f6d617Schristos   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
36*75f6d617Schristos   dir=`echo "$object" | sed 's,/.*$,/,'`
37*75f6d617Schristos   if test "$dir" = "$object"; then
38*75f6d617Schristos      dir=
39*75f6d617Schristos   fi
40*75f6d617Schristos   # FIXME: should be _deps on DOS.
41*75f6d617Schristos   depfile="$dir.deps/$base"
42*75f6d617Schristosfi
43*75f6d617Schristos
44*75f6d617Schristostmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
45*75f6d617Schristos
46*75f6d617Schristosrm -f "$tmpdepfile"
47*75f6d617Schristos
48*75f6d617Schristos# Some modes work just like other modes, but use different flags.  We
49*75f6d617Schristos# parameterize here, but still list the modes in the big case below,
50*75f6d617Schristos# to make depend.m4 easier to write.  Note that we *cannot* use a case
51*75f6d617Schristos# here, because this file can only contain one case statement.
52*75f6d617Schristosif test "$depmode" = hp; then
53*75f6d617Schristos  # HP compiler uses -M and no extra arg.
54*75f6d617Schristos  gccflag=-M
55*75f6d617Schristos  depmode=gcc
56*75f6d617Schristosfi
57*75f6d617Schristos
58*75f6d617Schristosif test "$depmode" = dashXmstdout; then
59*75f6d617Schristos   # This is just like dashmstdout with a different argument.
60*75f6d617Schristos   dashmflag=-xM
61*75f6d617Schristos   depmode=dashmstdout
62*75f6d617Schristosfi
63*75f6d617Schristos
64*75f6d617Schristoscase "$depmode" in
65*75f6d617Schristosgcc3)
66*75f6d617Schristos## gcc 3 implements dependency tracking that does exactly what
67*75f6d617Schristos## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
68*75f6d617Schristos## it if -MD -MP comes after the -MF stuff.  Hmm.
69*75f6d617Schristos  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
70*75f6d617Schristos  stat=$?
71*75f6d617Schristos  if test $stat -eq 0; then :
72*75f6d617Schristos  else
73*75f6d617Schristos    rm -f "$tmpdepfile"
74*75f6d617Schristos    exit $stat
75*75f6d617Schristos  fi
76*75f6d617Schristos  mv "$tmpdepfile" "$depfile"
77*75f6d617Schristos  ;;
78*75f6d617Schristos
79*75f6d617Schristosgcc)
80*75f6d617Schristos## There are various ways to get dependency output from gcc.  Here's
81*75f6d617Schristos## why we pick this rather obscure method:
82*75f6d617Schristos## - Don't want to use -MD because we'd like the dependencies to end
83*75f6d617Schristos##   up in a subdir.  Having to rename by hand is ugly.
84*75f6d617Schristos##   (We might end up doing this anyway to support other compilers.)
85*75f6d617Schristos## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
86*75f6d617Schristos##   -MM, not -M (despite what the docs say).
87*75f6d617Schristos## - Using -M directly means running the compiler twice (even worse
88*75f6d617Schristos##   than renaming).
89*75f6d617Schristos  if test -z "$gccflag"; then
90*75f6d617Schristos    gccflag=-MD,
91*75f6d617Schristos  fi
92*75f6d617Schristos  "$@" -Wp,"$gccflag$tmpdepfile"
93*75f6d617Schristos  stat=$?
94*75f6d617Schristos  if test $stat -eq 0; then :
95*75f6d617Schristos  else
96*75f6d617Schristos    rm -f "$tmpdepfile"
97*75f6d617Schristos    exit $stat
98*75f6d617Schristos  fi
99*75f6d617Schristos  rm -f "$depfile"
100*75f6d617Schristos  echo "$object : \\" > "$depfile"
101*75f6d617Schristos  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
102*75f6d617Schristos## The second -e expression handles DOS-style file names with drive letters.
103*75f6d617Schristos  sed -e 's/^[^:]*: / /' \
104*75f6d617Schristos      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
105*75f6d617Schristos## This next piece of magic avoids the `deleted header file' problem.
106*75f6d617Schristos## The problem is that when a header file which appears in a .P file
107*75f6d617Schristos## is deleted, the dependency causes make to die (because there is
108*75f6d617Schristos## typically no way to rebuild the header).  We avoid this by adding
109*75f6d617Schristos## dummy dependencies for each header file.  Too bad gcc doesn't do
110*75f6d617Schristos## this for us directly.
111*75f6d617Schristos  tr ' ' '
112*75f6d617Schristos' < "$tmpdepfile" |
113*75f6d617Schristos## Some versions of gcc put a space before the `:'.  On the theory
114*75f6d617Schristos## that the space means something, we add a space to the output as
115*75f6d617Schristos## well.
116*75f6d617Schristos## Some versions of the HPUX 10.20 sed can't process this invocation
117*75f6d617Schristos## correctly.  Breaking it into two sed invocations is a workaround.
118*75f6d617Schristos    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
119*75f6d617Schristos  rm -f "$tmpdepfile"
120*75f6d617Schristos  ;;
121*75f6d617Schristos
122*75f6d617Schristoshp)
123*75f6d617Schristos  # This case exists only to let depend.m4 do its work.  It works by
124*75f6d617Schristos  # looking at the text of this script.  This case will never be run,
125*75f6d617Schristos  # since it is checked for above.
126*75f6d617Schristos  exit 1
127*75f6d617Schristos  ;;
128*75f6d617Schristos
129*75f6d617Schristossgi)
130*75f6d617Schristos  if test "$libtool" = yes; then
131*75f6d617Schristos    "$@" "-Wp,-MDupdate,$tmpdepfile"
132*75f6d617Schristos  else
133*75f6d617Schristos    "$@" -MDupdate "$tmpdepfile"
134*75f6d617Schristos  fi
135*75f6d617Schristos  stat=$?
136*75f6d617Schristos  if test $stat -eq 0; then :
137*75f6d617Schristos  else
138*75f6d617Schristos    rm -f "$tmpdepfile"
139*75f6d617Schristos    exit $stat
140*75f6d617Schristos  fi
141*75f6d617Schristos  rm -f "$depfile"
142*75f6d617Schristos
143*75f6d617Schristos  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
144*75f6d617Schristos    echo "$object : \\" > "$depfile"
145*75f6d617Schristos
146*75f6d617Schristos    # Clip off the initial element (the dependent).  Don't try to be
147*75f6d617Schristos    # clever and replace this with sed code, as IRIX sed won't handle
148*75f6d617Schristos    # lines with more than a fixed number of characters (4096 in
149*75f6d617Schristos    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
150*75f6d617Schristos    # the IRIX cc adds comments like `#:fec' to the end of the
151*75f6d617Schristos    # dependency line.
152*75f6d617Schristos    tr ' ' '
153*75f6d617Schristos' < "$tmpdepfile" \
154*75f6d617Schristos    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
155*75f6d617Schristos    tr '
156*75f6d617Schristos' ' ' >> $depfile
157*75f6d617Schristos    echo >> $depfile
158*75f6d617Schristos
159*75f6d617Schristos    # The second pass generates a dummy entry for each header file.
160*75f6d617Schristos    tr ' ' '
161*75f6d617Schristos' < "$tmpdepfile" \
162*75f6d617Schristos   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
163*75f6d617Schristos   >> $depfile
164*75f6d617Schristos  else
165*75f6d617Schristos    # The sourcefile does not contain any dependencies, so just
166*75f6d617Schristos    # store a dummy comment line, to avoid errors with the Makefile
167*75f6d617Schristos    # "include basename.Plo" scheme.
168*75f6d617Schristos    echo "#dummy" > "$depfile"
169*75f6d617Schristos  fi
170*75f6d617Schristos  rm -f "$tmpdepfile"
171*75f6d617Schristos  ;;
172*75f6d617Schristos
173*75f6d617Schristosaix)
174*75f6d617Schristos  # The C for AIX Compiler uses -M and outputs the dependencies
175*75f6d617Schristos  # in a .u file.  This file always lives in the current directory.
176*75f6d617Schristos  # Also, the AIX compiler puts `$object:' at the start of each line;
177*75f6d617Schristos  # $object doesn't have directory information.
178*75f6d617Schristos  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
179*75f6d617Schristos  tmpdepfile="$stripped.u"
180*75f6d617Schristos  outname="$stripped.o"
181*75f6d617Schristos  if test "$libtool" = yes; then
182*75f6d617Schristos    "$@" -Wc,-M
183*75f6d617Schristos  else
184*75f6d617Schristos    "$@" -M
185*75f6d617Schristos  fi
186*75f6d617Schristos
187*75f6d617Schristos  stat=$?
188*75f6d617Schristos  if test $stat -eq 0; then :
189*75f6d617Schristos  else
190*75f6d617Schristos    rm -f "$tmpdepfile"
191*75f6d617Schristos    exit $stat
192*75f6d617Schristos  fi
193*75f6d617Schristos
194*75f6d617Schristos  if test -f "$tmpdepfile"; then
195*75f6d617Schristos    # Each line is of the form `foo.o: dependent.h'.
196*75f6d617Schristos    # Do two passes, one to just change these to
197*75f6d617Schristos    # `$object: dependent.h' and one to simply `dependent.h:'.
198*75f6d617Schristos    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
199*75f6d617Schristos    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
200*75f6d617Schristos  else
201*75f6d617Schristos    # The sourcefile does not contain any dependencies, so just
202*75f6d617Schristos    # store a dummy comment line, to avoid errors with the Makefile
203*75f6d617Schristos    # "include basename.Plo" scheme.
204*75f6d617Schristos    echo "#dummy" > "$depfile"
205*75f6d617Schristos  fi
206*75f6d617Schristos  rm -f "$tmpdepfile"
207*75f6d617Schristos  ;;
208*75f6d617Schristos
209*75f6d617Schristostru64)
210*75f6d617Schristos   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
211*75f6d617Schristos   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
212*75f6d617Schristos   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
213*75f6d617Schristos   # dependencies in `foo.d' instead, so we check for that too.
214*75f6d617Schristos   # Subdirectories are respected.
215*75f6d617Schristos
216*75f6d617Schristos   base=`echo "$object" | sed -e 's/\.o$/.d/' -e 's/\.lo$/.d/'`
217*75f6d617Schristos   tmpdepfile1="$base.o.d"
218*75f6d617Schristos   tmpdepfile2="$base.d"
219*75f6d617Schristos   if test "$libtool" = yes; then
220*75f6d617Schristos      "$@" -Wc,-MD
221*75f6d617Schristos   else
222*75f6d617Schristos      "$@" -MD
223*75f6d617Schristos   fi
224*75f6d617Schristos
225*75f6d617Schristos   stat=$?
226*75f6d617Schristos   if test $stat -eq 0; then :
227*75f6d617Schristos   else
228*75f6d617Schristos      rm -f "$tmpdepfile1" "$tmpdepfile2"
229*75f6d617Schristos      exit $stat
230*75f6d617Schristos   fi
231*75f6d617Schristos
232*75f6d617Schristos   if test -f "$tmpdepfile1"; then
233*75f6d617Schristos      tmpdepfile="$tmpdepfile1"
234*75f6d617Schristos   else
235*75f6d617Schristos      tmpdepfile="$tmpdepfile2"
236*75f6d617Schristos   fi
237*75f6d617Schristos   if test -f "$tmpdepfile"; then
238*75f6d617Schristos      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
239*75f6d617Schristos      # That's a space and a tab in the [].
240*75f6d617Schristos      sed -e 's,^.*\.[a-z]*:[ 	]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
241*75f6d617Schristos   else
242*75f6d617Schristos      echo "#dummy" > "$depfile"
243*75f6d617Schristos   fi
244*75f6d617Schristos   rm -f "$tmpdepfile"
245*75f6d617Schristos   ;;
246*75f6d617Schristos
247*75f6d617Schristos#nosideeffect)
248*75f6d617Schristos  # This comment above is used by automake to tell side-effect
249*75f6d617Schristos  # dependency tracking mechanisms from slower ones.
250*75f6d617Schristos
251*75f6d617Schristosdashmstdout)
252*75f6d617Schristos  # Important note: in order to support this mode, a compiler *must*
253*75f6d617Schristos  # always write the proprocessed file to stdout, regardless of -o,
254*75f6d617Schristos  # because we must use -o when running libtool.
255*75f6d617Schristos  test -z "$dashmflag" && dashmflag=-M
256*75f6d617Schristos  ( IFS=" "
257*75f6d617Schristos    case " $* " in
258*75f6d617Schristos    *" --mode=compile "*) # this is libtool, let us make it quiet
259*75f6d617Schristos      for arg
260*75f6d617Schristos      do # cycle over the arguments
261*75f6d617Schristos        case "$arg" in
262*75f6d617Schristos	"--mode=compile")
263*75f6d617Schristos	  # insert --quiet before "--mode=compile"
264*75f6d617Schristos	  set fnord "$@" --quiet
265*75f6d617Schristos	  shift # fnord
266*75f6d617Schristos	  ;;
267*75f6d617Schristos	esac
268*75f6d617Schristos	set fnord "$@" "$arg"
269*75f6d617Schristos	shift # fnord
270*75f6d617Schristos	shift # "$arg"
271*75f6d617Schristos      done
272*75f6d617Schristos      ;;
273*75f6d617Schristos    esac
274*75f6d617Schristos    "$@" $dashmflag | sed 's:^[^:]*\:[ 	]*:'"$object"'\: :' > "$tmpdepfile"
275*75f6d617Schristos  ) &
276*75f6d617Schristos  proc=$!
277*75f6d617Schristos  "$@"
278*75f6d617Schristos  stat=$?
279*75f6d617Schristos  wait "$proc"
280*75f6d617Schristos  if test "$stat" != 0; then exit $stat; fi
281*75f6d617Schristos  rm -f "$depfile"
282*75f6d617Schristos  cat < "$tmpdepfile" > "$depfile"
283*75f6d617Schristos  tr ' ' '
284*75f6d617Schristos' < "$tmpdepfile" | \
285*75f6d617Schristos## Some versions of the HPUX 10.20 sed can't process this invocation
286*75f6d617Schristos## correctly.  Breaking it into two sed invocations is a workaround.
287*75f6d617Schristos    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
288*75f6d617Schristos  rm -f "$tmpdepfile"
289*75f6d617Schristos  ;;
290*75f6d617Schristos
291*75f6d617SchristosdashXmstdout)
292*75f6d617Schristos  # This case only exists to satisfy depend.m4.  It is never actually
293*75f6d617Schristos  # run, as this mode is specially recognized in the preamble.
294*75f6d617Schristos  exit 1
295*75f6d617Schristos  ;;
296*75f6d617Schristos
297*75f6d617Schristosmakedepend)
298*75f6d617Schristos  # X makedepend
299*75f6d617Schristos  (
300*75f6d617Schristos    shift
301*75f6d617Schristos    cleared=no
302*75f6d617Schristos    for arg in "$@"; do
303*75f6d617Schristos      case $cleared in no)
304*75f6d617Schristos        set ""; shift
305*75f6d617Schristos	cleared=yes
306*75f6d617Schristos      esac
307*75f6d617Schristos      case "$arg" in
308*75f6d617Schristos        -D*|-I*)
309*75f6d617Schristos	  set fnord "$@" "$arg"; shift;;
310*75f6d617Schristos	-*)
311*75f6d617Schristos	  ;;
312*75f6d617Schristos	*)
313*75f6d617Schristos	  set fnord "$@" "$arg"; shift;;
314*75f6d617Schristos      esac
315*75f6d617Schristos    done
316*75f6d617Schristos    obj_suffix="`echo $object | sed 's/^.*\././'`"
317*75f6d617Schristos    touch "$tmpdepfile"
318*75f6d617Schristos    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
319*75f6d617Schristos  ) &
320*75f6d617Schristos  proc=$!
321*75f6d617Schristos  "$@"
322*75f6d617Schristos  stat=$?
323*75f6d617Schristos  wait "$proc"
324*75f6d617Schristos  if test "$stat" != 0; then exit $stat; fi
325*75f6d617Schristos  rm -f "$depfile"
326*75f6d617Schristos  cat < "$tmpdepfile" > "$depfile"
327*75f6d617Schristos  sed '1,2d' "$tmpdepfile" | tr ' ' '
328*75f6d617Schristos' | \
329*75f6d617Schristos## Some versions of the HPUX 10.20 sed can't process this invocation
330*75f6d617Schristos## correctly.  Breaking it into two sed invocations is a workaround.
331*75f6d617Schristos    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
332*75f6d617Schristos  rm -f "$tmpdepfile" "$tmpdepfile".bak
333*75f6d617Schristos  ;;
334*75f6d617Schristos
335*75f6d617Schristoscpp)
336*75f6d617Schristos  # Important note: in order to support this mode, a compiler *must*
337*75f6d617Schristos  # always write the proprocessed file to stdout, regardless of -o,
338*75f6d617Schristos  # because we must use -o when running libtool.
339*75f6d617Schristos  ( IFS=" "
340*75f6d617Schristos    case " $* " in
341*75f6d617Schristos    *" --mode=compile "*)
342*75f6d617Schristos      for arg
343*75f6d617Schristos      do # cycle over the arguments
344*75f6d617Schristos        case $arg in
345*75f6d617Schristos	"--mode=compile")
346*75f6d617Schristos	  # insert --quiet before "--mode=compile"
347*75f6d617Schristos	  set fnord "$@" --quiet
348*75f6d617Schristos	  shift # fnord
349*75f6d617Schristos	  ;;
350*75f6d617Schristos	esac
351*75f6d617Schristos	set fnord "$@" "$arg"
352*75f6d617Schristos	shift # fnord
353*75f6d617Schristos	shift # "$arg"
354*75f6d617Schristos      done
355*75f6d617Schristos      ;;
356*75f6d617Schristos    esac
357*75f6d617Schristos    "$@" -E |
358*75f6d617Schristos    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
359*75f6d617Schristos    sed '$ s: \\$::' > "$tmpdepfile"
360*75f6d617Schristos  ) &
361*75f6d617Schristos  proc=$!
362*75f6d617Schristos  "$@"
363*75f6d617Schristos  stat=$?
364*75f6d617Schristos  wait "$proc"
365*75f6d617Schristos  if test "$stat" != 0; then exit $stat; fi
366*75f6d617Schristos  rm -f "$depfile"
367*75f6d617Schristos  echo "$object : \\" > "$depfile"
368*75f6d617Schristos  cat < "$tmpdepfile" >> "$depfile"
369*75f6d617Schristos  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
370*75f6d617Schristos  rm -f "$tmpdepfile"
371*75f6d617Schristos  ;;
372*75f6d617Schristos
373*75f6d617Schristosmsvisualcpp)
374*75f6d617Schristos  # Important note: in order to support this mode, a compiler *must*
375*75f6d617Schristos  # always write the proprocessed file to stdout, regardless of -o,
376*75f6d617Schristos  # because we must use -o when running libtool.
377*75f6d617Schristos  ( IFS=" "
378*75f6d617Schristos    case " $* " in
379*75f6d617Schristos    *" --mode=compile "*)
380*75f6d617Schristos      for arg
381*75f6d617Schristos      do # cycle over the arguments
382*75f6d617Schristos        case $arg in
383*75f6d617Schristos	"--mode=compile")
384*75f6d617Schristos	  # insert --quiet before "--mode=compile"
385*75f6d617Schristos	  set fnord "$@" --quiet
386*75f6d617Schristos	  shift # fnord
387*75f6d617Schristos	  ;;
388*75f6d617Schristos	esac
389*75f6d617Schristos	set fnord "$@" "$arg"
390*75f6d617Schristos	shift # fnord
391*75f6d617Schristos	shift # "$arg"
392*75f6d617Schristos      done
393*75f6d617Schristos      ;;
394*75f6d617Schristos    esac
395*75f6d617Schristos    for arg
396*75f6d617Schristos    do
397*75f6d617Schristos      case "$arg" in
398*75f6d617Schristos      "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
399*75f6d617Schristos	set fnord "$@"
400*75f6d617Schristos	shift
401*75f6d617Schristos	shift
402*75f6d617Schristos	;;
403*75f6d617Schristos      *)
404*75f6d617Schristos	set fnord "$@" "$arg"
405*75f6d617Schristos	shift
406*75f6d617Schristos	shift
407*75f6d617Schristos	;;
408*75f6d617Schristos      esac
409*75f6d617Schristos    done
410*75f6d617Schristos    "$@" -E |
411*75f6d617Schristos    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
412*75f6d617Schristos  ) &
413*75f6d617Schristos  proc=$!
414*75f6d617Schristos  "$@"
415*75f6d617Schristos  stat=$?
416*75f6d617Schristos  wait "$proc"
417*75f6d617Schristos  if test "$stat" != 0; then exit $stat; fi
418*75f6d617Schristos  rm -f "$depfile"
419*75f6d617Schristos  echo "$object : \\" > "$depfile"
420*75f6d617Schristos  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
421*75f6d617Schristos  echo "	" >> "$depfile"
422*75f6d617Schristos  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
423*75f6d617Schristos  rm -f "$tmpdepfile"
424*75f6d617Schristos  ;;
425*75f6d617Schristos
426*75f6d617Schristosnone)
427*75f6d617Schristos  exec "$@"
428*75f6d617Schristos  ;;
429*75f6d617Schristos
430*75f6d617Schristos*)
431*75f6d617Schristos  echo "Unknown depmode $depmode" 1>&2
432*75f6d617Schristos  exit 1
433*75f6d617Schristos  ;;
434*75f6d617Schristosesac
435*75f6d617Schristos
436*75f6d617Schristosexit 0
437