]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* m4/libtool.m4: Speed up max_cmd_len check.
authorPeter O'Gorman <peter@pogma.com>
Sat, 11 Oct 2003 16:51:46 +0000 (16:51 +0000)
committerPeter O'Gorman <peter@pogma.com>
Sat, 11 Oct 2003 16:51:46 +0000 (16:51 +0000)
ChangeLog
NEWS
m4/libtool.m4

index ad60d31e5cf56f81e30f2f7378167f1fab252fe3..b58833dc258481ff9f5d6503d66c53adc81169bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-10-12  Peter O'Gorman <peter@pogma.com>
+
+       * m4/libtool.m4: Speed up max_cmd_len check.
+
 2003-10-08  Gary V. Vaughan  <gary@gnu.org>
 
        * libtoolize.in: AC_CONFIG_M4_DIR has landed in CVS autoconf.
diff --git a/NEWS b/NEWS
index 0a939fe310a4646823337c35d0fe5bf77d174b6d..23f7bfc6344a459adbdeba3bceab731576d6d8af 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ New in 1.5b: 2003-??-??; CVS version 1.5a, Libtool team:
 * Mode inferrence removed, shorthand for choosing modes added.
 * Specifying -allow-undefined is now an error.
 * Initial support for amigaos-ppc.
+* Speed up max_cmd_len check.
 * Bug fixes.
 \f
 New in 1.5.1: 2003-??-??; CVS version 1.5.0a, Libtool team:
index f0e21e7554cb042ac13632af4d4ea4dc0a6c099a..9cdb8f902708e9235e371d818b523da432908583 100644 (file)
@@ -677,18 +677,23 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
 
  *)
+    # Make testring a little bigger before we do anything with it.
+    # a 1K string should be a reasonable start.
+    for i in 1 2 3 4 5 6 7 8 ; do
+      testring=$testring$testring
+    done
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
-              = "XX$testring") >/dev/null 2>&1 &&
-           new_result=`expr "X$testring" : ".*" 2>&1` &&
-           lt_cv_sys_max_cmd_len=$new_result &&
+    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring$testring" 2>/dev/null` \
+              = "XX$testring$testring") >/dev/null 2>&1 &&
            test $i != 17 # 1/2 MB should be enough
     do
       i=`expr $i + 1`
       testring=$testring$testring
     done
+    # Only check the string length outside the loop.
+    lt_cv_sys_max_cmd_len=`expr "X$testring" : ".*" 2>&1`
     testring=
     # Add a significant safety factor because C++ compilers can tack on massive
     # amounts of additional arguments before passing them to the linker.