diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-07-06 23:24:51 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2006-07-06 23:24:51 +0000 |
commit | 27b56ba6cc4d22c0407c0372ec8d6de20e9ac2a7 (patch) | |
tree | fb41ac292252903edcd6ef7a56a825224d78fa07 /ltmain.sh | |
parent | 525dc87d06289ac03a09201758ab9f43bdd856bf (diff) | |
download | gcc-27b56ba6cc4d22c0407c0372ec8d6de20e9ac2a7.tar.gz |
Port to hosts whose 'sort' and 'tail' implementations treat operands with leading '+' as file names...
Port to hosts whose 'sort' and 'tail' implementations
treat operands with leading '+' as file names, as POSIX
has required since 2001. However, make sure the code still
works on pre-POSIX hosts.
* ltmain.sh: Don't assume "sort +2" is equivalent to
"sort -k 3", since POSIX 1003.1-2001 no longer requires this.
contrib:
* compare_tests: Don't assume "sort +2" is equivalent to
"sort -k 3", since POSIX 1003.1-2001 no longer requires this.
gcc:
* Makefile.in (slowcompare): Port to POSIX 1003.1-2001,
which says you should use "tail -c +N" rather than "tail +Nc".
Fix a bug: the old code incorrectly skipped 15 bytes, not 16.
From-SVN: r115234
Diffstat (limited to 'ltmain.sh')
-rw-r--r-- | ltmain.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ltmain.sh b/ltmain.sh index 219823fc45d..a3c55f9a751 100644 --- 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 |