~ubuntu-branches/ubuntu/intrepid/gwenview/intrepid

« back to all changes in this revision

Viewing changes to admin/depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Christopher Martin
  • Date: 2005-04-06 11:33:06 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050406113306-7zovl7z0io5bacpd
Tags: 1.2.0-1
* New upstream release.
  + Fixes crashes when using "Back" to navigate. (Closes: #301811)
* Enable KIPI support.
* Add a doc-base file for the handbook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
19
# 02111-1307, USA.
20
20
 
 
21
# As a special exception to the GNU General Public License, if you
 
22
# distribute this file as part of a program that contains a
 
23
# configuration script generated by Autoconf, you may include it under
 
24
# the same distribution terms that you use for the rest of that program.
 
25
 
21
26
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
22
27
 
23
28
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
50
55
case "$depmode" in
51
56
gcc3)
52
57
## gcc 3 implements dependency tracking that does exactly what
53
 
## we want.  Yay!
54
 
  if "$@" -MT "$object" -MF "$tmpdepfile" -MD -MP; then :
 
58
## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 
59
## it if -MD -MP comes after the -MF stuff.  Hmm.
 
60
  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
 
61
  stat=$?
 
62
  if test $stat -eq 0; then :
55
63
  else
56
 
    stat=$?
57
64
    rm -f "$tmpdepfile"
58
65
    exit $stat
59
66
  fi
73
80
  if test -z "$gccflag"; then
74
81
    gccflag=-MD,
75
82
  fi
76
 
  if "$@" -Wp,"$gccflag$tmpdepfile"; then :
 
83
  "$@" -Wp,"$gccflag$tmpdepfile"
 
84
  stat=$?
 
85
  if test $stat -eq 0; then :
77
86
  else
78
 
    stat=$?
79
87
    rm -f "$tmpdepfile"
80
88
    exit $stat
81
89
  fi
126
134
  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
127
135
    echo "$object : \\" > "$depfile"
128
136
 
129
 
    # Clip off the initial element (the dependent). Don't try to be
 
137
    # Clip off the initial element (the dependent).  Don't try to be
130
138
    # clever and replace this with sed code, as IRIX sed won't handle
131
139
    # lines with more than a fixed number of characters (4096 in
132
 
    # IRIX 6.2 sed, 8192 in IRIX 6.5).
 
140
    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
 
141
    # the IRIX cc adds comments like `#:fec' to the end of the
 
142
    # dependency line.
133
143
    tr ' ' '
134
 
' < "$tmpdepfile" | sed 's/^[^\.]*\.o://' | tr '
 
144
' < "$tmpdepfile" \
 
145
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
 
146
    tr '
135
147
' ' ' >> $depfile
 
148
    echo >> $depfile
136
149
 
 
150
    # The second pass generates a dummy entry for each header file.
137
151
    tr ' ' '
138
 
' < "$tmpdepfile" | \
139
 
## Some versions of the HPUX 10.20 sed can't process this invocation
140
 
## correctly.  Breaking it into two sed invocations is a workaround.
141
 
      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
 
152
' < "$tmpdepfile" \
 
153
   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
 
154
   >> $depfile
142
155
  else
143
156
    # The sourcefile does not contain any dependencies, so just
144
157
    # store a dummy comment line, to avoid errors with the Makefile
150
163
 
151
164
aix)
152
165
  # The C for AIX Compiler uses -M and outputs the dependencies
153
 
  # in a .u file.
154
 
  tmpdepfile=`echo "$object" | sed 's/\(.*\)\..*$/\1.u/'`
 
166
  # in a .u file.  This file always lives in the current directory.
 
167
  # Also, the AIX compiler puts `$object:' at the start of each line;
 
168
  # $object doesn't have directory information.
 
169
  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
 
170
  tmpdepfile="$stripped.u"
 
171
  outname="$stripped.o"
155
172
  if test "$libtool" = yes; then
156
173
    "$@" -Wc,-M
157
174
  else
166
183
  fi
167
184
 
168
185
  if test -f "$tmpdepfile"; then
169
 
    echo "$object : \\" > "$depfile"
170
 
 
171
 
    # Clip off the initial element (the dependent). Don't try to be
172
 
    # clever and replace this with sed code, as IRIX sed won't handle
173
 
    # lines with more than a fixed number of characters (4096 in
174
 
    # IRIX 6.2 sed, 8192 in IRIX 6.5).
175
 
    tr ' ' '
176
 
' < "$tmpdepfile" | sed 's/^[^\.]*\.o://' | tr '
177
 
' ' ' >> $depfile
178
 
 
179
 
    tr ' ' '
180
 
' < "$tmpdepfile" | \
181
 
## Some versions of the HPUX 10.20 sed can't process this invocation
182
 
## correctly.  Breaking it into two sed invocations is a workaround.
183
 
      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
 
186
    # Each line is of the form `foo.o: dependent.h'.
 
187
    # Do two passes, one to just change these to
 
188
    # `$object: dependent.h' and one to simply `dependent.h:'.
 
189
    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
 
190
    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
184
191
  else
185
192
    # The sourcefile does not contain any dependencies, so just
186
193
    # store a dummy comment line, to avoid errors with the Makefile
190
197
  rm -f "$tmpdepfile"
191
198
  ;;
192
199
 
 
200
icc)
 
201
  # Must come before tru64.
 
202
 
 
203
  # Intel's C compiler understands `-MD -MF file'.  However
 
204
  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
 
205
  # will fill foo.d with something like
 
206
  #    foo.o: sub/foo.c
 
207
  #    foo.o: sub/foo.h
 
208
  # which is wrong.  We want:
 
209
  #    sub/foo.o: sub/foo.c
 
210
  #    sub/foo.o: sub/foo.h
 
211
  #    sub/foo.c:
 
212
  #    sub/foo.h:
 
213
 
 
214
  "$@" -MD -MF "$tmpdepfile"
 
215
  stat=$?
 
216
  if test $stat -eq 0; then :
 
217
  else
 
218
    rm -f "$tmpdepfile"
 
219
    exit $stat
 
220
  fi
 
221
  rm -f "$depfile"
 
222
  # Each line is of the form `foo.o: dependent.h'.
 
223
  # Do two passes, one to just change these to
 
224
  # `$object: dependent.h' and one to simply `dependent.h:'.
 
225
  sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
 
226
  sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
 
227
  rm -f "$tmpdepfile"
 
228
  ;;
 
229
 
 
230
tru64)
 
231
   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
 
232
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
 
233
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
 
234
   # dependencies in `foo.d' instead, so we check for that too.
 
235
   # Subdirectories are respected.
 
236
 
 
237
   tmpdepfile1="$object.d"
 
238
   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
 
239
   if test "$libtool" = yes; then
 
240
      "$@" -Wc,-MD
 
241
   else
 
242
      "$@" -MD
 
243
   fi
 
244
 
 
245
   stat=$?
 
246
   if test $stat -eq 0; then :
 
247
   else
 
248
      rm -f "$tmpdepfile1" "$tmpdepfile2"
 
249
      exit $stat
 
250
   fi
 
251
 
 
252
   if test -f "$tmpdepfile1"; then
 
253
      tmpdepfile="$tmpdepfile1"
 
254
   else
 
255
      tmpdepfile="$tmpdepfile2"
 
256
   fi
 
257
   if test -f "$tmpdepfile"; then
 
258
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
 
259
      # That's a space and a tab in the [].
 
260
      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
 
261
   else
 
262
      echo "#dummy" > "$depfile"
 
263
   fi
 
264
   rm -f "$tmpdepfile"
 
265
   ;;
 
266
 
193
267
#nosideeffect)
194
268
  # This comment above is used by automake to tell side-effect
195
269
  # dependency tracking mechanisms from slower ones.