Blame depcomp

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