From: Peter O'Gorman Date: Sat, 11 Oct 2003 16:51:46 +0000 (+0000) Subject: * m4/libtool.m4: Speed up max_cmd_len check. X-Git-Tag: release-1-9b~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=884ec923bd501efc6c43e7cfb58b7c903f397123;p=thirdparty%2Flibtool.git * m4/libtool.m4: Speed up max_cmd_len check. --- diff --git a/ChangeLog b/ChangeLog index ad60d31e5..b58833dc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-10-12 Peter O'Gorman + + * m4/libtool.m4: Speed up max_cmd_len check. + 2003-10-08 Gary V. Vaughan * libtoolize.in: AC_CONFIG_M4_DIR has landed in CVS autoconf. diff --git a/NEWS b/NEWS index 0a939fe31..23f7bfc63 100644 --- 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. New in 1.5.1: 2003-??-??; CVS version 1.5.0a, Libtool team: diff --git a/m4/libtool.m4 b/m4/libtool.m4 index f0e21e755..9cdb8f902 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -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.