Blame seq/sbiload/depcomp

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