Blame depcomp

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