summaryrefslogtreecommitdiff
path: root/ltmain.sh
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-06 23:24:51 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-06 23:24:51 +0000
commit108cf1776caa5e59c4cb1ab3dedcdcf5c5ba5ef5 (patch)
treefb41ac292252903edcd6ef7a56a825224d78fa07 /ltmain.sh
parent499c8b1ed3d898eff2c9b74468aad9b8fdee184f (diff)
downloadgcc-108cf1776caa5e59c4cb1ab3dedcdcf5c5ba5ef5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'ltmain.sh')
-rw-r--r--ltmain.sh8
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