roentgen b75cab
#! /bin/sh
roentgen b75cab
# depcomp - compile a program generating dependencies as side-effects
roentgen b75cab
roentgen b75cab
scriptversion=2006-10-15.18
roentgen b75cab
roentgen b75cab
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
roentgen b75cab
# Foundation, Inc.
roentgen b75cab
roentgen b75cab
# This program is free software; you can redistribute it and/or modify
roentgen b75cab
# it under the terms of the GNU General Public License as published by
roentgen b75cab
# the Free Software Foundation; either version 2, or (at your option)
roentgen b75cab
# any later version.
roentgen b75cab
roentgen b75cab
# This program is distributed in the hope that it will be useful,
roentgen b75cab
# but WITHOUT ANY WARRANTY; without even the implied warranty of
roentgen b75cab
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
roentgen b75cab
# GNU General Public License for more details.
roentgen b75cab
roentgen b75cab
# You should have received a copy of the GNU General Public License
roentgen b75cab
# along with this program; if not, write to the Free Software
roentgen b75cab
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
roentgen b75cab
# 02110-1301, USA.
roentgen b75cab
roentgen b75cab
# As a special exception to the GNU General Public License, if you
roentgen b75cab
# distribute this file as part of a program that contains a
roentgen b75cab
# configuration script generated by Autoconf, you may include it under
roentgen b75cab
# the same distribution terms that you use for the rest of that program.
roentgen b75cab
roentgen b75cab
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.</oliva@dcc.unicamp.br>
roentgen b75cab
roentgen b75cab
case $1 in
roentgen b75cab
  '')
roentgen b75cab
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
roentgen b75cab
     exit 1;
roentgen b75cab
     ;;
roentgen b75cab
  -h | --h*)
roentgen b75cab
    cat <<\EOF
roentgen b75cab
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
roentgen b75cab
roentgen b75cab
Run PROGRAMS ARGS to compile a file, generating dependencies
roentgen b75cab
as side-effects.
roentgen b75cab
roentgen b75cab
Environment variables:
roentgen b75cab
  depmode     Dependency tracking mode.
roentgen b75cab
  source      Source file read by `PROGRAMS ARGS'.
roentgen b75cab
  object      Object file output by `PROGRAMS ARGS'.
roentgen b75cab
  DEPDIR      directory where to store dependencies.
roentgen b75cab
  depfile     Dependency file to output.
roentgen b75cab
  tmpdepfile  Temporary file to use when outputing dependencies.
roentgen b75cab
  libtool     Whether libtool is used (yes/no).
roentgen b75cab
roentgen b75cab
Report bugs to <bug-automake@gnu.org>.</bug-automake@gnu.org>
roentgen b75cab
EOF
roentgen b75cab
    exit $?
roentgen b75cab
    ;;
roentgen b75cab
  -v | --v*)
roentgen b75cab
    echo "depcomp $scriptversion"
roentgen b75cab
    exit $?
roentgen b75cab
    ;;
roentgen b75cab
esac
roentgen b75cab
roentgen b75cab
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
roentgen b75cab
  echo "depcomp: Variables source, object and depmode must be set" 1>&2
roentgen b75cab
  exit 1
roentgen b75cab
fi
roentgen b75cab
roentgen b75cab
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
roentgen b75cab
depfile=${depfile-`echo "$object" |
roentgen b75cab
  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
roentgen b75cab
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
roentgen b75cab
roentgen b75cab
rm -f "$tmpdepfile"
roentgen b75cab
roentgen b75cab
# Some modes work just like other modes, but use different flags.  We
roentgen b75cab
# parameterize here, but still list the modes in the big case below,
roentgen b75cab
# to make depend.m4 easier to write.  Note that we *cannot* use a case
roentgen b75cab
# here, because this file can only contain one case statement.
roentgen b75cab
if test "$depmode" = hp; then
roentgen b75cab
  # HP compiler uses -M and no extra arg.
roentgen b75cab
  gccflag=-M
roentgen b75cab
  depmode=gcc
roentgen b75cab
fi
roentgen b75cab
roentgen b75cab
if test "$depmode" = dashXmstdout; then
roentgen b75cab
   # This is just like dashmstdout with a different argument.
roentgen b75cab
   dashmflag=-xM
roentgen b75cab
   depmode=dashmstdout
roentgen b75cab
fi
roentgen b75cab
roentgen b75cab
case "$depmode" in
roentgen b75cab
gcc3)
roentgen b75cab
## gcc 3 implements dependency tracking that does exactly what
roentgen b75cab
## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
roentgen b75cab
## it if -MD -MP comes after the -MF stuff.  Hmm.
roentgen b75cab
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
roentgen b75cab
## the command line argument order; so add the flags where they
roentgen b75cab
## appear in depend2.am.  Note that the slowdown incurred here
roentgen b75cab
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
roentgen b75cab
  for arg
roentgen b75cab
  do
roentgen b75cab
    case $arg in
roentgen b75cab
    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
roentgen b75cab
    *)  set fnord "$@" "$arg" ;;
roentgen b75cab
    esac
roentgen b75cab
    shift # fnord
roentgen b75cab
    shift # $arg
roentgen b75cab
  done
roentgen b75cab
  "$@"
roentgen b75cab
  stat=$?
roentgen b75cab
  if test $stat -eq 0; then :
roentgen b75cab
  else
roentgen b75cab
    rm -f "$tmpdepfile"
roentgen b75cab
    exit $stat
roentgen b75cab
  fi
roentgen b75cab
  mv "$tmpdepfile" "$depfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
gcc)
roentgen b75cab
## There are various ways to get dependency output from gcc.  Here's
roentgen b75cab
## why we pick this rather obscure method:
roentgen b75cab
## - Don't want to use -MD because we'd like the dependencies to end
roentgen b75cab
##   up in a subdir.  Having to rename by hand is ugly.
roentgen b75cab
##   (We might end up doing this anyway to support other compilers.)
roentgen b75cab
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
roentgen b75cab
##   -MM, not -M (despite what the docs say).
roentgen b75cab
## - Using -M directly means running the compiler twice (even worse
roentgen b75cab
##   than renaming).
roentgen b75cab
  if test -z "$gccflag"; then
roentgen b75cab
    gccflag=-MD,
roentgen b75cab
  fi
roentgen b75cab
  "$@" -Wp,"$gccflag$tmpdepfile"
roentgen b75cab
  stat=$?
roentgen b75cab
  if test $stat -eq 0; then :
roentgen b75cab
  else
roentgen b75cab
    rm -f "$tmpdepfile"
roentgen b75cab
    exit $stat
roentgen b75cab
  fi
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
  echo "$object : \\" > "$depfile"
roentgen b75cab
  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
roentgen b75cab
## The second -e expression handles DOS-style file names with drive letters.
roentgen b75cab
  sed -e 's/^[^:]*: / /' \
roentgen b75cab
      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
roentgen b75cab
## This next piece of magic avoids the `deleted header file' problem.
roentgen b75cab
## The problem is that when a header file which appears in a .P file
roentgen b75cab
## is deleted, the dependency causes make to die (because there is
roentgen b75cab
## typically no way to rebuild the header).  We avoid this by adding
roentgen b75cab
## dummy dependencies for each header file.  Too bad gcc doesn't do
roentgen b75cab
## this for us directly.
roentgen b75cab
  tr ' ' '
roentgen b75cab
' < "$tmpdepfile" |
roentgen b75cab
## Some versions of gcc put a space before the `:'.  On the theory
roentgen b75cab
## that the space means something, we add a space to the output as
roentgen b75cab
## well.
roentgen b75cab
## Some versions of the HPUX 10.20 sed can't process this invocation
roentgen b75cab
## correctly.  Breaking it into two sed invocations is a workaround.
roentgen b75cab
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
hp)
roentgen b75cab
  # This case exists only to let depend.m4 do its work.  It works by
