| 1 |
|
#! /bin/sh |
| 2 |
|
# ylwrap - wrapper for lex/yacc invocations. |
| 3 |
|
|
| 4 |
< |
scriptversion=2012-12-21.17; # UTC |
| 4 |
> |
scriptversion=2018-03-07.03; # UTC |
| 5 |
|
|
| 6 |
< |
# Copyright (C) 1996-2013 Free Software Foundation, Inc. |
| 6 |
> |
# Copyright (C) 1996-2018 Free Software Foundation, Inc. |
| 7 |
|
# |
| 8 |
|
# Written by Tom Tromey <tromey@cygnus.com>. |
| 9 |
|
# |
| 18 |
|
# GNU General Public License for more details. |
| 19 |
|
# |
| 20 |
|
# You should have received a copy of the GNU General Public License |
| 21 |
< |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 |
> |
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 22 |
|
|
| 23 |
|
# As a special exception to the GNU General Public License, if you |
| 24 |
|
# distribute this file as part of a program that contains a |
| 40 |
|
# guard FILE |
| 41 |
|
# ---------- |
| 42 |
|
# The CPP macro used to guard inclusion of FILE. |
| 43 |
< |
guard() |
| 43 |
> |
guard () |
| 44 |
|
{ |
| 45 |
|
printf '%s\n' "$1" \ |
| 46 |
|
| sed \ |
| 96 |
|
|
| 97 |
|
|
| 98 |
|
# The input. |
| 99 |
< |
input="$1" |
| 99 |
> |
input=$1 |
| 100 |
|
shift |
| 101 |
|
# We'll later need for a correct munging of "#line" directives. |
| 102 |
|
input_sub_rx=`get_dirname "$input" | quote_for_sed` |
| 103 |
< |
case "$input" in |
| 103 |
> |
case $input in |
| 104 |
|
[\\/]* | ?:[\\/]*) |
| 105 |
|
# Absolute path; do nothing. |
| 106 |
|
;; |
| 107 |
|
*) |
| 108 |
|
# Relative path. Make it absolute. |
| 109 |
< |
input="`pwd`/$input" |
| 109 |
> |
input=`pwd`/$input |
| 110 |
|
;; |
| 111 |
|
esac |
| 112 |
|
input_rx=`get_dirname "$input" | quote_for_sed` |
| 132 |
|
# guard in its implementation file. |
| 133 |
|
sed_fix_header_guards= |
| 134 |
|
|
| 135 |
< |
while test "$#" -ne 0; do |
| 136 |
< |
if test "$1" = "--"; then |
| 135 |
> |
while test $# -ne 0; do |
| 136 |
> |
if test x"$1" = x"--"; then |
| 137 |
|
shift |
| 138 |
|
break |
| 139 |
|
fi |
| 153 |
|
done |
| 154 |
|
|
| 155 |
|
# The program to run. |
| 156 |
< |
prog="$1" |
| 156 |
> |
prog=$1 |
| 157 |
|
shift |
| 158 |
|
# Make any relative path in $prog absolute. |
| 159 |
< |
case "$prog" in |
| 159 |
> |
case $prog in |
| 160 |
|
[\\/]* | ?:[\\/]*) ;; |
| 161 |
< |
*[\\/]*) prog="`pwd`/$prog" ;; |
| 161 |
> |
*[\\/]*) prog=`pwd`/$prog ;; |
| 162 |
|
esac |
| 163 |
|
|
| 164 |
– |
# FIXME: add hostname here for parallel makes that run commands on |
| 165 |
– |
# other machines. But that might take us over the 14-char limit. |
| 164 |
|
dirname=ylwrap$$ |
| 165 |
|
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' |
| 166 |
|
trap "ret=129; $do_exit" 1 |
| 186 |
|
# otherwise prepend '../'. |
| 187 |
|
case $to in |
| 188 |
|
[\\/]* | ?:[\\/]*) target=$to;; |
| 189 |
< |
*) target="../$to";; |
| 189 |
> |
*) target=../$to;; |
| 190 |
|
esac |
| 191 |
|
|
| 192 |
|
# Do not overwrite unchanged header files to avoid useless |
| 195 |
|
# output of all other files to a temporary file so we can |
| 196 |
|
# compare them to existing versions. |
| 197 |
|
if test $from != $parser; then |
| 198 |
< |
realtarget="$target" |
| 198 |
> |
realtarget=$target |
| 199 |
|
target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` |
| 200 |
|
fi |
| 201 |
|
|
| 239 |
|
# Local Variables: |
| 240 |
|
# mode: shell-script |
| 241 |
|
# sh-indentation: 2 |
| 242 |
< |
# eval: (add-hook 'write-file-hooks 'time-stamp) |
| 242 |
> |
# eval: (add-hook 'before-save-hook 'time-stamp) |
| 243 |
|
# time-stamp-start: "scriptversion=" |
| 244 |
|
# time-stamp-format: "%:y-%02m-%02d.%02H" |
| 245 |
< |
# time-stamp-time-zone: "UTC" |
| 245 |
> |
# time-stamp-time-zone: "UTC0" |
| 246 |
|
# time-stamp-end: "; # UTC" |
| 247 |
|
# End: |