/[svn]/ircd-hybrid-8/depcomp
ViewVC logotype

Diff of /ircd-hybrid-8/depcomp

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

revision 1156 by michael, Tue Aug 9 20:29:20 2011 UTC revision 1257 by michael, Sun Jan 15 06:28:46 2012 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2  # depcomp - compile a program generating dependencies as side-effects  # depcomp - compile a program generating dependencies as side-effects
3    
4  scriptversion=2009-04-28.21; # UTC  scriptversion=2011-12-04.11; # UTC
5    
6  # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free  # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
7  # Software Foundation, Inc.  # 2011 Free Software Foundation, Inc.
8    
9  # This program is free software; you can redistribute it and/or modify  # This program is free software; you can redistribute it and/or modify
10  # it under the terms of the GNU General Public License as published by  # it under the terms of the GNU General Public License as published by
# Line 44  Environment variables: Line 44  Environment variables:
44    object      Object file output by `PROGRAMS ARGS'.    object      Object file output by `PROGRAMS ARGS'.
45    DEPDIR      directory where to store dependencies.    DEPDIR      directory where to store dependencies.
46    depfile     Dependency file to output.    depfile     Dependency file to output.
47    tmpdepfile  Temporary file to use when outputing dependencies.    tmpdepfile  Temporary file to use when outputting dependencies.
48    libtool     Whether libtool is used (yes/no).    libtool     Whether libtool is used (yes/no).
49    
50  Report bugs to <bug-automake@gnu.org>.  Report bugs to <bug-automake@gnu.org>.
# Line 90  if test "$depmode" = msvcmsys; then Line 90  if test "$depmode" = msvcmsys; then
90     # This is just like msvisualcpp but w/o cygpath translation.     # This is just like msvisualcpp but w/o cygpath translation.
91     # Just convert the backslash-escaped backslashes to single forward     # Just convert the backslash-escaped backslashes to single forward
92     # slashes to satisfy depend.m4     # slashes to satisfy depend.m4
93     cygpath_u="sed s,\\\\\\\\,/,g"     cygpath_u='sed s,\\\\,/,g'
94     depmode=msvisualcpp     depmode=msvisualcpp
95  fi  fi
96    
97    if test "$depmode" = msvc7msys; then
98       # This is just like msvc7 but w/o cygpath translation.
99       # Just convert the backslash-escaped backslashes to single forward
100       # slashes to satisfy depend.m4
101       cygpath_u='sed s,\\\\,/,g'
102       depmode=msvc7
103    fi
104    
105  case "$depmode" in  case "$depmode" in
106  gcc3)  gcc3)
107  ## gcc 3 implements dependency tracking that does exactly what  ## gcc 3 implements dependency tracking that does exactly what
# Line 158  gcc) Line 166  gcc)
166  ' < "$tmpdepfile" |  ' < "$tmpdepfile" |
167  ## Some versions of gcc put a space before the `:'.  On the theory  ## Some versions of gcc put a space before the `:'.  On the theory
168  ## that the space means something, we add a space to the output as  ## that the space means something, we add a space to the output as
169  ## well.  ## well.  hp depmode also adds that space, but also prefixes the VPATH
170    ## to the object.  Take care to not repeat it in the output.
171  ## 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
172  ## correctly.  Breaking it into two sed invocations is a workaround.  ## correctly.  Breaking it into two sed invocations is a workaround.
173      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"      sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
174          | sed -e 's/$/ :/' >> "$depfile"
175    rm -f "$tmpdepfile"    rm -f "$tmpdepfile"
176    ;;    ;;
177    
# Line 405  tru64) Line 415  tru64)
415     rm -f "$tmpdepfile"     rm -f "$tmpdepfile"
416     ;;     ;;
417    
418    msvc7)
419      if test "$libtool" = yes; then
420        showIncludes=-Wc,-showIncludes
421      else
422        showIncludes=-showIncludes
423      fi
424      "$@" $showIncludes > "$tmpdepfile"
425      stat=$?
426      grep -v '^Note: including file: ' "$tmpdepfile"
427      if test "$stat" = 0; then :
428      else
429        rm -f "$tmpdepfile"
430        exit $stat
431      fi
432      rm -f "$depfile"
433      echo "$object : \\" > "$depfile"
434      # The first sed program below extracts the file names and escapes
435      # backslashes for cygpath.  The second sed program outputs the file
436      # name when reading, but also accumulates all include files in the
437      # hold buffer in order to output them again at the end.  This only
438      # works with sed implementations that can handle large buffers.
439      sed < "$tmpdepfile" -n '
440    /^Note: including file:  *\(.*\)/ {
441      s//\1/
442      s/\\/\\\\/g
443      p
444    }' | $cygpath_u | sort -u | sed -n '
445    s/ /\\ /g
446    s/\(.*\)/       \1 \\/p
447    s/.\(.*\) \\/\1:/
448    H
449    $ {
450      s/.*/ /
451      G
452      p
453    }' >> "$depfile"
454      rm -f "$tmpdepfile"
455      ;;
456    
457    msvc7msys)
458      # This case exists only to let depend.m4 do its work.  It works by
459      # looking at the text of this script.  This case will never be run,
460      # since it is checked for above.
461      exit 1
462      ;;
463    
464  #nosideeffect)  #nosideeffect)
465    # This comment above is used by automake to tell side-effect    # This comment above is used by automake to tell side-effect
466    # dependency tracking mechanisms from slower ones.    # dependency tracking mechanisms from slower ones.
# Line 503  makedepend) Line 559  makedepend)
559    touch "$tmpdepfile"    touch "$tmpdepfile"
560    ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"    ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
561    rm -f "$depfile"    rm -f "$depfile"
562    cat < "$tmpdepfile" > "$depfile"    # makedepend may prepend the VPATH from the source file name to the object.
563      # No need to regex-escape $object, excess matching of '.' is harmless.
564      sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
565    sed '1,2d' "$tmpdepfile" | tr ' ' '    sed '1,2d' "$tmpdepfile" | tr ' ' '
566  ' | \  ' | \
567  ## 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

Legend:
Removed from v.1156  
changed lines
  Added in v.1257

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28