roentgen b75cab
  # looking at the text of this script.  This case will never be run,
roentgen b75cab
  # since it is checked for above.
roentgen b75cab
  exit 1
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
sgi)
roentgen b75cab
  if test "$libtool" = yes; then
roentgen b75cab
    "$@" "-Wp,-MDupdate,$tmpdepfile"
roentgen b75cab
  else
roentgen b75cab
    "$@" -MDupdate "$tmpdepfile"
roentgen b75cab
  fi
roentgen b75cab
  stat=$?
roentgen b75cab
  if test $stat -eq 0; then :
roentgen b75cab
  else
roentgen b75cab
    rm -f "$tmpdepfile"
roentgen b75cab
    exit $stat
roentgen b75cab
  fi
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
roentgen b75cab
  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
roentgen b75cab
    echo "$object : \\" > "$depfile"
roentgen b75cab
roentgen b75cab
    # Clip off the initial element (the dependent).  Don't try to be
roentgen b75cab
    # clever and replace this with sed code, as IRIX sed won't handle
roentgen b75cab
    # lines with more than a fixed number of characters (4096 in
roentgen b75cab
    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
roentgen b75cab
    # the IRIX cc adds comments like `#:fec' to the end of the
roentgen b75cab
    # dependency line.
roentgen b75cab
    tr ' ' '
roentgen b75cab
' < "$tmpdepfile" \
roentgen b75cab
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
roentgen b75cab
    tr '
roentgen b75cab
' ' ' >> $depfile
roentgen b75cab
    echo >> $depfile
roentgen b75cab
roentgen b75cab
    # The second pass generates a dummy entry for each header file.
roentgen b75cab
    tr ' ' '
roentgen b75cab
' < "$tmpdepfile" \
roentgen b75cab
   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
roentgen b75cab
   >> $depfile
roentgen b75cab
  else
roentgen b75cab
    # The sourcefile does not contain any dependencies, so just
roentgen b75cab
    # store a dummy comment line, to avoid errors with the Makefile
roentgen b75cab
    # "include basename.Plo" scheme.
roentgen b75cab
    echo "#dummy" > "$depfile"
roentgen b75cab
  fi
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
aix)
roentgen b75cab
  # The C for AIX Compiler uses -M and outputs the dependencies
roentgen b75cab
  # in a .u file.  In older versions, this file always lives in the
roentgen b75cab
  # current directory.  Also, the AIX compiler puts `$object:' at the
roentgen b75cab
  # start of each line; $object doesn't have directory information.
roentgen b75cab
  # Version 6 uses the directory in both cases.
roentgen b75cab
  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
roentgen b75cab
  tmpdepfile="$stripped.u"
roentgen b75cab
  if test "$libtool" = yes; then
roentgen b75cab
    "$@" -Wc,-M
roentgen b75cab
  else
roentgen b75cab
    "$@" -M
roentgen b75cab
  fi
roentgen b75cab
  stat=$?
roentgen b75cab
roentgen b75cab
  if test -f "$tmpdepfile"; then :
roentgen b75cab
  else
roentgen b75cab
    stripped=`echo "$stripped" | sed 's,^.*/,,'`
roentgen b75cab
    tmpdepfile="$stripped.u"
roentgen b75cab
  fi
roentgen b75cab
roentgen b75cab
  if test $stat -eq 0; then :
roentgen b75cab
  else
roentgen b75cab
    rm -f "$tmpdepfile"
roentgen b75cab
    exit $stat
roentgen b75cab
  fi
roentgen b75cab
roentgen b75cab
  if test -f "$tmpdepfile"; then
roentgen b75cab
    outname="$stripped.o"
roentgen b75cab
    # Each line is of the form `foo.o: dependent.h'.
