OSDN Git Service

Port to hosts whose 'sort' and 'tail' implementations
[pf3gnuchains/gcc-fork.git] / ltmain.sh
index 219823f..a3c55f9 100644 (file)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -3839,7 +3839,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