CVS update: /ccvs/, /ccvs/build-aux/

[email protected] 15 Jun 2005 18:20:36 -0000
Newsgroups gmane.comp.version-control.cvs.cvs
Message-ID <[email protected]>
User: dprice  
Date: 05/06/15 11:20:36

Added:
 /ccvs/build-aux/
  bison-missing

Modified:
 /ccvs/
  ChangeLog, configure

Log:
 * build-aux/missing: Add hack to fail gracefully when Bison is too old.

File Changes:

Directory: /ccvs/
=================

File [changed]: ChangeLog
Url: https://ccvs.cvshome.org/source/browse/ccvs/ChangeLog?r1=1.1229&r2=1.1230
Delta lines:  +4 -0
-------------------
--- ChangeLog	15 Jun 2005 15:29:59 -0000	1.1229
+++ ChangeLog	15 Jun 2005 18:20:33 -0000	1.1230
@@ -1,5 +1,9 @@
 2005-06-15  Derek Price  <[email protected]>
 
+	* build-aux/missing: Add hack to fail gracefully when Bison is too old.
+
+2005-06-15  Derek Price  <[email protected]>
+
 	* HACKING: Note GNU Bison 1.875 requirement.
 
 2005-06-12  Conrad T. Pino  <[email protected]>

File [changed]: configure
Url: https://ccvs.cvshome.org/source/browse/ccvs/configure?r1=1.403&r2=1.404
Delta lines:  +3 -5
-------------------
--- configure	10 Jun 2005 20:31:51 -0000	1.403
+++ configure	15 Jun 2005 18:20:33 -0000	1.404
@@ -10128,13 +10128,11 @@
 
 
 
+  # expand $ac_aux_dir to an absolute path
+  am_aux_dir=`cd $ac_aux_dir && pwd`
 
   # getdate.y works with bison only.
-
-YACC=${YACC-"${am_missing_run}bison -y"}
-
-
-
+  test "${YACC+set}" = set || YACC="\${SHELL} $am_aux_dir/bison-missing --run bison -y"
 
 
 

Directory: /ccvs/build-aux/
===========================

File [added]: bison-missing
Url: https://ccvs.cvshome.org/source/browse/ccvs/build-aux/bison-missing?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 192
----------------
#! /bin/sh
# Common stub for a few missing GNU programs while installing.

scriptversion=2005-02-08.22

# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
#   Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <[email protected]>, 1996.

# 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.

# 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.

if test $# -eq 0; then
  echo 1>&2 "Try \`$0 --help' for more information"
  exit 1
fi

run=:

# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
  configure_ac=configure.ac
else
  configure_ac=configure.in
fi

msg="missing on your system"

case "$1" in
--run)
  # Try to run requested program, and just exit if it succeeds.
  run=
  shift
  "$@" && exit 0
  # Exit code 63 means version mismatch.  This often happens
  # when the user try to use an ancient version of a tool on
  # a file that requires a minimum version.  In this case we
  # we should proceed has if the program had been absent, or
  # if --run hadn't been passed.
  if test $? = 63; then
    run=:
    msg="probably too old"
  fi
  ;;

  -h|--h|--he|--hel|--help)
    echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...

Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.

Options:
  -h, --help      display this help and exit
  -v, --version   output version information and exit
  --run           try to run the given command, and emulate it if it fails

Supported PROGRAM values:
  bison        create \`y.tab.[ch]', if possible, from existing .[ch]

Send bug reports to <[email protected]>."
    exit $?
    ;;

  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
    echo "bison-missing $scriptversion (GNU CVS)"
    exit $?
    ;;

  -*)
    echo 1>&2 "$0: Unknown \`$1' option"
    echo 1>&2 "Try \`$0 --help' for more information"
    exit 1
    ;;

esac

# Now exit if we have it, but it failed.  Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
  bison)
    # Emulate failures since we depend on GNU Bison 1.875.
    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
       # We have it, but it failed.  Check the version number.
       major=`$1 --version |sed -n \
		'/ [0-9]\.[0-9][0-9]*/{s/^.* \([0-9]\)\..*$/\1/;p;}'`
       minor=`$1 --version |sed -n \
		'/ [0-9]\.[0-9][0-9]*/{s/^.*\.\([0-9]*\).*$/\1/;p;}'`
       if test $major -eq 1 && test $minor -lt 875; then
	  # Ignoring Bisons with a major version of 0, this is older than we
	  # support.  Fail gracefully since this is probably not a maintainer
	  # and they probably didn't mean to rebuild getdate.c from getdate.y -
	  # it only happened due to munged timestamps or whatnot.
	  :
       else
	  # We have it and it failed.  This is probably a maintainer and they
	  # are rebuilding a getdate.c from a new getdate.y with an error.
	  exit 1
       fi
    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
       # Could not run --version or --help.  This is probably someone
       # running `$TOOL --version' or `$TOOL --help' to check whether
       # $TOOL exists and not knowing $TOOL uses missing.
       exit 1
    fi
    ;;

  *)
    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
       # We have it, but it failed.
       exit 1
    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
       # Could not run --version or --help.  This is probably someone
       # running `$TOOL --version' or `$TOOL --help' to check whether
       # $TOOL exists and not knowing $TOOL uses missing.
       exit 1
    fi
    ;;
esac

# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
  bison)
    echo 1>&2 "\
WARNING: \`$1' $msg.  You should only need it if
         you modified a \`.y' file.  You may need the \`Bison' package
         in order for those modifications to take effect.  You can get
         \`Bison' from any GNU archive site."
    rm -f y.tab.c y.tab.h
    if [ $# -ne 1 ]; then
        eval LASTARG="\${$#}"
	case "$LASTARG" in
	*.y)
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
	    if [ -f "$SRCFILE" ]; then
	         cp "$SRCFILE" y.tab.c
	    fi
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
	    if [ -f "$SRCFILE" ]; then
	         cp "$SRCFILE" y.tab.h
	    fi
	  ;;
	esac
    fi
    if [ ! -f y.tab.h ]; then
	echo >y.tab.h
    fi
    if [ ! -f y.tab.c ]; then
	echo 'main() { return 0; }' >y.tab.c
    fi
    ;;

  *)
    echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
         You might have modified some files without having the
         proper tools for further handling them.  Check the \`README' file,
         it often tells you about the needed prerequisites for installing
         this package.  You may also peek at any GNU archive site, in case
         some other package would contain this missing \`$1' program."
    exit 1
    ;;
esac

exit 0

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End: