patch-build-aux_depcomp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. --- libsoup-2.44.2.orig/build-aux/depcomp 2013-10-18 00:01:49.000000000 +0200
  2. +++ libsoup-2.44.2/build-aux/depcomp 2014-04-14 17:21:42.708937363 +0200
  3. @@ -1,9 +1,9 @@
  4. #! /bin/sh
  5. # depcomp - compile a program generating dependencies as side-effects
  6. -scriptversion=2013-05-30.07; # UTC
  7. +scriptversion=2012-03-27.16; # UTC
  8. -# Copyright (C) 1999-2013 Free Software Foundation, Inc.
  9. +# Copyright (C) 1999-2012 Free Software Foundation, Inc.
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. @@ -27,9 +27,9 @@ scriptversion=2013-05-30.07; # UTC
  13. case $1 in
  14. '')
  15. - echo "$0: No command. Try '$0 --help' for more information." 1>&2
  16. - exit 1;
  17. - ;;
  18. + echo "$0: No command. Try '$0 --help' for more information." 1>&2
  19. + exit 1;
  20. + ;;
  21. -h | --h*)
  22. cat <<\EOF
  23. Usage: depcomp [--help] [--version] PROGRAM [ARGS]
  24. @@ -56,65 +56,11 @@ EOF
  25. ;;
  26. esac
  27. -# Get the directory component of the given path, and save it in the
  28. -# global variables '$dir'. Note that this directory component will
  29. -# be either empty or ending with a '/' character. This is deliberate.
  30. -set_dir_from ()
  31. -{
  32. - case $1 in
  33. - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
  34. - *) dir=;;
  35. - esac
  36. -}
  37. -
  38. -# Get the suffix-stripped basename of the given path, and save it the
  39. -# global variable '$base'.
  40. -set_base_from ()
  41. -{
  42. - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
  43. -}
  44. -
  45. -# If no dependency file was actually created by the compiler invocation,
  46. -# we still have to create a dummy depfile, to avoid errors with the
  47. -# Makefile "include basename.Plo" scheme.
  48. -make_dummy_depfile ()
  49. -{
  50. - echo "#dummy" > "$depfile"
  51. -}
  52. -
  53. -# Factor out some common post-processing of the generated depfile.
  54. -# Requires the auxiliary global variable '$tmpdepfile' to be set.
  55. -aix_post_process_depfile ()
  56. -{
  57. - # If the compiler actually managed to produce a dependency file,
  58. - # post-process it.
  59. - if test -f "$tmpdepfile"; then
  60. - # Each line is of the form 'foo.o: dependency.h'.
  61. - # Do two passes, one to just change these to
  62. - # $object: dependency.h
  63. - # and one to simply output
  64. - # dependency.h:
  65. - # which is needed to avoid the deleted-header problem.
  66. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
  67. - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
  68. - } > "$depfile"
  69. - rm -f "$tmpdepfile"
  70. - else
  71. - make_dummy_depfile
  72. - fi
  73. -}
  74. -
  75. # A tabulation character.
  76. tab=' '
  77. # A newline character.
  78. nl='
  79. '
  80. -# Character ranges might be problematic outside the C locale.
  81. -# These definitions help.
  82. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
  83. -lower=abcdefghijklmnopqrstuvwxyz
  84. -digits=0123456789
  85. -alpha=${upper}${lower}
  86. if test -z "$depmode" || test -z "$source" || test -z "$object"; then
  87. echo "depcomp: Variables source, object and depmode must be set" 1>&2
  88. @@ -128,9 +74,6 @@ tmpdepfile=${tmpdepfile-`echo "$depfile"
  89. rm -f "$tmpdepfile"
  90. -# Avoid interferences from the environment.
  91. -gccflag= dashmflag=
  92. -
  93. # Some modes work just like other modes, but use different flags. We
  94. # parameterize here, but still list the modes in the big case below,
  95. # to make depend.m4 easier to write. Note that we *cannot* use a case
  96. @@ -142,32 +85,32 @@ if test "$depmode" = hp; then
  97. fi
  98. if test "$depmode" = dashXmstdout; then
  99. - # This is just like dashmstdout with a different argument.
  100. - dashmflag=-xM
  101. - depmode=dashmstdout
  102. + # This is just like dashmstdout with a different argument.
  103. + dashmflag=-xM
  104. + depmode=dashmstdout
  105. fi
  106. cygpath_u="cygpath -u -f -"
  107. if test "$depmode" = msvcmsys; then
  108. - # This is just like msvisualcpp but w/o cygpath translation.
  109. - # Just convert the backslash-escaped backslashes to single forward
  110. - # slashes to satisfy depend.m4
  111. - cygpath_u='sed s,\\\\,/,g'
  112. - depmode=msvisualcpp
  113. + # This is just like msvisualcpp but w/o cygpath translation.
  114. + # Just convert the backslash-escaped backslashes to single forward
  115. + # slashes to satisfy depend.m4
  116. + cygpath_u='sed s,\\\\,/,g'
  117. + depmode=msvisualcpp
  118. fi
  119. if test "$depmode" = msvc7msys; then
  120. - # This is just like msvc7 but w/o cygpath translation.
  121. - # Just convert the backslash-escaped backslashes to single forward
  122. - # slashes to satisfy depend.m4
  123. - cygpath_u='sed s,\\\\,/,g'
  124. - depmode=msvc7
  125. + # This is just like msvc7 but w/o cygpath translation.
  126. + # Just convert the backslash-escaped backslashes to single forward
  127. + # slashes to satisfy depend.m4
  128. + cygpath_u='sed s,\\\\,/,g'
  129. + depmode=msvc7
  130. fi
  131. if test "$depmode" = xlc; then
  132. - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
  133. - gccflag=-qmakedep=gcc,-MF
  134. - depmode=gcc
  135. + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
  136. + gccflag=-qmakedep=gcc,-MF
  137. + depmode=gcc
  138. fi
  139. case "$depmode" in
  140. @@ -190,7 +133,8 @@ gcc3)
  141. done
  142. "$@"
  143. stat=$?
  144. - if test $stat -ne 0; then
  145. + if test $stat -eq 0; then :
  146. + else
  147. rm -f "$tmpdepfile"
  148. exit $stat
  149. fi
  150. @@ -198,17 +142,13 @@ gcc3)
  151. ;;
  152. gcc)
  153. -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
  154. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
  155. -## (see the conditional assignment to $gccflag above).
  156. ## There are various ways to get dependency output from gcc. Here's
  157. ## why we pick this rather obscure method:
  158. ## - Don't want to use -MD because we'd like the dependencies to end
  159. ## up in a subdir. Having to rename by hand is ugly.
  160. ## (We might end up doing this anyway to support other compilers.)
  161. ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
  162. -## -MM, not -M (despite what the docs say). Also, it might not be
  163. -## supported by the other compilers which use the 'gcc' depmode.
  164. +## -MM, not -M (despite what the docs say).
  165. ## - Using -M directly means running the compiler twice (even worse
  166. ## than renaming).
  167. if test -z "$gccflag"; then
  168. @@ -216,14 +156,15 @@ gcc)
  169. fi
  170. "$@" -Wp,"$gccflag$tmpdepfile"
  171. stat=$?
  172. - if test $stat -ne 0; then
  173. + if test $stat -eq 0; then :
  174. + else
  175. rm -f "$tmpdepfile"
  176. exit $stat
  177. fi
  178. rm -f "$depfile"
  179. echo "$object : \\" > "$depfile"
  180. - # The second -e expression handles DOS-style file names with drive
  181. - # letters.
  182. + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
  183. +## The second -e expression handles DOS-style file names with drive letters.
  184. sed -e 's/^[^:]*: / /' \
  185. -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
  186. ## This next piece of magic avoids the "deleted header file" problem.
  187. @@ -232,15 +173,15 @@ gcc)
  188. ## typically no way to rebuild the header). We avoid this by adding
  189. ## dummy dependencies for each header file. Too bad gcc doesn't do
  190. ## this for us directly.
  191. + tr ' ' "$nl" < "$tmpdepfile" |
  192. ## Some versions of gcc put a space before the ':'. On the theory
  193. ## that the space means something, we add a space to the output as
  194. ## well. hp depmode also adds that space, but also prefixes the VPATH
  195. ## to the object. Take care to not repeat it in the output.
  196. ## Some versions of the HPUX 10.20 sed can't process this invocation
  197. ## correctly. Breaking it into two sed invocations is a workaround.
  198. - tr ' ' "$nl" < "$tmpdepfile" \
  199. - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
  200. - | sed -e 's/$/ :/' >> "$depfile"
  201. + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
  202. + | sed -e 's/$/ :/' >> "$depfile"
  203. rm -f "$tmpdepfile"
  204. ;;
  205. @@ -258,7 +199,8 @@ sgi)
  206. "$@" -MDupdate "$tmpdepfile"
  207. fi
  208. stat=$?
  209. - if test $stat -ne 0; then
  210. + if test $stat -eq 0; then :
  211. + else
  212. rm -f "$tmpdepfile"
  213. exit $stat
  214. fi
  215. @@ -266,6 +208,7 @@ sgi)
  216. if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
  217. echo "$object : \\" > "$depfile"
  218. +
  219. # Clip off the initial element (the dependent). Don't try to be
  220. # clever and replace this with sed code, as IRIX sed won't handle
  221. # lines with more than a fixed number of characters (4096 in
  222. @@ -273,15 +216,19 @@ sgi)
  223. # the IRIX cc adds comments like '#:fec' to the end of the
  224. # dependency line.
  225. tr ' ' "$nl" < "$tmpdepfile" \
  226. - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
  227. - | tr "$nl" ' ' >> "$depfile"
  228. + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
  229. + tr "$nl" ' ' >> "$depfile"
  230. echo >> "$depfile"
  231. +
  232. # The second pass generates a dummy entry for each header file.
  233. tr ' ' "$nl" < "$tmpdepfile" \
  234. - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
  235. - >> "$depfile"
  236. + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
  237. + >> "$depfile"
  238. else
  239. - make_dummy_depfile
  240. + # The sourcefile does not contain any dependencies, so just
  241. + # store a dummy comment line, to avoid errors with the Makefile
  242. + # "include basename.Plo" scheme.
  243. + echo "#dummy" > "$depfile"
  244. fi
  245. rm -f "$tmpdepfile"
  246. ;;
  247. @@ -299,8 +246,9 @@ aix)
  248. # current directory. Also, the AIX compiler puts '$object:' at the
  249. # start of each line; $object doesn't have directory information.
  250. # Version 6 uses the directory in both cases.
  251. - set_dir_from "$object"
  252. - set_base_from "$object"
  253. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  254. + test "x$dir" = "x$object" && dir=
  255. + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  256. if test "$libtool" = yes; then
  257. tmpdepfile1=$dir$base.u
  258. tmpdepfile2=$base.u
  259. @@ -313,7 +261,9 @@ aix)
  260. "$@" -M
  261. fi
  262. stat=$?
  263. - if test $stat -ne 0; then
  264. +
  265. + if test $stat -eq 0; then :
  266. + else
  267. rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  268. exit $stat
  269. fi
  270. @@ -322,113 +272,65 @@ aix)
  271. do
  272. test -f "$tmpdepfile" && break
  273. done
  274. - aix_post_process_depfile
  275. - ;;
  276. -
  277. -tcc)
  278. - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
  279. - # FIXME: That version still under development at the moment of writing.
  280. - # Make that this statement remains true also for stable, released
  281. - # versions.
  282. - # It will wrap lines (doesn't matter whether long or short) with a
  283. - # trailing '\', as in:
  284. - #
  285. - # foo.o : \
  286. - # foo.c \
  287. - # foo.h \
  288. - #
  289. - # It will put a trailing '\' even on the last line, and will use leading
  290. - # spaces rather than leading tabs (at least since its commit 0394caf7
  291. - # "Emit spaces for -MD").
  292. - "$@" -MD -MF "$tmpdepfile"
  293. - stat=$?
  294. - if test $stat -ne 0; then
  295. - rm -f "$tmpdepfile"
  296. - exit $stat
  297. + if test -f "$tmpdepfile"; then
  298. + # Each line is of the form 'foo.o: dependent.h'.
  299. + # Do two passes, one to just change these to
  300. + # '$object: dependent.h' and one to simply 'dependent.h:'.
  301. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
  302. + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
  303. + else
  304. + # The sourcefile does not contain any dependencies, so just
  305. + # store a dummy comment line, to avoid errors with the Makefile
  306. + # "include basename.Plo" scheme.
  307. + echo "#dummy" > "$depfile"
  308. fi
  309. - rm -f "$depfile"
  310. - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
  311. - # We have to change lines of the first kind to '$object: \'.
  312. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
  313. - # And for each line of the second kind, we have to emit a 'dep.h:'
  314. - # dummy dependency, to avoid the deleted-header problem.
  315. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
  316. rm -f "$tmpdepfile"
  317. ;;
  318. -## The order of this option in the case statement is important, since the
  319. -## shell code in configure will try each of these formats in the order
  320. -## listed in this file. A plain '-MD' option would be understood by many
  321. -## compilers, so we must ensure this comes after the gcc and icc options.
  322. -pgcc)
  323. - # Portland's C compiler understands '-MD'.
  324. - # Will always output deps to 'file.d' where file is the root name of the
  325. - # source file under compilation, even if file resides in a subdirectory.
  326. - # The object file name does not affect the name of the '.d' file.
  327. - # pgcc 10.2 will output
  328. +icc)
  329. + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
  330. + # However on
  331. + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
  332. + # ICC 7.0 will fill foo.d with something like
  333. + # foo.o: sub/foo.c
  334. + # foo.o: sub/foo.h
  335. + # which is wrong. We want
  336. + # sub/foo.o: sub/foo.c
  337. + # sub/foo.o: sub/foo.h
  338. + # sub/foo.c:
  339. + # sub/foo.h:
  340. + # ICC 7.1 will output
  341. # foo.o: sub/foo.c sub/foo.h
  342. - # and will wrap long lines using '\' :
  343. + # and will wrap long lines using '\':
  344. # foo.o: sub/foo.c ... \
  345. # sub/foo.h ... \
  346. # ...
  347. - set_dir_from "$object"
  348. - # Use the source, not the object, to determine the base name, since
  349. - # that's sadly what pgcc will do too.
  350. - set_base_from "$source"
  351. - tmpdepfile=$base.d
  352. -
  353. - # For projects that build the same source file twice into different object
  354. - # files, the pgcc approach of using the *source* file root name can cause
  355. - # problems in parallel builds. Use a locking strategy to avoid stomping on
  356. - # the same $tmpdepfile.
  357. - lockdir=$base.d-lock
  358. - trap "
  359. - echo '$0: caught signal, cleaning up...' >&2
  360. - rmdir '$lockdir'
  361. - exit 1
  362. - " 1 2 13 15
  363. - numtries=100
  364. - i=$numtries
  365. - while test $i -gt 0; do
  366. - # mkdir is a portable test-and-set.
  367. - if mkdir "$lockdir" 2>/dev/null; then
  368. - # This process acquired the lock.
  369. - "$@" -MD
  370. - stat=$?
  371. - # Release the lock.
  372. - rmdir "$lockdir"
  373. - break
  374. - else
  375. - # If the lock is being held by a different process, wait
  376. - # until the winning process is done or we timeout.
  377. - while test -d "$lockdir" && test $i -gt 0; do
  378. - sleep 1
  379. - i=`expr $i - 1`
  380. - done
  381. - fi
  382. - i=`expr $i - 1`
  383. - done
  384. - trap - 1 2 13 15
  385. - if test $i -le 0; then
  386. - echo "$0: failed to acquire lock after $numtries attempts" >&2
  387. - echo "$0: check lockdir '$lockdir'" >&2
  388. - exit 1
  389. - fi
  390. -
  391. - if test $stat -ne 0; then
  392. + # tcc 0.9.26 (FIXME still under development at the moment of writing)
  393. + # will emit a similar output, but also prepend the continuation lines
  394. + # with horizontal tabulation characters.
  395. + "$@" -MD -MF "$tmpdepfile"
  396. + stat=$?
  397. + if test $stat -eq 0; then :
  398. + else
  399. rm -f "$tmpdepfile"
  400. exit $stat
  401. fi
  402. rm -f "$depfile"
  403. - # Each line is of the form `foo.o: dependent.h',
  404. - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
  405. + # Each line is of the form 'foo.o: dependent.h',
  406. + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
  407. # Do two passes, one to just change these to
  408. - # `$object: dependent.h' and one to simply `dependent.h:'.
  409. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
  410. - # Some versions of the HPUX 10.20 sed can't process this invocation
  411. - # correctly. Breaking it into two sed invocations is a workaround.
  412. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
  413. - | sed -e 's/$/ :/' >> "$depfile"
  414. + # '$object: dependent.h' and one to simply 'dependent.h:'.
  415. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
  416. + < "$tmpdepfile" > "$depfile"
  417. + sed '
  418. + s/[ '"$tab"'][ '"$tab"']*/ /g
  419. + s/^ *//
  420. + s/ *\\*$//
  421. + s/^[^:]*: *//
  422. + /^$/d
  423. + /:$/d
  424. + s/$/ :/
  425. + ' < "$tmpdepfile" >> "$depfile"
  426. rm -f "$tmpdepfile"
  427. ;;
  428. @@ -439,8 +341,9 @@ hp2)
  429. # 'foo.d', which lands next to the object file, wherever that
  430. # happens to be.
  431. # Much of this is similar to the tru64 case; see comments there.
  432. - set_dir_from "$object"
  433. - set_base_from "$object"
  434. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  435. + test "x$dir" = "x$object" && dir=
  436. + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  437. if test "$libtool" = yes; then
  438. tmpdepfile1=$dir$base.d
  439. tmpdepfile2=$dir.libs/$base.d
  440. @@ -451,7 +354,8 @@ hp2)
  441. "$@" +Maked
  442. fi
  443. stat=$?
  444. - if test $stat -ne 0; then
  445. + if test $stat -eq 0; then :
  446. + else
  447. rm -f "$tmpdepfile1" "$tmpdepfile2"
  448. exit $stat
  449. fi
  450. @@ -461,61 +365,76 @@ hp2)
  451. test -f "$tmpdepfile" && break
  452. done
  453. if test -f "$tmpdepfile"; then
  454. - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
  455. + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
  456. # Add 'dependent.h:' lines.
  457. sed -ne '2,${
  458. - s/^ *//
  459. - s/ \\*$//
  460. - s/$/:/
  461. - p
  462. - }' "$tmpdepfile" >> "$depfile"
  463. + s/^ *//
  464. + s/ \\*$//
  465. + s/$/:/
  466. + p
  467. + }' "$tmpdepfile" >> "$depfile"
  468. else
  469. - make_dummy_depfile
  470. + echo "#dummy" > "$depfile"
  471. fi
  472. rm -f "$tmpdepfile" "$tmpdepfile2"
  473. ;;
  474. tru64)
  475. - # The Tru64 compiler uses -MD to generate dependencies as a side
  476. - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
  477. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
  478. - # dependencies in 'foo.d' instead, so we check for that too.
  479. - # Subdirectories are respected.
  480. - set_dir_from "$object"
  481. - set_base_from "$object"
  482. + # The Tru64 compiler uses -MD to generate dependencies as a side
  483. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
  484. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
  485. + # dependencies in 'foo.d' instead, so we check for that too.
  486. + # Subdirectories are respected.
  487. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  488. + test "x$dir" = "x$object" && dir=
  489. + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  490. - if test "$libtool" = yes; then
  491. - # Libtool generates 2 separate objects for the 2 libraries. These
  492. - # two compilations output dependencies in $dir.libs/$base.o.d and
  493. - # in $dir$base.o.d. We have to check for both files, because
  494. - # one of the two compilations can be disabled. We should prefer
  495. - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
  496. - # automatically cleaned when .libs/ is deleted, while ignoring
  497. - # the former would cause a distcleancheck panic.
  498. - tmpdepfile1=$dir$base.o.d # libtool 1.5
  499. - tmpdepfile2=$dir.libs/$base.o.d # Likewise.
  500. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
  501. - "$@" -Wc,-MD
  502. - else
  503. - tmpdepfile1=$dir$base.d
  504. - tmpdepfile2=$dir$base.d
  505. - tmpdepfile3=$dir$base.d
  506. - "$@" -MD
  507. - fi
  508. + if test "$libtool" = yes; then
  509. + # With Tru64 cc, shared objects can also be used to make a
  510. + # static library. This mechanism is used in libtool 1.4 series to
  511. + # handle both shared and static libraries in a single compilation.
  512. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
  513. + #
  514. + # With libtool 1.5 this exception was removed, and libtool now
  515. + # generates 2 separate objects for the 2 libraries. These two
  516. + # compilations output dependencies in $dir.libs/$base.o.d and
  517. + # in $dir$base.o.d. We have to check for both files, because
  518. + # one of the two compilations can be disabled. We should prefer
  519. + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
  520. + # automatically cleaned when .libs/ is deleted, while ignoring
  521. + # the former would cause a distcleancheck panic.
  522. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
  523. + tmpdepfile2=$dir$base.o.d # libtool 1.5
  524. + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
  525. + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
  526. + "$@" -Wc,-MD
  527. + else
  528. + tmpdepfile1=$dir$base.o.d
  529. + tmpdepfile2=$dir$base.d
  530. + tmpdepfile3=$dir$base.d
  531. + tmpdepfile4=$dir$base.d
  532. + "$@" -MD
  533. + fi
  534. - stat=$?
  535. - if test $stat -ne 0; then
  536. - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  537. - exit $stat
  538. - fi
  539. + stat=$?
  540. + if test $stat -eq 0; then :
  541. + else
  542. + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
  543. + exit $stat
  544. + fi
  545. - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  546. - do
  547. - test -f "$tmpdepfile" && break
  548. - done
  549. - # Same post-processing that is required for AIX mode.
  550. - aix_post_process_depfile
  551. - ;;
  552. + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
  553. + do
  554. + test -f "$tmpdepfile" && break
  555. + done
  556. + if test -f "$tmpdepfile"; then
  557. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
  558. + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
  559. + else
  560. + echo "#dummy" > "$depfile"
  561. + fi
  562. + rm -f "$tmpdepfile"
  563. + ;;
  564. msvc7)
  565. if test "$libtool" = yes; then
  566. @@ -526,7 +445,8 @@ msvc7)
  567. "$@" $showIncludes > "$tmpdepfile"
  568. stat=$?
  569. grep -v '^Note: including file: ' "$tmpdepfile"
  570. - if test $stat -ne 0; then
  571. + if test "$stat" = 0; then :
  572. + else
  573. rm -f "$tmpdepfile"
  574. exit $stat
  575. fi
  576. @@ -552,7 +472,6 @@ $ {
  577. G
  578. p
  579. }' >> "$depfile"
  580. - echo >> "$depfile" # make sure the fragment doesn't end with a backslash
  581. rm -f "$tmpdepfile"
  582. ;;
  583. @@ -604,14 +523,13 @@ dashmstdout)
  584. # in the target name. This is to cope with DOS-style filenames:
  585. # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
  586. "$@" $dashmflag |
  587. - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
  588. + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
  589. rm -f "$depfile"
  590. cat < "$tmpdepfile" > "$depfile"
  591. - # Some versions of the HPUX 10.20 sed can't process this sed invocation
  592. - # correctly. Breaking it into two sed invocations is a workaround.
  593. - tr ' ' "$nl" < "$tmpdepfile" \
  594. - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
  595. - | sed -e 's/$/ :/' >> "$depfile"
  596. + tr ' ' "$nl" < "$tmpdepfile" | \
  597. +## Some versions of the HPUX 10.20 sed can't process this invocation
  598. +## correctly. Breaking it into two sed invocations is a workaround.
  599. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
  600. rm -f "$tmpdepfile"
  601. ;;
  602. @@ -664,12 +582,10 @@ makedepend)
  603. # makedepend may prepend the VPATH from the source file name to the object.
  604. # No need to regex-escape $object, excess matching of '.' is harmless.
  605. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
  606. - # Some versions of the HPUX 10.20 sed can't process the last invocation
  607. - # correctly. Breaking it into two sed invocations is a workaround.
  608. - sed '1,2d' "$tmpdepfile" \
  609. - | tr ' ' "$nl" \
  610. - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
  611. - | sed -e 's/$/ :/' >> "$depfile"
  612. + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
  613. +## Some versions of the HPUX 10.20 sed can't process this invocation
  614. +## correctly. Breaking it into two sed invocations is a workaround.
  615. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
  616. rm -f "$tmpdepfile" "$tmpdepfile".bak
  617. ;;
  618. @@ -705,10 +621,10 @@ cpp)
  619. esac
  620. done
  621. - "$@" -E \
  622. - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
  623. - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
  624. - | sed '$ s: \\$::' > "$tmpdepfile"
  625. + "$@" -E |
  626. + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
  627. + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
  628. + sed '$ s: \\$::' > "$tmpdepfile"
  629. rm -f "$depfile"
  630. echo "$object : \\" > "$depfile"
  631. cat < "$tmpdepfile" >> "$depfile"
  632. @@ -740,15 +656,15 @@ msvisualcpp)
  633. shift
  634. ;;
  635. "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
  636. - set fnord "$@"
  637. - shift
  638. - shift
  639. - ;;
  640. + set fnord "$@"
  641. + shift
  642. + shift
  643. + ;;
  644. *)
  645. - set fnord "$@" "$arg"
  646. - shift
  647. - shift
  648. - ;;
  649. + set fnord "$@" "$arg"
  650. + shift
  651. + shift
  652. + ;;
  653. esac
  654. done
  655. "$@" -E 2>/dev/null |