]> granicus.if.org Git - nethack/commitdiff
yet another follow-up for linux.370 ncursesw
authornhmall <nhmall@nethack.org>
Thu, 2 Jun 2022 20:31:30 +0000 (16:31 -0400)
committernhmall <nhmall@nethack.org>
Thu, 2 Jun 2022 20:31:30 +0000 (16:31 -0400)
sys/unix/hints/linux.370

index 53f4b1c2294fd1048909eeb28216fe2e8e56a26c..5bcd68afe85123040fd3977919c7511f92a80263 100755 (executable)
@@ -102,15 +102,16 @@ ifeq "$(USE_CURSESLIB)" "1"
 # Without CURSES_UNICODE the following simpler setting works.
 # CURSESLIB = -lncurses -ltinfo
 ifdef MAKEFILE_SRC
-HAVE_NCURSESW = $(shell expr `pkg-config ncursesw --libs >/dev/null; echo $$?` = 0)
-endif
-ifeq "$(HAVE_NCURSESW)" "1"
-CURSESLIB = -lncursesw
+comma:=,
+NCURSES_LFLAGS = $(shell pkg-config ncursesw --libs)
+CURSESLIB += $(subst -Wl$(comma)-Bsymbolic-functions,,$(NCURSES_LFLAGS))
+ifneq (,$(findstring ncursesw, $(CURSESLIB)))
+HAVE_NCURSESW=1
 else
-CURSESLIB = -lncurses
-endif      #HAVE_NCURSESW
-CURSESLIB += -ltinfo
+HAVE_NCURSESW=0
+endif
 WINLIB += $(CURSESLIB)
+endif      #MAKEFILE_SRC
 endif      #USE_CURSESLIB
 
 # NetHack sources control