~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Kees Cook, Ted Gould
  • Date: 2008-02-10 14:20:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080210142016-vcnb2zqyhszu0xvb
Tags: 0.46~pre1-0ubuntu1
[ Kees Cook ]
* debian/control:
  - add libgtkspell-dev build-dep to gain GtkSpell features (LP: #183547).
  - update Standards version (no changes needed).
  - add Vcs and Homepage fields.
  - switch to new python-lxml dep.
* debian/{control,rules}: switch from dpatch to quilt for more sanity.
* debian/patches/20_fix_glib_and_gxx43_ftbfs.patch:
  - merged against upstream fixes.
  - added additional fixes for newly written code.
* debian/rules: enable parallel building.

[ Ted Gould ]
* Updating POTFILES.in to make it so things build correctly.
* debian/control:
  - add ImageMagick++ and libboost-dev to build-deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
 
 
3
2
# depcomp - compile a program generating dependencies as side-effects
4
 
# Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
 
3
 
 
4
scriptversion=2006-10-15.18
 
5
 
 
6
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
 
7
# Foundation, Inc.
5
8
 
6
9
# This program is free software; you can redistribute it and/or modify
7
10
# it under the terms of the GNU General Public License as published by
15
18
 
16
19
# You should have received a copy of the GNU General Public License
17
20
# along with this program; if not, write to the Free Software
18
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
 
# 02111-1307, USA.
 
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
22
# 02110-1301, USA.
20
23
 
21
24
# As a special exception to the GNU General Public License, if you
22
25
# distribute this file as part of a program that contains a
25
28
 
26
29
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27
30
 
 
31
case $1 in
 
32
  '')
 
33
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
 
34
     exit 1;
 
35
     ;;
 
36
  -h | --h*)
 
37
    cat <<\EOF
 
38
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
 
39
 
 
40
Run PROGRAMS ARGS to compile a file, generating dependencies
 
41
as side-effects.
 
42
 
 
43
Environment variables:
 
44
  depmode     Dependency tracking mode.
 
45
  source      Source file read by `PROGRAMS ARGS'.
 
46
  object      Object file output by `PROGRAMS ARGS'.
 
47
  DEPDIR      directory where to store dependencies.
 
48
  depfile     Dependency file to output.
 
49
  tmpdepfile  Temporary file to use when outputing dependencies.
 
50
  libtool     Whether libtool is used (yes/no).
 
51
 
 
52
Report bugs to <bug-automake@gnu.org>.
 
53
EOF
 
54
    exit $?
 
55
    ;;
 
56
  -v | --v*)
 
57
    echo "depcomp $scriptversion"
 
58
    exit $?
 
59
    ;;
 
60
esac
 
61
 
28
62
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
29
63
  echo "depcomp: Variables source, object and depmode must be set" 1>&2
30
64
  exit 1
31
65
fi
32
 
# `libtool' can also be set to `yes' or `no'.
33
 
 
34
 
if test -z "$depfile"; then
35
 
   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
36
 
   dir=`echo "$object" | sed 's,/.*$,/,'`
37
 
   if test "$dir" = "$object"; then
38
 
      dir=
39
 
   fi
40
 
   # FIXME: should be _deps on DOS.
41
 
   depfile="$dir.deps/$base"
42
 
fi
43
 
 
 
66
 
 
67
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
 
