~ubuntu-branches/ubuntu/trusty/gnupg/trusty-updates

« back to all changes in this revision

Viewing changes to scripts/depcomp

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-12-04 22:26:16 UTC
  • mfrom: (1.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20121204222616-cr0fow26geq90l3y
Tags: 1.4.12-6ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Disable mlock() test since it fails with ulimit 0 (on buildds).
  - Set gpg (or gpg2) and gpgsm to use a passphrase agent by default.
  - Only suggest gnupg-curl and libldap; recommendations are pulled into
    minimal, and we don't need the keyserver utilities in a minimal Ubuntu
    system.
  - Remove the Win32 build.
  - Update config.guess/config.sub for aarch64.
* Dropped patches:
  - Fix udeb build failure on powerpc, building with -O2 instead of -Os.
    (No longer seems to be necessary.)
* Simplify removal of Win32 build, to make this easier to merge in future.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# depcomp - compile a program generating dependencies as side-effects
3
3
 
4
 
scriptversion=2004-05-31.23
 
4
scriptversion=2011-12-04.11; # UTC
5
5
 
6
 
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
 
6
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
 
7
# 2011 Free Software Foundation, Inc.
7
8
 
8
9
# This program is free software; you can redistribute it and/or modify
9
10
# it under the terms of the GNU General Public License as published by
16
17
# GNU General Public License for more details.
17
18
 
18
19
# You should have received a copy of the GNU General Public License
19
 
# along with this program; if not, write to the Free Software
20
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
 
# 02110-1301, USA.
 
20
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
21
 
23
22
# As a special exception to the GNU General Public License, if you
24
23
# distribute this file as part of a program that contains a
29
28
 
30
29
case $1 in
31
30
  '')
32
 
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
 
31
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
33
32
     exit 1;
34
33
     ;;
35
34
  -h | --h*)
41
40
 
42
41
Environment variables:
43
42
  depmode     Dependency tracking mode.
44
 
  source      Source file read by `PROGRAMS ARGS'.
45
 
  object      Object file output by `PROGRAMS ARGS'.
 
43
  source      Source file read by 'PROGRAMS ARGS'.
 
44
  object      Object file output by 'PROGRAMS ARGS'.
46
45
  DEPDIR      directory where to store dependencies.
47
46
  depfile     Dependency file to output.
48
 
  tmpdepfile  Temporary file to use when outputing dependencies.
 
47
  tmpdepfile  Temporary file to use when outputting dependencies.
49
48
  libtool     Whether libtool is used (yes/no).
50
49
 
51
50
Report bugs to <bug-automake@gnu.org>.
52
51
EOF
53
 
    exit 0
 
52
    exit $?
54
53
    ;;
55
54
  -v | --v*)
56
55
    echo "depcomp $scriptversion"
57
 
    exit 0
 
56
    exit $?
58
57
    ;;
59
58
esac
60
59
 
86
85
   depmode=dashmstdout
87
86
fi
88
87
 
 
88
cygpath_u="cygpath -u -f -"
 
89
if test "$depmode" = msvcmsys; then
 
90
   # This is just like msvisualcpp but w/o cygpath translation.
 
91
   # Just convert the backslash-escaped backslashes to single forward
 
92
   # slashes to satisfy depend.m4
 
93
   cygpath_u='sed s,\\\\,/,g'
 
94
   depmode=msvisualcpp
 
95
fi
 
96
 
 
97
if test "$depmode" = msvc7msys; then
 
98
   # This is just like msvc7 but w/o cygpath translation.
 
99
   # Just convert the backslash-escaped backslashes to single forward
 
100
   # slashes to satisfy depend.m4
 
101
   cygpath_u='sed s,\\\\,/,g'
 
102
   depmode=msvc7
 
103
fi
 
104
 
89
105
case "$depmode" in
90
106
gcc3)
91
107
## gcc 3 implements dependency tracking that does exactly what
92
108
## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
93
109
## it if -MD -MP comes after the -MF stuff.  Hmm.
94
 
  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
 
110
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
 
111
## the command line argument order; so add the flags where they
 
112
## appear in depend2.am.  Note that the slowdown incurred here
 
113
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
 
114
  for arg
 
115
  do
 
116
    case $arg in
 
117
    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
 
118
    *)  set fnord "$@" "$arg" ;;
 
119
    esac
 
120
    shift # fnord
 
121
    shift # $arg
 
122
  done
 
123
  "$@"
95
124
  stat=$?
96
125
  if test $stat -eq 0; then :
97
126
  else
127
156
## The second -e expression handles DOS-style file names with drive letters.
128
157
  sed -e 's/^[^:]*: / /' \
129
158
      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
130
 
## This next piece of magic avoids the `deleted header file' problem.
 
159
## This next piece of magic avoids the "deleted header file" problem.
131
160
## The problem is that when a header file which appears in a .P file
132
161
## is deleted, the dependency causes make to die (because there is
133
162
## typically no way to rebuild the header).  We avoid this by adding
135
164
## this for us directly.
136
165
  tr ' ' '
137
166
' < "$tmpdepfile" |
138
 
## Some versions of gcc put a space before the `:'.  On the theory
 
167
## Some versions of gcc put a space before the ':'.  On the theory
139
168
## that the space means something, we add a space to the output as
140
 
## well.
 
169
## well.  hp depmode also adds that space, but also prefixes the VPATH
 
170
## to the object.  Take care to not repeat it in the output.
141
171
## Some versions of the HPUX 10.20 sed can't process this invocation
142
172
## correctly.  Breaking it into two sed invocations is a workaround.
143
 
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
 
173
    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
 
174
      | sed -e 's/$/ :/' >> "$depfile"
144
175
  rm -f "$tmpdepfile"
145
176
  ;;
146
177
 
172
203
    # clever and replace this with sed code, as IRIX sed won't handle
173
204
    # lines with more than a fixed number of characters (4096 in
174
205
    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
175
 
    # the IRIX cc adds comments like `#:fec' to the end of the
 
206
    # the IRIX cc adds comments like '#:fec' to the end of the
176
207
    # dependency line.
177
208
    tr ' ' '
178
209
' < "$tmpdepfile" \
179
210
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
180
211
    tr '
181
 
' ' ' >> $depfile
182
 
    echo >> $depfile
 
212
' ' ' >> "$depfile"
 
213
    echo >> "$depfile"
183
214
 
184
215
    # The second pass generates a dummy entry for each header file.
185
216
    tr ' ' '
186
217
' < "$tmpdepfile" \
187
218
   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
188
 
   >> $depfile
 
219
   >> "$depfile"
189
220
  else
190
221
    # The sourcefile does not contain any dependencies, so just
191
222
    # store a dummy comment line, to avoid errors with the Makefile
198
229
aix)
199
230
  # The C for AIX Compiler uses -M and outputs the dependencies
200
231
  # in a .u file.  In older versions, this file always lives in the
201
 
  # current directory.  Also, the AIX compiler puts `$object:' at the
 
232
  # current directory.  Also, the AIX compiler puts '$object:' at the
202
233
  # start of each line; $object doesn't have directory information.
203
234
  # Version 6 uses the directory in both cases.
204
 
  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
205
 
  tmpdepfile="$stripped.u"
 
235
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
 
236
  test "x$dir" = "x$object" && dir=
 
237
  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
206
238
  if test "$libtool" = yes; then
 
239
    tmpdepfile1=$dir$base.u
 
240
    tmpdepfile2=$base.u
 
241
    tmpdepfile3=$dir.libs/$base.u
207
242
    "$@" -Wc,-M
208
243
  else
 
244
    tmpdepfile1=$dir$base.u
 
245
    tmpdepfile2=$dir$base.u
 
246
    tmpdepfile3=$dir$base.u
209
247
    "$@" -M
210
248
  fi
211
249
  stat=$?
212
250
 
213
 
  if test -f "$tmpdepfile"; then :
214
 
  else
215
 
    stripped=`echo "$stripped" | sed 's,^.*/,,'`
216
 
    tmpdepfile="$stripped.u"
217
 
  fi
218
 
 
219
251
  if test $stat -eq 0; then :
220
252
  else
221
 
    rm -f "$tmpdepfile"
 
253
    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
222
254
    exit $stat
223
255
  fi
224
256
 
 
257
  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
 
258
  do
 
259
    test -f "$tmpdepfile" && break
 
260
  done
225
261
  if test -f "$tmpdepfile"; then
226
 
    outname="$stripped.o"
227
 
    # Each line is of the form `foo.o: dependent.h'.
 
262
    # Each line is of the form 'foo.o: dependent.h'.
228
263
    # Do two passes, one to just change these to
229
 
    # `$object: dependent.h' and one to simply `dependent.h:'.
230
 
    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
231
 
    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
 
264
    # '$object: dependent.h' and one to simply 'dependent.h:'.
 
265
    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
 
266
    # That's a tab and a space in the [].
 
267
    sed -e 's,^.*\.[a-z]*:[      ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
232
268
  else
233
269
    # The sourcefile does not contain any dependencies, so just
234
270
    # store a dummy comment line, to avoid errors with the Makefile
239
275
  ;;
240
276
 
241
277
icc)
242
 
  # Intel's C compiler understands `-MD -MF file'.  However on
 
278
  # Intel's C compiler understands '-MD -MF file'.  However on
243
279
  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
244
280
  # ICC 7.0 will fill foo.d with something like
245
281
  #    foo.o: sub/foo.c
264
300
    exit $stat
265
301
  fi
266
302
  rm -f "$depfile"
267
 
  # Each line is of the form `foo.o: dependent.h',
268
 
  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
 
303
  # Each line is of the form 'foo.o: dependent.h',
 
304
  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
269
305
  # Do two passes, one to just change these to
270
 
  # `$object: dependent.h' and one to simply `dependent.h:'.
 
306
  # '$object: dependent.h' and one to simply 'dependent.h:'.
271
307
  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
272
308
  # Some versions of the HPUX 10.20 sed can't process this invocation
273
309
  # correctly.  Breaking it into two sed invocations is a workaround.
276
312
  rm -f "$tmpdepfile"
277
313
  ;;
278
314
 
 
315
hp2)
 
316
  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
 
317
  # compilers, which have integrated preprocessors.  The correct option
 
318
  # to use with these is +Maked; it writes dependencies to a file named
 
319
  # 'foo.d', which lands next to the object file, wherever that
 
320
  # happens to be.
 
321
  # Much of this is similar to the tru64 case; see comments there.
 
322
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
 
323
  test "x$dir" = "x$object" && dir=
 
324
  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
 
325
  if test "$libtool" = yes; then
 
326
    tmpdepfile1=$dir$base.d
 
327
    tmpdepfile2=$dir.libs/$base.d
 
328
    "$@" -Wc,+Maked
 
329
  else
 
330
    tmpdepfile1=$dir$base.d
 
331
    tmpdepfile2=$dir$base.d
 
332
    "$@" +Maked
 
333
  fi
 
334
  stat=$?
 
335
  if test $stat -eq 0; then :
 
336
  else
 
337
     rm -f "$tmpdepfile1" "$tmpdepfile2"
 
338
     exit $stat
 
339
  fi
 
340
 
 
341
  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
 
342
  do
 
343
    test -f "$tmpdepfile" && break
 
344
  done
 
345
  if test -f "$tmpdepfile"; then
 
346
    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
 
347
    # Add 'dependent.h:' lines.
 
348
    sed -ne '2,${
 
349
               s/^ *//
 
350
               s/ \\*$//
 
351
               s/$/:/
 
352
               p
 
353
             }' "$tmpdepfile" >> "$depfile"
 
354
  else
 
355
    echo "#dummy" > "$depfile"
 
356
  fi
 
357
  rm -f "$tmpdepfile" "$tmpdepfile2"
 
358
  ;;
 
359
 
279
360
tru64)
280
361
   # The Tru64 compiler uses -MD to generate dependencies as a side
281
 
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
 
362
   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
282
363
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
283
 
   # dependencies in `foo.d' instead, so we check for that too.
 
364
   # dependencies in 'foo.d' instead, so we check for that too.
284
365
   # Subdirectories are respected.
285
366
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
286
367
   test "x$dir" = "x$object" && dir=
287
368
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
288
369
 
289
370
   if test "$libtool" = yes; then
290
 
      # Dependencies are output in .lo.d with libtool 1.4.
291
 
      # With libtool 1.5 they are output both in $dir.libs/$base.o.d
292
 
      # and in $dir.libs/$base.o.d and $dir$base.o.d.  We process the
293
 
      # latter, because the former will be cleaned when $dir.libs is
294
 
      # erased.
295
 
      tmpdepfile1="$dir.libs/$base.lo.d"
296
 
      tmpdepfile2="$dir$base.o.d"
297
 
      tmpdepfile3="$dir.libs/$base.d"
 
371
      # With Tru64 cc, shared objects can also be used to make a
 
372
      # static library.  This mechanism is used in libtool 1.4 series to
 
373
      # handle both shared and static libraries in a single compilation.
 
374
      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
 
375
      #
 
376
      # With libtool 1.5 this exception was removed, and libtool now
 
377
      # generates 2 separate objects for the 2 libraries.  These two
 
378
      # compilations output dependencies in $dir.libs/$base.o.d and
 
379
      # in $dir$base.o.d.  We have to check for both files, because
 
380
      # one of the two compilations can be disabled.  We should prefer
 
381
      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
 
382
      # automatically cleaned when .libs/ is deleted, while ignoring
 
383
      # the former would cause a distcleancheck panic.
 
384
      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
 
385
      tmpdepfile2=$dir$base.o.d          # libtool 1.5
 
386
      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
 
387
      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
298
388
      "$@" -Wc,-MD
299
389
   else
300
 
      tmpdepfile1="$dir$base.o.d"
301
 
      tmpdepfile2="$dir$base.d"
302
 
      tmpdepfile3="$dir$base.d"
 
390
      tmpdepfile1=$dir$base.o.d
 
391
      tmpdepfile2=$dir$base.d
 
392
      tmpdepfile3=$dir$base.d
 
393
      tmpdepfile4=$dir$base.d
303
394
      "$@" -MD
304
395
   fi
305
396
 
306
397
   stat=$?
307
398
   if test $stat -eq 0; then :
308
399
   else
309
 
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
 
400
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
310
401
      exit $stat
311
402
   fi
312
403
 
313
 
   if test -f "$tmpdepfile1"; then
314
 
      tmpdepfile="$tmpdepfile1"
315
 
   elif test -f "$tmpdepfile2"; then
316
 
      tmpdepfile="$tmpdepfile2"
317
 
   else
318
 
      tmpdepfile="$tmpdepfile3"
319
 
   fi
 
404
   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
 
405
   do
 
406
     test -f "$tmpdepfile" && break
 
407
   done
320
408
   if test -f "$tmpdepfile"; then
321
409
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
322
410
      # That's a tab and a space in the [].
327
415
   rm -f "$tmpdepfile"
328
416
   ;;
329
417
 
 
418
msvc7)
 
419
  if test "$libtool" = yes; then
 
420
    showIncludes=-Wc,-showIncludes
 
421
  else
 
422
    showIncludes=-showIncludes
 
423
  fi
 
424
  "$@" $showIncludes > "$tmpdepfile"
 
425
  stat=$?
 
426
  grep -v '^Note: including file: ' "$tmpdepfile"
 
427
  if test "$stat" = 0; then :
 
428
  else
 
429
    rm -f "$tmpdepfile"
 
430
    exit $stat
 
431
  fi
 
432
  rm -f "$depfile"
 
433
  echo "$object : \\" > "$depfile"
 
434
  # The first sed program below extracts the file names and escapes
 
435
  # backslashes for cygpath.  The second sed program outputs the file
 
436
  # name when reading, but also accumulates all include files in the
 
437
  # hold buffer in order to output them again at the end.  This only
 
438
  # works with sed implementations that can handle large buffers.
 
439
  sed < "$tmpdepfile" -n '
 
440
/^Note: including file:  *\(.*\)/ {
 
441
  s//\1/
 
442
  s/\\/\\\\/g
 
443
  p
 
444
}' | $cygpath_u | sort -u | sed -n '
 
445
s/ /\\ /g
 
446
s/\(.*\)/       \1 \\/p
 
447
s/.\(.*\) \\/\1:/
 
448
H
 
449
$ {
 
450
  s/.*/ /
 
451
  G
 
452
  p
 
453
}' >> "$depfile"
 
454
  rm -f "$tmpdepfile"
 
455
  ;;
 
456
 
 
457
msvc7msys)
 
458
  # This case exists only to let depend.m4 do its work.  It works by
 
459
  # looking at the text of this script.  This case will never be run,
 
460
  # since it is checked for above.
 
461
  exit 1
 
462
  ;;
 
463
 
330
464
#nosideeffect)
331
465
  # This comment above is used by automake to tell side-effect
332
466
  # dependency tracking mechanisms from slower ones.
338
472
 
339
473
  # Remove the call to Libtool.
340
474
  if test "$libtool" = yes; then
341
 
    while test $1 != '--mode=compile'; do
 
475
    while test "X$1" != 'X--mode=compile'; do
342
476
      shift
343
477
    done
344
478
    shift
345
479
  fi
346
480
 
347
 
  # Remove `-o $object'.
 
481
  # Remove '-o $object'.
348
482
  IFS=" "
349
483
  for arg
350
484
  do
364
498
  done
365
499
 
366
500
  test -z "$dashmflag" && dashmflag=-M
367
 
  # Require at least two characters before searching for `:'
 
501
  # Require at least two characters before searching for ':'
368
502
  # in the target name.  This is to cope with DOS-style filenames:
369
 
  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
 
503
  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
370
504
  "$@" $dashmflag |
371
505
    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
372
506
  rm -f "$depfile"
389
523
  "$@" || exit $?
390
524
  # Remove any Libtool call
391
525
  if test "$libtool" = yes; then
392
 
    while test $1 != '--mode=compile'; do
 
526
    while test "X$1" != 'X--mode=compile'; do
393
527
      shift
394
528
    done
395
529
    shift
396
530
  fi
397
531
  # X makedepend
398
532
  shift
399
 
  cleared=no
400
 
  for arg in "$@"; do
 
533
  cleared=no eat=no
 
534
  for arg
 
535
  do
401
536
    case $cleared in
402
537
    no)
403
538
      set ""; shift
404
539
      cleared=yes ;;
405
540
    esac
 
541
    if test $eat = yes; then
 
542
      eat=no
 
543
      continue
 
544
    fi
406
545
    case "$arg" in
407
546
    -D*|-I*)
408
547
      set fnord "$@" "$arg"; shift ;;
409
548
    # Strip any option that makedepend may not understand.  Remove
410
549
    # the object too, otherwise makedepend will parse it as a source file.
 
550
    -arch)
 
551
      eat=yes ;;
411
552
    -*|$object)
412
553
      ;;
413
554
    *)
414
555
      set fnord "$@" "$arg"; shift ;;
415
556
    esac
416
557
  done
417
 
  obj_suffix="`echo $object | sed 's/^.*\././'`"
 
558
  obj_suffix=`echo "$object" | sed 's/^.*\././'`
418
559
  touch "$tmpdepfile"
419
560
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
420
561
  rm -f "$depfile"
421
 
  cat < "$tmpdepfile" > "$depfile"
 
562
  # makedepend may prepend the VPATH from the source file name to the object.
 
563
  # No need to regex-escape $object, excess matching of '.' is harmless.
 
564
  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
422
565
  sed '1,2d' "$tmpdepfile" | tr ' ' '
423
566
' | \
424
567
## Some versions of the HPUX 10.20 sed can't process this invocation
434
577
 
435
578
  # Remove the call to Libtool.
436
579
  if test "$libtool" = yes; then
437
 
    while test $1 != '--mode=compile'; do
 
580
    while test "X$1" != 'X--mode=compile'; do
438
581
      shift
439
582
    done
440
583
    shift
441
584
  fi
442
585
 
443
 
  # Remove `-o $object'.
 
586
  # Remove '-o $object'.
444
587
  IFS=" "
445
588
  for arg
446
589
  do
460
603
  done
461
604
 
462
605
  "$@" -E |
463
 
    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
 
606
    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
 
607
       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
464
608
    sed '$ s: \\$::' > "$tmpdepfile"
465
609
  rm -f "$depfile"
466
610
  echo "$object : \\" > "$depfile"
471
615
 
472
616
msvisualcpp)
473
617
  # Important note: in order to support this mode, a compiler *must*
474
 
  # always write the preprocessed file to stdout, regardless of -o,
475
 
  # because we must use -o when running libtool.
 
618
  # always write the preprocessed file to stdout.
476
619
  "$@" || exit $?
 
620
 
 
621
  # Remove the call to Libtool.
 
622
  if test "$libtool" = yes; then
 
623
    while test "X$1" != 'X--mode=compile'; do
 
624
      shift
 
625
    done
 
626
    shift
 
627
  fi
 
628
 
477
629
  IFS=" "
478
630
  for arg
479
631
  do
480
632
    case "$arg" in
 
633
    -o)
 
634
      shift
 
635
      ;;
 
636
    $object)
 
637
      shift
 
638
      ;;
481
639
    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
482
640
        set fnord "$@"
483
641
        shift
490
648
        ;;
491
649
    esac
492
650
  done
493
 
  "$@" -E |
494
 
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
 
651
  "$@" -E 2>/dev/null |
 
652
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
495
653
  rm -f "$depfile"
496
654
  echo "$object : \\" > "$depfile"
497
 
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"
 
655
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::      \1 \\:p' >> "$depfile"
498
656
  echo "        " >> "$depfile"
499
 
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
 
657
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
500
658
  rm -f "$tmpdepfile"
501
659
  ;;
502
660
 
 
661
msvcmsys)
 
662
  # This case exists only to let depend.m4 do its work.  It works by
 
663
  # looking at the text of this script.  This case will never be run,
 
664
  # since it is checked for above.
 
665
  exit 1
 
666
  ;;
 
667
 
503
668
none)
504
669
  exec "$@"
505
670
  ;;
518
683
# eval: (add-hook 'write-file-hooks 'time-stamp)
519
684
# time-stamp-start: "scriptversion="
520
685
# time-stamp-format: "%:y-%02m-%02d.%02H"
521
 
# time-stamp-end: "$"
 
686
# time-stamp-time-zone: "UTC"
 
687
# time-stamp-end: "; # UTC"
522
688
# End: