Mercurial > vim
comparison src/link.sh @ 2629:1ccc1ace9e5b v7.3.050
updated for version 7.3.050
Problem: The link script is clumsy.
Solution: Use the --as-needed linker option if available. (Kirill A.
Shutemov)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 03 Nov 2010 22:32:24 +0100 |
parents | 454f314d0e61 |
children | e1e3805fcd96 |
comparison
equal
deleted
inserted
replaced
2628:5c4b2fc4f067 | 2629:1ccc1ace9e5b |
---|---|
3 # link.sh -- try linking Vim with different sets of libraries, finding the | 3 # link.sh -- try linking Vim with different sets of libraries, finding the |
4 # minimal set for fastest startup. The problem is that configure adds a few | 4 # minimal set for fastest startup. The problem is that configure adds a few |
5 # libraries when they exist, but this doesn't mean they are needed for Vim. | 5 # libraries when they exist, but this doesn't mean they are needed for Vim. |
6 # | 6 # |
7 # Author: Bram Moolenaar | 7 # Author: Bram Moolenaar |
8 # Last change: 2006 Sep 26 | 8 # Last change: 2010 Nov 03 |
9 # License: Public domain | 9 # License: Public domain |
10 # | 10 # |
11 # Warning: This fails miserably if the linker doesn't return an error code! | 11 # Warning: This fails miserably if the linker doesn't return an error code! |
12 # | 12 # |
13 # Otherwise this script is fail-safe, falling back to the original full link | 13 # Otherwise this script is fail-safe, falling back to the original full link |
14 # command if anything fails. | 14 # command if anything fails. |
15 | 15 |
16 echo "$LINK " >link.cmd | 16 echo "$LINK " >link.cmd |
17 exit_value=0 | 17 exit_value=0 |
18 | 18 |
19 if test "$LINK_AS_NEEDED" = yes; then | |
20 echo "link.sh: \$LINK_AS_NEEDED set to 'yes': invoking linker directly." | |
21 cat link.cmd | |
22 if sh link.cmd; then | |
23 exit_value=0 | |
24 echo "link.sh: Linked fine" | |
25 else | |
26 exit_value=$? | |
27 echo "link.sh: Linking failed" | |
28 fi | |
29 else | |
30 if test -f auto/link.sed; then | |
31 | |
19 # | 32 # |
20 # If auto/link.sed already exists, use it. We assume a previous run of | 33 # If auto/link.sed already exists, use it. We assume a previous run of |
21 # link.sh has found the correct set of libraries. | 34 # link.sh has found the correct set of libraries. |
22 # | 35 # |
23 if test -f auto/link.sed; then | |
24 echo "link.sh: The file 'auto/link.sed' exists, which is going to be used now." | 36 echo "link.sh: The file 'auto/link.sed' exists, which is going to be used now." |
25 echo "link.sh: If linking fails, try deleting the auto/link.sed file." | 37 echo "link.sh: If linking fails, try deleting the auto/link.sed file." |
26 echo "link.sh: If this fails too, try creating an empty auto/link.sed file." | 38 echo "link.sh: If this fails too, try creating an empty auto/link.sed file." |
27 else | 39 else |
28 | 40 |
122 rm -f auto/link.sed | 134 rm -f auto/link.sed |
123 fi | 135 fi |
124 fi | 136 fi |
125 fi | 137 fi |
126 | 138 |
139 fi | |
140 | |
127 # | 141 # |
128 # cleanup | 142 # cleanup |
129 # | 143 # |
130 rm -f link.cmd linkit.sh link1.sed link2.sed link3.sed linkit2.sh | 144 rm -f link.cmd linkit.sh link1.sed link2.sed link3.sed linkit2.sh |
131 | 145 |