]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
got rid of interlock
authorTom Tromey <tromey@redhat.com>
Mon, 28 Apr 1997 00:22:07 +0000 (00:22 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 28 Apr 1997 00:22:07 +0000 (00:22 +0000)
ChangeLog
Makefile.am
Makefile.in
TODO
automake.in
automake.texi
interlock [deleted file]
lib/am/Makefile.am
lib/ylwrap
ylwrap

index 5418d7dbf5e0b2c48d981f8f863e6431e5d8e830..c8344f9bc5d78bf53821fdfec023398073e96832 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 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
index 49d04d7fdaaa2edb09208035b7b166e410dd5b72..f3376bb878191fdd29d69d0061d529e88834c8ec 100644 (file)
@@ -18,8 +18,8 @@ progs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \
 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)
 
index b4e0ebf74fabe88a6a8f0f4931005c60c2643da5..38dacf605d709399f96f682c0e2a67f5b5ad7ae5 100644 (file)
@@ -76,8 +76,8 @@ tags-clean.am texi-vers.am texinfos.am libs-clean.am ltlib-clean.am \
 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)
 
@@ -100,8 +100,8 @@ DATA =  $(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)
@@ -110,7 +110,7 @@ GZIP = --best
 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
 
@@ -411,7 +411,7 @@ dvi: $(DVIS) dvi-recursive
 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
 
diff --git a/TODO b/TODO
index b3b9d5d99a3ea07d455e44ec2c79250ce4552abe..b7eef500e4f185e493529b6d52ee33abbe6e61f9 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,10 @@
 * 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
index 47c56f1472ee35b80c10f9a359c08f46c229c0ce..76704f55e6c74bfa36a5fe4df470421c44929890 100755 (executable)
@@ -845,18 +845,16 @@ sub handle_yacc_lex_cxx
     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');
        }
     }
@@ -953,7 +951,7 @@ sub handle_yacc_lex_cxx
 # 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/;
@@ -965,11 +963,11 @@ sub output_yacc_build_rule
     {
        $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
        {
@@ -984,7 +982,7 @@ sub output_yacc_build_rule
 
 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/;
@@ -993,12 +991,12 @@ sub output_lex_build_rule
     &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
     {
@@ -4574,7 +4572,7 @@ sub initialize_global_constants
         "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'
         );
 
index 4d5f45a3a1fd950dc39d5e6c62e2ffb8fe8e43de..f0b91c6f4ed3623e9923bfefeb2947fe8d7d7a02 100644 (file)
@@ -1457,13 +1457,13 @@ the appropriate @samp{LDADD} variable.
 
 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
diff --git a/interlock b/interlock
deleted file mode 100755 (executable)
index 88e2733..0000000
--- a/interlock
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /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
index 49d04d7fdaaa2edb09208035b7b166e410dd5b72..f3376bb878191fdd29d69d0061d529e88834c8ec 100644 (file)
@@ -18,8 +18,8 @@ progs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \
 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)
 
index 5b47e055117f54d689310b05ff29961a57bece15..d74184c10ecce01e0782142150009f023ccf8951 100755 (executable)
@@ -1,6 +1,7 @@
 #! /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
@@ -17,8 +18,9 @@
 # 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
@@ -37,26 +54,42 @@ while test "$#" -ne 0; do
    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
diff --git a/ylwrap b/ylwrap
index 5b47e055117f54d689310b05ff29961a57bece15..d74184c10ecce01e0782142150009f023ccf8951 100755 (executable)
--- a/ylwrap
+++ b/ylwrap
@@ -1,6 +1,7 @@
 #! /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
@@ -17,8 +18,9 @@
 # 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
@@ -37,26 +54,42 @@ while test "$#" -ne 0; do
    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