~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/sacado/config/depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
# depcomp - compile a program generating dependencies as side-effects
4
 
# Copyright 1999, 2000 Free Software Foundation, Inc.
5
 
 
6
 
# This program is free software; you can redistribute it and/or modify
7
 
# it under the terms of the GNU General Public License as published by
8
 
# the Free Software Foundation; either version 2, or (at your option)
9
 
# any later version.
10
 
 
11
 
# This program is distributed in the hope that it will be useful,
12
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
# GNU General Public License for more details.
15
 
 
16
 
# You should have received a copy of the GNU General Public License
17
 
# 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.
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
 
 
26
 
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27
 
 
28
 
#echo "Calling depmode!  I am stopping now!"
29
 
#exit 1
30
 
 
31
 
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
32
 
  echo "depcomp: Variables source, object and depmode must be set" 1>&2
33
 
  exit 1
34
 
fi
35
 
# `libtool' can also be set to `yes' or `no'.
36
 
 
37
 
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
38
 
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
39
 
 
40
 
rm -f "$tmpdepfile"
41
 
 
42
 
# Some modes work just like other modes, but use different flags.  We
43
 
# parameterize here, but still list the modes in the big case below,
44
 
# to make depend.m4 easier to write.  Note that we *cannot* use a case
45
 
# here, because this file can only contain one case statement.
46
 
if test "$depmode" = hp; then
47
 
  # HP compiler uses -M and no extra arg.
48
 
  gccflag=-M
49
 
  depmode=gcc
50
 
fi
51
 
 
52
 
if test "$depmode" = dashXmstdout; then
53
 
   # This is just like dashmstdout with a different argument.
54
 
   dashmflag=-xM
55
 
   depmode=dashmstdout
56
 
fi
57
 
 
58
 
case "$depmode" in
59
 
gcc3)
60
 
## gcc 3 implements dependency tracking that does exactly what
61
 
## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
62
 
## it if -MD -MP comes after the -MF stuff.  Hmm.
63
 
  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
64
 
  stat=$?
65
 
  if test $stat -eq 0; then :
66
 
  else
67
 
    rm -f "$tmpdepfile"
68
 
    exit $stat
69
 
  fi
70
 
  mv "$tmpdepfile" "$depfile"
71
 
  ;;
72
 
 
73
 
gcc)
74
 
## There are various ways to get dependency output from gcc.  Here's
75
 
## why we pick this rather obscure method:
76
 
## - Don't want to use -MD because we'd like the dependencies to end
77
 
##   up in a subdir.  Having to rename by hand is ugly.
78
 
##   (We might end up doing this anyway to support other compilers.)
79
 
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
80
 
##   -MM, not -M (despite what the docs say).
81
 
## - Using -M directly means running the compiler twice (even worse
82
 
##   than renaming).
83
 
  if test -z "$gccflag"; then
84
 
    gccflag=-MD,
85
 
  fi
86
 
  "$@" -Wp,"$gccflag$tmpdepfile"
87
 
  stat=$?
88
 
  if test $stat -eq 0; then :
89
 
  else
90
 
    rm -f "$tmpdepfile"
91
 
    exit $stat
92
 
  fi
93
 
  rm -f "$depfile"
94
 
  echo "$object : \\" > "$depfile"
95
 
  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
96
 
## The second -e expression handles DOS-style file names with drive letters.
97
 
  sed -e 's/^[^:]*: / /' \
98
 
      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
99
 
## This next piece of magic avoids the `deleted header file' problem.
100
 
## The problem is that when a header file which appears in a .P file
101
 
## is deleted, the dependency causes make to die (because there is
102
 
## typically no way to rebuild the header).  We avoid this by adding
103
 
## dummy dependencies for each header file.  Too bad gcc doesn't do
104
 
## this for us directly.
105
 
  tr ' ' '
106
 
' < "$tmpdepfile" |
107
 
## Some versions of gcc put a space before the `:'.  On the theory
108
 
## that the space means something, we add a space to the output as
109
 
## well.
110
 
## Some versions of the HPUX 10.20 sed can't process this invocation
111
 
## correctly.  Breaking it into two sed invocations is a workaround.
112
 
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
113
 
  rm -f "$tmpdepfile"
114
 
  ;;
115
 
 
116
 
hp)
117
 
  # This case exists only to let depend.m4 do its work.  It works by
118
 
  # looking at the text of this script.  This case will never be run,
119
 
  # since it is checked for above.
120
 
  exit 1
121
 
  ;;
122
 
 
123
 
sgi)
124
 
  if test "$libtool" = yes; then
125
 
    "$@" "-Wp,-MDupdate,$tmpdepfile"
126
 
  else
127
 
    "$@" -MDupdate "$tmpdepfile"
128
 
  fi
129
 
  stat=$?
130
 
  if test $stat -eq 0; then :
131
 
  else
132
 
    rm -f "$tmpdepfile"
133
 
    exit $stat
134
 
  fi
135
 
  rm -f "$depfile"
136
 
 
137
 
  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
138
 
    echo "$object : \\" > "$depfile"
139
 
 
140
 
    # Clip off the initial element (the dependent).  Don't try to be
141
 
    # clever and replace this with sed code, as IRIX sed won't handle
142
 
    # lines with more than a fixed number of characters (4096 in
143
 
    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
144
 
    # the IRIX cc adds comments like `#:fec' to the end of the
145
 
    # dependency line.
146
 
    tr ' ' '
147
 
' < "$tmpdepfile" \
148
 
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
149
 
    tr '
150
 
' ' ' >> $depfile
151
 
    echo >> $depfile
152
 
 
153
 
    # The second pass generates a dummy entry for each header file.
154
 
    tr ' ' '
155
 
' < "$tmpdepfile" \
156
 
   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
157
 
   >> $depfile
158
 
  else
159
 
    # The sourcefile does not contain any dependencies, so just
160
 
    # store a dummy comment line, to avoid errors with the Makefile
161
 
    # "include basename.Plo" scheme.
162
 
    echo "#dummy" > "$depfile"
163
 
  fi
164
 
  rm -f "$tmpdepfile"
165
 
  ;;
166
 
 
167
 
aix)
168
 
  # The C for AIX Compiler uses -M and outputs the dependencies
169
 
  # in a .u file.  This file always lives in the current directory.
170
 
  # Also, the AIX compiler puts `$object:' at the start of each line;
171
 
  # $object doesn't have directory information.
172
 
  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
173
 
  tmpdepfile="$stripped.u"
174
 
  outname="$stripped.o"
175
 
  if test "$libtool" = yes; then
176
 
    "$@" -Wc,-M
177
 
  else
178
 
    "$@" -M
179
 
  fi
180
 
 
181
 
  stat=$?
182
 
  if test $stat -eq 0; then :
183
 
  else
184
 
    rm -f "$tmpdepfile"
185
 
    exit $stat
186
 
  fi
187
 
 
188
 
  if test -f "$tmpdepfile"; then
189
 
    # Each line is of the form `foo.o: dependent.h'.
190
 
    # Do two passes, one to just change these to
191
 
    # `$object: dependent.h' and one to simply `dependent.h:'.
192
 
    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
193
 
    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
194
 
  else
195
 
    # The sourcefile does not contain any dependencies, so just
196
 
    # store a dummy comment line, to avoid errors with the Makefile
197
 
    # "include basename.Plo" scheme.
198
 
    echo "#dummy" > "$depfile"
199
 
  fi
200
 
  rm -f "$tmpdepfile"
201
 
  ;;
202
 
 
203
 
tru64)
204
 
   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
205
 
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
206
 
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
207
 
   # dependencies in `foo.d' instead, so we check for that too.
208
 
   # Subdirectories are respected.
209
 
 
210
 
   tmpdepfile1="$object.d"
211
 
   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
212
 
   if test "$libtool" = yes; then
213
 
      "$@" -Wc,-MD
214
 
   else
215
 
      "$@" -MD
216
 
   fi
217
 
 
218
 
   stat=$?
219
 
   if test $stat -eq 0; then :
220
 
   else
221
 
      rm -f "$tmpdepfile1" "$tmpdepfile2"
222
 
      exit $stat
223
 
   fi
224
 
 
225
 
   if test -f "$tmpdepfile1"; then
226
 
      tmpdepfile="$tmpdepfile1"
227
 
   else
228
 
      tmpdepfile="$tmpdepfile2"
229
 
   fi
230
 
   if test -f "$tmpdepfile"; then
231
 
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
232
 
      # That's a space and a tab in the [].
233
 
      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
234
 
   else
235
 
      echo "#dummy" > "$depfile"
236
 
   fi
237
 
   rm -f "$tmpdepfile"
238
 
   ;;
239
 
 
240
 
#nosideeffect)
241
 
  # This comment above is used by automake to tell side-effect
242
 
  # dependency tracking mechanisms from slower ones.
243
 
 
244
 
dashmstdout)
245
 
  # Important note: in order to support this mode, a compiler *must*
246
 
  # always write the proprocessed file to stdout, regardless of -o,
247
 
  # because we must use -o when running libtool.
248
 
  test -z "$dashmflag" && dashmflag=-M
249
 
  ( IFS=" "
250
 
    case " $* " in
251
 
    *" --mode=compile "*) # this is libtool, let us make it quiet
252
 
      for arg
253
 
      do # cycle over the arguments
254
 
        case "$arg" in
255
 
        "--mode=compile")
256
 
          # insert --quiet before "--mode=compile"
257
 
          set fnord "$@" --quiet
258
 
          shift # fnord
259
 
          ;;
260
 
        esac
261
 
        set fnord "$@" "$arg"
262
 
        shift # fnord
263
 
        shift # "$arg"
264
 
      done
265
 
      ;;
266
 
    esac
267
 
    "$@" $dashmflag | sed 's:^[^:]*\:[  ]*:'"$object"'\: :' > "$tmpdepfile"
268
 
  ) &
269
 
  proc=$!
270
 
  "$@"
271
 
  stat=$?
272
 
  wait "$proc"
273
 
  if test "$stat" != 0; then exit $stat; fi
274
 
  rm -f "$depfile"
275
 
  cat < "$tmpdepfile" > "$depfile"
276
 
  tr ' ' '
277
 
' < "$tmpdepfile" | \
278
 
## Some versions of the HPUX 10.20 sed can't process this invocation
279
 
## correctly.  Breaking it into two sed invocations is a workaround.
280
 
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
281
 
  rm -f "$tmpdepfile"
282
 
  ;;
283
 
 
284
 
dashXmstdout)
285
 
  # This case only exists to satisfy depend.m4.  It is never actually
286
 
  # run, as this mode is specially recognized in the preamble.
287
 
  exit 1
288
 
  ;;
289
 
 
290
 
makedepend)
291
 
  # X makedepend
292
 
  (
293
 
    shift
294
 
    cleared=no
295
 
    for arg in "$@"; do
296
 
      case $cleared in no)
297
 
        set ""; shift
298
 
        cleared=yes
299
 
      esac
300
 
      case "$arg" in
301
 
        -D*|-I*)
302
 
          set fnord "$@" "$arg"; shift;;
303
 
        -*)
304
 
          ;;
305
 
        *)
306
 
          set fnord "$@" "$arg"; shift;;
307
 
      esac
308
 
    done
309
 
    obj_suffix="`echo $object | sed 's/^.*\././'`"
310
 
    touch "$tmpdepfile"
311
 
    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
312
 
  ) &
313
 
  proc=$!
314
 
  "$@"
315
 
  stat=$?
316
 
  wait "$proc"
317
 
  if test "$stat" != 0; then exit $stat; fi
318
 
  rm -f "$depfile"
319
 
  cat < "$tmpdepfile" > "$depfile"
320
 
  tail +3 "$tmpdepfile" | tr ' ' '
321
 
' | \
322
 
## Some versions of the HPUX 10.20 sed can't process this invocation
323
 
## correctly.  Breaking it into two sed invocations is a workaround.
324
 
    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
325
 
  rm -f "$tmpdepfile" "$tmpdepfile".bak
326
 
  ;;
327
 
 
328
 
cpp)
329
 
  # Important note: in order to support this mode, a compiler *must*
330
 
  # always write the proprocessed file to stdout, regardless of -o,
331
 
  # because we must use -o when running libtool.
332
 
  ( IFS=" "
333
 
    case " $* " in
334
 
    *" --mode=compile "*)
