* 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
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,
# 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
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], [