]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Don't assume that "sort +2" works, as POSIX
authorPaul Eggert <eggert@twinsun.com>
Mon, 6 May 2002 14:51:28 +0000 (14:51 +0000)
committerRobert Boehne <rboehne@gnu.org>
Mon, 6 May 2002 14:51:28 +0000 (14:51 +0000)
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
ltmain.in

index 2d1ff7c55c6a4fd145765cc6b58f2db0f8e8e40f..3dbce606b53b112463f741256146d0be849bfee1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-05-06  Paul Eggert  <eggert@twinsun.com>
+
+       * 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  <rittle@latour.rsch.comm.mot.com>
 
        * ltmain.sh: Detect and handle object name conflicts while
index 4487ab72d7420ffea8f2efdbbdccdb42b3f6b598..6b12f4eac4d4db65e7e5bd33bee29708fd46884a 100644 (file)
--- 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 >/dev/null 2>&1; then
+                 sort -k 3
+               else
+                 sort +2
+               fi |
+               uniq > "$nlist"S; then
              :
            else
              grep -v "^: " < "$nlist" > "$nlist"S