roentgen b75cab
    # Do two passes, one to just change these to
roentgen b75cab
    # `$object: dependent.h' and one to simply `dependent.h:'.
roentgen b75cab
    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
roentgen b75cab
    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
roentgen b75cab
  else
roentgen b75cab
    # The sourcefile does not contain any dependencies, so just
roentgen b75cab
    # store a dummy comment line, to avoid errors with the Makefile
roentgen b75cab
    # "include basename.Plo" scheme.
roentgen b75cab
    echo "#dummy" > "$depfile"
roentgen b75cab
  fi
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
icc)
roentgen b75cab
  # Intel's C compiler understands `-MD -MF file'.  However on
roentgen b75cab
  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
roentgen b75cab
  # ICC 7.0 will fill foo.d with something like
roentgen b75cab
  #    foo.o: sub/foo.c
roentgen b75cab
  #    foo.o: sub/foo.h
roentgen b75cab
  # which is wrong.  We want:
roentgen b75cab
  #    sub/foo.o: sub/foo.c
roentgen b75cab
  #    sub/foo.o: sub/foo.h
roentgen b75cab
  #    sub/foo.c:
roentgen b75cab
  #    sub/foo.h:
roentgen b75cab
  # ICC 7.1 will output
roentgen b75cab
  #    foo.o: sub/foo.c sub/foo.h
roentgen b75cab
  # and will wrap long lines using \ :
roentgen b75cab
  #    foo.o: sub/foo.c ... \
roentgen b75cab
  #     sub/foo.h ... \
roentgen b75cab
  #     ...
roentgen b75cab
roentgen b75cab
  "$@" -MD -MF "$tmpdepfile"
roentgen b75cab
  stat=$?
roentgen b75cab
  if test $stat -eq 0; then :
roentgen b75cab
  else
roentgen b75cab
    rm -f "$tmpdepfile"
roentgen b75cab
    exit $stat
roentgen b75cab
  fi
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
  # Each line is of the form `foo.o: dependent.h',
roentgen b75cab
  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
roentgen b75cab
  # Do two passes, one to just change these to
roentgen b75cab
  # `$object: dependent.h' and one to simply `dependent.h:'.
roentgen b75cab
  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
roentgen b75cab
  # Some versions of the HPUX 10.20 sed can't process this invocation
roentgen b75cab
  # correctly.  Breaking it into two sed invocations is a workaround.
roentgen b75cab
  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
roentgen b75cab
    sed -e 's/$/ :/' >> "$depfile"
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
hp2)
roentgen b75cab
  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
roentgen b75cab
  # compilers, which have integrated preprocessors.  The correct option
roentgen b75cab
  # to use with these is +Maked; it writes dependencies to a file named
roentgen b75cab
  # 'foo.d', which lands next to the object file, wherever that
roentgen b75cab
  # happens to be.
roentgen b75cab
  # Much of this is similar to the tru64 case; see comments there.
roentgen b75cab
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
roentgen b75cab
  test "x$dir" = "x$object" && dir=
roentgen b75cab
  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
roentgen b75cab
  if test "$libtool" = yes; then
roentgen b75cab
    tmpdepfile1=$dir$base.d
roentgen b75cab
    tmpdepfile2=$dir.libs/$base.d
roentgen b75cab
    "$@" -Wc,+Maked
roentgen b75cab
  else
roentgen b75cab
    tmpdepfile1=$dir$base.d
roentgen b75cab
    tmpdepfile2=$dir$base.d
roentgen b75cab
    "$@" +Maked
roentgen b75cab
  fi
roentgen b75cab
  stat=$?
roentgen b75cab
  if test $stat -eq 0; then :
roentgen b75cab
  else
roentgen b75cab
     rm -f "$tmpdepfile1" "$tmpdepfile2"
roentgen b75cab
     exit $stat
roentgen b75cab
  fi
roentgen b75cab
roentgen b75cab
  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
