]> granicus.if.org Git - nethack/commitdiff
use ncursesw on linux for curses support of enhanced1
authornhmall <nhmall@nethack.org>
Thu, 2 Jun 2022 18:43:46 +0000 (14:43 -0400)
committernhmall <nhmall@nethack.org>
Thu, 2 Jun 2022 18:43:46 +0000 (14:43 -0400)
sys/unix/hints/linux.370

index e24878163a98687c3eb5525966b1f85f521ebbd1..16b4099bf59d8abc8c1b72283af241e68352942f 100755 (executable)
@@ -125,16 +125,27 @@ CURSESLIB =
 #endif # WANT_WIN_CHAIN
 
 ifdef WANT_WIN_TTY
-CURSESLIB = -lncurses -ltinfo
+USE_CURSESLIB=1
 endif
 
 ifdef WANT_WIN_CURSES
-CURSESLIB = -lncurses -ltinfo
+ifneq "$(USE_CURSESLIB)" "1"
+USE_CURSESLIB=1
+endif
 endif
 
-ifdef CURSESLIB
+ifeq "$(USE_CURSESLIB)" "1"
+ifndef MAKEFILE_DAT
+ifndef MAKEFILE_UTL
+# If CURSES_UNICODE is defined, we need ncursesw.
+# Without CURSES_UNICODE the following simpler setting works.
+# CURSESLIB = -lncurses -ltinfo
+CURSESLIB = $(shell pkg-config ncursesw --libs || echo -lncursesw)
+CURSESLIB += -ltinfo
+endif      #not MAKEFILE_UTL
+endif      #not MAKEFILE_DAT
 WINLIB += $(CURSESLIB)
-endif
+endif      #USE_CURSESLIB
 
 ifdef WANT_WIN_X11
 USE_XPM=1