Files
nethack/sys/unix/hints/include/misc.370
nhmall c8f4ad907f more MAN2TXT follow-up
Following a commit for Issue #1153, g-branden-robinson commented:
> Mac OS X stayed on _groff_ 1.19.2 for over a decade (presumably due to
> _groff_ 1.20 adopting to GNU GPLv3), until finally dropping _groff_
> altogether for macOS Ventura (2022).
>
> There _has_ been an interface change in that time.  The [`-P` option I
> advised about is new to _groff_ 1.23.0 (July 2023)]
> (https://git.savannah.gnu.org/cgit/groff.git/tree/NEWS?h=1.23.0#n86).
> [...]
>
> There is a significant number of _groff_ users via Homebrew (enough that
> we hear from them occasionally via bug reports).  Some of these have
> upgraded to 1.23.0 via that mechanism.
> [...]
>
> `nroff -` is not necessary with any _nroff_ known to me; like many other
> Bell Labs Unix programs, it reads from the standard input stream by default
> if not given any operands.

Action taken:

1. Remove the unnecessary ' -' from the nroff command in Makefile.doc.
2. In the misc.370 file containing make snippets to include, test whether
   groff >= 1.23, and only insert the -P option for 1.23 or greater.
2023-11-28 08:00:14 -05:00

91 lines
2.3 KiB
Plaintext

#------------------------------------------------------------------------------
# NetHack 3.7 misc.370 $NHDT-Date: 1668359836 2022/11/13 17:17:16 $ $NHDT-Branch: NetHack-3.7 $
#
# Further set-up for miscellaneous odds and ends (after compiler.370)
#
# Included from:
# hints/linux.370
# hints/macOS.370
#
# This ensures that .moc files are compatible with the version of Qt chosen.
#
ifdef MAKEFILE_SRC
ifdef WANT_WIN_QT
# when switching from Qt5 to Qt6 or vice versa, any old .moc files will be
# incompatible; get rid of them in case user hasn't run 'make spotless';
# object files are incompatable with Qt library, so get rid of them too;
# Qt*.h-t are empty timestamp files and at most one should exist
QTany_H = Qt*.h-t
ifdef WANT_WIN_QT6
# Qt 6 builds and runs (with a couple of warnings) but needs more testing
QTn_H = Qt6.h-t
else
# Qt 5 is currently the default version for nethack 3.7.x's Qt interface
QTn_H = Qt5.h-t
endif
$(QTn_H) ::
@if test ! -f $@; then ( rm -f $(QTany_H) *.moc qt_*.o; touch $@ ); fi;
endif #WANT_WIN_QT
endif #MAKFILE_SRC
ifdef WANT_WIN_TTY
USE_CURSESLIB=1
endif
ifdef WANT_WIN_CURSES
ifneq "$(USE_CURSESLIB)" "1"
USE_CURSESLIB=1
endif
endif
ifeq "$(GIT)" "1"
ifndef GITSUBMODULES
GITSUBMODULES=1
endif
endif
ifeq "$(git)" "1"
ifndef GITSUBMODULES
GITSUBMODULES=1
endif
endif
ifeq "$(CPPREGEX)" "1"
REGEXOBJ=$(TARGETPFX)cppregex.o
ifndef CPLUSPLUS_NEEDED
CPLUSPLUS_NEEDED = 1
endif
endif
ifeq "$(cppregex)" "1"
REGEXOBJ=$(TARGETPFX)cppregex.o
ifndef CPLUSPLUS_NEEDED
CPLUSPLUS_NEEDED = 1
endif
endif
#detection of groff
NROFFISGROFF := $(shell echo `nroff --version | grep "GNU groff version"`)
#$(info NROFFISGROFF=$(NROFFISGROFF))
ifneq "$(NROFFISGROFF)" ""
# get the version of groff and flag if it is gt or eq to 1.23
GROFFGE123 := $(shell expr `echo $(NROFFISGROFF) | cut -f2 -d.` \>= 23)
endif # NROFFISGROFF
ifneq "$(NROFFISGROFF)" "" # It's groff
# add the -Tascii flag used by groff
MORE_MAN2TXT_FLAGS += -Tascii
ifneq "$(GROFFGE123)" "" # It's groff 1.23 or greater
#$(info GROFFGE123=$(GROFFGE123))
# add the groff 1.23 specific plain text flag -P
MORE_MAN2TXT_FLAGS += -P
endif
# add more plain text flags used by groff
MORE_MAN2TXT_FLAGS += -cbou
endif # end groff-specific
#end of hints/include/misc.370
#------------------------------------------------------------------------------