roentgen b75cab
  do
roentgen b75cab
    test -f "$tmpdepfile" && break
roentgen b75cab
  done
roentgen b75cab
  if test -f "$tmpdepfile"; then
roentgen b75cab
    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
roentgen b75cab
    # Add `dependent.h:' lines.
roentgen b75cab
    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
roentgen b75cab
  else
roentgen b75cab
    echo "#dummy" > "$depfile"
roentgen b75cab
  fi
roentgen b75cab
  rm -f "$tmpdepfile" "$tmpdepfile2"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
tru64)
roentgen b75cab
   # The Tru64 compiler uses -MD to generate dependencies as a side
roentgen b75cab
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
roentgen b75cab
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
roentgen b75cab
   # dependencies in `foo.d' instead, so we check for that too.
roentgen b75cab
   # Subdirectories are respected.
roentgen b75cab
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
roentgen b75cab
   test "x$dir" = "x$object" && dir=
roentgen b75cab
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
roentgen b75cab
roentgen b75cab
   if test "$libtool" = yes; then
roentgen b75cab
      # With Tru64 cc, shared objects can also be used to make a
roentgen b75cab
      # static library.  This mechanism is used in libtool 1.4 series to
roentgen b75cab
      # handle both shared and static libraries in a single compilation.
roentgen b75cab
      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
roentgen b75cab
      #
roentgen b75cab
      # With libtool 1.5 this exception was removed, and libtool now
roentgen b75cab
      # generates 2 separate objects for the 2 libraries.  These two
roentgen b75cab
      # compilations output dependencies in $dir.libs/$base.o.d and
roentgen b75cab
      # in $dir$base.o.d.  We have to check for both files, because
roentgen b75cab
      # one of the two compilations can be disabled.  We should prefer
roentgen b75cab
      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
roentgen b75cab
      # automatically cleaned when .libs/ is deleted, while ignoring
roentgen b75cab
      # the former would cause a distcleancheck panic.
roentgen b75cab
      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
roentgen b75cab
      tmpdepfile2=$dir$base.o.d          # libtool 1.5
roentgen b75cab
      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
roentgen b75cab
      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
roentgen b75cab
      "$@" -Wc,-MD
roentgen b75cab
   else
roentgen b75cab
      tmpdepfile1=$dir$base.o.d
roentgen b75cab
      tmpdepfile2=$dir$base.d
roentgen b75cab
      tmpdepfile3=$dir$base.d
roentgen b75cab
      tmpdepfile4=$dir$base.d
roentgen b75cab
      "$@" -MD
roentgen b75cab
   fi
roentgen b75cab
roentgen b75cab
   stat=$?
roentgen b75cab
   if test $stat -eq 0; then :
roentgen b75cab
   else
roentgen b75cab
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
roentgen b75cab
      exit $stat
roentgen b75cab
   fi
roentgen b75cab
roentgen b75cab
   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
roentgen b75cab
   do
roentgen b75cab
     test -f "$tmpdepfile" && break
roentgen b75cab
   done
roentgen b75cab
   if test -f "$tmpdepfile"; then
roentgen b75cab
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
roentgen b75cab
      # That's a tab and a space in the [].
roentgen b75cab
      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
roentgen b75cab
   else
roentgen b75cab
      echo "#dummy" > "$depfile"
roentgen b75cab
   fi
roentgen b75cab
   rm -f "$tmpdepfile"
roentgen b75cab
   ;;
roentgen b75cab
roentgen b75cab
#nosideeffect)
roentgen b75cab
  # This comment above is used by automake to tell side-effect
roentgen b75cab
  # dependency tracking mechanisms from slower ones.
roentgen b75cab
roentgen b75cab
dashmstdout)
roentgen b75cab
  # Important note: in order to support this mode, a compiler *must*
roentgen b75cab
  # always write the preprocessed file to stdout, regardless of -o.
roentgen b75cab
  "$@" || exit $?
roentgen b75cab
roentgen b75cab
  # Remove the call to Libtool.
roentgen b75cab
  if test "$libtool" = yes; then
roentgen b75cab
    while test $1 != '--mode=compile'; do
roentgen b75cab
      shift
roentgen b75cab
    done
roentgen b75cab
    shift
roentgen b75cab
  fi
roentgen b75cab
roentgen b75cab
  # Remove `-o $object'.
roentgen b75cab
  IFS=" "
roentgen b75cab
  for arg
roentgen b75cab
  do
roentgen b75cab
    case $arg in
roentgen b75cab
    -o)
roentgen b75cab
      shift
roentgen b75cab
      ;;
roentgen b75cab
    $object)
roentgen b75cab
      shift
roentgen b75cab
      ;;
roentgen b75cab
    *)
roentgen b75cab
      set fnord "$@" "$arg"
roentgen b75cab
      shift # fnord
roentgen b75cab
      shift # $arg
roentgen b75cab
      ;;
roentgen b75cab
    esac
roentgen b75cab
  done
roentgen b75cab
roentgen b75cab
  test -z "$dashmflag" && dashmflag=-M
roentgen b75cab
  # Require at least two characters before searching for `:'
roentgen b75cab
  # in the target name.  This is to cope with DOS-style filenames:
roentgen b75cab
  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
roentgen b75cab
  "$@" $dashmflag |
roentgen b75cab
    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
  cat < "$tmpdepfile" > "$depfile"
roentgen b75cab
  tr ' ' '
roentgen b75cab
' < "$tmpdepfile" | \
roentgen b75cab
## Some versions of the HPUX 10.20 sed can't process this invocation
roentgen b75cab
## correctly.  Breaking it into two sed invocations is a workaround.
roentgen b75cab
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
dashXmstdout)
roentgen b75cab
  # This case only exists to satisfy depend.m4.  It is never actually
roentgen b75cab
  # run, as this mode is specially recognized in the preamble.
roentgen b75cab
  exit 1
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
makedepend)
roentgen b75cab
  "$@" || exit $?
roentgen b75cab
  # Remove any Libtool call
roentgen b75cab
  if test "$libtool" = yes; then
roentgen b75cab
    while test $1 != '--mode=compile'; do
roentgen b75cab
      shift
roentgen b75cab
    done
roentgen b75cab
    shift
roentgen b75cab
  fi
roentgen b75cab
  # X makedepend
roentgen b75cab
  shift
roentgen b75cab
  cleared=no
roentgen b75cab
  for arg in "$@"; do
roentgen b75cab
    case $cleared in
roentgen b75cab
    no)
roentgen b75cab
      set ""; shift
roentgen b75cab
      cleared=yes ;;
roentgen b75cab
    esac
roentgen b75cab
    case "$arg" in
roentgen b75cab
    -D*|-I*)
roentgen b75cab
      set fnord "$@" "$arg"; shift ;;
roentgen b75cab
    # Strip any option that makedepend may not understand.  Remove
roentgen b75cab
    # the object too, otherwise makedepend will parse it as a source file.
roentgen b75cab
    -*|$object)
roentgen b75cab
      ;;
roentgen b75cab
    *)
roentgen b75cab
      set fnord "$@" "$arg"; shift ;;
roentgen b75cab
    esac
roentgen b75cab
  done
roentgen b75cab
  obj_suffix="`echo $object | sed 's/^.*\././'`"
roentgen b75cab
  touch "$tmpdepfile"
roentgen b75cab
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
  cat < "$tmpdepfile" > "$depfile"
roentgen b75cab
  sed '1,2d' "$tmpdepfile" | tr ' ' '
