updated for version 7.3.050
Problem: The link script is clumsy.
Solution: Use the --as-needed linker option if available. (Kirill A.
Shutemov)
diff --git a/src/configure.in b/src/configure.in
index 27bad25..6ffc675 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -3527,6 +3527,23 @@
fi
AC_SUBST(DEPEND_CFLAGS_FILTER)
+dnl link.sh tries to avoid overlinking in a hackish way.
+dnl At least GNU ld supports --as-needed which provides the same functionality
+dnl at linker level. Let's use it.
+AC_MSG_CHECKING(linker --as-needed support)
+LINK_AS_NEEDED=
+# Check if linker supports --as-needed and --no-as-needed options
+if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then
+ LDFLAGS="$LDFLAGS -Wl,--as-needed"
+ LINK_AS_NEEDED=yes
+fi
+if test "$LINK_AS_NEEDED" = yes; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST(LINK_AS_NEEDED)
+
dnl write output files
AC_OUTPUT(auto/config.mk:config.mk.in)