From 0e00101a0b5c704baf0bbeba03ae16c274dd8a47 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 6 May 2002 14:51:28 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ ltmain.in | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2d1ff7c55..3dbce606b 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 -- 2.47.3