Blame depcomp

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