]> granicus.if.org Git - nethack/commitdiff
updates for msdos cross-compile
authornhmall <nhmall@nethack.org>
Tue, 21 Jun 2022 07:15:25 +0000 (03:15 -0400)
committernhmall <nhmall@nethack.org>
Tue, 21 Jun 2022 07:15:25 +0000 (03:15 -0400)
gcc 12.1.0

also incorporate a libc patch for djgpp

sys/msdos/exceptn.S.patch [new file with mode: 0644]
sys/msdos/fetch-cross-compiler.sh
sys/unix/hints/include/cross-post.370
sys/unix/hints/include/cross-pre.370

diff --git a/sys/msdos/exceptn.S.patch b/sys/msdos/exceptn.S.patch
new file mode 100644 (file)
index 0000000..3092e60
--- /dev/null
@@ -0,0 +1,20 @@
+source https://www.vogons.org/viewtopic.php?f=61&t=71459
+--- orig/src/libc/go32/exceptn.S        2002-12-21 21:08:39.000000000 -0800
++++ ./src/libc/go32/exceptn.S 2020-01-18 18:37:27.397176800 -0800
+@@ -337,6 +337,15 @@
+        je      6f
+        orb     $2,%ah  /* If RShift is set, set LShift as well */
+ 6:
++        movb    %ah,%al
++       andb    %cs:___djgpp_sigint_mask, %ah   /* Mask off irrelevant bits */
++       cmpb    %cs:___djgpp_sigint_key+1, %ah  /* Test for SIGINT */
++        je      60f
++        movb    %al,%ah
++       andb    %cs:___djgpp_sigquit_mask, %ah  /* Mask off irrelevant bits */
++       cmpb    %cs:___djgpp_sigquit_key+1, %ah /* Test for SIGQUIT*/
++       jne     Lkbd_chain
++60:
+        inb     $0x60,%al                       /* Read the scan code */
+ 99:
+        movb    %ah,%bh                         /* Save KB status */
+
index 5b5d44e7071622fcfe1513d4f6345510713f8f9b..9970f76f03f277f723f2af44ecf35eaee3f695e6 100644 (file)
@@ -8,7 +8,7 @@ else
 fi
 
 if [ -z "$GCCVER" ]; then
-       export GCCVER=gcc1020
+       export GCCVER=gcc1210
 fi
 
 if [ -z "$LUA_VERSION" ]; then
@@ -22,7 +22,10 @@ fi
 
 #DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v2.9/"
 #DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/"
-DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.1/"
+#DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.1/"
+#DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.1/"
+DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.3/"
+
 if [ "$(uname)" = "Darwin" ]; then
     #Mac
     DJGPP_FILE="djgpp-osx-$GCCVER.tar.bz2"
@@ -88,6 +91,24 @@ if [ ! -d "pdcurses" ]; then
        git clone --depth 1 https://github.com/wmcbrine/PDCurses.git pdcurses
 fi
 
+if [ ! -d djgpp/djgpp-patch ]; then
+    echo "Getting djlsr205.zip" ;
+    cd djgpp
+    mkdir -p djgpp-patch
+    cd djgpp-patch
+    if [ "$(uname)" = "Darwin" ]; then
+       #Mac
+       curl http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djlsr205.zip
+    else
+       wget --quiet --no-hsts http://www.mirrorservice.org/sites/ftp.delorie.com/pub/djgpp/current/v2/djlsr205.zip
+    fi
+    ls -l
+    mkdir -p src/libc/go32
+    unzip -p djlsr205.zip src/libc/go32/exceptn.S >src/libc/go32/exceptn.S
+    patch -p0 -l -i ../../../sys/msdos/exceptn.S.patch
+    cd ../../
+fi
+
 cd ../
 
 # Don't fail the build if lua fetch failed because we cannot do anything about it
index a27965ddda252740fbf8aede350d0e18611040ef..2364a4109381ae177e08fa59b3908811870487e3 100644 (file)
@@ -18,6 +18,9 @@ $(TARGETPFX)vidvesa.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \
 $(TARGETPFX)vidstub.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \
                $(HACK_H)
 $(TARGETPFX)tile.o : tile.c
+$(TARGETPFX)exceptn.o : ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S
+       $(TARGET_CC) -c -o $@ ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S
+       $(TARGET_AR) ru ../lib/djgpp/i586-pc-msdosdjgpp/lib/libc.a $(TARGETPFX)exceptn.o
 $(GAMEBIN) : $(HOBJ) $(LUACROSSLIB)
        $(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \
        $(HOBJ) $(WINLIB) $(TARGET_LIBS)
index 2857c7a371679fa664ec0f6eaa22a52d0068d6b2..ed0c5734cdac56645d6653217d84d22b78f2cb69 100644 (file)
@@ -183,7 +183,7 @@ override LUALIBS=
 override TOPLUALIB=
 override GAMEBIN = $(TARGETPFX)nethack.exe
 override PACKAGE = dospkg
-override PREGAME += mkdir -p $(TARGETDIR) ;
+override PREGAME += mkdir -p $(TARGETDIR) ; make $(TARGETPFX)exceptn.o ;
 override CLEANMORE += rm -f -r $(TARGETDIR) ;
 VARDATND += nhtiles.bmp
 #