source: scripts/untested/autotools/patches/libtool-1.5.14-ltmain_sh-max_cmd_len.patch@ c2b8e07

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since c2b8e07 was d1afb9e, checked in by Jim Gifford <clfs@…>, 19 years ago

r587@server (orig r585): ryan | 2005-08-05 21:51:35 -0700
Add a sane autotools build to the mix.
Blatantly stolen from gentoo...



  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[d1afb9e]1--- libtool-1.5.14/ltmain.in
2+++ libtool-1.5.14/ltmain.in
3@@ -136,6 +136,30 @@
4 lo2o="s/\\.lo\$/.${objext}/"
5 o2lo="s/\\.${objext}\$/.lo/"
6 quote_scanset='[[~#^*{};<>?'"'"' ]'
7+
8+if test -z "$max_cmd_len"; then
9+ i=0
10+ testring="ABCD"
11+ new_result=
12+
13+ # If test is not a shell built-in, we'll probably end up computing a
14+ # maximum length that is only half of the actual maximum length, but
15+ # we can't tell.
16+ while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
17+ = "XX$testring") >/dev/null 2>&1 &&
18+ new_result=`expr "X$testring" : ".*" 2>&1` &&
19+ max_cmd_len="$new_result" &&
20+ test "$i" != 17 # 1/2 MB should be enough
21+ do
22+ i=`expr $i + 1`
23+ testring="$testring$testring"
24+ done
25+ testring=
26+ # Add a significant safety factor because C++ compilers can tack on massive
27+ # amounts of additional arguments before passing them to the linker.
28+ # It appears as though 1/2 is a usable value.
29+ max_cmd_len=`expr $max_cmd_len \/ 2`
30+fi
31
32 #####################################
33 # Shell function definitions:
Note: See TracBrowser for help on using the repository browser.