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

View File

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

View File

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

View File

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

View File

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