+# with --disable-overwrite, we installed into a subdirectory, but transformed
+# the headers to include like this:
+# <ncurses@LIB_SUFFIX@/curses.h>
+if [ x@WITH_OVERWRITE@ = xno ]; then
+ case $includedir in
+ $prefix/include/ncurses@LIB_SUFFIX@@EXTRA_SUFFIX@)
+ includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
+ ;;
+ esac
+fi
+
+LIBS="@LIBS@"
+if [ "@TINFO_NAME@" = "@LIB_NAME@" ]; then
+ LIBS="-l${THIS} $LIBS"
+else
+ LIBS="-l${THIS} -l${TINFO_LIB} $LIBS"
+fi
+
+# Ignore -L options which do not correspond to an actual directory, or which
+# are standard library directories (i.e., the linker is supposed to search
+# those directories).
+#
+# There is no portable way to find the list of standard library directories.
+# Require a POSIX shell anyway, to keep this simple.
+lib_flags=
+for opt in -L$libdir @LDFLAGS@ @EXTRA_LDFLAGS@ $LIBS
+do
+ case $opt in
+ -specs*) # ignore linker specs-files which were used to build library
+ continue