libtool-patches
[Top][All Lists]
Advanced

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

[PATCH] libtool: minimise forks per invocation on cygwin and mingw.


From: Gary V. Vaughan
Subject: [PATCH] libtool: minimise forks per invocation on cygwin and mingw.
Date: Thu, 8 Dec 2011 17:21:24 +0700

The recently pushed series of patches included the controversial
introduction of an additional 3 forks per invocation, which might
add a minute or two of wall-clock time to giant builds on windows.
By assuming that windows will run shell scripts on some shell with
all the modern optional features that libtool wants, this patch
eliminates even those 3 new forks.

Okay to push?

* build-aux/general.m4sh (lt_HAVE_PLUSEQ_OP, lt_HAVE_ARITH_OP)
(lt_HAVE_XSI_OPS) [cygwin, mingw]: Set these without a test on
the assumption that a modern shell (i.e. bash) will be used to
run libtool and libtoolize.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 build-aux/general.m4sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/build-aux/general.m4sh b/build-aux/general.m4sh
index 252b2d2..2ac6238 100644
--- a/build-aux/general.m4sh
+++ b/build-aux/general.m4sh
@@ -56,6 +56,7 @@ test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
 : ${SED="@SED@"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
+: ${host="@host_triplet@"}
 
 # Global variables:
 EXIT_SUCCESS=0
@@ -74,6 +75,18 @@ dirname='s|/[^/]*$||'
 basename='s|^.*/||'
 
 
+# Forks are unreasonably slow under Windows, so we assume that, for at
+# least cygwin and mingw, /bin/sh is bash, and save at least 3 forks per
+# invocation:
+case $host in
+  *cygwin* | *mingw*)
+    test -n "$lt_HAVE_PLUSEQ_OP" || lt_HAVE_PLUSEQ_OP=yes
+    test -n "$lt_HAVE_ARITH_OP"  || lt_HAVE_ARITH_OP=yes
+    test -n "$lt_HAVE_XSI_OPS"   || lt_HAVE_XSI_OPS=yes
+    ;;
+esac
+
+
 # lt_HAVE_PLUSEQ_OP
 # Can be empty, in which case the shell is probed, "yes" if += is useable
 # or anything else if += does not work.
-- 
1.7.8

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



reply via email to

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