Home | History | Annotate | Line # | Download | only in dist
depcomp revision 1.1.1.1.2.2
      1  1.1.1.1.2.2  snj #! /bin/sh
      2  1.1.1.1.2.2  snj # depcomp - compile a program generating dependencies as side-effects
      3  1.1.1.1.2.2  snj 
      4  1.1.1.1.2.2  snj scriptversion=2012-03-27.16; # UTC
      5  1.1.1.1.2.2  snj 
      6  1.1.1.1.2.2  snj # Copyright (C) 1999-2012 Free Software Foundation, Inc.
      7  1.1.1.1.2.2  snj 
      8  1.1.1.1.2.2  snj # This program is free software; you can redistribute it and/or modify
      9  1.1.1.1.2.2  snj # it under the terms of the GNU General Public License as published by
     10  1.1.1.1.2.2  snj # the Free Software Foundation; either version 2, or (at your option)
     11  1.1.1.1.2.2  snj # any later version.
     12  1.1.1.1.2.2  snj 
     13  1.1.1.1.2.2  snj # This program is distributed in the hope that it will be useful,
     14  1.1.1.1.2.2  snj # but WITHOUT ANY WARRANTY; without even the implied warranty of
     15  1.1.1.1.2.2  snj # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16  1.1.1.1.2.2  snj # GNU General Public License for more details.
     17  1.1.1.1.2.2  snj 
     18  1.1.1.1.2.2  snj # You should have received a copy of the GNU General Public License
     19  1.1.1.1.2.2  snj # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     20  1.1.1.1.2.2  snj 
     21  1.1.1.1.2.2  snj # As a special exception to the GNU General Public License, if you
     22  1.1.1.1.2.2  snj # distribute this file as part of a program that contains a
     23  1.1.1.1.2.2  snj # configuration script generated by Autoconf, you may include it under
     24  1.1.1.1.2.2  snj # the same distribution terms that you use for the rest of that program.
     25  1.1.1.1.2.2  snj 
     26  1.1.1.1.2.2  snj # Originally written by Alexandre Oliva <oliva (at] dcc.unicamp.br>.
     27  1.1.1.1.2.2  snj 
     28  1.1.1.1.2.2  snj case $1 in
     29  1.1.1.1.2.2  snj   '')
     30  1.1.1.1.2.2  snj      echo "$0: No command.  Try '$0 --help' for more information." 1>&2
     31  1.1.1.1.2.2  snj      exit 1;
     32  1.1.1.1.2.2  snj      ;;
     33  1.1.1.1.2.2  snj   -h | --h*)
     34  1.1.1.1.2.2  snj     cat <<\EOF
     35  1.1.1.1.2.2  snj Usage: depcomp [--help] [--version] PROGRAM [ARGS]
     36  1.1.1.1.2.2  snj 
     37  1.1.1.1.2.2  snj Run PROGRAMS ARGS to compile a file, generating dependencies
     38  1.1.1.1.2.2  snj as side-effects.
     39  1.1.1.1.2.2  snj 
     40  1.1.1.1.2.2  snj Environment variables:
     41  1.1.1.1.2.2  snj   depmode     Dependency tracking mode.
     42  1.1.1.1.2.2  snj   source      Source file read by 'PROGRAMS ARGS'.
     43  1.1.1.1.2.2  snj   object      Object file output by 'PROGRAMS ARGS'.
     44  1.1.1.1.2.2  snj   DEPDIR      directory where to store dependencies.
     45  1.1.1.1.2.2  snj   depfile     Dependency file to output.
     46  1.1.1.1.2.2  snj   tmpdepfile  Temporary file to use when outputting dependencies.
     47  1.1.1.1.2.2  snj   libtool     Whether libtool is used (yes/no).
     48  1.1.1.1.2.2  snj 
     49  1.1.1.1.2.2  snj Report bugs to <bug-automake@gnu.org>.
     50  1.1.1.1.2.2  snj EOF
     51  1.1.1.1.2.2  snj     exit $?
     52  1.1.1.1.2.2  snj     ;;
     53  1.1.1.1.2.2  snj   -v | --v*)
     54  1.1.1.1.2.2  snj     echo "depcomp $scriptversion"
     55  1.1.1.1.2.2  snj     exit $?
     56  1.1.1.1.2.2  snj     ;;
     57  1.1.1.1.2.2  snj esac
     58  1.1.1.1.2.2  snj 
     59  1.1.1.1.2.2  snj # A tabulation character.
     60  1.1.1.1.2.2  snj tab='	'
     61  1.1.1.1.2.2  snj # A newline character.
     62  1.1.1.1.2.2  snj nl='
     63  1.1.1.1.2.2  snj '
     64  1.1.1.1.2.2  snj 
     65  1.1.1.1.2.2  snj if test -z "$depmode" || test -z "$source" || test -z "$object"; then
     66  1.1.1.1.2.2  snj   echo "depcomp: Variables source, object and depmode must be set" 1>&2
     67  1.1.1.1.2.2  snj   exit 1
     68  1.1.1.1.2.2  snj fi
     69  1.1.1.1.2.2  snj 
     70  1.1.1.1.2.2  snj # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
     71  1.1.1.1.2.2  snj depfile=${depfile-`echo "$object" |
     72  1.1.1.1.2.2  snj   sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
     73  1.1.1.1.2.2  snj tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
     74  1.1.1.1.2.2  snj 
     75  1.1.1.1.2.2  snj rm -f "$tmpdepfile"
     76  1.1.1.1.2.2  snj 
     77  1.1.1.1.2.2  snj # Some modes work just like other modes, but use different flags.  We
     78  1.1.1.1.2.2  snj # parameterize here, but still list the modes in the big case below,
     79  1.1.1.1.2.2  snj # to make depend.m4 easier to write.  Note that we *cannot* use a case
     80  1.1.1.1.2.2  snj # here, because this file can only contain one case statement.
     81  1.1.1.1.2.2  snj if test "$depmode" = hp; then
     82  1.1.1.1.2.2  snj   # HP compiler uses -M and no extra arg.
     83  1.1.1.1.2.2  snj   gccflag=-M
     84  1.1.1.1.2.2  snj   depmode=gcc
     85  1.1.1.1.2.2  snj fi
     86  1.1.1.1.2.2  snj 
     87  1.1.1.1.2.2  snj if test "$depmode" = dashXmstdout; then
     88  1.1.1.1.2.2  snj    # This is just like dashmstdout with a different argument.
     89  1.1.1.1.2.2  snj    dashmflag=-xM
     90  1.1.1.1.2.2  snj    depmode=dashmstdout
     91  1.1.1.1.2.2  snj fi
     92  1.1.1.1.2.2  snj 
     93  1.1.1.1.2.2  snj cygpath_u="cygpath -u -f -"
     94  1.1.1.1.2.2  snj if test "$depmode" = msvcmsys; then
     95  1.1.1.1.2.2  snj    # This is just like msvisualcpp but w/o cygpath translation.
     96  1.1.1.1.2.2  snj    # Just convert the backslash-escaped backslashes to single forward
     97  1.1.1.1.2.2  snj    # slashes to satisfy depend.m4
     98  1.1.1.1.2.2  snj    cygpath_u='sed s,\\\\,/,g'
     99  1.1.1.1.2.2  snj    depmode=msvisualcpp
    100  1.1.1.1.2.2  snj fi
    101  1.1.1.1.2.2  snj 
    102  1.1.1.1.2.2  snj if test "$depmode" = msvc7msys; then
    103  1.1.1.1.2.2  snj    # This is just like msvc7 but w/o cygpath translation.
    104  1.1.1.1.2.2  snj    # Just convert the backslash-escaped backslashes to single forward
    105  1.1.1.1.2.2  snj    # slashes to satisfy depend.m4
    106  1.1.1.1.2.2  snj    cygpath_u='sed s,\\\\,/,g'
    107  1.1.1.1.2.2  snj    depmode=msvc7
    108  1.1.1.1.2.2  snj fi
    109  1.1.1.1.2.2  snj 
    110  1.1.1.1.2.2  snj if test "$depmode" = xlc; then
    111  1.1.1.1.2.2  snj    # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
    112  1.1.1.1.2.2  snj    gccflag=-qmakedep=gcc,-MF
    113  1.1.1.1.2.2  snj    depmode=gcc
    114  1.1.1.1.2.2  snj fi
    115  1.1.1.1.2.2  snj 
    116  1.1.1.1.2.2  snj case "$depmode" in
    117  1.1.1.1.2.2  snj gcc3)
    118  1.1.1.1.2.2  snj ## gcc 3 implements dependency tracking that does exactly what
    119  1.1.1.1.2.2  snj ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
    120  1.1.1.1.2.2  snj ## it if -MD -MP comes after the -MF stuff.  Hmm.
    121  1.1.1.1.2.2  snj ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
    122  1.1.1.1.2.2  snj ## the command line argument order; so add the flags where they
    123  1.1.1.1.2.2  snj ## appear in depend2.am.  Note that the slowdown incurred here
    124  1.1.1.1.2.2  snj ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
    125  1.1.1.1.2.2  snj   for arg
    126  1.1.1.1.2.2  snj   do
    127  1.1.1.1.2.2  snj     case $arg in
    128  1.1.1.1.2.2  snj     -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
    129  1.1.1.1.2.2  snj     *)  set fnord "$@" "$arg" ;;
    130  1.1.1.1.2.2  snj     esac
    131  1.1.1.1.2.2  snj     shift # fnord
    132  1.1.1.1.2.2  snj     shift # $arg
    133  1.1.1.1.2.2  snj   done
    134  1.1.1.1.2.2  snj   "$@"
    135  1.1.1.1.2.2  snj   stat=$?
    136  1.1.1.1.2.2  snj   if test $stat -eq 0; then :
    137  1.1.1.1.2.2  snj   else
    138  1.1.1.1.2.2  snj     rm -f "$tmpdepfile"
    139  1.1.1.1.2.2  snj     exit $stat
    140  1.1.1.1.2.2  snj   fi
    141  1.1.1.1.2.2  snj   mv "$tmpdepfile" "$depfile"
    142  1.1.1.1.2.2  snj   ;;
    143  1.1.1.1.2.2  snj 
    144  1.1.1.1.2.2  snj gcc)
    145  1.1.1.1.2.2  snj ## There are various ways to get dependency output from gcc.  Here's
    146  1.1.1.1.2.2  snj ## why we pick this rather obscure method:
    147  1.1.1.1.2.2  snj ## - Don't want to use -MD because we'd like the dependencies to end
    148  1.1.1.1.2.2  snj ##   up in a subdir.  Having to rename by hand is ugly.
    149  1.1.1.1.2.2  snj ##   (We might end up doing this anyway to support other compilers.)
    150  1.1.1.1.2.2  snj ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
    151  1.1.1.1.2.2  snj ##   -MM, not -M (despite what the docs say).
    152  1.1.1.1.2.2  snj ## - Using -M directly means running the compiler twice (even worse
    153  1.1.1.1.2.2  snj ##   than renaming).
    154  1.1.1.1.2.2  snj   if test -z "$gccflag"; then
    155  1.1.1.1.2.2  snj     gccflag=-MD,
    156  1.1.1.1.2.2  snj   fi
    157  1.1.1.1.2.2  snj   "$@" -Wp,"$gccflag$tmpdepfile"
    158  1.1.1.1.2.2  snj   stat=$?
    159  1.1.1.1.2.2  snj   if test $stat -eq 0; then :
    160  1.1.1.1.2.2  snj   else
    161  1.1.1.1.2.2  snj     rm -f "$tmpdepfile"
    162  1.1.1.1.2.2  snj     exit $stat
    163  1.1.1.1.2.2  snj   fi
    164  1.1.1.1.2.2  snj   rm -f "$depfile"
    165  1.1.1.1.2.2  snj   echo "$object : \\" > "$depfile"
    166  1.1.1.1.2.2  snj   alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
    167  1.1.1.1.2.2  snj ## The second -e expression handles DOS-style file names with drive letters.
    168  1.1.1.1.2.2  snj   sed -e 's/^[^:]*: / /' \
    169  1.1.1.1.2.2  snj       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
    170  1.1.1.1.2.2  snj ## This next piece of magic avoids the "deleted header file" problem.
    171  1.1.1.1.2.2  snj ## The problem is that when a header file which appears in a .P file
    172  1.1.1.1.2.2  snj ## is deleted, the dependency causes make to die (because there is
    173  1.1.1.1.2.2  snj ## typically no way to rebuild the header).  We avoid this by adding
    174  1.1.1.1.2.2  snj ## dummy dependencies for each header file.  Too bad gcc doesn't do
    175  1.1.1.1.2.2  snj ## this for us directly.
    176  1.1.1.1.2.2  snj   tr ' ' "$nl" < "$tmpdepfile" |
    177  1.1.1.1.2.2  snj ## Some versions of gcc put a space before the ':'.  On the theory
    178  1.1.1.1.2.2  snj ## that the space means something, we add a space to the output as
    179  1.1.1.1.2.2  snj ## well.  hp depmode also adds that space, but also prefixes the VPATH
    180  1.1.1.1.2.2  snj ## to the object.  Take care to not repeat it in the output.
    181  1.1.1.1.2.2  snj ## Some versions of the HPUX 10.20 sed can't process this invocation
    182  1.1.1.1.2.2  snj ## correctly.  Breaking it into two sed invocations is a workaround.
    183  1.1.1.1.2.2  snj     sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
    184  1.1.1.1.2.2  snj       | sed -e 's/$/ :/' >> "$depfile"
    185  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    186  1.1.1.1.2.2  snj   ;;
    187  1.1.1.1.2.2  snj 
    188  1.1.1.1.2.2  snj hp)
    189  1.1.1.1.2.2  snj   # This case exists only to let depend.m4 do its work.  It works by
    190  1.1.1.1.2.2  snj   # looking at the text of this script.  This case will never be run,
    191  1.1.1.1.2.2  snj   # since it is checked for above.
    192  1.1.1.1.2.2  snj   exit 1
    193  1.1.1.1.2.2  snj   ;;
    194  1.1.1.1.2.2  snj 
    195  1.1.1.1.2.2  snj sgi)
    196  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    197  1.1.1.1.2.2  snj     "$@" "-Wp,-MDupdate,$tmpdepfile"
    198  1.1.1.1.2.2  snj   else
    199  1.1.1.1.2.2  snj     "$@" -MDupdate "$tmpdepfile"
    200  1.1.1.1.2.2  snj   fi
    201  1.1.1.1.2.2  snj   stat=$?
    202  1.1.1.1.2.2  snj   if test $stat -eq 0; then :
    203  1.1.1.1.2.2  snj   else
    204  1.1.1.1.2.2  snj     rm -f "$tmpdepfile"
    205  1.1.1.1.2.2  snj     exit $stat
    206  1.1.1.1.2.2  snj   fi
    207  1.1.1.1.2.2  snj   rm -f "$depfile"
    208  1.1.1.1.2.2  snj 
    209  1.1.1.1.2.2  snj   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
    210  1.1.1.1.2.2  snj     echo "$object : \\" > "$depfile"
    211  1.1.1.1.2.2  snj 
    212  1.1.1.1.2.2  snj     # Clip off the initial element (the dependent).  Don't try to be
    213  1.1.1.1.2.2  snj     # clever and replace this with sed code, as IRIX sed won't handle
    214  1.1.1.1.2.2  snj     # lines with more than a fixed number of characters (4096 in
    215  1.1.1.1.2.2  snj     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
    216  1.1.1.1.2.2  snj     # the IRIX cc adds comments like '#:fec' to the end of the
    217  1.1.1.1.2.2  snj     # dependency line.
    218  1.1.1.1.2.2  snj     tr ' ' "$nl" < "$tmpdepfile" \
    219  1.1.1.1.2.2  snj     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
    220  1.1.1.1.2.2  snj     tr "$nl" ' ' >> "$depfile"
    221  1.1.1.1.2.2  snj     echo >> "$depfile"
    222  1.1.1.1.2.2  snj 
    223  1.1.1.1.2.2  snj     # The second pass generates a dummy entry for each header file.
    224  1.1.1.1.2.2  snj     tr ' ' "$nl" < "$tmpdepfile" \
    225  1.1.1.1.2.2  snj    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    226  1.1.1.1.2.2  snj    >> "$depfile"
    227  1.1.1.1.2.2  snj   else
    228  1.1.1.1.2.2  snj     # The sourcefile does not contain any dependencies, so just
    229  1.1.1.1.2.2  snj     # store a dummy comment line, to avoid errors with the Makefile
    230  1.1.1.1.2.2  snj     # "include basename.Plo" scheme.
    231  1.1.1.1.2.2  snj     echo "#dummy" > "$depfile"
    232  1.1.1.1.2.2  snj   fi
    233  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    234  1.1.1.1.2.2  snj   ;;
    235  1.1.1.1.2.2  snj 
    236  1.1.1.1.2.2  snj xlc)
    237  1.1.1.1.2.2  snj   # This case exists only to let depend.m4 do its work.  It works by
    238  1.1.1.1.2.2  snj   # looking at the text of this script.  This case will never be run,
    239  1.1.1.1.2.2  snj   # since it is checked for above.
    240  1.1.1.1.2.2  snj   exit 1
    241  1.1.1.1.2.2  snj   ;;
    242  1.1.1.1.2.2  snj 
    243  1.1.1.1.2.2  snj aix)
    244  1.1.1.1.2.2  snj   # The C for AIX Compiler uses -M and outputs the dependencies
    245  1.1.1.1.2.2  snj   # in a .u file.  In older versions, this file always lives in the
    246  1.1.1.1.2.2  snj   # current directory.  Also, the AIX compiler puts '$object:' at the
    247  1.1.1.1.2.2  snj   # start of each line; $object doesn't have directory information.
    248  1.1.1.1.2.2  snj   # Version 6 uses the directory in both cases.
    249  1.1.1.1.2.2  snj   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    250  1.1.1.1.2.2  snj   test "x$dir" = "x$object" && dir=
    251  1.1.1.1.2.2  snj   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
    252  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    253  1.1.1.1.2.2  snj     tmpdepfile1=$dir$base.u
    254  1.1.1.1.2.2  snj     tmpdepfile2=$base.u
    255  1.1.1.1.2.2  snj     tmpdepfile3=$dir.libs/$base.u
    256  1.1.1.1.2.2  snj     "$@" -Wc,-M
    257  1.1.1.1.2.2  snj   else
    258  1.1.1.1.2.2  snj     tmpdepfile1=$dir$base.u
    259  1.1.1.1.2.2  snj     tmpdepfile2=$dir$base.u
    260  1.1.1.1.2.2  snj     tmpdepfile3=$dir$base.u
    261  1.1.1.1.2.2  snj     "$@" -M
    262  1.1.1.1.2.2  snj   fi
    263  1.1.1.1.2.2  snj   stat=$?
    264  1.1.1.1.2.2  snj 
    265  1.1.1.1.2.2  snj   if test $stat -eq 0; then :
    266  1.1.1.1.2.2  snj   else
    267  1.1.1.1.2.2  snj     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
    268  1.1.1.1.2.2  snj     exit $stat
    269  1.1.1.1.2.2  snj   fi
    270  1.1.1.1.2.2  snj 
    271  1.1.1.1.2.2  snj   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
    272  1.1.1.1.2.2  snj   do
    273  1.1.1.1.2.2  snj     test -f "$tmpdepfile" && break
    274  1.1.1.1.2.2  snj   done
    275  1.1.1.1.2.2  snj   if test -f "$tmpdepfile"; then
    276  1.1.1.1.2.2  snj     # Each line is of the form 'foo.o: dependent.h'.
    277  1.1.1.1.2.2  snj     # Do two passes, one to just change these to
    278  1.1.1.1.2.2  snj     # '$object: dependent.h' and one to simply 'dependent.h:'.
    279  1.1.1.1.2.2  snj     sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    280  1.1.1.1.2.2  snj     sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    281  1.1.1.1.2.2  snj   else
    282  1.1.1.1.2.2  snj     # The sourcefile does not contain any dependencies, so just
    283  1.1.1.1.2.2  snj     # store a dummy comment line, to avoid errors with the Makefile
    284  1.1.1.1.2.2  snj     # "include basename.Plo" scheme.
    285  1.1.1.1.2.2  snj     echo "#dummy" > "$depfile"
    286  1.1.1.1.2.2  snj   fi
    287  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    288  1.1.1.1.2.2  snj   ;;
    289  1.1.1.1.2.2  snj 
    290  1.1.1.1.2.2  snj icc)
    291  1.1.1.1.2.2  snj   # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
    292  1.1.1.1.2.2  snj   # However on
    293  1.1.1.1.2.2  snj   #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
    294  1.1.1.1.2.2  snj   # ICC 7.0 will fill foo.d with something like
    295  1.1.1.1.2.2  snj   #    foo.o: sub/foo.c
    296  1.1.1.1.2.2  snj   #    foo.o: sub/foo.h
    297  1.1.1.1.2.2  snj   # which is wrong.  We want
    298  1.1.1.1.2.2  snj   #    sub/foo.o: sub/foo.c
    299  1.1.1.1.2.2  snj   #    sub/foo.o: sub/foo.h
    300  1.1.1.1.2.2  snj   #    sub/foo.c:
    301  1.1.1.1.2.2  snj   #    sub/foo.h:
    302  1.1.1.1.2.2  snj   # ICC 7.1 will output
    303  1.1.1.1.2.2  snj   #    foo.o: sub/foo.c sub/foo.h
    304  1.1.1.1.2.2  snj   # and will wrap long lines using '\':
    305  1.1.1.1.2.2  snj   #    foo.o: sub/foo.c ... \
    306  1.1.1.1.2.2  snj   #     sub/foo.h ... \
    307  1.1.1.1.2.2  snj   #     ...
    308  1.1.1.1.2.2  snj   # tcc 0.9.26 (FIXME still under development at the moment of writing)
    309  1.1.1.1.2.2  snj   # will emit a similar output, but also prepend the continuation lines
    310  1.1.1.1.2.2  snj   # with horizontal tabulation characters.
    311  1.1.1.1.2.2  snj   "$@" -MD -MF "$tmpdepfile"
    312  1.1.1.1.2.2  snj   stat=$?
    313  1.1.1.1.2.2  snj   if test $stat -eq 0; then :
    314  1.1.1.1.2.2  snj   else
    315  1.1.1.1.2.2  snj     rm -f "$tmpdepfile"
    316  1.1.1.1.2.2  snj     exit $stat
    317  1.1.1.1.2.2  snj   fi
    318  1.1.1.1.2.2  snj   rm -f "$depfile"
    319  1.1.1.1.2.2  snj   # Each line is of the form 'foo.o: dependent.h',
    320  1.1.1.1.2.2  snj   # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
    321  1.1.1.1.2.2  snj   # Do two passes, one to just change these to
    322  1.1.1.1.2.2  snj   # '$object: dependent.h' and one to simply 'dependent.h:'.
    323  1.1.1.1.2.2  snj   sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
    324  1.1.1.1.2.2  snj     < "$tmpdepfile" > "$depfile"
    325  1.1.1.1.2.2  snj   sed '
    326  1.1.1.1.2.2  snj     s/[ '"$tab"'][ '"$tab"']*/ /g
    327  1.1.1.1.2.2  snj     s/^ *//
    328  1.1.1.1.2.2  snj     s/ *\\*$//
    329  1.1.1.1.2.2  snj     s/^[^:]*: *//
    330  1.1.1.1.2.2  snj     /^$/d
    331  1.1.1.1.2.2  snj     /:$/d
    332  1.1.1.1.2.2  snj     s/$/ :/
    333  1.1.1.1.2.2  snj   ' < "$tmpdepfile" >> "$depfile"
    334  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    335  1.1.1.1.2.2  snj   ;;
    336  1.1.1.1.2.2  snj 
    337  1.1.1.1.2.2  snj hp2)
    338  1.1.1.1.2.2  snj   # The "hp" stanza above does not work with aCC (C++) and HP's ia64
    339  1.1.1.1.2.2  snj   # compilers, which have integrated preprocessors.  The correct option
    340  1.1.1.1.2.2  snj   # to use with these is +Maked; it writes dependencies to a file named
    341  1.1.1.1.2.2  snj   # 'foo.d', which lands next to the object file, wherever that
    342  1.1.1.1.2.2  snj   # happens to be.
    343  1.1.1.1.2.2  snj   # Much of this is similar to the tru64 case; see comments there.
    344  1.1.1.1.2.2  snj   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    345  1.1.1.1.2.2  snj   test "x$dir" = "x$object" && dir=
    346  1.1.1.1.2.2  snj   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
    347  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    348  1.1.1.1.2.2  snj     tmpdepfile1=$dir$base.d
    349  1.1.1.1.2.2  snj     tmpdepfile2=$dir.libs/$base.d
    350  1.1.1.1.2.2  snj     "$@" -Wc,+Maked
    351  1.1.1.1.2.2  snj   else
    352  1.1.1.1.2.2  snj     tmpdepfile1=$dir$base.d
    353  1.1.1.1.2.2  snj     tmpdepfile2=$dir$base.d
    354  1.1.1.1.2.2  snj     "$@" +Maked
    355  1.1.1.1.2.2  snj   fi
    356  1.1.1.1.2.2  snj   stat=$?
    357  1.1.1.1.2.2  snj   if test $stat -eq 0; then :
    358  1.1.1.1.2.2  snj   else
    359  1.1.1.1.2.2  snj      rm -f "$tmpdepfile1" "$tmpdepfile2"
    360  1.1.1.1.2.2  snj      exit $stat
    361  1.1.1.1.2.2  snj   fi
    362  1.1.1.1.2.2  snj 
    363  1.1.1.1.2.2  snj   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
    364  1.1.1.1.2.2  snj   do
    365  1.1.1.1.2.2  snj     test -f "$tmpdepfile" && break
    366  1.1.1.1.2.2  snj   done
    367  1.1.1.1.2.2  snj   if test -f "$tmpdepfile"; then
    368  1.1.1.1.2.2  snj     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
    369  1.1.1.1.2.2  snj     # Add 'dependent.h:' lines.
    370  1.1.1.1.2.2  snj     sed -ne '2,${
    371  1.1.1.1.2.2  snj 	       s/^ *//
    372  1.1.1.1.2.2  snj 	       s/ \\*$//
    373  1.1.1.1.2.2  snj 	       s/$/:/
    374  1.1.1.1.2.2  snj 	       p
    375  1.1.1.1.2.2  snj 	     }' "$tmpdepfile" >> "$depfile"
    376  1.1.1.1.2.2  snj   else
    377  1.1.1.1.2.2  snj     echo "#dummy" > "$depfile"
    378  1.1.1.1.2.2  snj   fi
    379  1.1.1.1.2.2  snj   rm -f "$tmpdepfile" "$tmpdepfile2"
    380  1.1.1.1.2.2  snj   ;;
    381  1.1.1.1.2.2  snj 
    382  1.1.1.1.2.2  snj tru64)
    383  1.1.1.1.2.2  snj    # The Tru64 compiler uses -MD to generate dependencies as a side
    384  1.1.1.1.2.2  snj    # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    385  1.1.1.1.2.2  snj    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
    386  1.1.1.1.2.2  snj    # dependencies in 'foo.d' instead, so we check for that too.
    387  1.1.1.1.2.2  snj    # Subdirectories are respected.
    388  1.1.1.1.2.2  snj    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    389  1.1.1.1.2.2  snj    test "x$dir" = "x$object" && dir=
    390  1.1.1.1.2.2  snj    base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
    391  1.1.1.1.2.2  snj 
    392  1.1.1.1.2.2  snj    if test "$libtool" = yes; then
    393  1.1.1.1.2.2  snj       # With Tru64 cc, shared objects can also be used to make a
    394  1.1.1.1.2.2  snj       # static library.  This mechanism is used in libtool 1.4 series to
    395  1.1.1.1.2.2  snj       # handle both shared and static libraries in a single compilation.
    396  1.1.1.1.2.2  snj       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
    397  1.1.1.1.2.2  snj       #
    398  1.1.1.1.2.2  snj       # With libtool 1.5 this exception was removed, and libtool now
    399  1.1.1.1.2.2  snj       # generates 2 separate objects for the 2 libraries.  These two
    400  1.1.1.1.2.2  snj       # compilations output dependencies in $dir.libs/$base.o.d and
    401  1.1.1.1.2.2  snj       # in $dir$base.o.d.  We have to check for both files, because
    402  1.1.1.1.2.2  snj       # one of the two compilations can be disabled.  We should prefer
    403  1.1.1.1.2.2  snj       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
    404  1.1.1.1.2.2  snj       # automatically cleaned when .libs/ is deleted, while ignoring
    405  1.1.1.1.2.2  snj       # the former would cause a distcleancheck panic.
    406  1.1.1.1.2.2  snj       tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
    407  1.1.1.1.2.2  snj       tmpdepfile2=$dir$base.o.d          # libtool 1.5
    408  1.1.1.1.2.2  snj       tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
    409  1.1.1.1.2.2  snj       tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
    410  1.1.1.1.2.2  snj       "$@" -Wc,-MD
    411  1.1.1.1.2.2  snj    else
    412  1.1.1.1.2.2  snj       tmpdepfile1=$dir$base.o.d
    413  1.1.1.1.2.2  snj       tmpdepfile2=$dir$base.d
    414  1.1.1.1.2.2  snj       tmpdepfile3=$dir$base.d
    415  1.1.1.1.2.2  snj       tmpdepfile4=$dir$base.d
    416  1.1.1.1.2.2  snj       "$@" -MD
    417  1.1.1.1.2.2  snj    fi
    418  1.1.1.1.2.2  snj 
    419  1.1.1.1.2.2  snj    stat=$?
    420  1.1.1.1.2.2  snj    if test $stat -eq 0; then :
    421  1.1.1.1.2.2  snj    else
    422  1.1.1.1.2.2  snj       rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
    423  1.1.1.1.2.2  snj       exit $stat
    424  1.1.1.1.2.2  snj    fi
    425  1.1.1.1.2.2  snj 
    426  1.1.1.1.2.2  snj    for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
    427  1.1.1.1.2.2  snj    do
    428  1.1.1.1.2.2  snj      test -f "$tmpdepfile" && break
    429  1.1.1.1.2.2  snj    done
    430  1.1.1.1.2.2  snj    if test -f "$tmpdepfile"; then
    431  1.1.1.1.2.2  snj       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    432  1.1.1.1.2.2  snj       sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    433  1.1.1.1.2.2  snj    else
    434  1.1.1.1.2.2  snj       echo "#dummy" > "$depfile"
    435  1.1.1.1.2.2  snj    fi
    436  1.1.1.1.2.2  snj    rm -f "$tmpdepfile"
    437  1.1.1.1.2.2  snj    ;;
    438  1.1.1.1.2.2  snj 
    439  1.1.1.1.2.2  snj msvc7)
    440  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    441  1.1.1.1.2.2  snj     showIncludes=-Wc,-showIncludes
    442  1.1.1.1.2.2  snj   else
    443  1.1.1.1.2.2  snj     showIncludes=-showIncludes
    444  1.1.1.1.2.2  snj   fi
    445  1.1.1.1.2.2  snj   "$@" $showIncludes > "$tmpdepfile"
    446  1.1.1.1.2.2  snj   stat=$?
    447  1.1.1.1.2.2  snj   grep -v '^Note: including file: ' "$tmpdepfile"
    448  1.1.1.1.2.2  snj   if test "$stat" = 0; then :
    449  1.1.1.1.2.2  snj   else
    450  1.1.1.1.2.2  snj     rm -f "$tmpdepfile"
    451  1.1.1.1.2.2  snj     exit $stat
    452  1.1.1.1.2.2  snj   fi
    453  1.1.1.1.2.2  snj   rm -f "$depfile"
    454  1.1.1.1.2.2  snj   echo "$object : \\" > "$depfile"
    455  1.1.1.1.2.2  snj   # The first sed program below extracts the file names and escapes
    456  1.1.1.1.2.2  snj   # backslashes for cygpath.  The second sed program outputs the file
    457  1.1.1.1.2.2  snj   # name when reading, but also accumulates all include files in the
    458  1.1.1.1.2.2  snj   # hold buffer in order to output them again at the end.  This only
    459  1.1.1.1.2.2  snj   # works with sed implementations that can handle large buffers.
    460  1.1.1.1.2.2  snj   sed < "$tmpdepfile" -n '
    461  1.1.1.1.2.2  snj /^Note: including file:  *\(.*\)/ {
    462  1.1.1.1.2.2  snj   s//\1/
    463  1.1.1.1.2.2  snj   s/\\/\\\\/g
    464  1.1.1.1.2.2  snj   p
    465  1.1.1.1.2.2  snj }' | $cygpath_u | sort -u | sed -n '
    466  1.1.1.1.2.2  snj s/ /\\ /g
    467  1.1.1.1.2.2  snj s/\(.*\)/'"$tab"'\1 \\/p
    468  1.1.1.1.2.2  snj s/.\(.*\) \\/\1:/
    469  1.1.1.1.2.2  snj H
    470  1.1.1.1.2.2  snj $ {
    471  1.1.1.1.2.2  snj   s/.*/'"$tab"'/
    472  1.1.1.1.2.2  snj   G
    473  1.1.1.1.2.2  snj   p
    474  1.1.1.1.2.2  snj }' >> "$depfile"
    475  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    476  1.1.1.1.2.2  snj   ;;
    477  1.1.1.1.2.2  snj 
    478  1.1.1.1.2.2  snj msvc7msys)
    479  1.1.1.1.2.2  snj   # This case exists only to let depend.m4 do its work.  It works by
    480  1.1.1.1.2.2  snj   # looking at the text of this script.  This case will never be run,
    481  1.1.1.1.2.2  snj   # since it is checked for above.
    482  1.1.1.1.2.2  snj   exit 1
    483  1.1.1.1.2.2  snj   ;;
    484  1.1.1.1.2.2  snj 
    485  1.1.1.1.2.2  snj #nosideeffect)
    486  1.1.1.1.2.2  snj   # This comment above is used by automake to tell side-effect
    487  1.1.1.1.2.2  snj   # dependency tracking mechanisms from slower ones.
    488  1.1.1.1.2.2  snj 
    489  1.1.1.1.2.2  snj dashmstdout)
    490  1.1.1.1.2.2  snj   # Important note: in order to support this mode, a compiler *must*
    491  1.1.1.1.2.2  snj   # always write the preprocessed file to stdout, regardless of -o.
    492  1.1.1.1.2.2  snj   "$@" || exit $?
    493  1.1.1.1.2.2  snj 
    494  1.1.1.1.2.2  snj   # Remove the call to Libtool.
    495  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    496  1.1.1.1.2.2  snj     while test "X$1" != 'X--mode=compile'; do
    497  1.1.1.1.2.2  snj       shift
    498  1.1.1.1.2.2  snj     done
    499  1.1.1.1.2.2  snj     shift
    500  1.1.1.1.2.2  snj   fi
    501  1.1.1.1.2.2  snj 
    502  1.1.1.1.2.2  snj   # Remove '-o $object'.
    503  1.1.1.1.2.2  snj   IFS=" "
    504  1.1.1.1.2.2  snj   for arg
    505  1.1.1.1.2.2  snj   do
    506  1.1.1.1.2.2  snj     case $arg in
    507  1.1.1.1.2.2  snj     -o)
    508  1.1.1.1.2.2  snj       shift
    509  1.1.1.1.2.2  snj       ;;
    510  1.1.1.1.2.2  snj     $object)
    511  1.1.1.1.2.2  snj       shift
    512  1.1.1.1.2.2  snj       ;;
    513  1.1.1.1.2.2  snj     *)
    514  1.1.1.1.2.2  snj       set fnord "$@" "$arg"
    515  1.1.1.1.2.2  snj       shift # fnord
    516  1.1.1.1.2.2  snj       shift # $arg
    517  1.1.1.1.2.2  snj       ;;
    518  1.1.1.1.2.2  snj     esac
    519  1.1.1.1.2.2  snj   done
    520  1.1.1.1.2.2  snj 
    521  1.1.1.1.2.2  snj   test -z "$dashmflag" && dashmflag=-M
    522  1.1.1.1.2.2  snj   # Require at least two characters before searching for ':'
    523  1.1.1.1.2.2  snj   # in the target name.  This is to cope with DOS-style filenames:
    524  1.1.1.1.2.2  snj   # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
    525  1.1.1.1.2.2  snj   "$@" $dashmflag |
    526  1.1.1.1.2.2  snj     sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
    527  1.1.1.1.2.2  snj   rm -f "$depfile"
    528  1.1.1.1.2.2  snj   cat < "$tmpdepfile" > "$depfile"
    529  1.1.1.1.2.2  snj   tr ' ' "$nl" < "$tmpdepfile" | \
    530  1.1.1.1.2.2  snj ## Some versions of the HPUX 10.20 sed can't process this invocation
    531  1.1.1.1.2.2  snj ## correctly.  Breaking it into two sed invocations is a workaround.
    532  1.1.1.1.2.2  snj     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
    533  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    534  1.1.1.1.2.2  snj   ;;
    535  1.1.1.1.2.2  snj 
    536  1.1.1.1.2.2  snj dashXmstdout)
    537  1.1.1.1.2.2  snj   # This case only exists to satisfy depend.m4.  It is never actually
    538  1.1.1.1.2.2  snj   # run, as this mode is specially recognized in the preamble.
    539  1.1.1.1.2.2  snj   exit 1
    540  1.1.1.1.2.2  snj   ;;
    541  1.1.1.1.2.2  snj 
    542  1.1.1.1.2.2  snj makedepend)
    543  1.1.1.1.2.2  snj   "$@" || exit $?
    544  1.1.1.1.2.2  snj   # Remove any Libtool call
    545  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    546  1.1.1.1.2.2  snj     while test "X$1" != 'X--mode=compile'; do
    547  1.1.1.1.2.2  snj       shift
    548  1.1.1.1.2.2  snj     done
    549  1.1.1.1.2.2  snj     shift
    550  1.1.1.1.2.2  snj   fi
    551  1.1.1.1.2.2  snj   # X makedepend
    552  1.1.1.1.2.2  snj   shift
    553  1.1.1.1.2.2  snj   cleared=no eat=no
    554  1.1.1.1.2.2  snj   for arg
    555  1.1.1.1.2.2  snj   do
    556  1.1.1.1.2.2  snj     case $cleared in
    557  1.1.1.1.2.2  snj     no)
    558  1.1.1.1.2.2  snj       set ""; shift
    559  1.1.1.1.2.2  snj       cleared=yes ;;
    560  1.1.1.1.2.2  snj     esac
    561  1.1.1.1.2.2  snj     if test $eat = yes; then
    562  1.1.1.1.2.2  snj       eat=no
    563  1.1.1.1.2.2  snj       continue
    564  1.1.1.1.2.2  snj     fi
    565  1.1.1.1.2.2  snj     case "$arg" in
    566  1.1.1.1.2.2  snj     -D*|-I*)
    567  1.1.1.1.2.2  snj       set fnord "$@" "$arg"; shift ;;
    568  1.1.1.1.2.2  snj     # Strip any option that makedepend may not understand.  Remove
    569  1.1.1.1.2.2  snj     # the object too, otherwise makedepend will parse it as a source file.
    570  1.1.1.1.2.2  snj     -arch)
    571  1.1.1.1.2.2  snj       eat=yes ;;
    572  1.1.1.1.2.2  snj     -*|$object)
    573  1.1.1.1.2.2  snj       ;;
    574  1.1.1.1.2.2  snj     *)
    575  1.1.1.1.2.2  snj       set fnord "$@" "$arg"; shift ;;
    576  1.1.1.1.2.2  snj     esac
    577  1.1.1.1.2.2  snj   done
    578  1.1.1.1.2.2  snj   obj_suffix=`echo "$object" | sed 's/^.*\././'`
    579  1.1.1.1.2.2  snj   touch "$tmpdepfile"
    580  1.1.1.1.2.2  snj   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
    581  1.1.1.1.2.2  snj   rm -f "$depfile"
    582  1.1.1.1.2.2  snj   # makedepend may prepend the VPATH from the source file name to the object.
    583  1.1.1.1.2.2  snj   # No need to regex-escape $object, excess matching of '.' is harmless.
    584  1.1.1.1.2.2  snj   sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
    585  1.1.1.1.2.2  snj   sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
    586  1.1.1.1.2.2  snj ## Some versions of the HPUX 10.20 sed can't process this invocation
    587  1.1.1.1.2.2  snj ## correctly.  Breaking it into two sed invocations is a workaround.
    588  1.1.1.1.2.2  snj     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
    589  1.1.1.1.2.2  snj   rm -f "$tmpdepfile" "$tmpdepfile".bak
    590  1.1.1.1.2.2  snj   ;;
    591  1.1.1.1.2.2  snj 
    592  1.1.1.1.2.2  snj cpp)
    593  1.1.1.1.2.2  snj   # Important note: in order to support this mode, a compiler *must*
    594  1.1.1.1.2.2  snj   # always write the preprocessed file to stdout.
    595  1.1.1.1.2.2  snj   "$@" || exit $?
    596  1.1.1.1.2.2  snj 
    597  1.1.1.1.2.2  snj   # Remove the call to Libtool.
    598  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    599  1.1.1.1.2.2  snj     while test "X$1" != 'X--mode=compile'; do
    600  1.1.1.1.2.2  snj       shift
    601  1.1.1.1.2.2  snj     done
    602  1.1.1.1.2.2  snj     shift
    603  1.1.1.1.2.2  snj   fi
    604  1.1.1.1.2.2  snj 
    605  1.1.1.1.2.2  snj   # Remove '-o $object'.
    606  1.1.1.1.2.2  snj   IFS=" "
    607  1.1.1.1.2.2  snj   for arg
    608  1.1.1.1.2.2  snj   do
    609  1.1.1.1.2.2  snj     case $arg in
    610  1.1.1.1.2.2  snj     -o)
    611  1.1.1.1.2.2  snj       shift
    612  1.1.1.1.2.2  snj       ;;
    613  1.1.1.1.2.2  snj     $object)
    614  1.1.1.1.2.2  snj       shift
    615  1.1.1.1.2.2  snj       ;;
    616  1.1.1.1.2.2  snj     *)
    617  1.1.1.1.2.2  snj       set fnord "$@" "$arg"
    618  1.1.1.1.2.2  snj       shift # fnord
    619  1.1.1.1.2.2  snj       shift # $arg
    620  1.1.1.1.2.2  snj       ;;
    621  1.1.1.1.2.2  snj     esac
    622  1.1.1.1.2.2  snj   done
    623  1.1.1.1.2.2  snj 
    624  1.1.1.1.2.2  snj   "$@" -E |
    625  1.1.1.1.2.2  snj     sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
    626  1.1.1.1.2.2  snj        -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
    627  1.1.1.1.2.2  snj     sed '$ s: \\$::' > "$tmpdepfile"
    628  1.1.1.1.2.2  snj   rm -f "$depfile"
    629  1.1.1.1.2.2  snj   echo "$object : \\" > "$depfile"
    630  1.1.1.1.2.2  snj   cat < "$tmpdepfile" >> "$depfile"
    631  1.1.1.1.2.2  snj   sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
    632  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    633  1.1.1.1.2.2  snj   ;;
    634  1.1.1.1.2.2  snj 
    635  1.1.1.1.2.2  snj msvisualcpp)
    636  1.1.1.1.2.2  snj   # Important note: in order to support this mode, a compiler *must*
    637  1.1.1.1.2.2  snj   # always write the preprocessed file to stdout.
    638  1.1.1.1.2.2  snj   "$@" || exit $?
    639  1.1.1.1.2.2  snj 
    640  1.1.1.1.2.2  snj   # Remove the call to Libtool.
    641  1.1.1.1.2.2  snj   if test "$libtool" = yes; then
    642  1.1.1.1.2.2  snj     while test "X$1" != 'X--mode=compile'; do
    643  1.1.1.1.2.2  snj       shift
    644  1.1.1.1.2.2  snj     done
    645  1.1.1.1.2.2  snj     shift
    646  1.1.1.1.2.2  snj   fi
    647  1.1.1.1.2.2  snj 
    648  1.1.1.1.2.2  snj   IFS=" "
    649  1.1.1.1.2.2  snj   for arg
    650  1.1.1.1.2.2  snj   do
    651  1.1.1.1.2.2  snj     case "$arg" in
    652  1.1.1.1.2.2  snj     -o)
    653  1.1.1.1.2.2  snj       shift
    654  1.1.1.1.2.2  snj       ;;
    655  1.1.1.1.2.2  snj     $object)
    656  1.1.1.1.2.2  snj       shift
    657  1.1.1.1.2.2  snj       ;;
    658  1.1.1.1.2.2  snj     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
    659  1.1.1.1.2.2  snj 	set fnord "$@"
    660  1.1.1.1.2.2  snj 	shift
    661  1.1.1.1.2.2  snj 	shift
    662  1.1.1.1.2.2  snj 	;;
    663  1.1.1.1.2.2  snj     *)
    664  1.1.1.1.2.2  snj 	set fnord "$@" "$arg"
    665  1.1.1.1.2.2  snj 	shift
    666  1.1.1.1.2.2  snj 	shift
    667  1.1.1.1.2.2  snj 	;;
    668  1.1.1.1.2.2  snj     esac
    669  1.1.1.1.2.2  snj   done
    670  1.1.1.1.2.2  snj   "$@" -E 2>/dev/null |
    671  1.1.1.1.2.2  snj   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
    672  1.1.1.1.2.2  snj   rm -f "$depfile"
    673  1.1.1.1.2.2  snj   echo "$object : \\" > "$depfile"
    674  1.1.1.1.2.2  snj   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
    675  1.1.1.1.2.2  snj   echo "$tab" >> "$depfile"
    676  1.1.1.1.2.2  snj   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
    677  1.1.1.1.2.2  snj   rm -f "$tmpdepfile"
    678  1.1.1.1.2.2  snj   ;;
    679  1.1.1.1.2.2  snj 
    680  1.1.1.1.2.2  snj msvcmsys)
    681  1.1.1.1.2.2  snj   # This case exists only to let depend.m4 do its work.  It works by
    682  1.1.1.1.2.2  snj   # looking at the text of this script.  This case will never be run,
    683  1.1.1.1.2.2  snj   # since it is checked for above.
    684  1.1.1.1.2.2  snj   exit 1
    685  1.1.1.1.2.2  snj   ;;
    686  1.1.1.1.2.2  snj 
    687  1.1.1.1.2.2  snj none)
    688  1.1.1.1.2.2  snj   exec "$@"
    689  1.1.1.1.2.2  snj   ;;
    690  1.1.1.1.2.2  snj 
    691  1.1.1.1.2.2  snj *)
    692  1.1.1.1.2.2  snj   echo "Unknown depmode $depmode" 1>&2
    693  1.1.1.1.2.2  snj   exit 1
    694  1.1.1.1.2.2  snj   ;;
    695  1.1.1.1.2.2  snj esac
    696  1.1.1.1.2.2  snj 
    697  1.1.1.1.2.2  snj exit 0
    698  1.1.1.1.2.2  snj 
    699  1.1.1.1.2.2  snj # Local Variables:
    700  1.1.1.1.2.2  snj # mode: shell-script
    701  1.1.1.1.2.2  snj # sh-indentation: 2
    702  1.1.1.1.2.2  snj # eval: (add-hook 'write-file-hooks 'time-stamp)
    703  1.1.1.1.2.2  snj # time-stamp-start: "scriptversion="
    704  1.1.1.1.2.2  snj # time-stamp-format: "%:y-%02m-%02d.%02H"
    705  1.1.1.1.2.2  snj # time-stamp-time-zone: "UTC"
    706  1.1.1.1.2.2  snj # time-stamp-end: "; # UTC"
    707  1.1.1.1.2.2  snj # End:
    708