more msdos cross-compile fixes

undefined reference to g.variables if certain parts of
drawing.c are included in host-side utilities, so
surround the offending code in
->  #if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
This commit is contained in:
nhmall
2019-11-26 00:02:38 -05:00
parent 7fcccdf5c6
commit 36983e6889
3 changed files with 35 additions and 36 deletions

View File

@@ -291,6 +291,7 @@ char ch;
return i; return i;
} }
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
/* /*
* Explanations of the functions found below: * Explanations of the functions found below:
* *
@@ -810,5 +811,6 @@ const struct symparse loadsyms[] = {
{ SYM_OTH, SYM_HERO_OVERRIDE + SYM_OFF_X, "S_hero_override" }, { SYM_OTH, SYM_HERO_OVERRIDE + SYM_OFF_X, "S_hero_override" },
{ 0, 0, (const char *) 0 } /* fence post */ { 0, 0, (const char *) 0 } /* fence post */
}; };
#endif /* !CROSSCOMPILE || CROSSCOMPILE_TARGET */
/*drawing.c*/ /*drawing.c*/

View File

@@ -145,11 +145,9 @@ TEXTIO = $(HOST_O)tiletext.o $(HOST_O)tiletxt.o $(HOST_O)drawing.o $(HOST_O
TEXTIO2 = $(HOST_O)tiletex2.o $(HOST_O)tiletxt2.o $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)monst.o \ TEXTIO2 = $(HOST_O)tiletex2.o $(HOST_O)tiletxt2.o $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)monst.o \
$(HOST_O)objects.o $(HOST_O)objects.o
#PLANAR_TIB = $(DAT)/NETHACK1.TIB
#OVERVIEW_TIB = $(DAT)/NETHACKO.TIB
TILE_BMP = $(DAT)/NHTILES.BMP TILE_BMP = $(DAT)/NHTILES.BMP
TILEUTIL = $(TILOBJ) $(U)tile2bin $(U)til2bin2 $(TILE_BMP) $(PLANAR_TIB) $(OVERVIEW_TIB) TILEUTIL = $(TILOBJ) $(TILE_BMP)
TILEFILES = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt TILEFILES = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt
@@ -255,7 +253,7 @@ LFLAGS =
#========================================== #==========================================
$(HOST_O)%.o : $(SRC)/%.c $(HOST_O)%.o : $(SRC)/%.c
$(HOST_CC) $(cflags) -o$@ $< $(HOST_CC) $(cflags) -o$@ $<
#========================================== #==========================================
# Rules for host files in sys/msdos # Rules for host files in sys/msdos
@@ -303,8 +301,7 @@ $(HOST_O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \
tileutil: $(U)gif2txt $(U)txt2ppm tileutil: $(U)gif2txt $(U)txt2ppm
@echo Optional tile development utilities are up to date. @echo Optional tile development utilities are up to date.
$(HOST_O)prereq.tag: hobj.tag $(U)makedefs $(HOST_O)utility.tag \ $(HOST_O)prereq.tag: hobj.tag $(U)makedefs $(HOST_O)utility.tag $(DAT)/nhdat
$(HOST_O)thintile.tag $(DAT)/nhdat
echo prereq done >$@ echo prereq done >$@
#========================================== #==========================================
@@ -418,17 +415,17 @@ $(HOST_O)tilemap.o: $(WSHR)/tilemap.c $(HACK_H) $(TILE_H)
# Required for tile support # Required for tile support
#========================================== #==========================================
$(DAT)/NetHack1.tib: $(TILEFILES) $(U)tile2bin #$(DAT)/NetHack1.tib: $(TILEFILES) $(U)tile2bin
@echo Creating binary tile files # @echo Creating binary tile files
cd $(DAT) # cd $(DAT)
$(U)tile2bin # $(U)tile2bin
cd $(SRC) # cd $(SRC)
$(DAT)/NetHacko.tib: $(HOST_O)thintile.tag $(TILEFILES2) $(U)til2bin2 #$(DAT)/NetHacko.tib: $(HOST_O)thintile.tag $(TILEFILES2) $(U)til2bin2
@echo Creating overview binary tile files # @echo Creating overview binary tile files
cd $(DAT) # cd $(DAT)
$(U)til2bin2 # $(U)til2bin2
cd $(SRC) # cd $(SRC)
$(DAT)/NHTILES.BMP: $(TILEFILES) $(U)tile2bmp $(DAT)/NHTILES.BMP: $(TILEFILES) $(U)tile2bmp
@echo Creating binary tile files which may take some time @echo Creating binary tile files which may take some time
@@ -441,39 +438,39 @@ $(U)tile2bmp: $(HOST_O)tile2bmp.o $(TEXTIO)
ar r temp.a $(TEXTIO) ar r temp.a $(TEXTIO)
$(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bmp.o temp.a $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bmp.o temp.a
$(U)tile2bin: $(HOST_O)tile2bin.o $(TEXTIO) #$(U)tile2bin: $(HOST_O)tile2bin.o $(TEXTIO)
-rm -f temp.a # -rm -f temp.a
ar r temp.a $(TEXTIO) # ar r temp.a $(TEXTIO)
$(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bin.o temp.a # $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bin.o temp.a
$(U)til2bin2: $(HOST_O)til2bin2.o $(TEXTIO2) #$(U)til2bin2: $(HOST_O)til2bin2.o $(TEXTIO2)
-rm -f temp.a # -rm -f temp.a
ar r temp.a $(TEXTIO2) # ar r temp.a $(TEXTIO2)
$(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)til2bin2.o temp.a # $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)til2bin2.o temp.a
$(U)thintile: $(HOST_O)thintile.o #$(U)thintile: $(HOST_O)thintile.o
$(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)thintile.o # $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)thintile.o
#$(HOST_O)thintile.o: $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c #$(HOST_O)thintile.o: $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c
# -rm -f temp.a # -rm -f temp.a
# ar r temp.a $(TEXTIO) # ar r temp.a $(TEXTIO)
# $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bmp.o temp.a # $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bmp.o temp.a
$(HOST_O)thintile.o: $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c #$(HOST_O)thintile.o: $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c
$(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE -DOVERVIEW_FILE -o$@ $(WSHR)/thintile.c # $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE -DOVERVIEW_FILE -o$@ $(WSHR)/thintile.c
$(HOST_O)thintile.tag: $(U)thintile $(TILEFILES) #$(HOST_O)thintile.tag: $(U)thintile $(TILEFILES)
$(U)thintile # $(U)thintile
echo thintiles created >$@ # echo thintiles created >$@
$(HOST_O)tile2bmp.o: $(HACK_H) $(TILE_H) $(WSHR)/tile2bmp.c $(HOST_O)tile2bmp.o: $(HACK_H) $(TILE_H) $(WSHR)/tile2bmp.c
$(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c
$(HOST_O)tile2bin.o: $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c #$(HOST_O)tile2bin.o: $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c
$(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/tile2bin.c # $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/tile2bin.c
$(HOST_O)til2bin2.o: $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c #$(HOST_O)til2bin2.o: $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c
$(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE_X=8 -DOVERVIEW_FILE -o$@ $(MSYS)/tile2bin.c # $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE_X=8 -DOVERVIEW_FILE -o$@ $(MSYS)/tile2bin.c
$(HOST_O)tiletext.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tiletext.c $(HOST_O)tiletext.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tiletext.c
$(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tiletext.c $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tiletext.c

View File

@@ -31,7 +31,7 @@ DJGPP_URL="$DJGPP_URL$DJGPP_FILE"
# export # export
if [ ! -d lib]; then if [ ! -d lib ]; then
mkdir -p lib mkdir -p lib
fi fi