From: nethack.allison Date: Mon, 17 Feb 2003 02:55:46 +0000 (+0000) Subject: more MSDOS build X-Git-Tag: MOVE2GIT~2168 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a83f1b830a636ee16e88fe0d77d0834d86257ed;p=nethack more MSDOS build --- diff --git a/include/pcconf.h b/include/pcconf.h index 9100df839..557f073a5 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -99,10 +99,6 @@ /* amiconf.h). In the future this will be the */ /* hook for mail reader implementation. */ -/*# define PC_LOCKING */ /* Allow confirmation before overwriting game */ - /* that is in progress or aborted when another */ - /* game is started with the same player name. */ - /* The following is needed for prototypes of certain functions */ #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__) @@ -160,12 +156,16 @@ #include "system.h" #endif -#ifdef __GO32__ +#ifdef __DJGPP__ #include /* close(), etc. */ -/* setmode is in io.h but lock() in io.h interferes with lock[] in decl.h */ -extern int FDECL(setmode, (int,int)); +/* lock() in io.h interferes with lock[] in decl.h */ +#define lock djlock +#include +#undef lock #include /* kbhit() */ #define PC_LOCKING +#define HOLD_LOCKFILE_OPEN +#define SELF_RECOVER /* NetHack itself can recover games */ #endif # ifdef MSDOS diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 1cdce958b..5f59cf11f 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -380,6 +380,11 @@ DJ1 = $(dir $(DJGPP)) CWSDPMI = $(subst /,\,$(DJ1))bin\CWSDPMI.* endif +ifdef BUILDRECOVER +RECOVEREXE = $(U)RECOVER.EXE +RECOVEROBJ = $(O)RECOVER.O +endif + #========================================== # Primary Targets. #========================================== @@ -397,7 +402,7 @@ util: $(O)utility.tag $(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \ $(INCL)/pm.h monstr.c vis_tab.c \ - $(U)lev_comp.exe $(U)dgn_comp.exe $(U)recover.exe $(TILEUTIL) + $(U)lev_comp.exe $(U)dgn_comp.exe $(RECOVEREXE) $(TILEUTIL) $(subst /,\,echo utilities made > $@) tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe @@ -420,9 +425,13 @@ endif @$(subst /,\,if exist $(DAT)/*.tib copy $(DAT)/*.tib $(GAMEDIR)) @$(subst /,\,copy $(SSHR)/NetHack.cnf $(GAMEDIR)/defaults.nh) @$(subst /,\,copy $(MSYS)/NHAccess.nh $(GAMEDIR)) - @$(subst /,\,copy $(U)recover.exe $(GAMEDIR)) +ifdef BUILDRECOVER + @$(subst /,\,copy $(RECOVEREXE) $(GAMEDIR)) +endif @$(subst /,\,copy $(DOC)/guidebo*.txt $(GAMEDIR)) +ifdef BUILDRECOVER @$(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)) +endif @$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)) ifdef CWSDPMI @$(subst /,\,if exist $(CWSDPMI) copy $(CWSDPMI) $(GAMEDIR)) @@ -435,7 +444,7 @@ endif # The main target. #========================================== -$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(O)$(GAME).lnk +$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk $(LINK) $(LFLAGS) -o$(GAME).exe @$(O)$(GAME).lnk $(LIBRARIES) @$(subst /,\,stubedit $(GAME).exe minstack=2048K) @$(subst /,\,copy $(GAME).exe $(GAMEFILE)) @@ -495,7 +504,9 @@ spotless: clean $(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe) $(subst /,\,if exist $(U)lev_comp.exe del $(U)lev_comp.exe) $(subst /,\,if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe) - $(subst /,\,if exist $(U)recover.exe del $(U)recover.exe) +ifdef BUILDRECOVER + $(subst /,\,if exist $(RECOVEREXE) del $(RECOVEREXE)) +endif $(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe) $(subst /,\,if exist $(U)tile2bin.exe del $(U)tile2bin.exe) $(subst /,\,if exist $(U)til2bin2.exe del $(U)til2bin2.exe) @@ -705,11 +716,13 @@ endif # Recover Utility #========================================== +ifdef BUILDRECOVER $(U)recover.exe: $(RECOVOBJS) $(LINK) $(LFLAGS) -o$@ $(O)recover.o $(O)recover.o: $(CONFIG_H) $(U)recover.c $(CC) $(cflags) -o$@ $(U)recover.c +endif #========================================== # Header file moves required for tile support diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c index f507b3a4a..fe73d6a3d 100644 --- a/sys/share/pcunix.c +++ b/sys/share/pcunix.c @@ -124,7 +124,7 @@ getlock() # if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) chdirx(orgdir, 0); # endif -# if defined(WIN32) +# if defined(WIN32) || defined(HOLD_LOCKFILE_OPEN) # if defined(HOLD_LOCKFILE_OPEN) if(errno == EACCES) { #define OOPS_BUFSZ 512 @@ -135,6 +135,7 @@ getlock() Strcat(oops, " Is the other game still running?\n"); if (strlen(fq_lock) < ((OOPS_BUFSZ -16) - strlen(oops))) Sprintf(eos(oops), "Cannot open %s", fq_lock); + Strcat(oops, "\n"); unlock_file(HLOCK); error(oops); } else