335
 
      for arg
336
 
      do # cycle over the arguments
337
 
        case $arg in
338
 
        "--mode=compile")
339
 
          # insert --quiet before "--mode=compile"
340
 
          set fnord "$@" --quiet
341
 
          shift # fnord
342
 
          ;;
343
 
        esac
344
 
        set fnord "$@" "$arg"
345
 
        shift # fnord
346
 
        shift # "$arg"
347
 
      done
348
 
      ;;
349
 
    esac
350
 
    "$@" -E |
351
 
    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
352
 
    sed '$ s: \\$::' > "$tmpdepfile"
353
 
  ) &
354
 
  proc=$!
355
 
  "$@"
356
 
  stat=$?
357
 
  wait "$proc"
358
 
  if test "$stat" != 0; then exit $stat; fi
359
 
  rm -f "$depfile"
360
 
  echo "$object : \\" > "$depfile"
361
 
  cat < "$tmpdepfile" >> "$depfile"
362
 
  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
363
 
  rm -f "$tmpdepfile"
364
 
  ;;
365
 
 
366
 
msvisualcpp)
367
 
  # Important note: in order to support this mode, a compiler *must*
368
 
  # always write the proprocessed file to stdout, regardless of -o,
369
 
  # because we must use -o when running libtool.
370
 
  ( IFS=" "
371
 
    case " $* " in
372
 
    *" --mode=compile "*)
373
 
      for arg
374
 
      do # cycle over the arguments
375
 
        case $arg in
376
 
        "--mode=compile")
377
 
          # insert --quiet before "--mode=compile"
378
 
          set fnord "$@" --quiet
379
 
          shift # fnord
380
 
          ;;
381
 
        esac
382
 
        set fnord "$@" "$arg"
383
 
        shift # fnord
384
 
        shift # "$arg"
385
 
      done
386
 
      ;;
387
 
    esac
388
 
    "$@" -E |
389
 
    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
390
 
  ) &
391
 
  proc=$!
392
 
  "$@"
393
 
  stat=$?
394
 
  wait "$proc"
395
 
  if test "$stat" != 0; then exit $stat; fi
396
 
  rm -f "$depfile"
397
 
  echo "$object : \\" > "$depfile"
398
 
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"
399
 
  echo "        " >> "$depfile"
400
 
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
401
 
  rm -f "$tmpdepfile"
402
 
  ;;
403
 
 
404
 
none)
405
 
  if test -n "$CYGWIN_INTEL_WINDOWS"; then
406
 
    #echo "Using the intel compiler icl under Windows XP to generate dependency files!" 
407
 
    #exec "$@"
408
 
    # First, generate the dependency file
409
 
    "$@" -QM "$object" -QMM -QMF "$tmpdepfile"
410
 
    # Next, actually compile the source file
411
 
    "$@"
412
 
    stat=$?
413
 
    if test $stat -eq 0; then :
414
 
    else
415
 
     rm -f "$tmpdepfile"
416
 
     exit $stat
417
 
    fi
418
 
    #rm -f "$depfile"
419
 
    echo "$object : \\" > "$depfile"
420
 
    cat "$tmpdepfile" | sed 's%.* \([a-z]\):%/cygdrive/\1%' \
421
 
      | perl -e 'foreach(<STDIN>) { $_=~s%\\%/%g; print $_; }' \
422
 
      | sed 's%\(^.*$\)%\1 \\%' | sed 's%^.*: %%' >> "$depfile"
423
 
    rm -f "$tmpdepfile"
424
 
    # Above I had to use perl since sed would refuse to replace
425
 
    # the file path sep '\' correctly with '/'.
426
 
    # Remove these two commands once you get the above figured out!
427
 
    #mv "$depfile" "$tmpdepfile"
428
 
    #echo "# dummy" > "$depfile"
429
 
  else
430
 
    echo "depcomp: depmode==none, not building in depeandency tracking!"
431
 
    exec "$@"
432
 
  fi
433
 
  ;;
434
 
 
435
 
*)
436
 
  echo "Unknown depmode $depmode" 1>&2
437
 
  exit 1
438
 
  ;;
439
 
esac
440
 
 
441
 
exit 0