2007-06-01 Steve Ellcey <sje@cup.hp.com>

* libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): Try using getconf
	to set lt_cv_sys_max_cmd_len.
This commit is contained in:
Paolo Bonzini 2007-06-01 11:33:01 +00:00
parent fa7ccaf7e5
commit 350c058541
2 changed files with 34 additions and 23 deletions

View File

@ -1,3 +1,8 @@
2007-06-01 Steve Ellcey <sje@cup.hp.com>
* libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): Try using getconf
to set lt_cv_sys_max_cmd_len.
2007-05-31 Paolo Bonzini <bonzini@gnu.org>
* ltgcc.m4: Update from GCC.

12
libtool.m4 vendored
View File

@ -1439,6 +1439,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
fi
;;
*)
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
# Make teststring 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
@ -1458,10 +1463,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
# Only check the string length outside the loop.
lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
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.
# 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
])