commit 6eb540a199255cc1dae84fd4ba4598cc33cf22c6 parent 70f1e016b49e93d990ad686ebd8b1998aa45e5f4 Author: hhvn <dev@hhvn.uk> Date: Sun, 23 Jan 2022 00:08:22 +0000 configure: always link tinfow if it exists Diffstat:
M | configure | | | 24 | ++++++------------------ |
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/configure b/configure @@ -34,29 +34,17 @@ cat > test.c <<- EOF EOF ${CC} -ltinfow -o test test.c >/dev/null 2>/dev/null && { printf '%s\n' "yes" - hastinfow=1 + cat >> config.mk <<- EOF + # linking with tinfow + # on some systems both ncursesw and tinfow must be linked + # otherwise, thank ncurses for the nondescript segfault in initscr()... + LDFLAGS += -ltinfow + EOF } || { printf '%s\n' "no" hastinfow=0 } -[ $hastinfow -eq 1 ] && { - printf '%s' "should link with libtinfow... " - cat > test.c <<- EOF - #include <ncurses.h> - int main(void) { initscr(); endwin(); return 0; } - EOF - ${CC} -ltinfow -o test test.c >/dev/null 2>/dev/null && ./test >/dev/null 2>/dev/null && { - printf '%s\n' "yes" - cat >> config.mk <<- EOF - # linking with tinfow - # on some systems both ncursesw and tinfow must be linked - # otherwise, thank ncurses for the nondescript segfault in initscr()... - LDFLAGS += -ltinfow - EOF - } || printf '%s\n' "no" -} - printf '%s' "checking for strlcat... " cat > test.c <<- EOF #include <string.h>