]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/mkinstalldirs: Mention automake-patches@gnu.org and
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 9 Nov 2003 00:10:50 +0000 (00:10 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 9 Nov 2003 00:10:50 +0000 (00:10 +0000)
bug-automake@gnu.org.
* lib/compile, lib/depcomp, lib/elisp-comp, lib/mdate-sh:
Likewise.  Also add support for --help and --version.
* lib/py-compile, lib/ylwrap: Likewise, and reindent.

ChangeLog
NEWS
lib/compile
lib/depcomp
lib/elisp-comp
lib/mdate-sh
lib/mkinstalldirs
lib/py-compile
lib/ylwrap

index b0aaf657a1b035fc58ef73104fefc4f771836d5d..d1e04bed7c165f160b90ea16f87224e89e5e6711 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-11-09  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * lib/mkinstalldirs: Mention automake-patches@gnu.org and
+       bug-automake@gnu.org.
+       * lib/compile, lib/depcomp, lib/elisp-comp, lib/mdate-sh:
+       Likewise.  Also add support for --help and --version.
+       * lib/py-compile, lib/ylwrap: Likewise, and reindent.
+
 2003-11-08  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * lib/am/tags.am (ETAGSFLAGS, CTAGSFLAGS): Remove.
diff --git a/NEWS b/NEWS
index 8e8139040f13aab9dc1484b644d5815290059dea..9179e408a1a5525f571f51e559a825d04a6f2220 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -80,7 +80,8 @@ New in 1.7a:
 
   - New option no-dist.
 
-  - install-sh now understands --version and --help.
+  - compile, depcomp, elisp-comp, install-sh, mdate-sh, mkinstalldirs,
+    py-compile, and ylwrap, now all understand --version and --help.
 
   - Automake will now recognize AC_CONFIG_LINKS so far as removing created
     links as part of the distclean target and including source files in
index 9bb997a6a9b4549a733ed71f7e449e70c89f7a69..a81e000ae1ac9a495befd876f4713de48bdf00f5 100755 (executable)
@@ -1,8 +1,9 @@
 #! /bin/sh
-
 # Wrapper for compilers which do not understand `-c -o'.
 
-# Copyright 1999, 2000 Free Software Foundation, Inc.
+scriptversion=2003-11-09.00
+
+# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Usage:
-# compile PROGRAM [ARGS]...
-# `-o FOO.o' is removed from the args passed to the actual compile.
+# 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 command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit 0
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit 0
+    ;;
+esac
+
 
 prog=$1
 shift
@@ -35,39 +63,39 @@ ofile=
 cfile=
 args=
 while test $# -gt 0; do
-   case "$1" in
+  case "$1" in
     -o)
-       # configure might choose to run compile as `compile cc -o foo foo.c'.
-       # So we do something ugly here.
-       ofile=$2
-       shift
-       case "$ofile" in
+      # configure might choose to run compile as `compile cc -o foo foo.c'.
+      # So we do something ugly here.
+      ofile=$2
+      shift
+      case "$ofile" in
        *.o | *.obj)
-          ;;
+         ;;
        *)
-          args="$args -o $ofile"
-          ofile=
-          ;;
-       esac
+         args="$args -o $ofile"
+         ofile=
+         ;;
+      esac
        ;;
     *.c)
-       cfile=$1
-       args="$args $1"
-       ;;
+      cfile=$1
+      args="$args $1"
+      ;;
     *)
-       args="$args $1"
-       ;;
-   esac
-   shift
+      args="$args $1"
+      ;;
+  esac
+  shift
 done
 
 if test -z "$ofile" || test -z "$cfile"; then
-   # If no `-o' option was seen then we might have been invoked from a
-   # pattern rule where we don't need one.  That is ok -- this is a
-   # normal compilation that the losing compiler can handle.  If no
-   # `.c' file was seen then we are probably linking.  That is also
-   # ok.
-   exec "$prog" $args
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$prog" $args
 fi
 
 # Name of file we expect compiler to create.
@@ -79,10 +107,10 @@ cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
 # object file name, since that is what matters with a parallel build.
 lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
 while true; do
-   if mkdir $lockdir > /dev/null 2>&1; then
-      break
-   fi
-   sleep 1
+  if mkdir $lockdir > /dev/null 2>&1; then
+    break
+  fi
+  sleep 1
 done
 # FIXME: race condition here if user kills between mkdir and trap.
 trap "rmdir $lockdir; exit 1" 1 2 15
@@ -92,8 +120,17 @@ trap "rmdir $lockdir; exit 1" 1 2 15
 status=$?
 
 if test -f "$cofile"; then
-   mv "$cofile" "$ofile"
+  mv "$cofile" "$ofile"
 fi
 
 rmdir $lockdir
 exit $status
+
+# 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:
index dcb2b19d553af5b01bbca4ae94a394fe414e57de..9e5522d045f5e086ce88cf287a5db1e9f7bafb71 100755 (executable)
@@ -1,6 +1,8 @@
 #! /bin/sh
-
 # depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2003-11-08.23
+
 # Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 
 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
 
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit 0
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit 0
+    ;;
+esac
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -477,3 +509,12 @@ none)
 esac
 
 exit 0
+
+# 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:
index 00898596b6151206ca094e35b63a16a34a3eaaa6..489ae83d7680fd406b548390c5d8b19197ac341e 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/sh
 # Copyright (C) 1995, 2000, 2003  Free Software Foundation, Inc.
+
+scriptversion=2003-11-08.23
+
 # Franc,ois Pinard <pinard@iro.umontreal.ca>, 1995.
 #
 # This program is free software; you can redistribute it and/or modify
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# This script byte-compiles all `.el' files which are part of its
-# arguments, using GNU Emacs, and put the resulting `.elc' files into
-# the current directory, so disregarding the original directories used
-# in `.el' arguments.
-#
-# This script manages in such a way that all Emacs LISP files to
-# be compiled are made visible between themselves, in the event
-# they require or load-library one another.
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
 
