From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9106: 24.0.50; ./configure causes massive recompilation Date: Wed, 20 Jul 2011 01:24:44 -0400 Message-ID: References: <4E2623CA.8090805@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1311139543 423 80.91.229.12 (20 Jul 2011 05:25:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2011 05:25:43 +0000 (UTC) Cc: 9106@debbugs.gnu.org, bug-gnulib@gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 07:25:39 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QjPHu-0007n2-Tq for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2011 07:25:39 +0200 Original-Received: from localhost ([::1]:60960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjPHt-0002Iz-TY for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2011 01:25:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjPHQ-0002E2-D7 for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2011 01:25:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjPHL-0000mo-JL for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2011 01:25:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjPHL-0000mj-6O for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2011 01:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QjPHK-0008Ip-4E; Wed, 20 Jul 2011 01:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2011 05:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9106 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9106-submit@debbugs.gnu.org id=B9106.131113949931907 (code B ref 9106); Wed, 20 Jul 2011 05:25:02 +0000 Original-Received: (at 9106) by debbugs.gnu.org; 20 Jul 2011 05:24:59 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QjPHD-0008IV-JX for submit@debbugs.gnu.org; Wed, 20 Jul 2011 01:24:59 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QjPH8-0008IE-2U for 9106@debbugs.gnu.org; Wed, 20 Jul 2011 01:24:54 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QjPH2-0000Dw-03; Wed, 20 Jul 2011 01:24:44 -0400 In-reply-to: <4E2623CA.8090805@cs.ucla.edu> (message from Paul Eggert on Tue, 19 Jul 2011 17:39:38 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 20 Jul 2011 01:25:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:49461 Archived-At: > Date: Tue, 19 Jul 2011 17:39:38 -0700 > From: Paul Eggert > Cc: bug-gnulib > > [cc'ing bug-gnulib as it's related; see ] > > > It used to be the case that if the results of running `configure' > > didn't change anything of essence, "make" would do nothing. This > > worked by producing the generated files under temporary names and by > > using move-if-change to overwrite the old files if the new ones were > > different. > > If memory serves, that process is pretty error-prone. One can't > simply use move-if-change: one needs a separate time stamp file for > each file that one is doing the move-if-change trick with. Otherwise, > when you run 'make' again, it will cheerfully regenerate all the .h > files again. Sorry, I don't see the difficulty. Perhaps I'm missing something. The current recipe for producing, e.g., unistd.h from unistd.in.h is this: unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ [...] -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ } > $@-t && \ mv $@-t $@ What I'm suggesting is to replace the last command ("mv $@-t $@") with this: move-if-change $@-t $@ That's it. Make will indeed cheerfully regenerate unistd.h-t, but as long as that file isn't copied over unistd.h, the source files that include unistd.h won't be recompiled. Regeneration of unistd.h-t is very fast; it's the needless recompilation of the plethora of source files that include unistd.h that is the problem addressed by this bug report. It could be the case that some configure.in wizardry would resolve this even nicer, by doing a similar move-if-change trick with config.status (whose being a prerequisite of these header files is the trigger for their regeneration, IIUC). That will prevent even the regeneration itself. But I don't know if this is possible without too much effort, so the suggested simpler "band-aid" is good enough for me. > Part of the problem is deciding automatically whether a change is > one "of essence". I think comparing the old file with the new one, like move-if-change does, is all that's needed. There's no requirement to detect changes that are non-essential, like comments etc. -- if any change is detected, let the files be recompiled. Am I missing something?