+LDFLAGS=
+if test "$libdir" != "/usr/lib" ; then
+ LDFLAGS="$LDFLAGS -L\${libdir}"
+fi
+if test "x@EXTRA_LDFLAGS@" != "x" ; then
+ LDFLAGS="$LDFLAGS @EXTRA_LDFLAGS@"
+fi
+
+# Check if we should specify the tinfo library explicitly so that terminfo
+# functions or curses variables (which also reside in tinfo) can be linked
+# using the -lncurses option.
+NEED_TINFO=no
+if test "x@TINFO_LIBS@" != "x" && \
+ test "x$TINFO_ARG_SUFFIX" != "x$MAIN_LIBRARY"
+then
+ case "x$LDFLAGS" in
+ (*--as-needed*)
+ NEED_TINFO=yes
+ ;;
+ esac
+ case "x$LDFLAGS" in
+ (*,-rpath,*)
+ ;;
+ (*)
+ NEED_TINFO=yes
+ ;;
+ esac