summaryrefslogtreecommitdiff
path: root/src/link.sh
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-11-03 22:32:24 +0100
committerBram Moolenaar <Bram@vim.org>2010-11-03 22:32:24 +0100
commit22e193ddd551cf67635e73231c259415bd70c135 (patch)
tree25ff2571555022cd358b128f614d75e72c934843 /src/link.sh
parent2d0860d06c29f73ef42c01e2f4284e471d8023b4 (diff)
downloadvim-git-22e193ddd551cf67635e73231c259415bd70c135.tar.gz
updated for version 7.3.050v7.3.050
Problem: The link script is clumsy. Solution: Use the --as-needed linker option if available. (Kirill A. Shutemov)
Diffstat (limited to 'src/link.sh')
-rwxr-xr-xsrc/link.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/link.sh b/src/link.sh
index 3d90f3cac..71ee061e3 100755
--- a/src/link.sh
+++ b/src/link.sh
@@ -5,7 +5,7 @@
# libraries when they exist, but this doesn't mean they are needed for Vim.
#
# Author: Bram Moolenaar
-# Last change: 2006 Sep 26
+# Last change: 2010 Nov 03
# License: Public domain
#
# Warning: This fails miserably if the linker doesn't return an error code!
@@ -16,11 +16,23 @@
echo "$LINK " >link.cmd
exit_value=0
+if test "$LINK_AS_NEEDED" = yes; then
+ echo "link.sh: \$LINK_AS_NEEDED set to 'yes': invoking linker directly."
+ cat link.cmd
+ if sh link.cmd; then
+ exit_value=0
+ echo "link.sh: Linked fine"
+ else
+ exit_value=$?
+ echo "link.sh: Linking failed"
+ fi
+else
+ if test -f auto/link.sed; then
+
#
# If auto/link.sed already exists, use it. We assume a previous run of
# link.sh has found the correct set of libraries.
#
-if test -f auto/link.sed; then
echo "link.sh: The file 'auto/link.sed' exists, which is going to be used now."
echo "link.sh: If linking fails, try deleting the auto/link.sed file."
echo "link.sh: If this fails too, try creating an empty auto/link.sed file."
@@ -124,6 +136,8 @@ if test -f auto/link.sed -a ! -s auto/link.sed -a ! -f link3.sed; then
fi
fi
+fi
+
#
# cleanup
#