From patchwork Thu Dec 14 18:13:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 24941 Received: (qmail 24433 invoked by alias); 14 Dec 2017 18:14:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24413 invoked by uid 89); 14 Dec 2017 18:14:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=regeneration X-HELO: relay1.mentorg.com Date: Thu, 14 Dec 2017 18:13:53 +0000 From: Joseph Myers To: Subject: Do not build .mo files in source directory (bug 14121) Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Building and installing glibc leaves .mo files (compiled message translations) behind in the source directory. Building those files in the source directory may once have made sense, if they were included in release tarballs; now that release tarballs are just the output of "git archive", building any non-checked-in files in the source directory does not make sense. This patch changes these files to be built in the build directory instead. This is necessary but not sufficient to avoid build-many-glibcs.py needing to copy the glibc source directory. Its list of files to touch on checkout to avoid subsequent regeneration (configure, preconfigure, *-kw.h) is incomplete (missing at least INSTALL, sysdeps/gnu/errlist.c, posix/testcases.h, posix/ptestcases.h, locale/C-translit.h, (only regenerated for Hurd builds) sysdeps/mach/hurd/bits/errno.h) - the existing list may be sufficient to prevent regeneration that actually changes the file contents depending on the installed build tools, but not to ensure there is no regeneration at all - and there might well be other things writing into the source directory in the course of building and testing (so needing appropriate testing with read-only source directories with different timestamp orderings to find and eliminate all such cases). Tested for x86_64. 2017-12-14 Joseph Myers [BZ #14121] * po/Makefile (%.mo): Change to $(objpfx)%.mo. Use $(make-target-directory). ($(mo-installed)): Use $(objpfx)%.mo. diff --git a/po/Makefile b/po/Makefile index 122db23..d72f652 100644 --- a/po/Makefile +++ b/po/Makefile @@ -80,11 +80,12 @@ libc.pot.files: FORCE # Compile the binary message object files from the portable object source # files of translations for each language. -%.mo: %.po +$(objpfx)%.mo: %.po + $(make-target-directory) $(MSGFMT) -o $@ $< # Install the message object files as libc.po in the language directory. -$(mo-installed): %.mo $(+force); $(do-install) || exit 0 +$(mo-installed): $(objpfx)%.mo $(+force); $(do-install) || exit 0 .PHONY: linguas linguas.mo linguas: $(ALL_LINGUAS:=.po)