]> code.delx.au - gnu-emacs/commitdiff
Do not overwrite config.status while executing it.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Jul 2012 20:34:58 +0000 (13:34 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Jul 2012 20:34:58 +0000 (13:34 -0700)
* Makefile.in (MAKEFILE_NAME): New macro.
($(MAKEFILE_NAME)): Rename rule from Makefile.
* configure.ac (epaths): Set MAKEFILE_NAME to a bogus value,
so that GNU 'make' isn't tempted to make the Makefile and then
regenerate config.status while config.status is running.

Fixes: debbugs:11214
ChangeLog
Makefile.in
configure.ac

index d3c52b6922daa60e9f3e5f7e6b95008311fed211..14bf1f385cd662488f39a0effa6f89cb757bd0ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Do not overwrite config.status while executing it (Bug#11214).
+       * Makefile.in (MAKEFILE_NAME): New macro.
+       ($(MAKEFILE_NAME)): Rename rule from Makefile.
+       * configure.ac (epaths): Set MAKEFILE_NAME to a bogus value,
+       so that GNU 'make' isn't tempted to make the Makefile and then
+       regenerate config.status while config.status is running.
+
        Update .PHONY listings in makefiles.
        * Makefile.in (.PHONY): Add all, ${SUBDIR}, blessmail, epath-force,
        FRC, install-arch-dep, install-arch-indep, install-doc,
index 4b9364ac3f4737978baee82ac989f36791ba3c72..89c06cce16e3e2facb33fcb1233b97b97e937e3c 100644 (file)
@@ -350,7 +350,12 @@ blessmail: Makefile src FRC
 # We used to have one rule per */Makefile.in, but that leads to race
 # conditions with parallel makes, so let's assume that the time stamp on
 # ./Makefile is representative of the time stamp on all the other Makefiles.
-Makefile: config.status $(srcdir)/src/config.in \
+#
+# config.status overrides MAKEFILE_NAME with a bogus name when creating
+# src/epaths.h, so that 'make epaths-force' does not recursively invoke
+# config.status and overwrite config.status while executing it (Bug#11214).
+MAKEFILE_NAME = Makefile
+$(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \
           $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN)
        ./config.status
 
index 23833f4913c301690bad80c4340e9fb02b5d697a..a68caca4072c86360e655124af22d472eeaf46b8 100644 (file)
@@ -4464,7 +4464,7 @@ dnl by configure.  This also explains the `move-if-change' test and
 dnl the use of force in the `epaths-force' rule in Makefile.in.
 AC_CONFIG_COMMANDS([epaths], [
 echo creating src/epaths.h
-${MAKE-make} epaths-force
+${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
 ], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"])
 
 AC_CONFIG_COMMANDS([gdbinit], [