annotate src/liblo-0.26/depcomp @ 4:e13257ea84a4

Add bzip2, zlib, liblo, portaudio sources
author Chris Cannam
date Wed, 20 Mar 2013 13:59:52 +0000
parents
children
rev   line source
Chris@4 1 #! /bin/sh
Chris@4 2 # depcomp - compile a program generating dependencies as side-effects
Chris@4 3
Chris@4 4 scriptversion=2007-03-29.01
Chris@4 5
Chris@4 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
Chris@4 7 # Foundation, Inc.
Chris@4 8
Chris@4 9 # This program is free software; you can redistribute it and/or modify
Chris@4 10 # it under the terms of the GNU General Public License as published by
Chris@4 11 # the Free Software Foundation; either version 2, or (at your option)
Chris@4 12 # any later version.
Chris@4 13
Chris@4 14 # This program is distributed in the hope that it will be useful,
Chris@4 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@4 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@4 17 # GNU General Public License for more details.
Chris@4 18
Chris@4 19 # You should have received a copy of the GNU General Public License
Chris@4 20 # along with this program; if not, write to the Free Software
Chris@4 21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Chris@4 22 # 02110-1301, USA.
Chris@4 23
Chris@4 24 # As a special exception to the GNU General Public License, if you
Chris@4 25 # distribute this file as part of a program that contains a
Chris@4 26 # configuration script generated by Autoconf, you may include it under
Chris@4 27 # the same distribution terms that you use for the rest of that program.
Chris@4 28
Chris@4 29 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
Chris@4 30
Chris@4 31 case $1 in
Chris@4 32 '')
Chris@4 33 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
Chris@4 34 exit 1;
Chris@4 35 ;;
Chris@4 36 -h | --h*)
Chris@4 37 cat <<\EOF
Chris@4 38 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Chris@4 39
Chris@4 40 Run PROGRAMS ARGS to compile a file, generating dependencies
Chris@4 41 as side-effects.
Chris@4 42
Chris@4 43 Environment variables:
Chris@4 44 depmode Dependency tracking mode.
Chris@4 45 source Source file read by `PROGRAMS ARGS'.
Chris@4 46 object Object file output by `PROGRAMS ARGS'.
Chris@4 47 DEPDIR directory where to store dependencies.
Chris@4 48 depfile Dependency file to output.
Chris@4 49 tmpdepfile Temporary file to use when outputing dependencies.
Chris@4 50 libtool Whether libtool is used (yes/no).
Chris@4 51
Chris@4 52 Report bugs to <bug-automake@gnu.org>.
Chris@4 53 EOF
Chris@4 54 exit $?
Chris@4 55 ;;
Chris@4 56 -v | --v*)
Chris@4 57 echo "depcomp $scriptversion"
Chris@4 58 exit $?
Chris@4 59 ;;
Chris@4 60 esac
Chris@4 61
Chris@4 62 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
Chris@4 63 echo "depcomp: Variables source, object and depmode must be set" 1>&2
Chris@4 64 exit 1
Chris@4 65 fi
Chris@4 66
Chris@4 67 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
Chris@4 68 depfile=${depfile-`echo "$object" |
Chris@4 69 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
Chris@4 70 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
Chris@4 71
Chris@4 72 rm -f "$tmpdepfile"
Chris@4 73
Chris@4 74 # Some modes work just like other modes, but use different flags. We
Chris@4 75 # parameterize here, but still list the modes in the big case below,
Chris@4 76 # to make depend.m4 easier to write. Note that we *cannot* use a case
Chris@4 77 # here, because this file can only contain one case statement.
Chris@4 78 if test "$depmode" = hp; then
Chris@4 79 # HP compiler uses -M and no extra arg.
Chris@4 80 gccflag=-M
Chris@4 81 depmode=gcc
Chris@4 82 fi
Chris@4 83
Chris@4 84 if test "$depmode" = dashXmstdout; then
Chris@4 85 # This is just like dashmstdout with a different argument.
Chris@4 86 dashmflag=-xM
Chris@4 87 depmode=dashmstdout
Chris@4 88 fi
Chris@4 89
Chris@4 90 case "$depmode" in
Chris@4 91 gcc3)
Chris@4 92 ## gcc 3 implements dependency tracking that does exactly what
Chris@4 93 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
Chris@4 94 ## it if -MD -MP comes after the -MF stuff. Hmm.
Chris@4 95 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
Chris@4 96 ## the command line argument order; so add the flags where they
Chris@4 97 ## appear in depend2.am. Note that the slowdown incurred here
Chris@4 98 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
Chris@4 99 for arg
Chris@4 100 do
Chris@4 101 case $arg in
Chris@4 102 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
Chris@4 103 *) set fnord "$@" "$arg" ;;
Chris@4 104 esac
Chris@4 105 shift # fnord
Chris@4 106 shift # $arg
Chris@4 107 done
Chris@4 108 "$@"
Chris@4 109 stat=$?
Chris@4 110 if test $stat -eq 0; then :
Chris@4 111 else
Chris@4 112 rm -f "$tmpdepfile"
Chris@4 113 exit $stat
Chris@4 114 fi
Chris@4 115 mv "$tmpdepfile" "$depfile"
Chris@4 116 ;;
Chris@4 117
Chris@4 118 gcc)
Chris@4 119 ## There are various ways to get dependency output from gcc. Here's
Chris@4 120 ## why we pick this rather obscure method:
Chris@4 121 ## - Don't want to use -MD because we'd like the dependencies to end
Chris@4 122 ## up in a subdir. Having to rename by hand is ugly.
Chris@4 123 ## (We might end up doing this anyway to support other compilers.)
Chris@4 124 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
Chris@4 125 ## -MM, not -M (despite what the docs say).
Chris@4 126 ## - Using -M directly means running the compiler twice (even worse
Chris@4 127 ## than renaming).
Chris@4 128 if test -z "$gccflag"; then
Chris@4 129 gccflag=-MD,
Chris@4 130 fi
Chris@4 131 "$@" -Wp,"$gccflag$tmpdepfile"
Chris@4 132 stat=$?
Chris@4 133 if test $stat -eq 0; then :
Chris@4 134 else
Chris@4 135 rm -f "$tmpdepfile"
Chris@4 136 exit $stat
Chris@4 137 fi
Chris@4 138 rm -f "$depfile"
Chris@4 139 echo "$object : \\" > "$depfile"
Chris@4 140 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Chris@4 141 ## The second -e expression handles DOS-style file names with drive letters.
Chris@4 142 sed -e 's/^[^:]*: / /' \
Chris@4 143 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
Chris@4 144 ## This next piece of magic avoids the `deleted header file' problem.
Chris@4 145 ## The problem is that when a header file which appears in a .P file
Chris@4 146 ## is deleted, the dependency causes make to die (because there is
Chris@4 147 ## typically no way to rebuild the header). We avoid this by adding
Chris@4 148 ## dummy dependencies for each header file. Too bad gcc doesn't do
Chris@4 149 ## this for us directly.
Chris@4 150 tr ' ' '
Chris@4 151 ' < "$tmpdepfile" |
Chris@4 152 ## Some versions of gcc put a space before the `:'. On the theory
Chris@4 153 ## that the space means something, we add a space to the output as
Chris@4 154 ## well.
Chris@4 155 ## Some versions of the HPUX 10.20 sed can't process this invocation
Chris@4 156 ## correctly. Breaking it into two sed invocations is a workaround.
Chris@4 157 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
Chris@4 158 rm -f "$tmpdepfile"
Chris@4 159 ;;
Chris@4 160
Chris@4 161 hp)
Chris@4 162 # This case exists only to let depend.m4 do its work. It works by
Chris@4 163 # looking at the text of this script. This case will never be run,
Chris@4 164 # since it is checked for above.
Chris@4 165 exit 1
Chris@4 166 ;;
Chris@4 167
Chris@4 168 sgi)
Chris@4 169 if test "$libtool" = yes; then
Chris@4 170 "$@" "-Wp,-MDupdate,$tmpdepfile"
Chris@4 171 else
Chris@4 172 "$@" -MDupdate "$tmpdepfile"
Chris@4 173 fi
Chris@4 174 stat=$?
Chris@4 175 if test $stat -eq 0; then :
Chris@4 176 else
Chris@4 177 rm -f "$tmpdepfile"
Chris@4 178 exit $stat
Chris@4 179 fi
Chris@4 180 rm -f "$depfile"
Chris@4 181
Chris@4 182 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
Chris@4 183 echo "$object : \\" > "$depfile"
Chris@4 184
Chris@4 185 # Clip off the initial element (the dependent). Don't try to be
Chris@4 186 # clever and replace this with sed code, as IRIX sed won't handle
Chris@4 187 # lines with more than a fixed number of characters (4096 in
Chris@4 188 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
Chris@4 189 # the IRIX cc adds comments like `#:fec' to the end of the
Chris@4 190 # dependency line.
Chris@4 191 tr ' ' '
Chris@4 192 ' < "$tmpdepfile" \
Chris@4 193 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
Chris@4 194 tr '
Chris@4 195 ' ' ' >> $depfile
Chris@4 196 echo >> $depfile
Chris@4 197
Chris@4 198 # The second pass generates a dummy entry for each header file.
Chris@4 199 tr ' ' '
Chris@4 200 ' < "$tmpdepfile" \
Chris@4 201 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
Chris@4 202 >> $depfile
Chris@4 203 else
Chris@4 204 # The sourcefile does not contain any dependencies, so just
Chris@4 205 # store a dummy comment line, to avoid errors with the Makefile
Chris@4 206 # "include basename.Plo" scheme.
Chris@4 207 echo "#dummy" > "$depfile"
Chris@4 208 fi
Chris@4 209 rm -f "$tmpdepfile"
Chris@4 210 ;;
Chris@4 211
Chris@4 212 aix)
Chris@4 213 # The C for AIX Compiler uses -M and outputs the dependencies
Chris@4 214 # in a .u file. In older versions, this file always lives in the
Chris@4 215 # current directory. Also, the AIX compiler puts `$object:' at the
Chris@4 216 # start of each line; $object doesn't have directory information.
Chris@4 217 # Version 6 uses the directory in both cases.
Chris@4 218 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
Chris@4 219 test "x$dir" = "x$object" && dir=
Chris@4 220 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
Chris@4 221 if test "$libtool" = yes; then
Chris@4 222 tmpdepfile1=$dir$base.u
Chris@4 223 tmpdepfile2=$base.u
Chris@4 224 tmpdepfile3=$dir.libs/$base.u
Chris@4 225 "$@" -Wc,-M
Chris@4 226 else
Chris@4 227 tmpdepfile1=$dir$base.u
Chris@4 228 tmpdepfile2=$dir$base.u
Chris@4 229 tmpdepfile3=$dir$base.u
Chris@4 230 "$@" -M
Chris@4 231 fi
Chris@4 232 stat=$?
Chris@4 233
Chris@4 234 if test $stat -eq 0; then :
Chris@4 235 else
Chris@4 236 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
Chris@4 237 exit $stat
Chris@4 238 fi
Chris@4 239
Chris@4 240 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
Chris@4 241 do
Chris@4 242 test -f "$tmpdepfile" && break
Chris@4 243 done
Chris@4 244 if test -f "$tmpdepfile"; then
Chris@4 245 # Each line is of the form `foo.o: dependent.h'.
Chris@4 246 # Do two passes, one to just change these to
Chris@4 247 # `$object: dependent.h' and one to simply `dependent.h:'.
Chris@4 248 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
Chris@4 249 # That's a tab and a space in the [].
Chris@4 250 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
Chris@4 251 else
Chris@4 252 # The sourcefile does not contain any dependencies, so just
Chris@4 253 # store a dummy comment line, to avoid errors with the Makefile
Chris@4 254 # "include basename.Plo" scheme.
Chris@4 255 echo "#dummy" > "$depfile"
Chris@4 256 fi
Chris@4 257 rm -f "$tmpdepfile"
Chris@4 258 ;;
Chris@4 259
Chris@4 260 icc)
Chris@4 261 # Intel's C compiler understands `-MD -MF file'. However on
Chris@4 262 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
Chris@4 263 # ICC 7.0 will fill foo.d with something like
Chris@4 264 # foo.o: sub/foo.c
Chris@4 265 # foo.o: sub/foo.h
Chris@4 266 # which is wrong. We want:
Chris@4 267 # sub/foo.o: sub/foo.c
Chris@4 268 # sub/foo.o: sub/foo.h
Chris@4 269 # sub/foo.c:
Chris@4 270 # sub/foo.h:
Chris@4 271 # ICC 7.1 will output
Chris@4 272 # foo.o: sub/foo.c sub/foo.h
Chris@4 273 # and will wrap long lines using \ :
Chris@4 274 # foo.o: sub/foo.c ... \
Chris@4 275 # sub/foo.h ... \
Chris@4 276 # ...
Chris@4 277
Chris@4 278 "$@" -MD -MF "$tmpdepfile"
Chris@4 279 stat=$?
Chris@4 280 if test $stat -eq 0; then :
Chris@4 281 else
Chris@4 282 rm -f "$tmpdepfile"
Chris@4 283 exit $stat
Chris@4 284 fi
Chris@4 285 rm -f "$depfile"
Chris@4 286 # Each line is of the form `foo.o: dependent.h',
Chris@4 287 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
Chris@4 288 # Do two passes, one to just change these to
Chris@4 289 # `$object: dependent.h' and one to simply `dependent.h:'.
Chris@4 290 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
Chris@4 291 # Some versions of the HPUX 10.20 sed can't process this invocation
Chris@4 292 # correctly. Breaking it into two sed invocations is a workaround.
Chris@4 293 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
Chris@4 294 sed -e 's/$/ :/' >> "$depfile"
Chris@4 295 rm -f "$tmpdepfile"
Chris@4 296 ;;
Chris@4 297
Chris@4 298 hp2)
Chris@4 299 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
Chris@4 300 # compilers, which have integrated preprocessors. The correct option
Chris@4 301 # to use with these is +Maked; it writes dependencies to a file named
Chris@4 302 # 'foo.d', which lands next to the object file, wherever that
Chris@4 303 # happens to be.
Chris@4 304 # Much of this is similar to the tru64 case; see comments there.
Chris@4 305 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
Chris@4 306 test "x$dir" = "x$object" && dir=
Chris@4 307 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
Chris@4 308 if test "$libtool" = yes; then
Chris@4 309 tmpdepfile1=$dir$base.d
Chris@4 310 tmpdepfile2=$dir.libs/$base.d
Chris@4 311 "$@" -Wc,+Maked
Chris@4 312 else
Chris@4 313 tmpdepfile1=$dir$base.d
Chris@4 314 tmpdepfile2=$dir$base.d
Chris@4 315 "$@" +Maked
Chris@4 316 fi
Chris@4 317 stat=$?
Chris@4 318 if test $stat -eq 0; then :
Chris@4 319 else
Chris@4 320 rm -f "$tmpdepfile1" "$tmpdepfile2"
Chris@4 321 exit $stat
Chris@4 322 fi
Chris@4 323
Chris@4 324 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
Chris@4 325 do
Chris@4 326 test -f "$tmpdepfile" && break
Chris@4 327 done
Chris@4 328 if test -f "$tmpdepfile"; then
Chris@4 329 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
Chris@4 330 # Add `dependent.h:' lines.
Chris@4 331 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
Chris@4 332 else
Chris@4 333 echo "#dummy" > "$depfile"
Chris@4 334 fi
Chris@4 335 rm -f "$tmpdepfile" "$tmpdepfile2"
Chris@4 336 ;;
Chris@4 337
Chris@4 338 tru64)
Chris@4 339 # The Tru64 compiler uses -MD to generate dependencies as a side
Chris@4 340 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
Chris@4 341 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
Chris@4 342 # dependencies in `foo.d' instead, so we check for that too.
Chris@4 343 # Subdirectories are respected.
Chris@4 344 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
Chris@4 345 test "x$dir" = "x$object" && dir=
Chris@4 346 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
Chris@4 347
Chris@4 348 if test "$libtool" = yes; then
Chris@4 349 # With Tru64 cc, shared objects can also be used to make a
Chris@4 350 # static library. This mechanism is used in libtool 1.4 series to
Chris@4 351 # handle both shared and static libraries in a single compilation.
Chris@4 352 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
Chris@4 353 #
Chris@4 354 # With libtool 1.5 this exception was removed, and libtool now
Chris@4 355 # generates 2 separate objects for the 2 libraries. These two
Chris@4 356 # compilations output dependencies in $dir.libs/$base.o.d and
Chris@4 357 # in $dir$base.o.d. We have to check for both files, because
Chris@4 358 # one of the two compilations can be disabled. We should prefer
Chris@4 359 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
Chris@4 360 # automatically cleaned when .libs/ is deleted, while ignoring
Chris@4 361 # the former would cause a distcleancheck panic.
Chris@4 362 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
Chris@4 363 tmpdepfile2=$dir$base.o.d # libtool 1.5
Chris@4 364 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
Chris@4 365 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
Chris@4 366 "$@" -Wc,-MD
Chris@4 367 else
Chris@4 368 tmpdepfile1=$dir$base.o.d
Chris@4 369 tmpdepfile2=$dir$base.d
Chris@4 370 tmpdepfile3=$dir$base.d
Chris@4 371 tmpdepfile4=$dir$base.d
Chris@4 372 "$@" -MD
Chris@4 373 fi
Chris@4 374
Chris@4 375 stat=$?
Chris@4 376 if test $stat -eq 0; then :
Chris@4 377 else
Chris@4 378 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
Chris@4 379 exit $stat
Chris@4 380 fi
Chris@4 381
Chris@4 382 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
Chris@4 383 do
Chris@4 384 test -f "$tmpdepfile" && break
Chris@4 385 done
Chris@4 386 if test -f "$tmpdepfile"; then
Chris@4 387 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
Chris@4 388 # That's a tab and a space in the [].
Chris@4 389 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
Chris@4 390 else
Chris@4 391 echo "#dummy" > "$depfile"
Chris@4 392 fi
Chris@4 393 rm -f "$tmpdepfile"
Chris@4 394 ;;
Chris@4 395
Chris@4 396 #nosideeffect)
Chris@4 397 # This comment above is used by automake to tell side-effect
Chris@4 398 # dependency tracking mechanisms from slower ones.
Chris@4 399
Chris@4 400 dashmstdout)
Chris@4 401 # Important note: in order to support this mode, a compiler *must*
Chris@4 402 # always write the preprocessed file to stdout, regardless of -o.
Chris@4 403 "$@" || exit $?
Chris@4 404
Chris@4 405 # Remove the call to Libtool.
Chris@4 406 if test "$libtool" = yes; then
Chris@4 407 while test $1 != '--mode=compile'; do
Chris@4 408 shift
Chris@4 409 done
Chris@4 410 shift
Chris@4 411 fi
Chris@4 412
Chris@4 413 # Remove `-o $object'.
Chris@4 414 IFS=" "
Chris@4 415 for arg
Chris@4 416 do
Chris@4 417 case $arg in
Chris@4 418 -o)
Chris@4 419 shift
Chris@4 420 ;;
Chris@4 421 $object)
Chris@4 422 shift
Chris@4 423 ;;
Chris@4 424 *)
Chris@4 425 set fnord "$@" "$arg"
Chris@4 426 shift # fnord
Chris@4 427 shift # $arg
Chris@4 428 ;;
Chris@4 429 esac
Chris@4 430 done
Chris@4 431
Chris@4 432 test -z "$dashmflag" && dashmflag=-M
Chris@4 433 # Require at least two characters before searching for `:'
Chris@4 434 # in the target name. This is to cope with DOS-style filenames:
Chris@4 435 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
Chris@4 436 "$@" $dashmflag |
Chris@4 437 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
Chris@4 438 rm -f "$depfile"
Chris@4 439 cat < "$tmpdepfile" > "$depfile"
Chris@4 440 tr ' ' '
Chris@4 441 ' < "$tmpdepfile" | \
Chris@4 442 ## Some versions of the HPUX 10.20 sed can't process this invocation
Chris@4 443 ## correctly. Breaking it into two sed invocations is a workaround.
Chris@4 444 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
Chris@4 445 rm -f "$tmpdepfile"
Chris@4 446 ;;
Chris@4 447
Chris@4 448 dashXmstdout)
Chris@4 449 # This case only exists to satisfy depend.m4. It is never actually
Chris@4 450 # run, as this mode is specially recognized in the preamble.
Chris@4 451 exit 1
Chris@4 452 ;;
Chris@4 453
Chris@4 454 makedepend)
Chris@4 455 "$@" || exit $?
Chris@4 456 # Remove any Libtool call
Chris@4 457 if test "$libtool" = yes; then
Chris@4 458 while test $1 != '--mode=compile'; do
Chris@4 459 shift
Chris@4 460 done
Chris@4 461 shift
Chris@4 462 fi
Chris@4 463 # X makedepend
Chris@4 464 shift
Chris@4 465 cleared=no
Chris@4 466 for arg in "$@"; do
Chris@4 467 case $cleared in
Chris@4 468 no)
Chris@4 469 set ""; shift
Chris@4 470 cleared=yes ;;
Chris@4 471 esac
Chris@4 472 case "$arg" in
Chris@4 473 -D*|-I*)
Chris@4 474 set fnord "$@" "$arg"; shift ;;
Chris@4 475 # Strip any option that makedepend may not understand. Remove
Chris@4 476 # the object too, otherwise makedepend will parse it as a source file.
Chris@4 477 -*|$object)
Chris@4 478 ;;
Chris@4 479 *)
Chris@4 480 set fnord "$@" "$arg"; shift ;;
Chris@4 481 esac
Chris@4 482 done
Chris@4 483 obj_suffix="`echo $object | sed 's/^.*\././'`"
Chris@4 484 touch "$tmpdepfile"
Chris@4 485 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
Chris@4 486 rm -f "$depfile"
Chris@4 487 cat < "$tmpdepfile" > "$depfile"
Chris@4 488 sed '1,2d' "$tmpdepfile" | tr ' ' '
Chris@4 489 ' | \
Chris@4 490 ## Some versions of the HPUX 10.20 sed can't process this invocation
Chris@4 491 ## correctly. Breaking it into two sed invocations is a workaround.
Chris@4 492 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
Chris@4 493 rm -f "$tmpdepfile" "$tmpdepfile".bak
Chris@4 494 ;;
Chris@4 495
Chris@4 496 cpp)
Chris@4 497 # Important note: in order to support this mode, a compiler *must*
Chris@4 498 # always write the preprocessed file to stdout.
Chris@4 499 "$@" || exit $?
Chris@4 500
Chris@4 501 # Remove the call to Libtool.
Chris@4 502 if test "$libtool" = yes; then
Chris@4 503 while test $1 != '--mode=compile'; do
Chris@4 504 shift
Chris@4 505 done
Chris@4 506 shift
Chris@4 507 fi
Chris@4 508
Chris@4 509 # Remove `-o $object'.
Chris@4 510 IFS=" "
Chris@4 511 for arg
Chris@4 512 do
Chris@4 513 case $arg in
Chris@4 514 -o)
Chris@4 515 shift
Chris@4 516 ;;
Chris@4 517 $object)
Chris@4 518 shift
Chris@4 519 ;;
Chris@4 520 *)
Chris@4 521 set fnord "$@" "$arg"
Chris@4 522 shift # fnord
Chris@4 523 shift # $arg
Chris@4 524 ;;
Chris@4 525 esac
Chris@4 526 done
Chris@4 527
Chris@4 528 "$@" -E |
Chris@4 529 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
Chris@4 530 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
Chris@4 531 sed '$ s: \\$::' > "$tmpdepfile"
Chris@4 532 rm -f "$depfile"
Chris@4 533 echo "$object : \\" > "$depfile"
Chris@4 534 cat < "$tmpdepfile" >> "$depfile"
Chris@4 535 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
Chris@4 536 rm -f "$tmpdepfile"
Chris@4 537 ;;
Chris@4 538
Chris@4 539 msvisualcpp)
Chris@4 540 # Important note: in order to support this mode, a compiler *must*
Chris@4 541 # always write the preprocessed file to stdout, regardless of -o,
Chris@4 542 # because we must use -o when running libtool.
Chris@4 543 "$@" || exit $?
Chris@4 544 IFS=" "
Chris@4 545 for arg
Chris@4 546 do
Chris@4 547 case "$arg" in
Chris@4 548 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
Chris@4 549 set fnord "$@"
Chris@4 550 shift
Chris@4 551 shift
Chris@4 552 ;;
Chris@4 553 *)
Chris@4 554 set fnord "$@" "$arg"
Chris@4 555 shift
Chris@4 556 shift
Chris@4 557 ;;
Chris@4 558 esac
Chris@4 559 done
Chris@4 560 "$@" -E |
Chris@4 561 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
Chris@4 562 rm -f "$depfile"
Chris@4 563 echo "$object : \\" > "$depfile"
Chris@4 564 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
Chris@4 565 echo " " >> "$depfile"
Chris@4 566 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
Chris@4 567 rm -f "$tmpdepfile"
Chris@4 568 ;;
Chris@4 569
Chris@4 570 none)
Chris@4 571 exec "$@"
Chris@4 572 ;;
Chris@4 573
Chris@4 574 *)
Chris@4 575 echo "Unknown depmode $depmode" 1>&2
Chris@4 576 exit 1
Chris@4 577 ;;
Chris@4 578 esac
Chris@4 579
Chris@4 580 exit 0
Chris@4 581
Chris@4 582 # Local Variables:
Chris@4 583 # mode: shell-script
Chris@4 584 # sh-indentation: 2
Chris@4 585 # eval: (add-hook 'write-file-hooks 'time-stamp)
Chris@4 586 # time-stamp-start: "scriptversion="
Chris@4 587 # time-stamp-format: "%:y-%02m-%02d.%02H"
Chris@4 588 # time-stamp-end: "$"
Chris@4 589 # End: