]> granicus.if.org Git - nethack/commitdiff
another follow-up for ncursesw and CURSES_UNICODE
authornhmall <nhmall@nethack.org>
Thu, 2 Jun 2022 19:26:48 +0000 (15:26 -0400)
committernhmall <nhmall@nethack.org>
Thu, 2 Jun 2022 19:26:48 +0000 (15:26 -0400)
Don't define CURSES_UNICODE without ncursesw being available

sys/unix/hints/linux.370

index 5e077007f28499a80cb4f6e83a31fc45a00a7464..53f4b1c2294fd1048909eeb28216fe2e8e56a26c 100755 (executable)
@@ -86,6 +86,33 @@ endif
 
 #-INCLUDE compiler.370
 
+CURSESLIB =
+ifdef WANT_WIN_TTY
+USE_CURSESLIB=1
+endif
+
+ifdef WANT_WIN_CURSES
+ifneq "$(USE_CURSESLIB)" "1"
+USE_CURSESLIB=1
+endif
+endif
+
+ifeq "$(USE_CURSESLIB)" "1"
+# If CURSES_UNICODE is defined, we need ncursesw.
+# 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
+else
+CURSESLIB = -lncurses
+endif      #HAVE_NCURSESW
+CURSESLIB += -ltinfo
+WINLIB += $(CURSESLIB)
+endif      #USE_CURSESLIB
+
 # NetHack sources control
 NHCFLAGS+=-DDLB
 NHCFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
@@ -106,8 +133,14 @@ NHCFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
 #NHCFLAGS+=-DNO_CHRONICLE
 #NHCFLAGS+=-DLIVELOG
 ifdef WANT_WIN_CURSES
+ifeq "$(HAVE_NCURSESW)" "1"
 NHCFLAGS+=-DCURSES_UNICODE
-endif
+else
+ifdef MAKEFILE_SRC
+$(info Attention: CURSES_UNICODE is not being defined without ncursesw)
+endif   #MAKEFILE_SRC
+endif   #HAVE_NCURSESW
+endif   #WANT_WIN_CURSES
 
 CFLAGS+= $(WINCFLAGS)    #WINCFLAGS set from multiw-2.370
 CFLAGS+= $(NHCFLAGS)
@@ -117,41 +150,12 @@ CCXXFLAGS+= $(NHCFLAGS)
 
 VARDATND =
 VARDATND0 =
-CURSESLIB =
 
 #ifdef WANT_WIN_CHAIN
 #HINTSRC=$(CHAINSRC)
 #HINTOBJ=$(CHAINOBJ)
 #endif # WANT_WIN_CHAIN
 
-ifdef WANT_WIN_TTY
-USE_CURSESLIB=1
-endif
-
-ifdef WANT_WIN_CURSES
-ifneq "$(USE_CURSESLIB)" "1"
-USE_CURSESLIB=1
-endif
-endif
-
-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
-HAVE_NCURSESW = $(shell expr `pkg-config ncursesw --libs >/dev/null; echo $$?` = 0)
-ifeq "$(HAVE_NCURSESW)" "1"
-CURSESLIB = -lncursesw
-else
-CURSESLIB = -lncurses
-endif      #HAVE_NCURSESW
-CURSESLIB += -ltinfo
-endif      #not MAKEFILE_UTL
-endif      #not MAKEFILE_DAT
-WINLIB += $(CURSESLIB)
-endif      #USE_CURSESLIB
-
 ifdef WANT_WIN_X11
 USE_XPM=1
 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11