~ubuntu-branches/ubuntu/oneiric/denemo/oneiric

« back to all changes in this revision

Viewing changes to depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-10-27 08:00:18 UTC
  • mfrom: (1.2.7 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101027080018-suwj9ozy99d0a5a2
Tags: 0.8.16-1ubuntu1
* Merge with Debian testing (LP: #638617), Ubuntu remaining changes:
  - debian/patches/ubuntuize.diff:
    + Provide a Ubuntu-specific customization.
  - debian/patches/fix_desktop.diff:
    + Add missing trailing semicolon.
    + Add MIME types.

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=2007-03-29.01
 
4
scriptversion=2009-04-28.21; # UTC
5
5
 
6
 
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
7
 
# Foundation, Inc.
 
6
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
 
7
# Software Foundation, Inc.
8
8
 
9
9
# This program is free software; you can redistribute it and/or modify
10
10
# it under the terms of the GNU General Public License as published by
17
17
# GNU General Public License for more details.
18
18
 
19
19
# You should have received a copy of the GNU General Public License
20
 
# along with this program; if not, write to the Free Software
21
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
 
# 02110-1301, USA.
 
20
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
21
 
24
22
# As a special exception to the GNU General Public License, if you
25
23
# distribute this file as part of a program that contains a
87
85
   depmode=dashmstdout
88
86
fi
89
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
 
90
97
case "$depmode" in
91
98
gcc3)
92
99
## gcc 3 implements dependency tracking that does exactly what
192
199
' < "$tmpdepfile" \
193
200
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
194
201
    tr '
195
 
' ' ' >> $depfile
196
 
    echo >> $depfile
 
202
' ' ' >> "$depfile"
 
203
    echo >> "$depfile"
197
204
 
198
205
    # The second pass generates a dummy entry for each header file.
199
206
    tr ' ' '
200
207
' < "$tmpdepfile" \
201
208
   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
202
 
   >> $depfile
 
209
   >> "$depfile"
203
210
  else
204
211
    # The sourcefile does not contain any dependencies, so just
205
212
    # store a dummy comment line, to avoid errors with the Makefile
328
335
  if test -f "$tmpdepfile"; then
329
336
    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
330
337
    # Add `dependent.h:' lines.
331
 
    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
 
338
    sed -ne '2,${
 
339
               s/^ *//
 
340
               s/ \\*$//
 
341
               s/$/:/
 
342
               p
 
343
             }' "$tmpdepfile" >> "$depfile"
332
344
  else
333
345
    echo "#dummy" > "$depfile"
334
346
  fi
404
416
 
405
417
  # Remove the call to Libtool.
406
418
  if test "$libtool" = yes; then
407
 
    while test $1 != '--mode=compile'; do
 
419
    while test "X$1" != 'X--mode=compile'; do
408
420
      shift
409
421
    done
410
422
    shift
455
467
  "$@" || exit $?
456
468
  # Remove any Libtool call
457
469
  if test "$libtool" = yes; then
458
 
    while test $1 != '--mode=compile'; do
 
470
    while test "X$1" != 'X--mode=compile'; do
459
471
      shift
460
472
    done
461
473
    shift
462
474
  fi
463
475
  # X makedepend
464
476
  shift
465
 
  cleared=no
466
 
  for arg in "$@"; do
 
477
  cleared=no eat=no
 
478
  for arg
 
479
  do
467
480
    case $cleared in
468
481
    no)
469
482
      set ""; shift
470
483
      cleared=yes ;;
471
484
    esac
 
485
    if test $eat = yes; then
 
486
      eat=no
 
487
      continue
 
488
    fi
472
489
    case "$arg" in
473
490
    -D*|-I*)
474
491
      set fnord "$@" "$arg"; shift ;;
475
492
    # Strip any option that makedepend may not understand.  Remove
476
493
    # the object too, otherwise makedepend will parse it as a source file.
 
494
    -arch)
 
495
      eat=yes ;;
477
496
    -*|$object)
478
497
      ;;
479
498
    *)
480
499
      set fnord "$@" "$arg"; shift ;;
481
500
    esac
482
501
  done
483
 
  obj_suffix="`echo $object | sed 's/^.*\././'`"
 
502
  obj_suffix=`echo "$object" | sed 's/^.*\././'`
484
503
  touch "$tmpdepfile"
485
504
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
486
505
  rm -f "$depfile"
500
519
 
501
520
  # Remove the call to Libtool.
502
521
  if test "$libtool" = yes; then
503
 
    while test $1 != '--mode=compile'; do
 
522
    while test "X$1" != 'X--mode=compile'; do
504
523
      shift
505
524
    done
506
525
    shift
538
557
 
539
558
msvisualcpp)
540
559
  # Important note: in order to support this mode, a compiler *must*
541
 
  # always write the preprocessed file to stdout, regardless of -o,
542
 
  # because we must use -o when running libtool.
 
560
  # always write the preprocessed file to stdout.
543
561
  "$@" || exit $?
 
562
 
 
563
  # Remove the call to Libtool.
 
564
  if test "$libtool" = yes; then
 
565
    while test "X$1" != 'X--mode=compile'; do
 
566
      shift
 
567
    done
 
568
    shift
 
569
  fi
 
570
 
544
571
  IFS=" "
545
572
  for arg
546
573
  do
547
574
    case "$arg" in
 
575
    -o)
 
576
      shift
 
577
      ;;
 
578
    $object)
 
579
      shift
 
580
      ;;
548
581
    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
549
582
        set fnord "$@"
550
583
        shift
557
590
        ;;
558
591
    esac
559
592
  done
560
 
  "$@" -E |
561
 
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
 
593
  "$@" -E 2>/dev/null |
 
594
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
562
595
  rm -f "$depfile"
563
596
  echo "$object : \\" > "$depfile"
564
 
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"
 
597
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::      \1 \\:p' >> "$depfile"
565
598
  echo "        " >> "$depfile"
566
 
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
 
599
  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
567
600
  rm -f "$tmpdepfile"
568
601
  ;;
569
602
 
 
603
msvcmsys)
 
604
  # This case exists only to let depend.m4 do its work.  It works by
 
605
  # looking at the text of this script.  This case will never be run,
 
606
  # since it is checked for above.
 
607
  exit 1
 
608
  ;;
 
609
 
570
610
none)
571
611
  exec "$@"
572
612
  ;;
585
625
# eval: (add-hook 'write-file-hooks 'time-stamp)
586
626
# time-stamp-start: "scriptversion="
587
627
# time-stamp-format: "%:y-%02m-%02d.%02H"
588
 
# time-stamp-end: "$"
 
628
# time-stamp-time-zone: "UTC"
 
629
# time-stamp-end: "; # UTC"
589
630
# End: