automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] eliminate some installation overhead


From: Jim Meyering
Subject: [PATCH] eliminate some installation overhead
Date: Mon, 26 May 2008 17:05:01 +0200

Hello!

Since part of coreutils' install program (currently ifdef'd out) incurs
a performance hit due to an SELinux implementation problem (I hear that
a solution is in the works), I'm motivated to continue Ralf's work of
minimizing automake's practice of exec'ing install once per installed
file.

This first installment addresses man pages.
I've tested it with coreutils, and as expected, it results in a single
invocation of install for all man/*.1 files, rather than 100 separate
invocations, where they were being done one at a time.

Of course, if you specify --program-transform-name=SED_SCRIPT,
it does the usual one-at-a-time invocation, as it must, in order
to perform each name transformation.

This is mainly a heads-up, to see if there are any objections.
If not, I'll write a NEWS entry and a test or two.

Jim

>From 3d4ffb61b751d821ce4ce38209bfba54bf7b0faf Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 26 May 2008 16:51:38 +0200
Subject: [PATCH] eliminate some installation overhead

* lib/am/mans.am (install-man%SECTION%) [!%?NOTRANS_MANS%]:
When possible, install all man pages with a single invocation
of $(INSTALL_DATA).
---
 lib/am/mans.am |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/lib/am/mans.am b/lib/am/mans.am
index 338b43c..a51e1f3 100644
--- a/lib/am/mans.am
+++ b/lib/am/mans.am
@@ -72,6 +72,25 @@ if %?TRANS_MANS%
 ?HAVE_TRANS?       *.%SECTION%*) list="$$list $$i" ;; \
 ?HAVE_TRANS?     esac; \
 ?HAVE_TRANS?   done; \
+       install_all_at_once=1; \
+       case '$(program_transform_name)' in \
+         s,x,x,) for i in $$list; do \
+           case $$i in *.%SECTION%) ;; *) install_all_at_once=0;; esac;done;;\
+         *) install_all_at_once=0 ;; esac; \
+       if test $$install_all_at_once = 1; then \
+## convert names in $$list to be $(srcdir)-relative, if needed
+         new_list=; \
+         for i in $$list; do \
+## Find the file.
+           if test -f $$i; then file=$$i; \
+           else file=$(srcdir)/$$i; fi; \
+           new_list="$$new_list $$file"; \
+         done; \
+         list=$$new_list; \
+         echo " $(INSTALL_DATA) $$list $(DESTDIR)$(man%SECTION%dir)"; \
+         $(INSTALL_DATA) $$list "$(DESTDIR)$(man%SECTION%dir)"; \
+         exit 0; \
+       fi; \
        for i in $$list; do \
 ## Find the file.
          if test -f $$i; then file=$$i; \
--
1.5.5.1.383.g8078b




reply via email to

[Prev in Thread] Current Thread [Next in Thread]