Sun Apr 27 11:03:36 1997 Tom Tromey <tromey@cygnus.com>
+ * automake.in (handle_yacc_lex_cxx): Don't use interlock.
+ (output_yacc_build_rule): Don't use interlock; just use new ylwrap
+ instead.
+ (output_lex_build_rule): Likewise.
+ (initialize_global_constants): [common_files] Don't include
+ interlock.
+
+ * Makefile.am (pkgdata_SCRIPTS): Removed interlock.
+ * interlock: Removed.
+ * ylwrap: Changed interface. Now runs command in subdir.
+
* remake.am (config.status): Look in srcdir for config header.
($(srcdir)/configure): Likewise.
* remake-hdr.am (@STAMP@): Look in srcdir for config header. From
ansi2knr.1 lisp.am lisp-clean.am
## These must all be executable when installed.
-pkgdata_SCRIPTS = config.guess config.sub install-sh interlock \
-mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \
+mkinstalldirs elisp-comp ylwrap acinstall
EXTRA_DIST = acinstall $(pkgdata_DATA)
progs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \
ansi2knr.1 lisp.am lisp-clean.am
-pkgdata_SCRIPTS = config.guess config.sub install-sh interlock \
-mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \
+mkinstalldirs elisp-comp ylwrap acinstall
EXTRA_DIST = acinstall $(pkgdata_DATA)
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS README-alpha THANKS TODO aclocal.in aclocal.m4 \
ansi2knr.1 ansi2knr.c automake.in config.guess config.sub configure \
-configure.in elisp-comp install-sh interlock mdate-sh missing \
-mkinstalldirs stamp-vti texinfo.tex version.texi ylwrap
+configure.in elisp-comp install-sh mdate-sh missing mkinstalldirs \
+stamp-vti texinfo.tex version.texi ylwrap
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
default: all
.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
+.SUFFIXES: .texi .texinfo .info .dvi .ps
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile
check: all-am
$(MAKE) check-recursive
installcheck: installcheck-recursive installcheck-local
-all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA)
+all-am: $(INFO_DEPS) $(SCRIPTS) $(DATA) Makefile
install-exec-am: install-binSCRIPTS
* update text in missing
avoid passive voice
+* if `interlock' exists, that should be an error (?)
+ should also warn about using new ylwrap and not old one
+ only do this when looking for ylwrap
+
** make sure every variable that is used is also defined
* make sure `missing' defines are generated
if ($yacc_count > 1 || $lex_count > 1)
{
# If there is more than one distinct yacc (resp lex) source
- # file in a given directory, then the `interlock' program is
+ # file in a given directory, then the `ylwrap' program is
# required to allow parallel builds to work correctly. FIXME:
# for now, no line number.
- &require_config_file ($FOREIGN, 'interlock', 'ylwrap');
+ &require_config_file ($FOREIGN, 'ylwrap');
if ($config_aux_dir ne '.' && $config_aux_dir ne '')
{
- &define_variable ('INTERLOCK', $config_aux_dir . "/interlock");
&define_variable ('YLWRAP', $config_aux_dir . "/ylwrap");
}
else
{
- &define_variable ('INTERLOCK', '$(srcdir)/interlock');
&define_variable ('YLWRAP', '$(srcdir)/ylwrap');
}
}
# compiled with C or C++, depending on the extension of the YACC file.
sub output_yacc_build_rule
{
- local ($yacc_suffix, $use_interlock, $c_suffix) = @_;
+ local ($yacc_suffix, $use_ylwrap, $c_suffix) = @_;
local ($c_suffix, $suffix);
($c_suffix = $yacc_suffix) =~ tr/y/c/;
{
$output_rules .= "$yacc_suffix$suffix:\n\t";
- if ($use_interlock)
+ if ($use_ylwrap)
{
- $output_rules .= ('$(SHELL) $(INTERLOCK) =yacclockdir $(YLWRAP)'
- . ' "$(YACC)" y.tab.c $*' . $suffix
- . ' y.tab.h $*.h -- $(YFLAGS) $<');
+ $output_rules .= ('$(SHELL) $(YLWRAP)'
+ . ' "$(YACC)" $< y.tab.c $*' . $suffix
+ . ' y.tab.h $*.h -- $(YFLAGS)');
}
else
{
sub output_lex_build_rule
{
- local ($lex_suffix, $use_interlock) = @_;
+ local ($lex_suffix, $use_ylwrap) = @_;
local ($c_suffix);
($c_suffix = $lex_suffix) =~ tr/l/c/;
&define_configure_variable ('LEXLIB');
$output_rules .= "$lex_suffix$c_suffix:\n\t";
- if ($use_interlock)
+ if ($use_ylwrap)
{
- # is the $@ correct here? If so, why not use it in the
- # interlock build rule for yacc above?
- $output_rules .= '$(SHELL) $(INTERLOCK) =lexlockdir $(YLWRAP)'
- . ' "$(LEX)" $(LEX_OUTPUT_ROOT).c $@ -- $(LFLAGS) $<';
+ # Is the $@ correct here? If so, why not use it in the ylwrap
+ # build rule for yacc above?
+ $output_rules .= '$(SHELL) $(YLWRAP)'
+ . ' "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(LFLAGS)';
}
else
{
"config.guess", "config.sub", "AUTHORS", "BACKLOG", "ABOUT-GNU",
"libversion.in", "mdate-sh", "mkinstalldirs", "install-sh",
'texinfo.tex', "ansi2knr.c", "ansi2knr.1", 'elisp-comp',
- 'interlock', 'ylwrap', 'acinclude.m4', @libtoolize_files,
+ 'ylwrap', 'acinclude.m4', @libtoolize_files,
'missing'
);
Automake makes it possible to include multiple yacc (or lex) source
files in a single program. Automake uses a small program called
-@code{interlock} to manage locks between multiple yacc invocations.
+@code{ylwrap} to run @code{yacc} (or @code{lex}) in a subdirectory.
This is necessary because yacc's output filename is fixed, and a
parallel make could conceivably invoke more than one instance of
-@code{yacc} simultaneously. @code{interlock} is distributed with
-automake. It should appear in the directory specified by
-@samp{AC_CONFIG_AUX_DIR}, or the current directory if that macro is not
-used in @file{configure.in}.
+@code{yacc} simultaneously. @code{ylwrap} is distributed with automake.
+It should appear in the directory specified by @samp{AC_CONFIG_AUX_DIR},
+or the current directory if that macro is not used in
+@file{configure.in}.
For @code{yacc}, simply managing locking is insufficient. @code{yacc}
output also always uses the same symbol names internally, so it isn't
+++ /dev/null
-#! /bin/sh
-# interlock - wrap program invocation in lock to allow
-# parallel builds to work.
-# Written by Tom Tromey <tromey@cygnus.com>, Aug 10 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.
-
-# Usage:
-# interlock lock-dir-name program args-to-program...
-
-dirname="$1"
-program="$2"
-
-shift
-shift
-
-while (mkdir $dirname > /dev/null 2>&1 && exit 1 || exit 0); do
- # Wait a bit.
- sleep 1
-done
-
-# Race condition here: if interrupted after the loop but before this
-# trap, the lock can be left around.
-trap "rmdir $dirname > /dev/null 2>&1" 1 2 3 15
-
-# We have the lock, so run the program.
-$program ${1+"$@"}
-ret=$?
-
-# Release the lock.
-rmdir $dirname > /dev/null 2>&1
-
-exit $ret
ansi2knr.1 lisp.am lisp-clean.am
## These must all be executable when installed.
-pkgdata_SCRIPTS = config.guess config.sub install-sh interlock \
-mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \
+mkinstalldirs elisp-comp ylwrap acinstall
EXTRA_DIST = acinstall $(pkgdata_DATA)
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-# Written by Tom Tromey <tromey@cygnus.com>, Aug 11 1996
+# 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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Usage:
-# ylwrap PROG [OUTPUT DESIRED]... -- [ARGS]...
-# * PROG is program to run.
+# 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
prog="$1"
shift
+# The input.
+input="$1"
+shift
+case "$input" in
+ /*)
+ # 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
+
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
shift
done
-$prog ${1+"$@"} || exit $?
+# 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
-set X $pairlist
-shift
-status=0
-first=yes
-while test "$#" -ne 0; do
- if test -f "$1"; then
- mv "$1" "$2" || 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
+cd $dirname
+"$prog" ${1+"$@"} "$input"
+status=$?
+
+if test $status -eq 0; then
+ set X $pairlist
shift
- first=no
-done
+ first=yes
+ while test "$#" -ne 0; do
+ if test -f "$1"; then
+ mv "$1" "../$2" || 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
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-# Written by Tom Tromey <tromey@cygnus.com>, Aug 11 1996
+# 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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Usage:
-# ylwrap PROG [OUTPUT DESIRED]... -- [ARGS]...
-# * PROG is program to run.
+# 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
prog="$1"
shift
+# The input.
+input="$1"
+shift
+case "$input" in
+ /*)
+ # 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
+
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
shift
done
-$prog ${1+"$@"} || exit $?
+# 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
-set X $pairlist
-shift
-status=0
-first=yes
-while test "$#" -ne 0; do
- if test -f "$1"; then
- mv "$1" "$2" || 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
+cd $dirname
+"$prog" ${1+"$@"} "$input"
+status=$?
+
+if test $status -eq 0; then
+ set X $pairlist
shift
- first=no
-done
+ first=yes
+ while test "$#" -ne 0; do
+ if test -f "$1"; then
+ mv "$1" "../$2" || 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