From: Paul Eggert Date: Mon, 6 May 2002 14:51:40 +0000 (+0000) Subject: * ltmain.in: Don't assume that "sort +2" works, as POSIX X-Git-Tag: release-1-5~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d197caf0e14883df45c334947f0e68602bcb16ca;p=thirdparty%2Flibtool.git * ltmain.in: Don't assume that "sort +2" works, as POSIX 1003.1-2001 says that "sort +2" is supposed to sort the file named "+2". An example host that behaves like this is textutils 2.0.21 with _POSIX2_VERSION=200112. --- diff --git a/ChangeLog b/ChangeLog index a73d7263c..e31f4311a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-05-06 Paul Eggert + + * ltmain.in: Don't assume that "sort +2" works, as POSIX + 1003.1-2001 says that "sort +2" is supposed to sort the file + named "+2". An example host that behaves like this is + textutils 2.0.21 with _POSIX2_VERSION=200112. + 2002-05-06 Loren James Rittle * ltmain.sh: Detect and handle object name conflicts while diff --git a/ltmain.in b/ltmain.in index 4487ab72d..6b12f4eac 100644 --- a/ltmain.in +++ b/ltmain.in @@ -3812,7 +3812,13 @@ extern \"C\" { fi # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S