annotate src/fftw-3.3.3/depcomp @ 169:223a55898ab9 tip default

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