head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.2
	netbsd-11-0-RC3:1.1.1.2
	netbsd-11-0-RC2:1.1.1.2
	netbsd-11-0-RC1:1.1.1.2
	gcc-14-3-0:1.1.1.2
	perseant-exfatfs-base-20250801:1.1.1.2
	netbsd-11:1.1.1.2.0.30
	netbsd-11-base:1.1.1.2
	gcc-12-5-0:1.1.1.2
	netbsd-10-1-RELEASE:1.1.1.2
	perseant-exfatfs-base-20240630:1.1.1.2
	gcc-12-4-0:1.1.1.2
	perseant-exfatfs:1.1.1.2.0.28
	perseant-exfatfs-base:1.1.1.2
	netbsd-8-3-RELEASE:1.1.1.2
	netbsd-9-4-RELEASE:1.1.1.2
	netbsd-10-0-RELEASE:1.1.1.2
	netbsd-10-0-RC6:1.1.1.2
	netbsd-10-0-RC5:1.1.1.2
	netbsd-10-0-RC4:1.1.1.2
	netbsd-10-0-RC3:1.1.1.2
	netbsd-10-0-RC2:1.1.1.2
	netbsd-10-0-RC1:1.1.1.2
	gcc-12-3-0:1.1.1.2
	gcc-10-5-0:1.1.1.2
	netbsd-10:1.1.1.2.0.26
	netbsd-10-base:1.1.1.2
	netbsd-9-3-RELEASE:1.1.1.2
	gcc-10-4-0:1.1.1.2
	cjep_sun2x-base1:1.1.1.2
	cjep_sun2x:1.1.1.2.0.24
	cjep_sun2x-base:1.1.1.2
	cjep_staticlib_x-base1:1.1.1.2
	netbsd-9-2-RELEASE:1.1.1.2
	cjep_staticlib_x:1.1.1.2.0.22
	cjep_staticlib_x-base:1.1.1.2
	gcc-10-3-0:1.1.1.2
	netbsd-9-1-RELEASE:1.1.1.2
	gcc-9-3-0:1.1.1.2
	gcc-7-5-0:1.1.1.2
	phil-wifi-20200421:1.1.1.2
	phil-wifi-20200411:1.1.1.2
	is-mlppp:1.1.1.2.0.20
	is-mlppp-base:1.1.1.2
	phil-wifi-20200406:1.1.1.2
	netbsd-8-2-RELEASE:1.1.1.2
	gcc-8-4-0:1.1.1.2
	netbsd-9-0-RELEASE:1.1.1.2
	netbsd-9-0-RC2:1.1.1.2
	netbsd-9-0-RC1:1.1.1.2
	phil-wifi-20191119:1.1.1.2
	gcc-8-3-0:1.1.1.2
	netbsd-9:1.1.1.2.0.18
	netbsd-9-base:1.1.1.2
	phil-wifi-20190609:1.1.1.2
	netbsd-8-1-RELEASE:1.1.1.2
	netbsd-8-1-RC1:1.1.1.2
	pgoyette-compat-merge-20190127:1.1.1.2
	pgoyette-compat-20190127:1.1.1.2
	gcc-7-4-0:1.1.1.2
	pgoyette-compat-20190118:1.1.1.2
	pgoyette-compat-1226:1.1.1.2
	pgoyette-compat-1126:1.1.1.2
	gcc-6-5-0:1.1.1.2
	pgoyette-compat-1020:1.1.1.2
	pgoyette-compat-0930:1.1.1.2
	pgoyette-compat-0906:1.1.1.2
	netbsd-7-2-RELEASE:1.1.1.1
	pgoyette-compat-0728:1.1.1.2
	netbsd-8-0-RELEASE:1.1.1.2
	phil-wifi:1.1.1.2.0.16
	phil-wifi-base:1.1.1.2
	pgoyette-compat-0625:1.1.1.2
	netbsd-8-0-RC2:1.1.1.2
	pgoyette-compat-0521:1.1.1.2
	pgoyette-compat-0502:1.1.1.2
	pgoyette-compat-0422:1.1.1.2
	netbsd-8-0-RC1:1.1.1.2
	pgoyette-compat-0415:1.1.1.2
	pgoyette-compat-0407:1.1.1.2
	pgoyette-compat-0330:1.1.1.2
	pgoyette-compat-0322:1.1.1.2
	pgoyette-compat-0315:1.1.1.2
	netbsd-7-1-2-RELEASE:1.1.1.1
	pgoyette-compat:1.1.1.2.0.14
	pgoyette-compat-base:1.1.1.2
	gcc-6-4-0:1.1.1.2
	netbsd-7-1-1-RELEASE:1.1.1.1
	gcc-5-5-0:1.1.1.2
	matt-nb8-mediatek:1.1.1.2.0.12
	matt-nb8-mediatek-base:1.1.1.2
	perseant-stdc-iso10646:1.1.1.2.0.10
	perseant-stdc-iso10646-base:1.1.1.2
	netbsd-8:1.1.1.2.0.8
	netbsd-8-base:1.1.1.2
	prg-localcount2-base3:1.1.1.2
	prg-localcount2-base2:1.1.1.2
	prg-localcount2-base1:1.1.1.2
	prg-localcount2:1.1.1.2.0.6
	prg-localcount2-base:1.1.1.2
	pgoyette-localcount-20170426:1.1.1.2
	bouyer-socketcan-base1:1.1.1.2
	pgoyette-localcount-20170320:1.1.1.2
	netbsd-7-1:1.1.1.1.0.26
	netbsd-7-1-RELEASE:1.1.1.1
	netbsd-7-1-RC2:1.1.1.1
	netbsd-7-nhusb-base-20170116:1.1.1.1
	bouyer-socketcan:1.1.1.2.0.4
	bouyer-socketcan-base:1.1.1.2
	pgoyette-localcount-20170107:1.1.1.2
	netbsd-7-1-RC1:1.1.1.1
	pgoyette-localcount-20161104:1.1.1.2
	netbsd-7-0-2-RELEASE:1.1.1.1
	localcount-20160914:1.1.1.2
	netbsd-7-nhusb:1.1.1.1.0.24
	netbsd-7-nhusb-base:1.1.1.1
	pgoyette-localcount-20160806:1.1.1.2
	pgoyette-localcount-20160726:1.1.1.2
	pgoyette-localcount:1.1.1.2.0.2
	pgoyette-localcount-base:1.1.1.2
	gcc-5-4-0:1.1.1.2
	netbsd-7-0-1-RELEASE:1.1.1.1
	gcc-5-3-0:1.1.1.2
	netbsd-7-0:1.1.1.1.0.22
	netbsd-7-0-RELEASE:1.1.1.1
	gcc-4-8-5-pre-gcc-old-import:1.1.1.1
	netbsd-7-0-RC3:1.1.1.1
	netbsd-7-0-RC2:1.1.1.1
	post-gcc-4-8-5-merge:1.1.1.1
	gcc-4-8-5:1.1.1.1
	netbsd-7-0-RC1:1.1.1.1
	gcc-4-8-4:1.1.1.1
	gcc-4-8-20141009:1.1.1.1
	netbsd-6-0-6-RELEASE:1.1.1.1
	netbsd-6-1-5-RELEASE:1.1.1.1
	netbsd-7:1.1.1.1.0.20
	netbsd-7-base:1.1.1.1
	gcc-4-8-3:1.1.1.1
	yamt-pagecache-base9:1.1.1.1
	yamt-pagecache-tag8:1.1.1.1
	netbsd-6-1-4-RELEASE:1.1.1.1
	netbsd-6-0-5-RELEASE:1.1.1.1
	tls-earlyentropy:1.1.1.1.0.18
	tls-earlyentropy-base:1.1.1.1
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.1
	riastradh-drm2-base3:1.1.1.1
	gcc-4-8-3-pre-r208254:1.1.1.1
	gcc-4-8-3-pre-r206687:1.1.1.1
	imported-to-gcc-old-20140227-0107:1.1.1.1
	netbsd-6-1-3-RELEASE:1.1.1.1
	netbsd-6-0-4-RELEASE:1.1.1.1
	netbsd-6-1-2-RELEASE:1.1.1.1
	netbsd-6-0-3-RELEASE:1.1.1.1
	netbsd-6-1-1-RELEASE:1.1.1.1
	riastradh-drm2-base2:1.1.1.1
	riastradh-drm2-base1:1.1.1.1
	riastradh-drm2:1.1.1.1.0.12
	riastradh-drm2-base:1.1.1.1
	netbsd-6-1:1.1.1.1.0.16
	netbsd-6-0-2-RELEASE:1.1.1.1
	netbsd-6-1-RELEASE:1.1.1.1
	netbsd-6-1-RC4:1.1.1.1
	netbsd-6-1-RC3:1.1.1.1
	agc-symver:1.1.1.1.0.14
	agc-symver-base:1.1.1.1
	netbsd-6-1-RC2:1.1.1.1
	netbsd-6-1-RC1:1.1.1.1
	yamt-pagecache-base8:1.1.1.1
	netbsd-6-0-1-RELEASE:1.1.1.1
	yamt-pagecache-base7:1.1.1.1
	matt-nb6-plus-nbase:1.1.1.1
	yamt-pagecache-base6:1.1.1.1
	netbsd-6-0:1.1.1.1.0.10
	netbsd-6-0-RELEASE:1.1.1.1
	gcc-4-5-4:1.1.1.1
	netbsd-6-0-RC2:1.1.1.1
	tls-maxphys:1.1.1.1.0.8
	tls-maxphys-base:1.1.1.1
	matt-nb6-plus:1.1.1.1.0.6
	matt-nb6-plus-base:1.1.1.1
	netbsd-6-0-RC1:1.1.1.1
	yamt-pagecache-base5:1.1.1.1
	yamt-pagecache-base4:1.1.1.1
	netbsd-6:1.1.1.1.0.4
	netbsd-6-base:1.1.1.1
	yamt-pagecache-base3:1.1.1.1
	yamt-pagecache-base2:1.1.1.1
	yamt-pagecache:1.1.1.1.0.2
	yamt-pagecache-base:1.1.1.1
	gcc-4-5-3:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2011.06.21.01.19.46;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2011.06.21.01.19.46;	author mrg;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2016.01.24.06.05.38;	author mrg;	state Exp;
branches;
next	;
commitid	uWWfbLp08zOK79Sy;


desc
@@


1.1
log
@Initial revision
@
text
@#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.

scriptversion=2009-04-28.21; # UTC

# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
# 2007, 2009 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, see <http://www.gnu.org/licenses/>.

# 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-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@


1.1.1.1
log
@initial import of GCC 4.5.3 sources.  changes since 4.1 are way too numerous
to review, please see http://gcc.gnu.org/gcc-4.5/changes.html (and the 4.2,
4.3 and 4.4 versions, too.)

this includes the core, c++, objc and the non java/ada/fortran parts of the
testsuite.
@
text
@@


1.1.1.2
log
@import GCC 5.3.0.  see these urls for details which are too large to
include here:

	http://gcc.gnu.org/gcc-4.9/changes.html
	http://gcc.gnu.org/gcc-5/changes.html

(note that GCC 5.x is a release stream like GCC 4.9.x, 4.8.x, etc.)


the main issues we will have are:

The default mode for C is now -std=gnu11 instead of -std=gnu89.

ARM:
The deprecated option -mwords-little-endian has been removed.
The options -mapcs, -mapcs-frame, -mtpcs-frame and -mtpcs-leaf-frame
 which are only applicable to the old ABI have been deprecated.

MIPS:
The o32 ABI has been modified and extended. The o32 64-bit
 floating-point register support is now obsolete and has been removed.
 It has been replaced by three ABI extensions FPXX, FP64A, and FP64.
 The meaning of the -mfp64 command-line option has changed. It is now
 used to enable the FP64A and FP64 ABI extensions.
@
text
@d4 1
a4 1
scriptversion=2013-01-12.17; # UTC
d6 2
a7 1
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
a32 32
get_dirname ()
{
  case $1 in
    */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
    # Otherwise,  we want the empty string (not ".").
  esac
}

# guard FILE
# ----------
# The CPP macro used to guard inclusion of FILE.
guard ()
{
  printf '%s\n' "$1"                                                    \
    | sed                                                               \
        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'   \
        -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'                        \
        -e 's/__*/_/g'
}

# quote_for_sed [STRING]
# ----------------------
# Return STRING (or stdin) quoted to be used as a sed pattern.
quote_for_sed ()
{
  case $# in
    0) cat;;
    1) printf '%s\n' "$1";;
  esac \
    | sed -e 's|[][\\.*]|\\&|g'
}

d35 1
a35 1
    echo "$0: No files given.  Try '$0 --help' for more information." 1>&2
d68 1
a68 1
input=$1
d70 1
a70 3
# We'll later need for a correct munging of "#line" directives.
input_sub_rx=`get_dirname "$input" | quote_for_sed`
case $input in
d76 1
a76 1
    input=`pwd`/$input
a78 14
input_rx=`get_dirname "$input" | quote_for_sed`

# The parser itself, the first file, is the destination of the .y.c
# rule in the Makefile.
parser=$1

# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
# instance, we rename #include "y.tab.h" into #include "parse.h"
# during the conversion from y.tab.c to parse.c.
sed_fix_filenames=

# Also rename header guards, as Bison 2.7 for instance uses its header
# guard in its implementation file.
sed_fix_header_guards=
d80 3
a82 2
while test $# -ne 0; do
  if test x"$1" = x"--"; then
d86 1
a86 3
  from=$1
  shift
  to=$1
a87 2
  sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
  sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
d91 1
a91 1
prog=$1
d94 1
a94 1
case $prog in
d96 1
a96 1
  *[\\/]*) prog=`pwd`/$prog ;;
d99 2
d102 1
a102 5
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
d114 29
a142 3
  for from in *
  do
    to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
d145 4
a148 4
      # otherwise prepend '../'.
      case $to in
        [\\/]* | ?:[\\/]*) target=$to;;
        *) target=../$to;;
d151 9
a159 8
      # Do not overwrite unchanged header files to avoid useless
      # recompilations.  Always update the parser itself: 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 $from != $parser; then
        realtarget=$target
        target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
d161 27
a187 18

      # Munge "#line" or "#" directives.  Don't let the resulting
      # debug information point at an absolute srcdir.  Use the real
      # output file name, not yy.lex.c for instance.  Adjust the
      # include guards too.
      sed -e "/^#/!b"                           \
          -e "s|$input_rx|$input_sub_rx|"       \
          -e "$sed_fix_filenames"               \
          -e "$sed_fix_header_guards"           \
        "$from" >"$target" || ret=$?

      # Check whether files must be updated.
      if test "$from" != "$parser"; then
        if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
          echo "$to is unchanged"
          rm -f "$target"
        else
          echo "updating $to"
d192 5
a196 4
      # A missing file is only an error for the parser.  This is a
      # blatant hack to let us support using "yacc -d".  If -d is not
      # specified, don't fail when the header file is "missing".
      if test "$from" = "$parser"; then
d200 3
d204 2
@

