From: Paul Eggert Date: Mon, 30 Jul 2012 20:34:58 +0000 (-0700) Subject: Do not overwrite config.status while executing it. X-Git-Tag: emacs-24.2.90~984 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f25abd317c64e2a69e1839633382841c3848a2d;p=emacs.git Do not overwrite config.status while executing it. * 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 --- diff --git a/ChangeLog b/ChangeLog index d3c52b6922d..14bf1f385cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2012-07-30 Paul Eggert + 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, diff --git a/Makefile.in b/Makefile.in index 4b9364ac3f4..89c06cce16e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/configure.ac b/configure.ac index 23833f4913c..a68caca4072 100644 --- a/configure.ac +++ b/configure.ac @@ -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], [