head	1.2;
access;
symbols
	RELENG_8_4:1.2.0.8
	RELENG_9_1_0_RELEASE:1.2
	RELENG_9_1:1.2.0.6
	RELENG_9_1_BP:1.2
	RELENG_8_3_0_RELEASE:1.1.1.2
	RELENG_8_3:1.1.1.2.0.48
	RELENG_8_3_BP:1.1.1.2
	RELENG_9_0_0_RELEASE:1.2
	RELENG_9_0:1.2.0.4
	RELENG_9_0_BP:1.2
	RELENG_9:1.2.0.2
	RELENG_9_BP:1.2
	RELENG_7_4_0_RELEASE:1.1.1.2
	RELENG_8_2_0_RELEASE:1.1.1.2
	RELENG_7_4:1.1.1.2.0.46
	RELENG_7_4_BP:1.1.1.2
	RELENG_8_2:1.1.1.2.0.44
	RELENG_8_2_BP:1.1.1.2
	RELENG_8_1_0_RELEASE:1.1.1.2
	RELENG_8_1:1.1.1.2.0.42
	RELENG_8_1_BP:1.1.1.2
	RELENG_7_3_0_RELEASE:1.1.1.2
	RELENG_7_3:1.1.1.2.0.40
	RELENG_7_3_BP:1.1.1.2
	RELENG_8_0_0_RELEASE:1.1.1.2
	RELENG_8_0:1.1.1.2.0.38
	RELENG_8_0_BP:1.1.1.2
	RELENG_8:1.1.1.2.0.36
	RELENG_8_BP:1.1.1.2
	RELENG_7_2_0_RELEASE:1.1.1.2
	RELENG_7_2:1.1.1.2.0.34
	RELENG_7_2_BP:1.1.1.2
	RELENG_7_1_0_RELEASE:1.1.1.2
	RELENG_6_4_0_RELEASE:1.1.1.2
	RELENG_7_1:1.1.1.2.0.32
	RELENG_7_1_BP:1.1.1.2
	RELENG_6_4:1.1.1.2.0.30
	RELENG_6_4_BP:1.1.1.2
	RELENG_7_0_0_RELEASE:1.1.1.2
	RELENG_6_3_0_RELEASE:1.1.1.2
	RELENG_7_0:1.1.1.2.0.28
	RELENG_7_0_BP:1.1.1.2
	RELENG_6_3:1.1.1.2.0.26
	RELENG_6_3_BP:1.1.1.2
	RELENG_7:1.1.1.2.0.24
	RELENG_7_BP:1.1.1.2
	RELENG_6_2_0_RELEASE:1.1.1.2
	RELENG_6_2:1.1.1.2.0.22
	RELENG_6_2_BP:1.1.1.2
	RELENG_5_5_0_RELEASE:1.1.1.2
	RELENG_5_5:1.1.1.2.0.20
	RELENG_5_5_BP:1.1.1.2
	RELENG_6_1_0_RELEASE:1.1.1.2
	RELENG_6_1:1.1.1.2.0.18
	RELENG_6_1_BP:1.1.1.2
	RELENG_6_0_0_RELEASE:1.1.1.2
	RELENG_6_0:1.1.1.2.0.16
	RELENG_6_0_BP:1.1.1.2
	RELENG_6:1.1.1.2.0.14
	RELENG_6_BP:1.1.1.2
	RELENG_5_4_0_RELEASE:1.1.1.2
	RELENG_5_4:1.1.1.2.0.12
	RELENG_5_4_BP:1.1.1.2
	RELENG_4_11_0_RELEASE:1.1.1.1.6.1
	RELENG_4_11:1.1.1.1.6.1.0.18
	RELENG_4_11_BP:1.1.1.1.6.1
	RELENG_5_3_0_RELEASE:1.1.1.2
	RELENG_5_3:1.1.1.2.0.10
	RELENG_5_3_BP:1.1.1.2
	RELENG_5:1.1.1.2.0.8
	RELENG_5_BP:1.1.1.2
	binutils_2_15_20040523:1.1.1.2
	RELENG_4_10_0_RELEASE:1.1.1.1.6.1
	RELENG_4_10:1.1.1.1.6.1.0.16
	RELENG_4_10_BP:1.1.1.1.6.1
	RELENG_5_2_1_RELEASE:1.1.1.2
	RELENG_5_2_0_RELEASE:1.1.1.2
	RELENG_5_2:1.1.1.2.0.6
	RELENG_5_2_BP:1.1.1.2
	RELENG_4_9_0_RELEASE:1.1.1.1.6.1
	RELENG_4_9:1.1.1.1.6.1.0.14
	RELENG_4_9_BP:1.1.1.1.6.1
	RELENG_5_1_0_RELEASE:1.1.1.2
	RELENG_5_1:1.1.1.2.0.4
	RELENG_5_1_BP:1.1.1.2
	RELENG_4_8_0_RELEASE:1.1.1.1.6.1
	RELENG_4_8:1.1.1.1.6.1.0.12
	RELENG_4_8_BP:1.1.1.1.6.1
	RELENG_5_0_0_RELEASE:1.1.1.2
	RELENG_5_0:1.1.1.2.0.2
	RELENG_5_0_BP:1.1.1.2
	binutils_2_13_2_20021127:1.1.1.2
	binutils_2_13_20021011:1.1.1.2
	RELENG_4_7_0_RELEASE:1.1.1.1.6.1
	RELENG_4_7:1.1.1.1.6.1.0.10
	RELENG_4_7_BP:1.1.1.1.6.1
	BEFORE_BU_2121__RELENG4:1.1.1.1.6.1
	binutils_2_12_20020720:1.1.1.2
	RELENG_4_6_2_RELEASE:1.1.1.1.6.1
	RELENG_4_6_1_RELEASE:1.1.1.1.6.1
	binutils_2_12_20020622:1.1.1.2
	RELENG_4_6_0_RELEASE:1.1.1.1.6.1
	RELENG_4_6:1.1.1.1.6.1.0.8
	RELENG_4_6_BP:1.1.1.1.6.1
	binutils_2_12_20020410:1.1.1.2
	BEFORE_BU_2_12:1.1.1.2
	binutils_2_12_anoncvs_20020320:1.1.1.2
	binutils_2_12_anoncvs_20020221:1.1.1.2
	RELENG_4_5_0_RELEASE:1.1.1.1.6.1
	binutils_anoncvs_20020127:1.1.1.2
	RELENG_4_5:1.1.1.1.6.1.0.6
	RELENG_4_5_BP:1.1.1.1.6.1
	binutils_2_11_cvs_20011031:1.1.1.2
	RELENG_4_4_0_RELEASE:1.1.1.1.6.1
	RELENG_4_4:1.1.1.1.6.1.0.4
	RELENG_4_4_BP:1.1.1.1.6.1
	BEFORE_BU_2112__RELENG4:1.1.1.1.6.1
	binutils_2_11_cvs_20010719:1.1.1.2
	binutils_2_11_2:1.1.1.2
	binutils_2_11_0:1.1.1.2
	BEFORE_BU_2110:1.1.1.2
	RELENG_4_3_0_RELEASE:1.1.1.1.6.1
	RELENG_4_3:1.1.1.1.6.1.0.2
	RELENG_4_3_BP:1.1.1.1.6.1
	RELENG_4_2_0_RELEASE:1.1.1.1.6.1
	binutils_2_10_1:1.1.1.2
	RELENG_4_1_1_RELEASE:1.1.1.1.6.1
	PRE_SMPNG:1.1.1.2
	RELENG_4_1_0_RELEASE:1.1.1.1.6.1
	RELENG_3_5_0_RELEASE:1.1.1.1
	binutils_2_10_0:1.1.1.2
	BEFORE_UPGRADING_2_9_1:1.1.1.1
	sourceware_binutils-2_10-branch_anoncvs_20000512:1.1.1.2
	RELENG_4_0_0_RELEASE:1.1.1.1
	RELENG_4:1.1.1.1.0.6
	RELENG_4_BP:1.1.1.1
	RELENG_3_4_0_RELEASE:1.1.1.1
	RELENG_3_3_0_RELEASE:1.1.1.1
	RELENG_3_2_PAO:1.1.1.1.0.4
	RELENG_3_2_PAO_BP:1.1.1.1
	RELENG_3_2_0_RELEASE:1.1.1.1
	RELENG_3_1_0_RELEASE:1.1.1.1
	RELENG_3:1.1.1.1.0.2
	RELENG_3_BP:1.1.1.1
	RELENG_3_0_0_RELEASE:1.1.1.1
	gnu_2_9_1:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2011.02.18.20.54.12;	author dim;	state Exp;
branches
	1.2.8.1;
next	1.1;

1.1
date	98.09.06.22.56.53;	author jdp;	state Exp;
branches
	1.1.1.1;
next	;

1.2.8.1
date	2011.02.18.20.54.12;	author svnexp;	state dead;
branches;
next	1.2.8.2;

1.2.8.2
date	2013.03.28.13.00.27;	author svnexp;	state Exp;
branches;
next	;

1.1.1.1
date	98.09.06.22.56.53;	author jdp;	state Exp;
branches
	1.1.1.1.6.1;
next	1.1.1.2;

1.1.1.2
date	2000.05.12.23.14.28;	author obrien;	state Exp;
branches;
next	;

1.1.1.1.6.1
date	2000.07.07.05.33.01;	author obrien;	state Exp;
branches;
next	;


desc
@@


1.2
log
@SVN rev 218822 on 2011-02-18 20:54:12Z by dim

Merge binutils 2.17.50 to head.  This brings a number of improvements to
x86 CPU support, better support for powerpc64, some new directives, and
many other things.  Bump __FreeBSD_version, and add a note to UPDATING.

Thanks to the many people that have helped to test this.

Obtained from:	projects/binutils-2.17
@
text
@#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.

scriptversion=2005-05-14.22

# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
#   Free Software Foundation, Inc.
#
# Written by Tom Tromey <tromey@@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

# This file is maintained in Automake, please report
# bugs to <bug-automake@@gnu.org> or send patches to
# <automake-patches@@gnu.org>.

case "$1" in
  '')
    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
    exit 1
    ;;
  --basedir)
    basedir=$2
    shift 2
    ;;
  -h|--h*)
    cat <<\EOF
Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...

Wrapper for lex/yacc invocations, renaming files as desired.

  INPUT is the input file
  OUTPUT is one file PROG generates
  DESIRED is the file we actually want instead of OUTPUT
  PROGRAM is program to run
  ARGS are passed to PROG

Any number of OUTPUT,DESIRED pairs may be used.

Report bugs to <bug-automake@@gnu.org>.
EOF
    exit $?
    ;;
  -v|--v*)
    echo "ylwrap $scriptversion"
    exit $?
    ;;
esac


# The input.
input="$1"
shift
case "$input" in
  [\\/]* | ?:[\\/]*)
    # Absolute path; do nothing.
    ;;
  *)
    # Relative path.  Make it absolute.
    input="`pwd`/$input"
    ;;
esac

pairlist=
while test "$#" -ne 0; do
  if test "$1" = "--"; then
    shift
    break
  fi
  pairlist="$pairlist $1"
  shift
done

# The program to run.
prog="$1"
shift
# Make any relative path in $prog absolute.
case "$prog" in
  [\\/]* | ?:[\\/]*) ;;
  *[\\/]*) prog="`pwd`/$prog" ;;
esac

# FIXME: add hostname here for parallel makes that run commands on
# other machines.  But that might take us over the 14-char limit.
dirname=ylwrap$$
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1

cd $dirname

case $# in
  0) $prog "$input" ;;
  *) $prog "$@@" "$input" ;;
esac
ret=$?

if test $ret -eq 0; then
  set X $pairlist
  shift
  first=yes
  # Since DOS filename conventions don't allow two dots,
  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
  y_tab_nodot="no"
  if test -f y_tab.c || test -f y_tab.h; then
    y_tab_nodot="yes"
  fi

  # The directory holding the input.
  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
  # Quote $INPUT_DIR so we can use it in a regexp.
  # FIXME: really we should care about more than `.' and `\'.
  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`

  while test "$#" -ne 0; do
    from="$1"
    # Handle y_tab.c and y_tab.h output by DOS
    if test $y_tab_nodot = "yes"; then
      if test $from = "y.tab.c"; then
    	from="y_tab.c"
      else
    	if test $from = "y.tab.h"; then
    	  from="y_tab.h"
    	fi
      fi
    fi
    if test -f "$from"; then
      # If $2 is an absolute path name, then just use that,
      # otherwise prepend `../'.
      case "$2" in
    	[\\/]* | ?:[\\/]*) target="$2";;
    	*) target="../$2";;
      esac

      # We do not want to overwrite a header file if it hasn't
      # changed.  This avoid useless recompilations.  However the
      # parser itself (the first file) should always be updated,
      # because it is the destination of the .y.c rule in the
      # Makefile.  Divert the output of all other files to a temporary
      # file so we can compare them to existing versions.
      if test $first = no; then
	realtarget="$target"
	target="tmp-`echo $target | sed s/.*[\\/]//g`"
      fi
      # Edit out `#line' or `#' directives.
      #
      # We don't want the resulting debug information to point at
      # an absolute srcdir; it is better for it to just mention the
      # .y file with no path.
      #
      # We want to use the real output file name, not yy.lex.c for
      # instance.
      #
      # We want the include guards to be adjusted too.
      FROM=`echo "$from" | sed \
            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
      TARGET=`echo "$2" | sed \
            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`

      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?

      # Check whether header files must be updated.
      if test $first = no; then
	if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
	  echo "$2" is unchanged
	  rm -f "$target"
	else
          echo updating "$2"
          mv -f "$target" "$realtarget"
        fi
      fi
    else
      # A missing file is only an error for the first file.  This
      # is a blatant hack to let us support using "yacc -d".  If -d
      # is not specified, we don't want an error when the header
      # file is "missing".
      if test $first = yes; then
        ret=1
      fi
    fi
    shift
    shift
    first=no
  done
else
  ret=$?
fi

# Remove the directory.
cd ..
rm -rf $dirname

exit $ret

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
@


1.2.8.1
log
@file ylwrap was added on branch RELENG_8_4 on 2013-03-28 13:00:27 +0000
@
text
@d1 223
@


1.2.8.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 123
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# Usage:
#     ylwrap PROGRAM INPUT [OUTPUT DESIRED]... -- [ARGS]...
# * PROGRAM is program to run.
# * INPUT is the input file
# * OUTPUT is file PROG generates
# * DESIRED is file we actually want
# * ARGS are passed to PROG
# Any number of OUTPUT,DESIRED pairs may be used.

# The program to run.
prog="$1"
shift
# Make any relative path in $prog absolute.
case "$prog" in
 /* | [A-Za-z]:\\*) ;;
 */*) prog="`pwd`/$prog" ;;
esac

# The input.
input="$1"
shift
case "$input" in
 /* | [A-Za-z]:\\*)
    # Absolute path; do nothing.
    ;;
 *)
    # Relative path.  Make it absolute.  Why?  Because otherwise any
    # debugging info in the generated file will point to the wrong
    # place.  This is really gross.
    input="`pwd`/$input"
    ;;
esac

# We don't want to use the absolute path if the input in the current
# directory like when making a tar ball.
input_base=`echo $input | sed -e 's|.*/||'`
if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then
  input=$input_base
fi

pairlist=
while test "$#" -ne 0; do
   if test "$1" = "--"; then
      shift
      break
   fi
   pairlist="$pairlist $1"
   shift
done

# FIXME: add hostname here for parallel makes that run commands on
# other machines.  But that might take us over the 14-char limit.
dirname=ylwrap$$
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1

cd $dirname
case "$input" in
 /* | [A-Za-z]:\\*)
    # Absolute path; do nothing.
    ;;
 *)
    # Make a symbolic link, hard link or hardcopy.
    ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" .
    ;;
esac
$prog ${1+"$@@"} "$input"
status=$?

if test $status -eq 0; then
   set X $pairlist
   shift
   first=yes
   while test "$#" -ne 0; do
      if test -f "$1"; then
         # If $2 is an absolute path name, then just use that,
         # otherwise prepend `../'.
         case "$2" in
	   /* | [A-Za-z]:\\*) target="$2";;
	   *) target="../$2";;
	 esac
	 mv "$1" "$target" || status=$?
      else
	 # A missing file is only an error for the first file.  This
	 # is a blatant hack to let us support using "yacc -d".  If -d
	 # is not specified, we don't want an error when the header
	 # file is "missing".
	 if test $first = yes; then
	    status=1
	 fi
      fi
      shift
      shift
      first=no
   done
else
   status=$?
fi

# Remove the directory.
cd ..
rm -rf $dirname

exit $status
@


1.1
log
@Initial revision
@
text
@d3 6
a8 1
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
d23 2
a24 1
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
d26 41
a66 8
# Usage:
#     ylwrap PROGRAM INPUT [OUTPUT DESIRED]... -- [ARGS]...
# * PROGRAM is program to run.
# * INPUT is the input file
# * OUTPUT is file PROG generates
# * DESIRED is file we actually want
# * ARGS are passed to PROG
# Any number of OUTPUT,DESIRED pairs may be used.
a67 8
# The program to run.
prog="$1"
shift
# Make any relative path in $prog absolute.
case "$prog" in
 /*) ;;
 */*) prog="`pwd`/$prog" ;;
esac
d73 1
a73 1
 /*)
d76 2
a77 4
 *)
    # Relative path.  Make it absolute.  Why?  Because otherwise any
    # debugging info in the generated file will point to the wrong
    # place.  This is really gross.
d84 6
a89 6
   if test "$1" = "--"; then
      shift
      break
   fi
   pairlist="$pairlist $1"
   shift
d92 9
a107 2
$prog ${1+"$@@"} "$input"
status=$?
d109 30
a138 13
if test $status -eq 0; then
   set X $pairlist
   shift
   first=yes
   while test "$#" -ne 0; do
      if test -f "$1"; then
         # If $2 is an absolute path name, then just use that,
         # otherwise prepend `../'.
         case "$2" in
	   /*) target="$2";;
	   *) target="../$2";;
	 esac
	 mv "$1" "$target" || status=$?
d140 22
a161 7
	 # A missing file is only an error for the first file.  This
	 # is a blatant hack to let us support using "yacc -d".  If -d
	 # is not specified, we don't want an error when the header
	 # file is "missing".
	 if test $first = yes; then
	    status=1
	 fi
d163 43
a205 4
      shift
      shift
      first=no
   done
d207 1
a207 1
   status=$?
d214 10
a223 1
exit $status
@


1.1.1.1
log
@Import GNU binutils-2.9.1.  This will break things for a few minutes
until I've made the commits to resolve the conflicts.

Submitted by:	Doug Rabson <dfr>
@
text
@@


1.1.1.1.6.1
log
@Upgrade to Binutils 2.10.0.
@
text
@d34 1
a34 1
 /* | [A-Za-z]:\\*) ;;
d42 1
a42 1
 /* | [A-Za-z]:\\*)
a52 7
# We don't want to use the absolute path if the input in the current
# directory like when making a tar ball.
input_base=`echo $input | sed -e 's|.*/||'`
if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then
  input=$input_base
fi

a69 9
case "$input" in
 /* | [A-Za-z]:\\*)
    # Absolute path; do nothing.
    ;;
 *)
    # Make a symbolic link, hard link or hardcopy.
    ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" .
    ;;
esac
d82 1
a82 1
	   /* | [A-Za-z]:\\*) target="$2";;
@


1.1.1.2
log
@Import of Binutils 2.10 snapshot.
@
text
@d34 1
a34 1
 /* | [A-Za-z]:\\*) ;;
d42 1
a42 1
 /* | [A-Za-z]:\\*)
a52 7
# We don't want to use the absolute path if the input in the current
# directory like when making a tar ball.
input_base=`echo $input | sed -e 's|.*/||'`
if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then
  input=$input_base
fi

a69 9
case "$input" in
 /* | [A-Za-z]:\\*)
    # Absolute path; do nothing.
    ;;
 *)
    # Make a symbolic link, hard link or hardcopy.
    ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" .
    ;;
esac
d82 1
a82 1
	   /* | [A-Za-z]:\\*) target="$2";;
@
