]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set
authorSteve Ellcey <sje@cup.hp.com>
Fri, 1 Jun 2007 06:37:15 +0000 (06:37 +0000)
committerPeter O'Gorman <peter@pogma.com>
Fri, 1 Jun 2007 06:37:15 +0000 (06:37 +0000)
lt_cv_sys_max_cmd_len.

ChangeLog
libtool.m4

index 1a9fa7adc86d9ef6025d83a73f19a1a0fc6386d5..4c40e8c7a36c43949f4cab13004f6a3cc2a4bf9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-01  Steve Ellcey  <sje@cup.hp.com>
+
+       * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set
+       lt_cv_sys_max_cmd_len.
+
 2007-05-28  Peter O'Gorman  <peter@pogma.com>
 
        * ltmain.in, libtool.m4 [darwin]: Only use ${wl} in verstring
index b885b1f66f4163f06604c1e7bf740a8215e7b377..ce63d9ced3f8d45375a8fcc01c24726ce4a575a5 100644 (file)
@@ -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
 ])