roentgen b75cab
' | \
roentgen b75cab
## Some versions of the HPUX 10.20 sed can't process this invocation
roentgen b75cab
## correctly.  Breaking it into two sed invocations is a workaround.
roentgen b75cab
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
roentgen b75cab
  rm -f "$tmpdepfile" "$tmpdepfile".bak
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
cpp)
roentgen b75cab
  # Important note: in order to support this mode, a compiler *must*
roentgen b75cab
  # always write the preprocessed file to stdout.
roentgen b75cab
  "$@" || exit $?
roentgen b75cab
roentgen b75cab
  # Remove the call to Libtool.
roentgen b75cab
  if test "$libtool" = yes; then
roentgen b75cab
    while test $1 != '--mode=compile'; do
roentgen b75cab
      shift
roentgen b75cab
    done
roentgen b75cab
    shift
roentgen b75cab
  fi
roentgen b75cab
roentgen b75cab
  # Remove `-o $object'.
roentgen b75cab
  IFS=" "
roentgen b75cab
  for arg
roentgen b75cab
  do
roentgen b75cab
    case $arg in
roentgen b75cab
    -o)
roentgen b75cab
      shift
roentgen b75cab
      ;;
roentgen b75cab
    $object)
roentgen b75cab
      shift
roentgen b75cab
      ;;
roentgen b75cab
    *)
roentgen b75cab
      set fnord "$@" "$arg"
roentgen b75cab
      shift # fnord
roentgen b75cab
      shift # $arg
roentgen b75cab
      ;;
roentgen b75cab
    esac
roentgen b75cab
  done
roentgen b75cab
roentgen b75cab
  "$@" -E |
roentgen b75cab
    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
roentgen b75cab
       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
roentgen b75cab
    sed '$ s: \\$::' > "$tmpdepfile"
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
  echo "$object : \\" > "$depfile"
roentgen b75cab
  cat < "$tmpdepfile" >> "$depfile"
roentgen b75cab
  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
msvisualcpp)
roentgen b75cab
  # Important note: in order to support this mode, a compiler *must*
roentgen b75cab
  # always write the preprocessed file to stdout, regardless of -o,
roentgen b75cab
  # because we must use -o when running libtool.
roentgen b75cab
  "$@" || exit $?
roentgen b75cab
  IFS=" "
roentgen b75cab
  for arg
roentgen b75cab
  do
roentgen b75cab
    case "$arg" in
roentgen b75cab
    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
roentgen b75cab
	set fnord "$@"
roentgen b75cab
	shift
roentgen b75cab
	shift
roentgen b75cab
	;;
roentgen b75cab
    *)
roentgen b75cab
	set fnord "$@" "$arg"
roentgen b75cab
	shift
roentgen b75cab
	shift
roentgen b75cab
	;;
roentgen b75cab
    esac
roentgen b75cab
  done
roentgen b75cab
  "$@" -E |
roentgen b75cab
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
roentgen b75cab
  rm -f "$depfile"
roentgen b75cab
  echo "$object : \\" > "$depfile"
roentgen b75cab
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
roentgen b75cab
  echo "	" >> "$depfile"
roentgen b75cab
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
roentgen b75cab
  rm -f "$tmpdepfile"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
none)
roentgen b75cab
  exec "$@"
roentgen b75cab
  ;;
roentgen b75cab
roentgen b75cab
*)
roentgen b75cab
  echo "Unknown depmode $depmode" 1>&2
roentgen b75cab
  exit 1
roentgen b75cab
  ;;
roentgen b75cab
esac
roentgen b75cab
roentgen b75cab
exit 0
roentgen b75cab
roentgen b75cab
# Local Variables:
roentgen b75cab
# mode: shell-script
roentgen b75cab
# sh-indentation: 2
roentgen b75cab
# eval: (add-hook 'write-file-hooks 'time-stamp)
roentgen b75cab
# time-stamp-start: "scriptversion="
roentgen b75cab
# time-stamp-format: "%:y-%02m-%02d.%02H"
roentgen b75cab
# time-stamp-end: "$"
roentgen b75cab
# End: