From: nhmall Date: Wed, 15 Jun 2022 22:34:47 +0000 (-0400) Subject: more macOS.370 ncurses tinkering X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57390a7b2cfac1a622858fff1fb0c5ff784523f2;p=nethack more macOS.370 ncurses tinkering --- diff --git a/sys/unix/hints/macOS.370 b/sys/unix/hints/macOS.370 index 098024703..bc5583da4 100755 --- a/sys/unix/hints/macOS.370 +++ b/sys/unix/hints/macOS.370 @@ -62,8 +62,6 @@ endif # WANT_WIN_QT5 ifdef WANT_WIN_QT6 QTDIR :=$(shell brew --prefix)/opt/qt@6 endif # WANT_WIN_QT6 -else -$(info forcing use of macports) endif # HAVE_HOMEBREW ifeq "$(HAVE_MACPORTS)" "1" ifdef WANT_WIN_QT5 @@ -115,29 +113,6 @@ USE_CURSESLIB=1 endif endif -ifeq "$(USE_CURSESLIB)" "1" -# default -CURSESLIB = -lncurses -# If CURSES_UNICODE is defined, we need ncursesw. -# Without CURSES_UNICODE the following simpler setting works. -# CURSESLIB = -lncurses -ltinfo -ifdef MAKEFILE_SRC -comma:=, -NCURSES_LFLAGS = $(shell pkg-config ncursesw --libs) -ifneq (,$(findstring ncurses, $(NCURSES_LFLAGS))) -HAVE_NCURSESW=1 -else -HAVE_NCURSESW=0 -endif -#$(info $(NCURSES_LFLAGS)) -#$(info HAVE_NCURSESW=$(HAVE_NCURSESW)) -ifeq "$(HAVE_NCURSESW)" "1" -CURSESLIB = $(NCURSES_LFLAGS) -#$(info $(CURSESLIB)) -endif #HAVE_NCURSESW -endif #MAKEFILE_SRC -endif #USE_CURSESLIB - # NetHack sources control NHCFLAGS+=-DDLB NHCFLAGS+=-DHACKDIR=\"$(HACKDIR)\" @@ -157,17 +132,38 @@ NHCFLAGS+=-DNOMAIL #NHCFLAGS+=-DTTY_SOUND_ESCCODES #NHCFLAGS+=-DNO_CHRONICLE #NHCFLAGS+=-DLIVELOG -ifdef WANT_WIN_CURSES + +ifdef MAKEFILE_SRC +ifeq "$(USE_CURSESLIB)" "1" +# default +CURSESLIB = -lncurses +ifeq "$(CURSES_UNICODE)" "sys" +NHCFLAGS+=-DCURSES_UNICODE +else +# If CURSES_UNICODE is defined, we need ncursesw. +# Without CURSES_UNICODE the following simpler setting works. +# CURSESLIB = -lncurses -ltinfo +comma:=, +NCURSES_LFLAGS = $(shell pkg-config ncursesw --libs) +ifneq (,$(findstring ncurses, $(NCURSES_LFLAGS))) +HAVE_NCURSESW=1 +else +HAVE_NCURSESW=0 +endif +ifneq "$(CURSES_UNICODE)" "0" ifeq "$(HAVE_NCURSESW)" "1" +CURSESLIB = $(NCURSES_LFLAGS) NHCFLAGS+=-DCURSES_UNICODE else -ifdef MAKEFILE_SRC $(info Attention: CURSES_UNICODE is not being defined without ncursesw) -endif #MAKEFILE_SRC endif #HAVE_NCURSESW -endif #WANT_WIN_CURSES +endif #not CURSES_UNICODE=0 +endif #not CURSES_UNICODE=sys +endif #USE_CURSESLIB +endif #MAKEFILE_SRC ifdef MAKEFILE_SRC +ifneq "$(CURSES_UNICODE)" "0" ifdef CURSESLIB PKGCFLAGS= ifeq "$(HAVE_HOMEBREW)" "1" @@ -194,6 +190,9 @@ LFLAGS += $(HOMEBREW_LFLAGS) $(MACPORTS_LFLAGS) WINLIB += $(HOMEBREW_WINLIB) $(MACPORTS_WINLIB) $(CURSESLIB) PKGCFLAGS += $(HOMEBREW_CFLAGS) $(MACPORTS_CFLAGS) endif #CURSESLIB +else # CURSES_UNICODE +WINLIB += $(CURSESLIB) +endif #not CURSES_UNICODE=0 endif #MAKEFILE_SRC CFLAGS+= $(PKGCFLAGS) $(WINCFLAGS) #WINCFLAGS set from multiw-2.370 @@ -214,7 +213,7 @@ ifdef WANT_WIN_X11 USE_XPM=1 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 VARDATND0 += x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -# -x: if built without dlb, some versions of mkfontdir think *.lev are fonts +# -x: if built without dodlb, some versions of mkfontdir think *.lev are fonts POSTINSTALL += bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev ); # separate from CFLAGS so that we don't pass it to every file X11CFLAGS = -I/opt/X11/include