attempt to fix github issue #1104 gui build curses

Check for pdcursesmod explicitly, since it is require for
curses support under the NetHackW gui version

Closes #1104
This commit is contained in:
nhmall
2023-09-30 10:20:27 -04:00
parent 086f68187f
commit cf3cbcf832
5 changed files with 36 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
Copyright (c) NetHack Development Team 1990-2022
Copyright (c) NetHack Development Team 1990-2023
NetHack may be freely redistributed. See license for details.
==============================================================
Instructions for compiling and installing
@@ -83,7 +83,7 @@ Via git (recommended)
submodules/lua and submodules/pdcurses folders:
git submodule init
git submodule update --remote
git submodule update
Via zip download
@@ -100,13 +100,13 @@ Via zip download
tar -xvf lua-5.4.6.tar.gz
cd ..
o obtain pdcurses
o obtain pdcursesmod
cd lib
wget --no-check-certificate ^
http://github.com/wmcbrine/PDCurses/archive/refs/tags/3.9.zip ^
--output-document=pdcurses3.9.zip
tar -xvf pdcurses3.9.zip
ren PDCurses-3.9 pdcurses
https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/v4.3.7.tar.gz ^
--output-document=pdcursesmod.tar.gz
tar -xvf pdcursesmod.tar.gz
ren PDCursesMod-4.3.7 pdcursesmod
cd ..
o update your Makefiles to reflect:
@@ -124,9 +124,9 @@ Via zip download
In sys/windows/Makefile.nmake
change from
PDCURSES_TOP = ..\submodules\pdcurses
PDCURSES_TOP = ..\submodules\pdcursesmod
to
PDCURSES_TOP = ..\lib\pdcurses
PDCURSES_TOP = ..\lib\pdcursesmod
change from
LUATOP = ..\submodules\lua

View File

@@ -236,7 +236,7 @@ PDCURSES_TOP=$(LIBDIR)\$(PDCDIST)
ADD_CURSES=Y
!ENDIF # GIT_AVAILABLE
!ELSE # INTERNET_AVAILABLE is not Y below
# Your Makefile settings do not allow pdcurses or pdcursesmod to be obtained by
# Your Makefile settings do not allow $(PDCDIST) to be obtained by
# git or by download. Check to see if it is available at one of
# the expected locations already, with precedence given to ../submodules,
# then ../lib.
@@ -249,7 +249,7 @@ PDCURSES_TOP=$(LIBDIR)\$(PDCDIST)
ADD_CURSES=Y
!ENDIF # pdcurses sources available somewhere
!IF "$(ADD_CURSES)" == "Y"
!MESSAGE Your Makefile settings do not allow pdcurses or pdcursesmod to be
!MESSAGE Your Makefile settings do not allow $(PDCDIST) to be
!MESSAGE obtained by git or by download, but a copy of pdcurses was
!MESSAGE found in $(PDCURSES_TOP),
!MESSAGE so that will be used.
@@ -431,9 +431,9 @@ LUAOBJFILES = $(LUAOBJFILES) $(OLUA)lbitlib.o
# PDCurses build macros
# Source for the NetHack repository submodule in
# ../submodules/pdcurses
# or ../submodules/pdcursesmod
# is https://github.com/wmcbrine/PDCurses.git
# or https://github.com/Bill-Gray/PDCursesMod
# ../submodules/pdcursesmod
# is https://github.com/Bill-Gray/PDCursesMod
#=================================================================
!IF "$(ADD_CURSES)" == "Y"
@@ -471,7 +471,9 @@ PDCWINGUIOBJS = $(OPDC)pdcclip_wingui.o $(OPDC)pdcdisp_wingui.o \
PDCLIB = $(LIBDIR)\$(PDCDIST)-$(TARGET_CPU).lib
PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON)
PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC)
PDCINCLGUI = /I$(PDCWINCON)
PDCINCLCON = /I$(PDCWINGUI)
!ELSE
PDCLIB =
PDCDEP =
@@ -1304,10 +1306,10 @@ DLB =
$(Q)$(CC) /wd4244 /wd4267 /wd4774 $(PDCINCL) $(CFLAGS:-w44774= ) $(CURSESDEF2) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
{$(PDCWINCON)}.c{$(OBJPDC)}.o:
$(Q)$(CC) /wd4244 /wd4267 /wd4774 $(PDCINCL) $(CFLAGS) $(CURSESDEF2) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
$(Q)$(CC) /wd4244 /wd4267 /wd4774 $(PDCINCL) $(PDCINCLCON) $(CFLAGS) $(CURSESDEF2) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
{$(PDCWINGUI)}.c{$(OBJPDC)}.o:
$(Q)$(CC) /wd4244 /wd4267 /wd4774 $(PDCINCL) $(CFLAGS) $(CURSESDEF2) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
$(Q)$(CC) /wd4244 /wd4267 /wd4774 $(PDCINCL) $(PDCINCLGUI) $(CFLAGS) $(CURSESDEF2) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
#==========================================
# Rules for LUA files

View File

@@ -16,7 +16,7 @@
<PropertyGroup>
<OutDir>$(BinDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="Exists('$(PDCURSES)')">
<ItemDefinitionGroup Condition="Exists('$(PDCURSESMOD)')">
<ClCompile>
<AdditionalIncludeDirectories>$(PDCURSES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>CURSES_GRAPHICS;PDC_NCMOUSE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -351,4 +351,4 @@
<Target Name="AfterRebuild">
<MSBuild Projects="$(vsDir)NetHack\afternethack.proj" Targets="Build" Properties="Configuration=$(Configuration)" />
</Target>
</Project>
</Project>

View File

@@ -8,12 +8,10 @@
<SymbolsDir>$(ProjectDir)symbols\$(Configuration)\$(Platform)\$(TargetName)\</SymbolsDir>
<ToolsDir>$(RootDir)tools\$(Configuration)\$(Platform)\</ToolsDir>
<ImageDir>$(vsDir)\Images\</ImageDir>
<SubmodulesDir>$(RootDir)submodules\</SubmodulesDir>
<UtilDir>$(RootDir)util\</UtilDir>
<DatDir>$(RootDir)dat\</DatDir>
<DocDir>$(RootDir)doc\</DocDir>
<IncDir>$(RootDir)include\</IncDir>
<LuaDir>$(SubmodulesDir)lua\</LuaDir>
<LibDir>$(RootDir)lib\</LibDir>
<SndWavDir>$(RootDir)sound\wav\</SndWavDir>
<SndWindDir>$(RootDir)sound\windsound\</SndWindDir>
@@ -28,11 +26,21 @@
<OutDir>$(ToolsDir)</OutDir>
<IntDir>$(ObjDir)</IntDir>
<WinCursDir>$(RootDir)win\curses\</WinCursDir>
<SubmodulesDir>$(RootDir)submodules\</SubmodulesDir>
<LuaDir>$(SubmodulesDir)lua\</LuaDir>
</PropertyGroup>
<PropertyGroup Condition="'$(PDCURSES)'=='' AND Exists('$(SubmodulesDir)PDCursesMod')">
<PDCURSES>$(SubmodulesDir)PDCursesMod\</PDCURSES>
<PropertyGroup Condition="'$(PDCURSESMOD)'=='' AND Exists('$(SubmodulesDir)PDCursesMod')">
<PDCURSESMOD>$(SubmodulesDir)PDCursesMod\</PDCURSESMOD>
<PDCURSES>$(PDCURSESMOD)</PDCURSES>
</PropertyGroup>
<PropertyGroup Condition="'$(PDCURSES)'=='' AND Exists('$(RootDir)lib\PDCursesMod') And !Exists('$(SubmodulesDir)PDCursesMod')">
<PDCURSES>$(RootDir)lib\PDCursesMod\</PDCURSES>
<PropertyGroup Condition="'$(PDCURSESMOD)'=='' AND Exists('$(LibDir)PDCursesMod')">
<PDCURSESMOD>$(LibDir)PDCursesMod\</PDCURSESMOD>
<PDCURSES>$(PDCURSESMOD)</PDCURSES>
</PropertyGroup>
<PropertyGroup Condition="'$(PDCURSES)'=='' AND '$(PDCURSESMOD)'=='' AND Exists('$(SubmodulesDir)PDCurses')">
<PDCURSES>$(SubmodulesDir)PDCurses\</PDCURSES>
</PropertyGroup>
<PropertyGroup Condition="'$(PDCURSES)'=='' AND '$(PDCURSESMOD)'=='' AND Exists('$(LibDir)PDCurses')">
<PDCURSES>$(LibDir)PDCurses\</PDCURSES>
</PropertyGroup>
</Project>

View File

@@ -469,6 +469,8 @@ curses_display_nhwindow(winid wid, boolean block)
{
menu_item *selected = NULL;
if (wid == WIN_ERR)
return;
if (curses_is_menu(wid) || curses_is_text(wid)) {
curses_end_menu(wid, "");
(void) curses_select_menu(wid, PICK_NONE, &selected);