From 7fcccdf5c6ebba566d9a60f29604cf6fe13b8c7d Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 25 Nov 2019 22:47:54 -0500 Subject: [PATCH] linux-hosted msdos cross-compiler updates --- sys/msdos/Makefile1.cross | 27 ++++++-------- sys/msdos/Makefile2.cross | 8 ++--- sys/msdos/msdos-cross-compile.sh | 60 ++++++++++++++++---------------- sys/unix/hints/linux | 4 --- 4 files changed, 45 insertions(+), 54 deletions(-) diff --git a/sys/msdos/Makefile1.cross b/sys/msdos/Makefile1.cross index 06053ab71..d00d19852 100644 --- a/sys/msdos/Makefile1.cross +++ b/sys/msdos/Makefile1.cross @@ -319,7 +319,7 @@ $(DAT)/nhdat: $(U)dlb_main $(DAT)/data $(DAT)/rumors \ cd $(DAT); \ pwd; \ cp $(MSYS)/msdoshlp.txt .; \ - ls -1 data oracles options quest.dat rumors help hh >dlb.lst; \ + ls -1 data oracles options rumors help hh >dlb.lst; \ ls -1 cmdhelp history opthelp wizhelp license >>dlb.lst; \ ls -1 bogusmon engrave epitaph tribute msdoshlp.txt >>dlb.lst; \ ls -1 *.lua >>dlb.lst; \ @@ -363,11 +363,6 @@ $(DAT)/rumors: $(HOST_O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal $(DAT)/oracles: $(HOST_O)utility.tag $(DAT)/oracles.txt $(U)makedefs -h -ifndef LUA_QTEXT_FILE -$(DAT)/quest.dat: $(HOST_O)utility.tag $(DAT)/quest.txt - $(U)makedefs -q -endif - $(DAT)/bogusmon: $(HOST_O)utility.tag $(DAT)/bogusmon.txt $(U)makedefs -s @@ -560,30 +555,30 @@ clean: spotless: clean if [ -f $(INCL)/pm.h ]; then rm $(INCL)/pm.h; fi; -# if [ -f $(U)dgn_flex.c ]; then rm $(U)dgn_flex.c; fi; -# if [ -f $(U)dgn_lex.c ]; then rm $(U)dgn_lex.c; fi; +## if [ -f $(U)dgn_flex.c ]; then rm $(U)dgn_flex.c; fi; +## if [ -f $(U)dgn_lex.c ]; then rm $(U)dgn_lex.c; fi; # if [ -f $(U)makedefs ]; then rm $(U)makedefs; fi; -# if [ -f $(U)dgn_comp ]; then rm $(U)dgn_comp; fi; +## if [ -f $(U)dgn_comp ]; then rm $(U)dgn_comp; fi; # if [ -f $(U)recover.exe ]; then rm $(U)recover.exe; fi; # if [ -f $(U)tilemap ]; then rm $(U)tilemap; fi; # if [ -f $(U)tile2bmp ]; then rm $(U)tile2bmp; fi; -# if [ -f $(U)tile2bin ]; then rm $(U)tile2bin; fi; -# if [ -f $(U)til2bin2 ]; then rm $(U)til2bin2; fi; -# if [ -f $(U)thintile ]; then rm $(U)thintile; fi; +## if [ -f $(U)tile2bin ]; then rm $(U)tile2bin; fi; +## if [ -f $(U)til2bin2 ]; then rm $(U)til2bin2; fi; +## if [ -f $(U)thintile ]; then rm $(U)thintile; fi; # if [ -f $(U)dlb_main ]; then rm $(U)dlb_main; fi; # if [ -f $(INCL)/vis_tab.h ]; then rm $(INCL)/vis_tab.h; fi; # if [ -f $(INCL)/onames.h ]; then rm $(INCL)/onames.h; fi; # if [ -f $(INCL)/pm.h ]; then rm $(INCL)/pm.h; fi; # if [ -f $(INCL)/date.h ]; then rm $(INCL)/date.h; fi; -# if [ -f $(INCL)/dgn_comp.h ]; then rm $(INCL)/dgn_comp.h; fi; -# if [ -f $(INCL)/lev_comp.h ]; then rm $(INCL)/lev_comp.h; fi; +## if [ -f $(INCL)/dgn_comp.h ]; then rm $(INCL)/dgn_comp.h; fi; +## if [ -f $(INCL)/lev_comp.h ]; then rm $(INCL)/lev_comp.h; fi; # if [ -f $(SRC)/vis_tab.c ]; then rm $(SRC)/vis_tab.c; fi; # if [ -f $(SRC)/tile.c ]; then rm $(SRC)/tile.c; fi; # if [ -f $(DAT)/options ]; then rm $(DAT)/options; fi; # if [ -f $(DAT)/data ]; then rm $(DAT)/data; fi; # if [ -f $(DAT)/rumors ]; then rm $(DAT)/rumors; fi; -# if [ -f $(DAT)/dungeon.pdf ]; then rm $(DAT)/dungeon.pdf; fi; -# if [ -f $(DAT)/dungeon ]; then rm $(DAT)/dungeon; fi; +## if [ -f $(DAT)/dungeon.pdf ]; then rm $(DAT)/dungeon.pdf; fi; +## if [ -f $(DAT)/dungeon ]; then rm $(DAT)/dungeon; fi; # if [ -f $(DAT)/oracles ]; then rm $(DAT)/oracles; fi; ## if [ -f $(DAT)/quest.dat ]; then rm $(DAT)/quest.dat; fi; # if [ -f $(DAT)/bogusmon ]; then rm $(DAT)/bogusmon; fi; diff --git a/sys/msdos/Makefile2.cross b/sys/msdos/Makefile2.cross index dcb148a6e..f9a848e13 100644 --- a/sys/msdos/Makefile2.cross +++ b/sys/msdos/Makefile2.cross @@ -38,10 +38,10 @@ GAMEDIR =../msdos-binary # your machine. # ADD_CURSES=Y -PDCURSES_TOP=../../pdcurses +PDCURSES_TOP=../lib/pdcurses # Set top of djgpp if not specified through ENV variables prior to make: -#DJGPP_TOP = $(HOME)/djgpp +#DJGPP_TOP = $(HOME)/lib/djgpp #--------------------------------------------------------------- # Location of LUA @@ -83,9 +83,9 @@ WSHR = ../win/share # Executables. ifndef DJGPP_TOP ifdef TRAVIS_BUILD_DIR -DJGPP_TOP = TRAVIS_BUILD_DIR/djgpp +DJGPP_TOP = TRAVIS_BUILD_DIR/lib/djgpp else -DJGPP_TOP = $(HOME)/djgpp +DJGPP_TOP = $(HOME)/lib/djgpp endif endif diff --git a/sys/msdos/msdos-cross-compile.sh b/sys/msdos/msdos-cross-compile.sh index 1edf7b147..7516d1937 100644 --- a/sys/msdos/msdos-cross-compile.sh +++ b/sys/msdos/msdos-cross-compile.sh @@ -1,9 +1,15 @@ #!/bin/sh #set -x + if [ -z "$TRAVIS_BUILD_DIR" ]; then - export DJGPP_TOP=$(pwd)/djgpp + export DJGPP_TOP=$(pwd)/lib/djgpp else - export DJGPP_TOP="$TRAVIS_BUILD_DIR/djgpp" + export DJGPP_TOP="$TRAVIS_BUILD_DIR/lib/djgpp" +fi + +if [ ! -d "$(pwd)/lib" ]; then + echo "Set up for Unix build and 'make fetch-lua' first." + exit 1 fi DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v2.9/" @@ -25,7 +31,11 @@ DJGPP_URL="$DJGPP_URL$DJGPP_FILE" # export -cd util +if [ ! -d lib]; then +mkdir -p lib +fi + +cd lib if [ ! -f "$DJGPP_FILE" ]; then if [ "$(uname)" = "Darwin" ]; then #Mac @@ -34,45 +44,38 @@ if [ ! -f "$DJGPP_FILE" ]; then wget --no-hsts "$DJGPP_URL" fi fi -cd ../ - - -if [ ! -d ../djgpp/i586-pc-msdosdjgpp ]; then - tar xjf "util/$DJGPP_FILE" -fi - -#echo after tar -# cd ../ -#pwd - -# PDCurses -if [ ! -d "../pdcurses" ]; then - echo "Getting ../pdcurses from https://github.com/wmcbrine/PDCurses.git" - git clone --depth 1 https://github.com/wmcbrine/PDCurses.git ../pdcurses +if [ ! -d djgpp/i586-pc-msdosdjgpp ]; then + tar xjf "$DJGPP_FILE" + rm $DJGPP_FILE fi # DOS-extender for use with djgpp -cd djgpp -if [ ! -d cwsdpmi ]; then +if [ ! -d djgpp/cwsdpmi ]; then if [ "$(uname)" = "Darwin" ]; then #Mac curl http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip -o csdpmi7b.zip else wget --no-hsts http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip fi + cd djgpp mkdir -p cwsdpmi cd cwsdpmi unzip ../csdpmi7b.zip - cd ../ + cd ../../ rm csdpmi7b.zip fi -cd ../ +# PDCurses +if [ ! -d "pdcurses" ]; then + echo "Getting ../pdcurses from https://github.com/wmcbrine/PDCurses.git" ; \ + git clone --depth 1 https://github.com/wmcbrine/PDCurses.git pdcurses +fi + +cd ../ #echo after dos extender - cd src mkdir -p ../msdos-binary @@ -93,16 +96,13 @@ make -f ../sys/msdos/Makefile2.cross unset GCC_EXEC_PREFIX #pwd -#ls ../djgpp/cwsdpmi/bin -#ls . - -if [ -f ../djgpp/cwsdpmi/bin/CWSDPMI.EXE ]; then - cp ../djgpp/cwsdpmi/bin/CWSDPMI.EXE ../msdos-binary/CWSDPMI.EXE; +if [ -f ../lib/djgpp/cwsdpmi/bin/CWSDPMI.EXE ]; then + cp ../lib/djgpp/cwsdpmi/bin/CWSDPMI.EXE ../msdos-binary/CWSDPMI.EXE; fi # ls -l ../msdos-binary cd ../msdos-binary -zip -9 ../NH370DOS.ZIP * +zip -9 ../lib/NH370DOS.ZIP * cd ../ -# ls -l NH370DOS.ZIP +ls -l lib/NH370DOS.ZIP diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index bcafe1cf1..dcdee332d 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -55,7 +55,3 @@ CHGRP=true VARDIRPERM = 0755 VARFILEPERM = 0600 GAMEPERM = 0755 - -CC=clang -CFLAGS+=-fsanitize=address -fno-omit-frame-pointer -LFLAGS+=-fsanitize=address -fno-omit-frame-pointer -- 2.50.1