-if test $# = 0; then
-  echo 1>&2 "No files given to $0"
-  exit 1
-fi
+case $1 in
+  '')
+     echo "$0: No files.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: elisp-comp [--help] [--version] FILES...
+
+This script byte-compiles all `.el' files listed as FILES using GNU
+Emacs, and put the resulting `.elc' files into the current directory,
+so disregarding the original directories used in `.el' arguments.
+
+This script manages in such a way that all Emacs LISP files to
+be compiled are made visible between themselves, in the event
+they require or load-library one another.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit 0
+    ;;
+  -v | --v*)
+    echo "elisp-comp $scriptversion"
+    exit 0
+    ;;
+esac
 
 if test -z "$EMACS" || test "$EMACS" = "t"; then
   # Value of "t" means we are running in a shell under Emacs.
@@ -58,3 +78,12 @@ cp "$@" $tempdir
 ) || exit $?
 
 (exit 0); exit
+
+# 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:
index b610b47a65d19dc775e5d5cdbf07fd98c9082315..05e828b081a70f081030b96889d67947e1e9d566 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
+
+scriptversion=2003-11-09.00
+
 # Copyright (C) 1995, 1996, 1997, 2003  Free Software Foundation, Inc.
 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
 #
 # 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 file.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: mdate-sh [--help] [--version] FILE
+
+Pretty-print the modification time of FILE.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit 0
+    ;;
+  -v | --v*)
+    echo "mdate-sh $scriptversion"
+    exit 0
+    ;;
+esac
+
 # Prevent date giving response in another language.
 LANG=C
 export LANG
@@ -131,3 +159,12 @@ esac
 
 # The result.
 echo $day $month $year
+
+# 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:
index a55cff670691f5878621cfd5d66edc5eb71fb3cc..6504b744b00bc19141cea554f123d2036611bda3 100755 (executable)
@@ -1,10 +1,15 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
+
+scriptversion=2003-11-08.23
+
 # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
 # Created: 1993-05-16
 # Public domain.
-
-scriptversion=2003-09-26.19
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
 
 errstatus=0
 dirmode=""
@@ -14,7 +19,8 @@ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
 
 Create each directory DIR (with mode MODE, if specified), including all
 leading file name components.
-"
+
+Report bugs to <bug-automake@gnu.org>."
 
 # process command line arguments
 while test $# -gt 0 ; do
index 4c84b678af183ff261e8a74573e0233ff9496f46..e712f4bf90e5a98310388a9b6ca8b5f93473fac9 100755 (executable)
@@ -1,7 +1,9 @@
 #!/bin/sh
-
 # py-compile - Compile a Python program
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+
+scriptversion=2003-11-09.01
+
+# Copyright (C) 2000, 2001, 2003  Free Software Foundation, Inc.
 
 # 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
@@ -23,7 +25,9 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# called as "py-compile [--basedir DIR] PY_FILES ...
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
 
 if [ -z "$PYTHON" ]; then
   PYTHON=python
@@ -32,26 +36,30 @@ fi
 basedir=
 
 case "$1" in
-    --basedir)
-       basedir=$2
-       shift 2
-       ;;
-    --help)
-       echo "Usage: py-compile [--basedir DIR] PY_FILES ..."
-       echo "Byte compile some python scripts.  This should be performed"
-       echo "after they have been moved to the final installation location"
-       exit 0
-       ;;
-    --version)
-       echo "py-compile version 0.0"
-       exit 0
-       ;;
-esac
-
-if [ $# = 0 ]; then
-    echo "No files given to $0" 1>&2
+  '')
+    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
     exit 1
-fi
+    ;;
+  --basedir)
+    basedir=$2
+    shift 2
+    ;;
+  -h|--h*)
+    cat <<\EOF
+Usage: py-compile [--help] [--version] [--basedir DIR] FILES..."
+
+Byte compile some python scripts FILES.  This should be performed
+after they have been moved to the final installation location
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit 0
+    ;;
+  -v|--v*)
+    echo "py-compile $scriptversion"
+    exit 0
+    ;;
+esac
 
 # if basedir was given, then it should be prepended to filenames before
 # byte compilation.
@@ -90,3 +98,11 @@ for file in string.split(files):
     py_compile.compile(path)
 print" 2>/dev/null || :
 
+# 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:
index ced3af3d619ff42d3b3adf98bc5f8f637b503da9..f5d0c30f6845ae8e3541e42f6d6e7e51d02aebb7 100755 (executable)
@@ -1,8 +1,10 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003 Free Software
-# Foundation, Inc.
+
+scriptversion=2003-11-09.00
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003
+#   Free Software Foundation, Inc.
 #
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Usage:
-#     ylwrap INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
-# * INPUT is the input file
-# * OUTPUT is file PROG generates
-# * DESIRED is file we actually want
-# * PROGRAM is program to run
-# * ARGS are passed to PROG
-# Any number of OUTPUT,DESIRED pairs may be used.
+# 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 0
+    ;;
+  -v|--v*)
+    echo "ylwrap $scriptversion"
+    exit 0
+    ;;
+esac
+
 
 # The input.
 input="$1"
 shift
 case "$input" in
- [\\/]* | ?:[\\/]*)
 [\\/]* | ?:[\\/]*)
     # Absolute path; do nothing.
     ;;
- *)
 *)
     # Relative path.  Make it absolute.
     input="`pwd`/$input"
     ;;
@@ -49,12 +80,12 @@ esac
 
 pairlist=
 while test "$#" -ne 0; do
-   if test "$1" = "--"; then
-      shift
-      break
-   fi
-   pairlist="$pairlist $1"
-   shift
+  if test "$1" = "--"; then
+    shift
+    break
+  fi
+  pairlist="$pairlist $1"
+  shift
 done
 
 # The program to run.
@@ -62,8 +93,8 @@ prog="$1"
 shift
 # Make any relative path in $prog absolute.
 case "$prog" in
- [\\/]* | ?:[\\/]*) ;;
- *[\\/]*) prog="`pwd`/$prog" ;;
 [\\/]* | ?:[\\/]*) ;;
 *[\\/]*) prog="`pwd`/$prog" ;;
 esac
 
 # FIXME: add hostname here for parallel makes that run commands on
@@ -75,82 +106,82 @@ mkdir $dirname || exit 1
 cd $dirname
 
 case $# in
- 0) $prog "$input" ;;
- *) $prog "$@" "$input" ;;
 0) $prog "$input" ;;
 *) $prog "$@" "$input" ;;
 esac
 status=$?
 
 if test $status -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
-
-        # 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 "/^#/{s,$input_rx,,;s,$from,$2,;s,$FROM,$TO,;}" "$from" >"$target" ||
-            status=$?
+  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
-        # 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
+       if test $from = "y.tab.h"; then
+         from="y_tab.h"
+       fi
       fi
-      shift
-      shift
-      first=no
-   done
+    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
+
+      # 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 "/^#/{s,$input_rx,,;s,$from,$2,;s,$FROM,$TO,;}" "$from" >"$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=$?
+  status=$?
 fi
 
 # Remove the directory.
@@ -158,3 +189,12 @@ cd ..
 rm -rf $dirname
 
 exit $status
+
+# 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: