[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (HEAD) speedup for max args check on *BSD
From: |
Peter O'Gorman |
Subject: |
Re: (HEAD) speedup for max args check on *BSD |
Date: |
Sun, 18 Apr 2004 00:34:39 +0900 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 |
Todd Vierling wrote:
Grumble. I shouldn't try to split diffs on a Friday afternoon.
Well, I had been thinking of doing this just for darwin, you provided the
excuse I needed! I added a safety zone (way too large) to return just 25% of
the actual length.
Applied patch is attached.
Peter
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.62
diff -u -r1.62 libtool.m4
--- m4/libtool.m4 15 Apr 2004 17:05:26 -0000 1.62
+++ m4/libtool.m4 16 Apr 2004 22:19:41 -0000
@@ -1107,6 +1107,17 @@
lt_cv_sys_max_cmd_len=8192;
;;
+ netbsd* | freebsd* | openbsd* )
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ ;;
+
*)
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
--
Peter O'Gorman - http://www.pogma.com
Index: ChangeLog
from Todd Vierling <address@hidden>,
Peter O'Gorman <address@hidden>
* m4/libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Use sysctl to get the
max cmd length on BSD* and darwin. Make sure that there is a safety
factor too.
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.62
diff -u -3 -p -u -r1.62 libtool.m4
--- m4/libtool.m4 15 Apr 2004 17:05:26 -0000 1.62
+++ m4/libtool.m4 17 Apr 2004 15:27:48 -0000
@@ -1107,6 +1107,18 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d
lt_cv_sys_max_cmd_len=8192;
;;
+ netbsd* | freebsd* | openbsd* | darwin* )
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ ;;
*)
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.