/[svn]/ircd-hybrid/trunk/ylwrap
ViewVC logotype

Diff of /ircd-hybrid/trunk/ylwrap

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

revision 2346 by michael, Sun Jan 6 11:27:11 2013 UTC revision 2347 by michael, Wed Jul 3 19:09:32 2013 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2  # ylwrap - wrapper for lex/yacc invocations.  # ylwrap - wrapper for lex/yacc invocations.
3    
4  scriptversion=2012-12-21.17; # UTC  scriptversion=2013-01-12.17; # UTC
5    
6  # Copyright (C) 1996-2013 Free Software Foundation, Inc.  # Copyright (C) 1996-2013 Free Software Foundation, Inc.
7  #  #
# Line 40  get_dirname () Line 40  get_dirname ()
40  # guard FILE  # guard FILE
41  # ----------  # ----------
42  # The CPP macro used to guard inclusion of FILE.  # The CPP macro used to guard inclusion of FILE.
43  guard()  guard ()
44  {  {
45    printf '%s\n' "$1"                                                    \    printf '%s\n' "$1"                                                    \
46      | sed                                                               \      | sed                                                               \
# Line 96  esac Line 96  esac
96    
97    
98  # The input.  # The input.
99  input="$1"  input=$1
100  shift  shift
101  # We'll later need for a correct munging of "#line" directives.  # We'll later need for a correct munging of "#line" directives.
102  input_sub_rx=`get_dirname "$input" | quote_for_sed`  input_sub_rx=`get_dirname "$input" | quote_for_sed`
103  case "$input" in  case $input in
104    [\\/]* | ?:[\\/]*)    [\\/]* | ?:[\\/]*)
105      # Absolute path; do nothing.      # Absolute path; do nothing.
106      ;;      ;;
107    *)    *)
108      # Relative path.  Make it absolute.      # Relative path.  Make it absolute.
109      input="`pwd`/$input"      input=`pwd`/$input
110      ;;      ;;
111  esac  esac
112  input_rx=`get_dirname "$input" | quote_for_sed`  input_rx=`get_dirname "$input" | quote_for_sed`
# Line 132  sed_fix_filenames= Line 132  sed_fix_filenames=
132  # guard in its implementation file.  # guard in its implementation file.
133  sed_fix_header_guards=  sed_fix_header_guards=
134    
135  while test "$#" -ne 0; do  while test $# -ne 0; do
136    if test "$1" = "--"; then    if test x"$1" = x"--"; then
137      shift      shift
138      break      break
139    fi    fi
# Line 153  while test "$#" -ne 0; do Line 153  while test "$#" -ne 0; do
153  done  done
154    
155  # The program to run.  # The program to run.
156  prog="$1"  prog=$1
157  shift  shift
158  # Make any relative path in $prog absolute.  # Make any relative path in $prog absolute.
159  case "$prog" in  case $prog in
160    [\\/]* | ?:[\\/]*) ;;    [\\/]* | ?:[\\/]*) ;;
161    *[\\/]*) prog="`pwd`/$prog" ;;    *[\\/]*) prog=`pwd`/$prog ;;
162  esac  esac
163    
 # FIXME: add hostname here for parallel makes that run commands on  
 # other machines.  But that might take us over the 14-char limit.  
164  dirname=ylwrap$$  dirname=ylwrap$$
165  do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'  do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
166  trap "ret=129; $do_exit" 1  trap "ret=129; $do_exit" 1
# Line 188  if test $ret -eq 0; then Line 186  if test $ret -eq 0; then
186        # otherwise prepend '../'.        # otherwise prepend '../'.
187        case $to in        case $to in
188          [\\/]* | ?:[\\/]*) target=$to;;          [\\/]* | ?:[\\/]*) target=$to;;
189          *) target="../$to";;          *) target=../$to;;
190        esac        esac
191    
192        # Do not overwrite unchanged header files to avoid useless        # Do not overwrite unchanged header files to avoid useless
# Line 197  if test $ret -eq 0; then Line 195  if test $ret -eq 0; then
195        # output of all other files to a temporary file so we can        # output of all other files to a temporary file so we can
196        # compare them to existing versions.        # compare them to existing versions.
197        if test $from != $parser; then        if test $from != $parser; then
198          realtarget="$target"          realtarget=$target
199          target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`          target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
200        fi        fi
201    

Legend:
Removed from v.2346  
changed lines
  Added in v.2347

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