Oh brother, I just found another regression. :-( func_fallback_echo isn't even defined inside configure unless we haven't found a better $ECHO. We should be trying to fork&exec an external utility with the test string, so that we are actually testing the right limit.
I'm pushing the fix below, which I've checked by using set -x generously and disabling the getconf mechanism, on GNU/Linux. One should note that recent Linux kernels do not actually have a limit on the maximum total command-line length any more, but they do have a limit on the maximum length of a single command-line argument. Now, ignoring the presence of getconf for a moment, I figured we should maybe be able to exploit this, but there's a glitch: our testing of expr "X$cmd" : ".*" inside both libtool.m4 and ltmain.sh passes the whole command-line as one argument to expr. It /might/ be possible to get around this in practice by using XSI shell internals if possible (and eventually we should be trying something to that extent anyway for efficiency reasons), but the whole area is sufficiently subtle that I would like to postpone any further non-regression-fixing action to well later. Thanks, Ralf Fix regression in command-line length computation. * libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): Use `env echo' rather than possibly-undefined func_fallback_echo, to ensure we fork and exec for this test. * NEWS: Update. Regression introduced in v2.2.6-39-g9c3d4d8. diff --git a/NEWS b/NEWS index 6e8e0fe..90e33f7 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,8 @@ New in 2.4.2 2010-12-??: git version 2.4.1a, Libtool team: * Bug fixes: - - None yet! + - The generic approximation of the command line length limit (when getconf is + not available) works again. Regression introduced in v2.2.6-39-g9c3d4d8. New in 2.4 2010-09-22: git version 2.2.11a, Libtool team: diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index d812584..6aebb63 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -1639,7 +1639,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do