Blame depcomp

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