68
depfile=${depfile-`echo "$object" |
 
69
  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
44
70
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
45
71
 
46
72
rm -f "$tmpdepfile"
66
92
## gcc 3 implements dependency tracking that does exactly what
67
93
## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
68
94
## it if -MD -MP comes after the -MF stuff.  Hmm.
69
 
  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
 
95
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
 
96
## the command line argument order; so add the flags where they
 
97
## appear in depend2.am.  Note that the slowdown incurred here
 
98
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
 
99
  for arg
 
100
  do
 
101
    case $arg in
 
102
    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
 
103
    *)  set fnord "$@" "$arg" ;;
 
104
    esac
 
105
    shift # fnord
 
106
    shift # $arg
 
107
  done
 
108
  "$@"
70
109
  stat=$?
71
110
  if test $stat -eq 0; then :
72
111
  else
251
290
  rm -f "$tmpdepfile"
252
291
  ;;
253
292
 
 
293
hp2)
 
294
  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
 
295
  # compilers, which have integrated preprocessors.  The correct option
 
296
  # to use with these is +Maked; it writes dependencies to a file named
 
297
  # 'foo.d', which lands next to the object file, wherever that
 
298
  # happens to be.
 
299
  # Much of this is similar to the tru64 case; see comments there.
 
300
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
 
301
  test "x$dir" = "x$object" && dir=
 
302
  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
 
303
  if test "$libtool" = yes; then
 
304
    tmpdepfile1=$dir$base.d
 
305
    tmpdepfile2=$dir.libs/$base.d
 
306
    "$@" -Wc,+Maked
 
307
  else
 
308
    tmpdepfile1=$dir$base.d
 
309
    tmpdepfile2=$dir$base.d
 
310
    "$@" +Maked
 
311
  fi
 
312
  stat=$?
 
313
  if test $stat -eq 0; then :
 
314
  else
 
315
     rm -f "$tmpdepfile1" "$tmpdepfile2"
 
316
     exit $stat
 
317
  fi
 
318
 
 
319
  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
 
320
  do
 
321
    test -f "$tmpdepfile" && break
 
322
  done
 
323
  if test -f "$tmpdepfile"; then
 
324
    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
 
325
    # Add `dependent.h:' lines.
 
326
    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
 
327
  else
 
328
    echo "#dummy" > "$depfile"
 
329
  fi
 
330
  rm -f "$tmpdepfile" "$tmpdepfile2"
 
331
  ;;
 
332
 
254
333
tru64)
255
334
   # The Tru64 compiler uses -MD to generate dependencies as a side
256
335
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
262
341
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
263
342
 
264
343
   if test "$libtool" = yes; then
265
 
      tmpdepfile1="$dir.libs/$base.lo.d"
266
 
      tmpdepfile2="$dir.libs/$base.d"
 
344
      # With Tru64 cc, shared objects can also be used to make a
 
345
      # static library.  This mechanism is used in libtool 1.4 series to
 
346
      # handle both shared and static libraries in a single compilation.
 
347
      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
 
348
      #
 
349
      # With libtool 1.5 this exception was removed, and libtool now
 
350
      # generates 2 separate objects for the 2 libraries.  These two
 
351
      # compilations output dependencies in $dir.libs/$base.o.d and
 
352
      # in $dir$base.o.d.  We have to check for both files, because
 
353
      # one of the two compilations can be disabled.  We should prefer
 
354
      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
 
355
      # automatically cleaned when .libs/ is deleted, while ignoring
 
356
      # the former would cause a distcleancheck panic.
 
357
      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
 
358
      tmpdepfile2=$dir$base.o.d          # libtool 1.5
 
359
      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
 
360
      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
267
361
      "$@" -Wc,-MD
268
362
   else
269
 
      tmpdepfile1="$dir$base.o.d"
270
 
      tmpdepfile2="$dir$base.d"
 
363
      tmpdepfile1=$dir$base.o.d
 
364
      tmpdepfile2=$dir$base.d
 
365
      tmpdepfile3=$dir$base.d
 
366
      tmpdepfile4=$dir$base.d
271
367
      "$@" -MD
272
368
   fi
273
369
 
274
370
   stat=$?
275
371
   if test $stat -eq 0; then :
276
372
   else
277
 
      rm -f "$tmpdepfile1" "$tmpdepfile2"
 
373
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
278
374
      exit $stat
279
375
   fi
280
376
 
281
 
   if test -f "$tmpdepfile1"; then
282
 
      tmpdepfile="$tmpdepfile1"
283
 
   else
284
 
      tmpdepfile="$tmpdepfile2"
285
 
   fi
 
377
   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
 
378
   do
 
379
     test -f "$tmpdepfile" && break
 
380
   done
286
381
   if test -f "$tmpdepfile"; then
287
382
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
288
383
      # That's a tab and a space in the [].
426
521
  done
427
522
 
428
523
  "$@" -E |
429
 
    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
 
524
    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
 
525
       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
430
526
    sed '$ s: \\$::' > "$tmpdepfile"
431
527
  rm -f "$depfile"
432
528
  echo "$object : \\" > "$depfile"
477
573
esac
478
574
 
479
575
exit 0
 
576
 
 
577
# Local Variables:
 
578
# mode: shell-script
 
579
# sh-indentation: 2
 
580
# eval: (add-hook 'write-file-hooks 'time-stamp)
 
581
# time-stamp-start: "scriptversion="
 
582
# time-stamp-format: "%:y-%02m-%02d.%02H"
 
583
# time-stamp-end: "$"
 
584
# End: