updates for msdos cross-compile

gcc 12.1.0

also incorporate a libc patch for djgpp
This commit is contained in:
nhmall
2022-06-21 03:15:25 -04:00
parent 4944338a73
commit 0085cd9e8c
4 changed files with 47 additions and 3 deletions

20
sys/msdos/exceptn.S.patch Normal file
View File

@@ -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 */

View 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

View 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)

View 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
#