/[classpath]/classpath/depcomp
ViewVC logotype

Diff of /classpath/depcomp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by cbj, Mon Nov 5 02:59:24 2001 UTC revision 1.2 by cbj, Fri Jan 10 16:49:15 2003 UTC
# Line 31  if test -z "$depmode" || test -z "$sourc Line 31  if test -z "$depmode" || test -z "$sourc
31  fi  fi
32  # `libtool' can also be set to `yes' or `no'.  # `libtool' can also be set to `yes' or `no'.
33    
34  depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}  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    
44  tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}  tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
45    
46  rm -f "$tmpdepfile"  rm -f "$tmpdepfile"
# Line 198  aix) Line 207  aix)
207    ;;    ;;
208    
209  tru64)  tru64)
210     # The Tru64 AIX compiler uses -MD to generate dependencies as a side     # The Tru64 compiler uses -MD to generate dependencies as a side
211     # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.     # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
212     # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put     # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
213     # dependencies in `foo.d' instead, so we check for that too.     # dependencies in `foo.d' instead, so we check for that too.
214     # Subdirectories are respected.     # Subdirectories are respected.
215       dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
216       test "x$dir" = "x$object" && dir=
217       base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
218    
    tmpdepfile1="$object.d"  
    tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`  
219     if test "$libtool" = yes; then     if test "$libtool" = yes; then
220          tmpdepfile1="$dir.libs/$base.lo.d"
221          tmpdepfile2="$dir.libs/$base.d"
222        "$@" -Wc,-MD        "$@" -Wc,-MD
223     else     else
224          tmpdepfile1="$dir$base.o.d"
225          tmpdepfile2="$dir$base.d"
226        "$@" -MD        "$@" -MD
227     fi     fi
228    
# Line 240  tru64) Line 254  tru64)
254    
255  dashmstdout)  dashmstdout)
256    # Important note: in order to support this mode, a compiler *must*    # Important note: in order to support this mode, a compiler *must*
257    # always write the proprocessed file to stdout, regardless of -o,    # always write the proprocessed file to stdout, regardless of -o.
258    # because we must use -o when running libtool.    "$@" || exit $?
259    test -z "$dashmflag" && dashmflag=-M  
260    ( IFS=" "    # Remove the call to Libtool.
261      case " $* " in    if test "$libtool" = yes; then
262      *" --mode=compile "*) # this is libtool, let us make it quiet      while test $1 != '--mode=compile'; do
263        for arg        shift
264        do # cycle over the arguments      done
265          case "$arg" in      shift
266          "--mode=compile")    fi
267            # insert --quiet before "--mode=compile"  
268            set fnord "$@" --quiet    # Remove `-o $object'.  We will use -o /dev/null later,
269            shift # fnord    # however we can't do the remplacement now because
270            ;;    # `-o $object' might simply not be used
271          esac    IFS=" "
272          set fnord "$@" "$arg"    for arg
273          shift # fnord    do
274          shift # "$arg"      case $arg in
275        done      -o)
276          shift
277          ;;
278        $object)
279          shift
280          ;;
281        *)
282          set fnord "$@" "$arg"
283          shift # fnord
284          shift # $arg
285        ;;        ;;
286      esac      esac
287      "$@" $dashmflag | sed 's:^[^:]*\:[  ]*:'"$object"'\: :' > "$tmpdepfile"    done
288    ) &  
289    proc=$!    test -z "$dashmflag" && dashmflag=-M
290    "$@"    "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[       ]*:'"$object"'\: :' > "$tmpdepfile"
   stat=$?  
   wait "$proc"  
   if test "$stat" != 0; then exit $stat; fi  
291    rm -f "$depfile"    rm -f "$depfile"
292    cat < "$tmpdepfile" > "$depfile"    cat < "$tmpdepfile" > "$depfile"
293    tr ' ' '    tr ' ' '
# Line 285  dashXmstdout) Line 305  dashXmstdout)
305    ;;    ;;
306    
307  makedepend)  makedepend)
308      "$@" || exit $?
309    # X makedepend    # X makedepend
310    (    shift
311      shift    cleared=no
312      cleared=no    for arg in "$@"; do
313      for arg in "$@"; do      case $cleared in
314        case $cleared in no)      no)
315          set ""; shift        set ""; shift
316          cleared=yes        cleared=yes ;;
317        esac      esac
318        case "$arg" in      case "$arg" in
319          -D*|-I*)      -D*|-I*)
320            set fnord "$@" "$arg"; shift;;        set fnord "$@" "$arg"; shift ;;
321          -*)      -*)
322            ;;        ;;
323          *)      *)
324            set fnord "$@" "$arg"; shift;;        set fnord "$@" "$arg"; shift ;;
325        esac      esac
326      done    done
327      obj_suffix="`echo $object | sed 's/^.*\././'`"    obj_suffix="`echo $object | sed 's/^.*\././'`"
328      touch "$tmpdepfile"    touch "$tmpdepfile"
329      ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"    ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   ) &  
   proc=$!  
   "$@"  
   stat=$?  
   wait "$proc"  
   if test "$stat" != 0; then exit $stat; fi  
330    rm -f "$depfile"    rm -f "$depfile"
331    cat < "$tmpdepfile" > "$depfile"    cat < "$tmpdepfile" > "$depfile"
332    tail +3 "$tmpdepfile" | tr ' ' '    sed '1,2d' "$tmpdepfile" | tr ' ' '
333  ' | \  ' | \
334  ## Some versions of the HPUX 10.20 sed can't process this invocation  ## Some versions of the HPUX 10.20 sed can't process this invocation
335  ## correctly.  Breaking it into two sed invocations is a workaround.  ## correctly.  Breaking it into two sed invocations is a workaround.
# Line 324  makedepend) Line 339  makedepend)
339    
340  cpp)  cpp)
341    # Important note: in order to support this mode, a compiler *must*    # Important note: in order to support this mode, a compiler *must*
342    # always write the proprocessed file to stdout, regardless of -o,    # always write the proprocessed file to stdout.
343    # because we must use -o when running libtool.    "$@" || exit $?
344    ( IFS=" "  
345      case " $* " in    # Remove the call to Libtool.
346      *" --mode=compile "*)    if test "$libtool" = yes; then
347        for arg      while test $1 != '--mode=compile'; do
348        do # cycle over the arguments        shift
349          case $arg in      done
350          "--mode=compile")      shift
351            # insert --quiet before "--mode=compile"    fi
352            set fnord "$@" --quiet  
353            shift # fnord    # Remove `-o $object'.
354            ;;    IFS=" "
355          esac    for arg
356          set fnord "$@" "$arg"    do
357          shift # fnord      case $arg in
358          shift # "$arg"      -o)
359        done        shift
360          ;;
361        $object)
362          shift
363          ;;
364        *)
365          set fnord "$@" "$arg"
366          shift # fnord
367          shift # $arg
368        ;;        ;;
369      esac      esac
370      "$@" -E |    done
371    
372      "$@" -E |
373      sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |      sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
374      sed '$ s: \\$::' > "$tmpdepfile"      sed '$ s: \\$::' > "$tmpdepfile"
   ) &  
   proc=$!  
   "$@"  
   stat=$?  
   wait "$proc"  
   if test "$stat" != 0; then exit $stat; fi  
375    rm -f "$depfile"    rm -f "$depfile"
376    echo "$object : \\" > "$depfile"    echo "$object : \\" > "$depfile"
377    cat < "$tmpdepfile" >> "$depfile"    cat < "$tmpdepfile" >> "$depfile"
# Line 364  msvisualcpp) Line 383  msvisualcpp)
383    # Important note: in order to support this mode, a compiler *must*    # Important note: in order to support this mode, a compiler *must*
384    # always write the proprocessed file to stdout, regardless of -o,    # always write the proprocessed file to stdout, regardless of -o,
385    # because we must use -o when running libtool.    # because we must use -o when running libtool.
386    ( IFS=" "    "$@" || exit $?
387      case " $* " in    IFS=" "
388      *" --mode=compile "*)    for arg
389        for arg    do
390        do # cycle over the arguments      case "$arg" in
391          case $arg in      "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
392          "--mode=compile")          set fnord "$@"
393            # insert --quiet before "--mode=compile"          shift
394            set fnord "$@" --quiet          shift
395            shift # fnord          ;;
396            ;;      *)
         esac  
397          set fnord "$@" "$arg"          set fnord "$@" "$arg"
398          shift # fnord          shift
399          shift # "$arg"          shift
400        done          ;;
       ;;  
401      esac      esac
402      "$@" -E |    done
403      sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"    "$@" -E |
404    ) &    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
   proc=$!  
   "$@"  
   stat=$?  
   wait "$proc"  
   if test "$stat" != 0; then exit $stat; fi  
405    rm -f "$depfile"    rm -f "$depfile"
406    echo "$object : \\" > "$depfile"    echo "$object : \\" > "$depfile"
407    . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"    . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26