From: Steve Ellcey Date: Fri, 1 Jun 2007 06:37:15 +0000 (+0000) Subject: * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set X-Git-Tag: release-1-5-24~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a78e64e8f0db0a10837d6fa6039cff3c7ec406e;p=thirdparty%2Flibtool.git * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set lt_cv_sys_max_cmd_len. --- diff --git a/ChangeLog b/ChangeLog index 1a9fa7adc..4c40e8c7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-01 Steve Ellcey + + * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set + lt_cv_sys_max_cmd_len. + 2007-05-28 Peter O'Gorman * ltmain.in, libtool.m4 [darwin]: Only use ${wl} in verstring diff --git a/libtool.m4 b/libtool.m4 index b885b1f66..ce63d9ced 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -794,24 +794,27 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl fi ;; *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + lt_cv_sys_max_cmd_len=`getconf ARG_MAX 2> /dev/null` + if test -n $lt_cv_sys_max_cmd_len; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi ;; esac ])