patch-depcomp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- cgilib-0.7.orig/depcomp 2009-02-08 19:47:04.000000000 +0100
  3. +++ cgilib-0.7/depcomp 2009-05-09 03:58:09.000000000 +0200
  4. @@ -1,10 +1,9 @@
  5. #! /bin/sh
  6. # depcomp - compile a program generating dependencies as side-effects
  7. -scriptversion=2007-03-29.01
  8. +scriptversion=2005-07-09.11
  9. -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
  10. -# Foundation, Inc.
  11. +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. @@ -92,20 +91,7 @@ gcc3)
  15. ## gcc 3 implements dependency tracking that does exactly what
  16. ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
  17. ## it if -MD -MP comes after the -MF stuff. Hmm.
  18. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon
  19. -## the command line argument order; so add the flags where they
  20. -## appear in depend2.am. Note that the slowdown incurred here
  21. -## affects only configure: in makefiles, %FASTDEP% shortcuts this.
  22. - for arg
  23. - do
  24. - case $arg in
  25. - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
  26. - *) set fnord "$@" "$arg" ;;
  27. - esac
  28. - shift # fnord
  29. - shift # $arg
  30. - done
  31. - "$@"
  32. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
  33. stat=$?
  34. if test $stat -eq 0; then :
  35. else
  36. @@ -215,39 +201,34 @@ aix)
  37. # current directory. Also, the AIX compiler puts `$object:' at the
  38. # start of each line; $object doesn't have directory information.
  39. # Version 6 uses the directory in both cases.
  40. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  41. - test "x$dir" = "x$object" && dir=
  42. - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  43. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
  44. + tmpdepfile="$stripped.u"
  45. if test "$libtool" = yes; then
  46. - tmpdepfile1=$dir$base.u
  47. - tmpdepfile2=$base.u
  48. - tmpdepfile3=$dir.libs/$base.u
  49. "$@" -Wc,-M
  50. else
  51. - tmpdepfile1=$dir$base.u
  52. - tmpdepfile2=$dir$base.u
  53. - tmpdepfile3=$dir$base.u
  54. "$@" -M
  55. fi
  56. stat=$?
  57. + if test -f "$tmpdepfile"; then :
  58. + else
  59. + stripped=`echo "$stripped" | sed 's,^.*/,,'`
  60. + tmpdepfile="$stripped.u"
  61. + fi
  62. +
  63. if test $stat -eq 0; then :
  64. else
  65. - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  66. + rm -f "$tmpdepfile"
  67. exit $stat
  68. fi
  69. - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  70. - do
  71. - test -f "$tmpdepfile" && break
  72. - done
  73. if test -f "$tmpdepfile"; then
  74. + outname="$stripped.o"
  75. # Each line is of the form `foo.o: dependent.h'.
  76. # Do two passes, one to just change these to
  77. # `$object: dependent.h' and one to simply `dependent.h:'.
  78. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
  79. - # That's a tab and a space in the [].
  80. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
  81. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
  82. + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
  83. else
  84. # The sourcefile does not contain any dependencies, so just
  85. # store a dummy comment line, to avoid errors with the Makefile
  86. @@ -295,46 +276,6 @@ icc)
  87. rm -f "$tmpdepfile"
  88. ;;
  89. -hp2)
  90. - # The "hp" stanza above does not work with aCC (C++) and HP's ia64
  91. - # compilers, which have integrated preprocessors. The correct option
  92. - # to use with these is +Maked; it writes dependencies to a file named
  93. - # 'foo.d', which lands next to the object file, wherever that
  94. - # happens to be.
  95. - # Much of this is similar to the tru64 case; see comments there.
  96. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  97. - test "x$dir" = "x$object" && dir=
  98. - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  99. - if test "$libtool" = yes; then
  100. - tmpdepfile1=$dir$base.d
  101. - tmpdepfile2=$dir.libs/$base.d
  102. - "$@" -Wc,+Maked
  103. - else
  104. - tmpdepfile1=$dir$base.d
  105. - tmpdepfile2=$dir$base.d
  106. - "$@" +Maked
  107. - fi
  108. - stat=$?
  109. - if test $stat -eq 0; then :
  110. - else
  111. - rm -f "$tmpdepfile1" "$tmpdepfile2"
  112. - exit $stat
  113. - fi
  114. -
  115. - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
  116. - do
  117. - test -f "$tmpdepfile" && break
  118. - done
  119. - if test -f "$tmpdepfile"; then
  120. - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
  121. - # Add `dependent.h:' lines.
  122. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
  123. - else
  124. - echo "#dummy" > "$depfile"
  125. - fi
  126. - rm -f "$tmpdepfile" "$tmpdepfile2"
  127. - ;;
  128. -
  129. tru64)
  130. # The Tru64 compiler uses -MD to generate dependencies as a side
  131. # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
  132. @@ -347,13 +288,13 @@ tru64)
  133. if test "$libtool" = yes; then
  134. # With Tru64 cc, shared objects can also be used to make a
  135. - # static library. This mechanism is used in libtool 1.4 series to
  136. + # static library. This mecanism is used in libtool 1.4 series to
  137. # handle both shared and static libraries in a single compilation.
  138. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
  139. #
  140. # With libtool 1.5 this exception was removed, and libtool now
  141. # generates 2 separate objects for the 2 libraries. These two
  142. - # compilations output dependencies in $dir.libs/$base.o.d and
  143. + # compilations output dependencies in in $dir.libs/$base.o.d and
  144. # in $dir$base.o.d. We have to check for both files, because
  145. # one of the two compilations can be disabled. We should prefer
  146. # $dir$base.o.d over $dir.libs/$base.o.d because the latter is