lemon-project-template-glpk

diff deps/glpk/depcomp @ 9:33de93886c88

Import GLPK 4.47
author Alpar Juttner <alpar@cs.elte.hu>
date Sun, 06 Nov 2011 20:59:10 +0100
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/deps/glpk/depcomp	Sun Nov 06 20:59:10 2011 +0100
     1.3 @@ -0,0 +1,630 @@
     1.4 +#! /bin/sh
     1.5 +# depcomp - compile a program generating dependencies as side-effects
     1.6 +
     1.7 +scriptversion=2009-04-28.21; # UTC
     1.8 +
     1.9 +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
    1.10 +# Software Foundation, Inc.
    1.11 +
    1.12 +# This program is free software; you can redistribute it and/or modify
    1.13 +# it under the terms of the GNU General Public License as published by
    1.14 +# the Free Software Foundation; either version 2, or (at your option)
    1.15 +# any later version.
    1.16 +
    1.17 +# This program is distributed in the hope that it will be useful,
    1.18 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.19 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.20 +# GNU General Public License for more details.
    1.21 +
    1.22 +# You should have received a copy of the GNU General Public License
    1.23 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.24 +
    1.25 +# As a special exception to the GNU General Public License, if you
    1.26 +# distribute this file as part of a program that contains a
    1.27 +# configuration script generated by Autoconf, you may include it under
    1.28 +# the same distribution terms that you use for the rest of that program.
    1.29 +
    1.30 +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
    1.31 +
    1.32 +case $1 in
    1.33 +  '')
    1.34 +     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
    1.35 +     exit 1;
    1.36 +     ;;
    1.37 +  -h | --h*)
    1.38 +    cat <<\EOF
    1.39 +Usage: depcomp [--help] [--version] PROGRAM [ARGS]
    1.40 +
    1.41 +Run PROGRAMS ARGS to compile a file, generating dependencies
    1.42 +as side-effects.
    1.43 +
    1.44 +Environment variables:
    1.45 +  depmode     Dependency tracking mode.
    1.46 +  source      Source file read by `PROGRAMS ARGS'.
    1.47 +  object      Object file output by `PROGRAMS ARGS'.
    1.48 +  DEPDIR      directory where to store dependencies.
    1.49 +  depfile     Dependency file to output.
    1.50 +  tmpdepfile  Temporary file to use when outputing dependencies.
    1.51 +  libtool     Whether libtool is used (yes/no).
    1.52 +
    1.53 +Report bugs to <bug-automake@gnu.org>.
    1.54 +EOF
    1.55 +    exit $?
    1.56 +    ;;
    1.57 +  -v | --v*)
    1.58 +    echo "depcomp $scriptversion"
    1.59 +    exit $?
    1.60 +    ;;
    1.61 +esac
    1.62 +
    1.63 +if test -z "$depmode" || test -z "$source" || test -z "$object"; then
    1.64 +  echo "depcomp: Variables source, object and depmode must be set" 1>&2
    1.65 +  exit 1
    1.66 +fi
    1.67 +
    1.68 +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
    1.69 +depfile=${depfile-`echo "$object" |
    1.70 +  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
    1.71 +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
    1.72 +
    1.73 +rm -f "$tmpdepfile"
    1.74 +
    1.75 +# Some modes work just like other modes, but use different flags.  We
    1.76 +# parameterize here, but still list the modes in the big case below,
    1.77 +# to make depend.m4 easier to write.  Note that we *cannot* use a case
    1.78 +# here, because this file can only contain one case statement.
    1.79 +if test "$depmode" = hp; then
    1.80 +  # HP compiler uses -M and no extra arg.
    1.81 +  gccflag=-M
    1.82 +  depmode=gcc
    1.83 +fi
    1.84 +
    1.85 +if test "$depmode" = dashXmstdout; then
    1.86 +   # This is just like dashmstdout with a different argument.
    1.87 +   dashmflag=-xM
    1.88 +   depmode=dashmstdout
    1.89 +fi
    1.90 +
    1.91 +cygpath_u="cygpath -u -f -"
    1.92 +if test "$depmode" = msvcmsys; then
    1.93 +   # This is just like msvisualcpp but w/o cygpath translation.
    1.94 +   # Just convert the backslash-escaped backslashes to single forward
    1.95 +   # slashes to satisfy depend.m4
    1.96 +   cygpath_u="sed s,\\\\\\\\,/,g"
    1.97 +   depmode=msvisualcpp
    1.98 +fi
    1.99 +
   1.100 +case "$depmode" in
   1.101 +gcc3)
   1.102 +## gcc 3 implements dependency tracking that does exactly what
   1.103 +## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
   1.104 +## it if -MD -MP comes after the -MF stuff.  Hmm.
   1.105 +## Unfortunately, FreeBSD c89 acceptance of flags depends upon
   1.106 +## the command line argument order; so add the flags where they
   1.107 +## appear in depend2.am.  Note that the slowdown incurred here
   1.108 +## affects only configure: in makefiles, %FASTDEP% shortcuts this.
   1.109 +  for arg
   1.110 +  do
   1.111 +    case $arg in
   1.112 +    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
   1.113 +    *)  set fnord "$@" "$arg" ;;
   1.114 +    esac
   1.115 +    shift # fnord
   1.116 +    shift # $arg
   1.117 +  done
   1.118 +  "$@"
   1.119 +  stat=$?
   1.120 +  if test $stat -eq 0; then :
   1.121 +  else
   1.122 +    rm -f "$tmpdepfile"
   1.123 +    exit $stat
   1.124 +  fi
   1.125 +  mv "$tmpdepfile" "$depfile"
   1.126 +  ;;
   1.127 +
   1.128 +gcc)
   1.129 +## There are various ways to get dependency output from gcc.  Here's
   1.130 +## why we pick this rather obscure method:
   1.131 +## - Don't want to use -MD because we'd like the dependencies to end
   1.132 +##   up in a subdir.  Having to rename by hand is ugly.
   1.133 +##   (We might end up doing this anyway to support other compilers.)
   1.134 +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
   1.135 +##   -MM, not -M (despite what the docs say).
   1.136 +## - Using -M directly means running the compiler twice (even worse
   1.137 +##   than renaming).
   1.138 +  if test -z "$gccflag"; then
   1.139 +    gccflag=-MD,
   1.140 +  fi
   1.141 +  "$@" -Wp,"$gccflag$tmpdepfile"
   1.142 +  stat=$?
   1.143 +  if test $stat -eq 0; then :
   1.144 +  else
   1.145 +    rm -f "$tmpdepfile"
   1.146 +    exit $stat
   1.147 +  fi
   1.148 +  rm -f "$depfile"
   1.149 +  echo "$object : \\" > "$depfile"
   1.150 +  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
   1.151 +## The second -e expression handles DOS-style file names with drive letters.
   1.152 +  sed -e 's/^[^:]*: / /' \
   1.153 +      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
   1.154 +## This next piece of magic avoids the `deleted header file' problem.
   1.155 +## The problem is that when a header file which appears in a .P file
   1.156 +## is deleted, the dependency causes make to die (because there is
   1.157 +## typically no way to rebuild the header).  We avoid this by adding
   1.158 +## dummy dependencies for each header file.  Too bad gcc doesn't do
   1.159 +## this for us directly.
   1.160 +  tr ' ' '
   1.161 +' < "$tmpdepfile" |
   1.162 +## Some versions of gcc put a space before the `:'.  On the theory
   1.163 +## that the space means something, we add a space to the output as
   1.164 +## well.
   1.165 +## Some versions of the HPUX 10.20 sed can't process this invocation
   1.166 +## correctly.  Breaking it into two sed invocations is a workaround.
   1.167 +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
   1.168 +  rm -f "$tmpdepfile"
   1.169 +  ;;
   1.170 +
   1.171 +hp)
   1.172 +  # This case exists only to let depend.m4 do its work.  It works by
   1.173 +  # looking at the text of this script.  This case will never be run,
   1.174 +  # since it is checked for above.
   1.175 +  exit 1
   1.176 +  ;;
   1.177 +
   1.178 +sgi)
   1.179 +  if test "$libtool" = yes; then
   1.180 +    "$@" "-Wp,-MDupdate,$tmpdepfile"
   1.181 +  else
   1.182 +    "$@" -MDupdate "$tmpdepfile"
   1.183 +  fi
   1.184 +  stat=$?
   1.185 +  if test $stat -eq 0; then :
   1.186 +  else
   1.187 +    rm -f "$tmpdepfile"
   1.188 +    exit $stat
   1.189 +  fi
   1.190 +  rm -f "$depfile"
   1.191 +
   1.192 +  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
   1.193 +    echo "$object : \\" > "$depfile"
   1.194 +
   1.195 +    # Clip off the initial element (the dependent).  Don't try to be
   1.196 +    # clever and replace this with sed code, as IRIX sed won't handle
   1.197 +    # lines with more than a fixed number of characters (4096 in
   1.198 +    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
   1.199 +    # the IRIX cc adds comments like `#:fec' to the end of the
   1.200 +    # dependency line.
   1.201 +    tr ' ' '
   1.202 +' < "$tmpdepfile" \
   1.203 +    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
   1.204 +    tr '
   1.205 +' ' ' >> "$depfile"
   1.206 +    echo >> "$depfile"
   1.207 +
   1.208 +    # The second pass generates a dummy entry for each header file.
   1.209 +    tr ' ' '
   1.210 +' < "$tmpdepfile" \
   1.211 +   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
   1.212 +   >> "$depfile"
   1.213 +  else
   1.214 +    # The sourcefile does not contain any dependencies, so just
   1.215 +    # store a dummy comment line, to avoid errors with the Makefile
   1.216 +    # "include basename.Plo" scheme.
   1.217 +    echo "#dummy" > "$depfile"
   1.218 +  fi
   1.219 +  rm -f "$tmpdepfile"
   1.220 +  ;;
   1.221 +
   1.222 +aix)
   1.223 +  # The C for AIX Compiler uses -M and outputs the dependencies
   1.224 +  # in a .u file.  In older versions, this file always lives in the
   1.225 +  # current directory.  Also, the AIX compiler puts `$object:' at the
   1.226 +  # start of each line; $object doesn't have directory information.
   1.227 +  # Version 6 uses the directory in both cases.
   1.228 +  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   1.229 +  test "x$dir" = "x$object" && dir=
   1.230 +  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   1.231 +  if test "$libtool" = yes; then
   1.232 +    tmpdepfile1=$dir$base.u
   1.233 +    tmpdepfile2=$base.u
   1.234 +    tmpdepfile3=$dir.libs/$base.u
   1.235 +    "$@" -Wc,-M
   1.236 +  else
   1.237 +    tmpdepfile1=$dir$base.u
   1.238 +    tmpdepfile2=$dir$base.u
   1.239 +    tmpdepfile3=$dir$base.u
   1.240 +    "$@" -M
   1.241 +  fi
   1.242 +  stat=$?
   1.243 +
   1.244 +  if test $stat -eq 0; then :
   1.245 +  else
   1.246 +    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
   1.247 +    exit $stat
   1.248 +  fi
   1.249 +
   1.250 +  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
   1.251 +  do
   1.252 +    test -f "$tmpdepfile" && break
   1.253 +  done
   1.254 +  if test -f "$tmpdepfile"; then
   1.255 +    # Each line is of the form `foo.o: dependent.h'.
   1.256 +    # Do two passes, one to just change these to
   1.257 +    # `$object: dependent.h' and one to simply `dependent.h:'.
   1.258 +    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
   1.259 +    # That's a tab and a space in the [].
   1.260 +    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   1.261 +  else
   1.262 +    # The sourcefile does not contain any dependencies, so just
   1.263 +    # store a dummy comment line, to avoid errors with the Makefile
   1.264 +    # "include basename.Plo" scheme.
   1.265 +    echo "#dummy" > "$depfile"
   1.266 +  fi
   1.267 +  rm -f "$tmpdepfile"
   1.268 +  ;;
   1.269 +
   1.270 +icc)
   1.271 +  # Intel's C compiler understands `-MD -MF file'.  However on
   1.272 +  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   1.273 +  # ICC 7.0 will fill foo.d with something like
   1.274 +  #    foo.o: sub/foo.c
   1.275 +  #    foo.o: sub/foo.h
   1.276 +  # which is wrong.  We want:
   1.277 +  #    sub/foo.o: sub/foo.c
   1.278 +  #    sub/foo.o: sub/foo.h
   1.279 +  #    sub/foo.c:
   1.280 +  #    sub/foo.h:
   1.281 +  # ICC 7.1 will output
   1.282 +  #    foo.o: sub/foo.c sub/foo.h
   1.283 +  # and will wrap long lines using \ :
   1.284 +  #    foo.o: sub/foo.c ... \
   1.285 +  #     sub/foo.h ... \
   1.286 +  #     ...
   1.287 +
   1.288 +  "$@" -MD -MF "$tmpdepfile"
   1.289 +  stat=$?
   1.290 +  if test $stat -eq 0; then :
   1.291 +  else
   1.292 +    rm -f "$tmpdepfile"
   1.293 +    exit $stat
   1.294 +  fi
   1.295 +  rm -f "$depfile"
   1.296 +  # Each line is of the form `foo.o: dependent.h',
   1.297 +  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
   1.298 +  # Do two passes, one to just change these to
   1.299 +  # `$object: dependent.h' and one to simply `dependent.h:'.
   1.300 +  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   1.301 +  # Some versions of the HPUX 10.20 sed can't process this invocation
   1.302 +  # correctly.  Breaking it into two sed invocations is a workaround.
   1.303 +  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
   1.304 +    sed -e 's/$/ :/' >> "$depfile"
   1.305 +  rm -f "$tmpdepfile"
   1.306 +  ;;
   1.307 +
   1.308 +hp2)
   1.309 +  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
   1.310 +  # compilers, which have integrated preprocessors.  The correct option
   1.311 +  # to use with these is +Maked; it writes dependencies to a file named
   1.312 +  # 'foo.d', which lands next to the object file, wherever that
   1.313 +  # happens to be.
   1.314 +  # Much of this is similar to the tru64 case; see comments there.
   1.315 +  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   1.316 +  test "x$dir" = "x$object" && dir=
   1.317 +  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   1.318 +  if test "$libtool" = yes; then
   1.319 +    tmpdepfile1=$dir$base.d
   1.320 +    tmpdepfile2=$dir.libs/$base.d
   1.321 +    "$@" -Wc,+Maked
   1.322 +  else
   1.323 +    tmpdepfile1=$dir$base.d
   1.324 +    tmpdepfile2=$dir$base.d
   1.325 +    "$@" +Maked
   1.326 +  fi
   1.327 +  stat=$?
   1.328 +  if test $stat -eq 0; then :
   1.329 +  else
   1.330 +     rm -f "$tmpdepfile1" "$tmpdepfile2"
   1.331 +     exit $stat
   1.332 +  fi
   1.333 +
   1.334 +  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
   1.335 +  do
   1.336 +    test -f "$tmpdepfile" && break
   1.337 +  done
   1.338 +  if test -f "$tmpdepfile"; then
   1.339 +    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
   1.340 +    # Add `dependent.h:' lines.
   1.341 +    sed -ne '2,${
   1.342 +	       s/^ *//
   1.343 +	       s/ \\*$//
   1.344 +	       s/$/:/
   1.345 +	       p
   1.346 +	     }' "$tmpdepfile" >> "$depfile"
   1.347 +  else
   1.348 +    echo "#dummy" > "$depfile"
   1.349 +  fi
   1.350 +  rm -f "$tmpdepfile" "$tmpdepfile2"
   1.351 +  ;;
   1.352 +
   1.353 +tru64)
   1.354 +   # The Tru64 compiler uses -MD to generate dependencies as a side
   1.355 +   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
   1.356 +   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
   1.357 +   # dependencies in `foo.d' instead, so we check for that too.
   1.358 +   # Subdirectories are respected.
   1.359 +   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   1.360 +   test "x$dir" = "x$object" && dir=
   1.361 +   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   1.362 +
   1.363 +   if test "$libtool" = yes; then
   1.364 +      # With Tru64 cc, shared objects can also be used to make a
   1.365 +      # static library.  This mechanism is used in libtool 1.4 series to
   1.366 +      # handle both shared and static libraries in a single compilation.
   1.367 +      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
   1.368 +      #
   1.369 +      # With libtool 1.5 this exception was removed, and libtool now
   1.370 +      # generates 2 separate objects for the 2 libraries.  These two
   1.371 +      # compilations output dependencies in $dir.libs/$base.o.d and
   1.372 +      # in $dir$base.o.d.  We have to check for both files, because
   1.373 +      # one of the two compilations can be disabled.  We should prefer
   1.374 +      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
   1.375 +      # automatically cleaned when .libs/ is deleted, while ignoring
   1.376 +      # the former would cause a distcleancheck panic.
   1.377 +      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
   1.378 +      tmpdepfile2=$dir$base.o.d          # libtool 1.5
   1.379 +      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
   1.380 +      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
   1.381 +      "$@" -Wc,-MD
   1.382 +   else
   1.383 +      tmpdepfile1=$dir$base.o.d
   1.384 +      tmpdepfile2=$dir$base.d
   1.385 +      tmpdepfile3=$dir$base.d
   1.386 +      tmpdepfile4=$dir$base.d
   1.387 +      "$@" -MD
   1.388 +   fi
   1.389 +
   1.390 +   stat=$?
   1.391 +   if test $stat -eq 0; then :
   1.392 +   else
   1.393 +      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
   1.394 +      exit $stat
   1.395 +   fi
   1.396 +
   1.397 +   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
   1.398 +   do
   1.399 +     test -f "$tmpdepfile" && break
   1.400 +   done
   1.401 +   if test -f "$tmpdepfile"; then
   1.402 +      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
   1.403 +      # That's a tab and a space in the [].
   1.404 +      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   1.405 +   else
   1.406 +      echo "#dummy" > "$depfile"
   1.407 +   fi
   1.408 +   rm -f "$tmpdepfile"
   1.409 +   ;;
   1.410 +
   1.411 +#nosideeffect)
   1.412 +  # This comment above is used by automake to tell side-effect
   1.413 +  # dependency tracking mechanisms from slower ones.
   1.414 +
   1.415 +dashmstdout)
   1.416 +  # Important note: in order to support this mode, a compiler *must*
   1.417 +  # always write the preprocessed file to stdout, regardless of -o.
   1.418 +  "$@" || exit $?
   1.419 +
   1.420 +  # Remove the call to Libtool.
   1.421 +  if test "$libtool" = yes; then
   1.422 +    while test "X$1" != 'X--mode=compile'; do
   1.423 +      shift
   1.424 +    done
   1.425 +    shift
   1.426 +  fi
   1.427 +
   1.428 +  # Remove `-o $object'.
   1.429 +  IFS=" "
   1.430 +  for arg
   1.431 +  do
   1.432 +    case $arg in
   1.433 +    -o)
   1.434 +      shift
   1.435 +      ;;
   1.436 +    $object)
   1.437 +      shift
   1.438 +      ;;
   1.439 +    *)
   1.440 +      set fnord "$@" "$arg"
   1.441 +      shift # fnord
   1.442 +      shift # $arg
   1.443 +      ;;
   1.444 +    esac
   1.445 +  done
   1.446 +
   1.447 +  test -z "$dashmflag" && dashmflag=-M
   1.448 +  # Require at least two characters before searching for `:'
   1.449 +  # in the target name.  This is to cope with DOS-style filenames:
   1.450 +  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
   1.451 +  "$@" $dashmflag |
   1.452 +    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
   1.453 +  rm -f "$depfile"
   1.454 +  cat < "$tmpdepfile" > "$depfile"
   1.455 +  tr ' ' '
   1.456 +' < "$tmpdepfile" | \
   1.457 +## Some versions of the HPUX 10.20 sed can't process this invocation
   1.458 +## correctly.  Breaking it into two sed invocations is a workaround.
   1.459 +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
   1.460 +  rm -f "$tmpdepfile"
   1.461 +  ;;
   1.462 +
   1.463 +dashXmstdout)
   1.464 +  # This case only exists to satisfy depend.m4.  It is never actually
   1.465 +  # run, as this mode is specially recognized in the preamble.
   1.466 +  exit 1
   1.467 +  ;;
   1.468 +
   1.469 +makedepend)
   1.470 +  "$@" || exit $?
   1.471 +  # Remove any Libtool call
   1.472 +  if test "$libtool" = yes; then
   1.473 +    while test "X$1" != 'X--mode=compile'; do
   1.474 +      shift
   1.475 +    done
   1.476 +    shift
   1.477 +  fi
   1.478 +  # X makedepend
   1.479 +  shift
   1.480 +  cleared=no eat=no
   1.481 +  for arg
   1.482 +  do
   1.483 +    case $cleared in
   1.484 +    no)
   1.485 +      set ""; shift
   1.486 +      cleared=yes ;;
   1.487 +    esac
   1.488 +    if test $eat = yes; then
   1.489 +      eat=no
   1.490 +      continue
   1.491 +    fi
   1.492 +    case "$arg" in
   1.493 +    -D*|-I*)
   1.494 +      set fnord "$@" "$arg"; shift ;;
   1.495 +    # Strip any option that makedepend may not understand.  Remove
   1.496 +    # the object too, otherwise makedepend will parse it as a source file.
   1.497 +    -arch)
   1.498 +      eat=yes ;;
   1.499 +    -*|$object)
   1.500 +      ;;
   1.501 +    *)
   1.502 +      set fnord "$@" "$arg"; shift ;;
   1.503 +    esac
   1.504 +  done
   1.505 +  obj_suffix=`echo "$object" | sed 's/^.*\././'`
   1.506 +  touch "$tmpdepfile"
   1.507 +  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   1.508 +  rm -f "$depfile"
   1.509 +  cat < "$tmpdepfile" > "$depfile"
   1.510 +  sed '1,2d' "$tmpdepfile" | tr ' ' '
   1.511 +' | \
   1.512 +## Some versions of the HPUX 10.20 sed can't process this invocation
   1.513 +## correctly.  Breaking it into two sed invocations is a workaround.
   1.514 +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
   1.515 +  rm -f "$tmpdepfile" "$tmpdepfile".bak
   1.516 +  ;;
   1.517 +
   1.518 +cpp)
   1.519 +  # Important note: in order to support this mode, a compiler *must*
   1.520 +  # always write the preprocessed file to stdout.
   1.521 +  "$@" || exit $?
   1.522 +
   1.523 +  # Remove the call to Libtool.
   1.524 +  if test "$libtool" = yes; then
   1.525 +    while test "X$1" != 'X--mode=compile'; do
   1.526 +      shift
   1.527 +    done
   1.528 +    shift
   1.529 +  fi
   1.530 +
   1.531 +  # Remove `-o $object'.
   1.532 +  IFS=" "
   1.533 +  for arg
   1.534 +  do
   1.535 +    case $arg in
   1.536 +    -o)
   1.537 +      shift
   1.538 +      ;;
   1.539 +    $object)
   1.540 +      shift
   1.541 +      ;;
   1.542 +    *)
   1.543 +      set fnord "$@" "$arg"
   1.544 +      shift # fnord
   1.545 +      shift # $arg
   1.546 +      ;;
   1.547 +    esac
   1.548 +  done
   1.549 +
   1.550 +  "$@" -E |
   1.551 +    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
   1.552 +       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
   1.553 +    sed '$ s: \\$::' > "$tmpdepfile"
   1.554 +  rm -f "$depfile"
   1.555 +  echo "$object : \\" > "$depfile"
   1.556 +  cat < "$tmpdepfile" >> "$depfile"
   1.557 +  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
   1.558 +  rm -f "$tmpdepfile"
   1.559 +  ;;
   1.560 +
   1.561 +msvisualcpp)
   1.562 +  # Important note: in order to support this mode, a compiler *must*
   1.563 +  # always write the preprocessed file to stdout.
   1.564 +  "$@" || exit $?
   1.565 +
   1.566 +  # Remove the call to Libtool.
   1.567 +  if test "$libtool" = yes; then
   1.568 +    while test "X$1" != 'X--mode=compile'; do
   1.569 +      shift
   1.570 +    done
   1.571 +    shift
   1.572 +  fi
   1.573 +
   1.574 +  IFS=" "
   1.575 +  for arg
   1.576 +  do
   1.577 +    case "$arg" in
   1.578 +    -o)
   1.579 +      shift
   1.580 +      ;;
   1.581 +    $object)
   1.582 +      shift
   1.583 +      ;;
   1.584 +    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
   1.585 +	set fnord "$@"
   1.586 +	shift
   1.587 +	shift
   1.588 +	;;
   1.589 +    *)
   1.590 +	set fnord "$@" "$arg"
   1.591 +	shift
   1.592 +	shift
   1.593 +	;;
   1.594 +    esac
   1.595 +  done
   1.596 +  "$@" -E 2>/dev/null |
   1.597 +  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   1.598 +  rm -f "$depfile"
   1.599 +  echo "$object : \\" > "$depfile"
   1.600 +  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
   1.601 +  echo "	" >> "$depfile"
   1.602 +  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   1.603 +  rm -f "$tmpdepfile"
   1.604 +  ;;
   1.605 +
   1.606 +msvcmsys)
   1.607 +  # This case exists only to let depend.m4 do its work.  It works by
   1.608 +  # looking at the text of this script.  This case will never be run,
   1.609 +  # since it is checked for above.
   1.610 +  exit 1
   1.611 +  ;;
   1.612 +
   1.613 +none)
   1.614 +  exec "$@"
   1.615 +  ;;
   1.616 +
   1.617 +*)
   1.618 +  echo "Unknown depmode $depmode" 1>&2
   1.619 +  exit 1
   1.620 +  ;;
   1.621 +esac
   1.622 +
   1.623 +exit 0
   1.624 +
   1.625 +# Local Variables:
   1.626 +# mode: shell-script
   1.627 +# sh-indentation: 2
   1.628 +# eval: (add-hook 'write-file-hooks 'time-stamp)
   1.629 +# time-stamp-start: "scriptversion="
   1.630 +# time-stamp-format: "%:y-%02m-%02d.%02H"
   1.631 +# time-stamp-time-zone: "UTC"
   1.632 +# time-stamp-end: "; # UTC"
   1.633 +# End: