~ubuntu-branches/ubuntu/saucy/libgphoto2/saucy-proposed

« back to all changes in this revision

Viewing changes to auto-aux/depcomp

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-07-31 07:00:09 UTC
  • mfrom: (1.4.4)
  • Revision ID: package-import@ubuntu.com-20130731070009-enrbvg3hry64cxl1
Tags: 2.5.2-0ubuntu1
* New upstream release.
* Drop 01-increase_max_entries.patch, 02-libusbx_no_debug.patch,
  03-libusbx-fixes.patch: fixed upstream.
* Add libxml2-dev build dependency for new optional features.
* ABI changes: libgphoto2-2 → libgphoto2-6,
  libgphoto2-port0 → libgphoto2-port10
* debian/libgphoto2-dev-doc.install: Adjust to changed HTML API doc folder
  name.
* debian/libgphoto2-port10.install: Adjust for changed libgphoto-port ABI.

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=2009-04-28.21; # UTC
 
4
scriptversion=2012-03-27.16; # UTC
5
5
 
6
 
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
7
 
# Software Foundation, Inc.
 
6
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
8
7
 
9
8
# This program is free software; you can redistribute it and/or modify
10
9
# it under the terms of the GNU General Public License as published by
28
27
 
29
28
case $1 in
30
29
  '')
31
 
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
 
30
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
32
31
     exit 1;
33
32
     ;;
34
33
  -h | --h*)
40
39
 
41
40
Environment variables:
42
41
  depmode     Dependency tracking mode.
43
 
  source      Source file read by `PROGRAMS ARGS'.
44
 
  object      Object file output by `PROGRAMS ARGS'.
 
42
  source      Source file read by 'PROGRAMS ARGS'.
 
43
  object      Object file output by 'PROGRAMS ARGS'.
45
44
  DEPDIR      directory where to store dependencies.
46
45
  depfile     Dependency file to output.
47
 
  tmpdepfile  Temporary file to use when outputing dependencies.
 
46
  tmpdepfile  Temporary file to use when outputting dependencies.
48
47
  libtool     Whether libtool is used (yes/no).
49
48
 
50
49
Report bugs to <bug-automake@gnu.org>.
57
56
    ;;
58
57
esac
59
58
 
 
59
# A tabulation character.
 
60
tab='   '
 
61
# A newline character.
 
62
nl='
 
63
'
 
64
 
60
65
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
61
66
  echo "depcomp: Variables source, object and depmode must be set" 1>&2
62
67
  exit 1
90
95
   # This is just like msvisualcpp but w/o cygpath translation.
91
96
   # Just convert the backslash-escaped backslashes to single forward
92
97
   # slashes to satisfy depend.m4
93
 
   cygpath_u="sed s,\\\\\\\\,/,g"
 
98
   cygpath_u='sed s,\\\\,/,g'
94
99
   depmode=msvisualcpp
95
100
fi
96
101
 
 
102
if test "$depmode" = msvc7msys; then
 
103
   # This is just like msvc7 but w/o cygpath translation.
 
104
   # Just convert the backslash-escaped backslashes to single forward
 
105
   # slashes to satisfy depend.m4
 
106
   cygpath_u='sed s,\\\\,/,g'
 
107
   depmode=msvc7
 
108
fi
 
109
 
 
110
if test "$depmode" = xlc; then
 
111
   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
 
112
   gccflag=-qmakedep=gcc,-MF
 
113
   depmode=gcc
 
114
fi
 
115
 
97
116
case "$depmode" in
98
117
gcc3)
99
118
## gcc 3 implements dependency tracking that does exactly what
148
167
## The second -e expression handles DOS-style file names with drive letters.
149
168
  sed -e 's/^[^:]*: / /' \
150
169
      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
151
 
## This next piece of magic avoids the `deleted header file' problem.
 
170
## This next piece of magic avoids the "deleted header file" problem.
152
171
## The problem is that when a header file which appears in a .P file
153
172
## is deleted, the dependency causes make to die (because there is
154
173
## typically no way to rebuild the header).  We avoid this by adding
155
174
## dummy dependencies for each header file.  Too bad gcc doesn't do
156
175
## this for us directly.
157
 
  tr ' ' '
158
 
' < "$tmpdepfile" |
159
 
## Some versions of gcc put a space before the `:'.  On the theory
 
176
  tr ' ' "$nl" < "$tmpdepfile" |
 
177
## Some versions of gcc put a space before the ':'.  On the theory
160
178
## that the space means something, we add a space to the output as
161
 
## well.
 
179
## well.  hp depmode also adds that space, but also prefixes the VPATH
 
180
## to the object.  Take care to not repeat it in the output.
162
181
## Some versions of the HPUX 10.20 sed can't process this invocation
163
182
## correctly.  Breaking it into two sed invocations is a workaround.
164
 
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
 
183
    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
 
184
      | sed -e 's/$/ :/' >> "$depfile"
165
185
  rm -f "$tmpdepfile"
166
186
  ;;
167
187
 
193
213
    # clever and replace this with sed code, as IRIX sed won't handle
194
214
    # lines with more than a fixed number of characters (4096 in
195
215
    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
196
 
    # the IRIX cc adds comments like `#:fec' to the end of the
 
216
    # the IRIX cc adds comments like '#:fec' to the end of the
197
217
    # dependency line.
198
 
    tr ' ' '
199
 
' < "$tmpdepfile" \
 
218
    tr ' ' "$nl" < "$tmpdepfile" \
200
219
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
201
 
    tr '
202
 
' ' ' >> "$depfile"
 
220
    tr "$nl" ' ' >> "$depfile"
203
221
    echo >> "$depfile"
204
222
 
205
223
    # The second pass generates a dummy entry for each header file.
206
 
    tr ' ' '
207
 
' < "$tmpdepfile" \
 
224
    tr ' ' "$nl" < "$tmpdepfile" \
208
225
   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
209
226
   >> "$depfile"
210
227
  else
216
233
  rm -f "$tmpdepfile"
217
234
  ;;
218
235
 
 
236
xlc)
 
237
  # This case exists only to let depend.m4 do its work.  It works by
 
238
  # looking at the text of this script.  This case will never be run,
 
239
  # since it is checked for above.
 
240
  exit 1
 
241
  ;;
 
242
 
219
243
aix)
220
244
  # The C for AIX Compiler uses -M and outputs the dependencies
221
245
  # in a .u file.  In older versions, this file always lives in the
222
 
  # current directory.  Also, the AIX compiler puts `$object:' at the
 
246
  # current directory.  Also, the AIX compiler puts '$object:' at the
223
247
  # start of each line; $object doesn't have directory information.
224
248
  # Version 6 uses the directory in both cases.
225
249
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
249
273
    test -f "$tmpdepfile" && break
250
274
  done
251
275
  if test -f "$tmpdepfile"; then
252
 
    # Each line is of the form `foo.o: dependent.h'.
 
276
    # Each line is of the form 'foo.o: dependent.h'.
253
277
    # Do two passes, one to just change these to
254
 
    # `$object: dependent.h' and one to simply `dependent.h:'.
 
278
    # '$object: dependent.h' and one to simply 'dependent.h:'.
255
279
    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
256
 
    # That's a tab and a space in the [].
257
 
    sed -e 's,^.*\.[a-z]*:[      ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
 
280
    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
258
281
  else
259
282
    # The sourcefile does not contain any dependencies, so just
260
283
    # store a dummy comment line, to avoid errors with the Makefile
265
288
  ;;
266
289
 
267
290
icc)
268
 
  # Intel's C compiler understands `-MD -MF file'.  However on
269
 
  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
 
291
  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
 
292
  # However on
 
293
  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
270
294
  # ICC 7.0 will fill foo.d with something like
271
295
  #    foo.o: sub/foo.c
272
296
  #    foo.o: sub/foo.h
273
 
  # which is wrong.  We want:
 
297
  # which is wrong.  We want
274
298
  #    sub/foo.o: sub/foo.c
275
299
  #    sub/foo.o: sub/foo.h
276
300
  #    sub/foo.c:
277
301
  #    sub/foo.h:
278
302
  # ICC 7.1 will output
279
303
  #    foo.o: sub/foo.c sub/foo.h
280
 
  # and will wrap long lines using \ :
 
304
  # and will wrap long lines using '\':
281
305
  #    foo.o: sub/foo.c ... \
282
306
  #     sub/foo.h ... \
283
307
  #     ...
284
 
 
 
308
  # tcc 0.9.26 (FIXME still under development at the moment of writing)
 
309
  # will emit a similar output, but also prepend the continuation lines
 
310
  # with horizontal tabulation characters.
285
311
  "$@" -MD -MF "$tmpdepfile"
286
312
  stat=$?
287
313
  if test $stat -eq 0; then :
290
316
    exit $stat
291
317
  fi
292
318
  rm -f "$depfile"
293
 
  # Each line is of the form `foo.o: dependent.h',
294
 
  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
 
319
  # Each line is of the form 'foo.o: dependent.h',
 
320
  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
295
321
  # Do two passes, one to just change these to
296
 
  # `$object: dependent.h' and one to simply `dependent.h:'.
297
 
  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
298
 
  # Some versions of the HPUX 10.20 sed can't process this invocation
299
 
  # correctly.  Breaking it into two sed invocations is a workaround.
300
 
  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
301
 
    sed -e 's/$/ :/' >> "$depfile"
 
322
  # '$object: dependent.h' and one to simply 'dependent.h:'.
 
323
  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
 
324
    < "$tmpdepfile" > "$depfile"
 
325
  sed '
 
326
    s/[ '"$tab"'][ '"$tab"']*/ /g
 
327
    s/^ *//
 
328
    s/ *\\*$//
 
329
    s/^[^:]*: *//
 
330
    /^$/d
 
331
    /:$/d
 
332
    s/$/ :/
 
333
  ' < "$tmpdepfile" >> "$depfile"
302
334
  rm -f "$tmpdepfile"
303
335
  ;;
304
336
 
334
366
  done
335
367
  if test -f "$tmpdepfile"; then
336
368
    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
337
 
    # Add `dependent.h:' lines.
 
369
    # Add 'dependent.h:' lines.
338
370
    sed -ne '2,${
339
371
               s/^ *//
340
372
               s/ \\*$//
349
381
 
350
382
tru64)
351
383
   # The Tru64 compiler uses -MD to generate dependencies as a side
352
 
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
 
384
   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
353
385
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
354
 
   # dependencies in `foo.d' instead, so we check for that too.
 
386
   # dependencies in 'foo.d' instead, so we check for that too.
355
387
   # Subdirectories are respected.
356
388
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
357
389
   test "x$dir" = "x$object" && dir=
397
429
   done
398
430
   if test -f "$tmpdepfile"; then
399
431
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
400
 
      # That's a tab and a space in the [].
401
 
      sed -e 's,^.*\.[a-z]*:[    ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
 
432
      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
402
433
   else
403
434
      echo "#dummy" > "$depfile"
404
435
   fi
405
436
   rm -f "$tmpdepfile"
406
437
   ;;
407
438
 
 
439
msvc7)
 
440
  if test "$libtool" = yes; then
 
441
    showIncludes=-Wc,-showIncludes
 
442
  else
 
443
    showIncludes=-showIncludes
 
444
  fi
 
445
  "$@" $showIncludes > "$tmpdepfile"
 
446
  stat=$?
 
447
  grep -v '^Note: including file: ' "$tmpdepfile"
 
448
  if test "$stat" = 0; then :
 
449
  else
 
450
    rm -f "$tmpdepfile"
 
451
    exit $stat
 
452
  fi
 
453
  rm -f "$depfile"
 
454
  echo "$object : \\" > "$depfile"
 
455
  # The first sed program below extracts the file names and escapes
 
456
  # backslashes for cygpath.  The second sed program outputs the file
 
457
  # name when reading, but also accumulates all include files in the
 
458
  # hold buffer in order to output them again at the end.  This only
 
459
  # works with sed implementations that can handle large buffers.
 
460
  sed < "$tmpdepfile" -n '
 
461
/^Note: including file:  *\(.*\)/ {
 
462
  s//\1/
 
463
  s/\\/\\\\/g
 
464
  p
 
465
}' | $cygpath_u | sort -u | sed -n '
 
466
s/ /\\ /g
 
467
s/\(.*\)/'"$tab"'\1 \\/p
 
468
s/.\(.*\) \\/\1:/
 
469
H
 
470
$ {
 
471
  s/.*/'"$tab"'/
 
472
  G
 
473
  p
 
474
}' >> "$depfile"
 
475
  rm -f "$tmpdepfile"
 
476
  ;;
 
477
 
 
478
msvc7msys)
 
479
  # This case exists only to let depend.m4 do its work.  It works by
 
480
  # looking at the text of this script.  This case will never be run,
 
481
  # since it is checked for above.
 
482
  exit 1
 
483
  ;;
 
484
 
408
485
#nosideeffect)
409
486
  # This comment above is used by automake to tell side-effect
410
487
  # dependency tracking mechanisms from slower ones.
422
499
    shift
423
500
  fi
424
501
 
425
 
  # Remove `-o $object'.
 
502
  # Remove '-o $object'.
426
503
  IFS=" "
427
504
  for arg
428
505
  do
442
519
  done
443
520
 
444
521
  test -z "$dashmflag" && dashmflag=-M
445
 
  # Require at least two characters before searching for `:'
 
522
  # Require at least two characters before searching for ':'
446
523
  # in the target name.  This is to cope with DOS-style filenames:
447
 
  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
 
524
  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
448
525
  "$@" $dashmflag |
449
 
    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
 
526
    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
450
527
  rm -f "$depfile"
451
528
  cat < "$tmpdepfile" > "$depfile"
452
 
  tr ' ' '
453
 
' < "$tmpdepfile" | \
 
529
  tr ' ' "$nl" < "$tmpdepfile" | \
454
530
## Some versions of the HPUX 10.20 sed can't process this invocation
455
531
## correctly.  Breaking it into two sed invocations is a workaround.
456
532
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
503
579
  touch "$tmpdepfile"
504
580
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
505
581
  rm -f "$depfile"
506
 
  cat < "$tmpdepfile" > "$depfile"
507
 
  sed '1,2d' "$tmpdepfile" | tr ' ' '
508
 
' | \
 
582
  # makedepend may prepend the VPATH from the source file name to the object.
 
583
  # No need to regex-escape $object, excess matching of '.' is harmless.
 
584
  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
 
585
  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
509
586
## Some versions of the HPUX 10.20 sed can't process this invocation
510
587
## correctly.  Breaking it into two sed invocations is a workaround.
511
588
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
525
602
    shift
526
603
  fi
527
604
 
528
 
  # Remove `-o $object'.
 
605
  # Remove '-o $object'.
529
606
  IFS=" "
530
607
  for arg
531
608
  do
594
671
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
595
672
  rm -f "$depfile"
596
673
  echo "$object : \\" > "$depfile"
597
 
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::      \1 \\:p' >> "$depfile"
598
 
  echo "        " >> "$depfile"
 
674
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
 
675
  echo "$tab" >> "$depfile"
599
676
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
600
677
  rm -f "$tmpdepfile"
601
678
  ;;