]> granicus.if.org Git - nethack/commitdiff
more MSDOS build
authornethack.allison <nethack.allison>
Mon, 17 Feb 2003 02:55:46 +0000 (02:55 +0000)
committernethack.allison <nethack.allison>
Mon, 17 Feb 2003 02:55:46 +0000 (02:55 +0000)
include/pcconf.h
sys/msdos/Makefile.GCC
sys/share/pcunix.c

index 9100df839c3b0574c84cf0ac776dd75dcc3600d9..557f073a56068ea2e0b83840481db143752a29b6 100644 (file)
                        /* 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__)
 #include "system.h"
 #endif
 
-#ifdef __GO32__
+#ifdef __DJGPP__
 #include <unistd.h> /* 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 <io.h>
+#undef lock
 #include <pc.h> /* kbhit() */
 #define PC_LOCKING
+#define HOLD_LOCKFILE_OPEN
+#define SELF_RECOVER           /* NetHack itself can recover games */
 #endif
 
 # ifdef MSDOS
index 1cdce958bd372b1592c035638fced76077ed8109..5f59cf11fa5cead082bc8938137e171edbecbfb7 100644 (file)
@@ -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
index f507b3a4a4623118496d45a951e113c53aa10b71..fe73d6a3d3cc655c6f3186d91609d68d1746431f 100644 (file)
@@ -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