From e355c3c6e076af6a0485284cf3e55b3fa5743731 Mon Sep 17 00:00:00 2001 From: Eric Branlund Date: Sat, 11 Jun 2022 12:40:04 -0700 Subject: [PATCH] Some hacks to compile and link an English version on Debian 11. --- src/externs.h | 10 +++++----- src/gcc-wrap | 10 ++++++++++ src/main.c | 25 +++++++++++++++++-------- src/makefile.std | 28 ++++++++++++++++++++++------ 4 files changed, 54 insertions(+), 19 deletions(-) create mode 100755 src/gcc-wrap diff --git a/src/externs.h b/src/externs.h index 6e0017e..5055ca1 100644 --- a/src/externs.h +++ b/src/externs.h @@ -2095,12 +2095,12 @@ extern void make_evilweapon(object_type *o_ptr, monster_race *r_ptr); extern bool apply_random_unique(int r_idx); extern char random_unique_name[3][80]; extern s16b random_unique_akills; -bool flag_generate_doppelganger; +extern bool flag_generate_doppelganger; -int flag_generate_lilywhite; +extern int flag_generate_lilywhite; -int special_idol_generate_type; +extern int special_idol_generate_type; extern bool check_rest_f50(int r_idx); @@ -2537,10 +2537,10 @@ extern void absorb_tsukumo(int m_idx); extern bool hack_flag_powerup_mutation; //v1.1.43 -bool lunatic_torch(int m_idx, int power); +extern bool lunatic_torch(int m_idx, int power); //v1.1.43 -bool flag_sunny_refraction; +extern bool flag_sunny_refraction; extern void update_flying_dist(void); //v1.1.44 diff --git a/src/gcc-wrap b/src/gcc-wrap new file mode 100755 index 0000000..44e985e --- /dev/null +++ b/src/gcc-wrap @@ -0,0 +1,10 @@ +#!/bin/sh + +eval src_file=\${$#} + +trap '' INT +backup=`mktemp tmp.XXXXXX` +mv $src_file $backup +nkf -e $backup > $src_file +$@ +mv $backup $src_file diff --git a/src/main.c b/src/main.c index 028506a..3c7957d 100644 --- a/src/main.c +++ b/src/main.c @@ -268,6 +268,21 @@ static void change_path(cptr info) } +/* + * Provided routines that main-win.c does, but do nothing: allows things to + * link. + */ +void init_music_hack() +{ +} + + +int find_mon_music_priority(int r_idx) +{ + return 0; +} + + /* * Simple "main" function for multiple platforms. * @@ -613,17 +628,9 @@ int main(int argc, char *argv[]) argv[1] = NULL; } - - /* Process the player name */ - process_player_name(TRUE); - - - /* Install "quit" hook */ quit_aux = quit_hook; - - #ifdef USE_XAW /* Attempt to use the "main-xaw.c" support */ if (!done && (!mstr || (streq(mstr, "xaw")))) @@ -777,6 +784,8 @@ int main(int argc, char *argv[]) /* Make sure we have a display! */ if (!done) quit("Unable to prepare any 'display module'!"); + /* Process the player name */ + process_player_name(TRUE); /* Hack -- If requested, display scores and quit */ if (show_score > 0) display_scores(0, show_score); diff --git a/src/makefile.std b/src/makefile.std index d4255b0..7ded339 100644 --- a/src/makefile.std +++ b/src/makefile.std @@ -49,14 +49,15 @@ SRCS = \ object1.c object2.c monster1.c monster2.c \ xtra1.c xtra2.c spells1.c spells2.c \ melee1.c melee2.c save.c files.c floors.c \ - cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c \ + cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c cmd_junko.c \ do-spell.c store.c birth.c load.c \ wizard1.c wizard2.c grid.c streams.c rooms.c \ generate.c dungeon.c init1.c init2.c \ effects.c racial.c inet.c report.c snipe.c hex.c \ artifact.c autopick.c mutation.c flavor.c spells3.c \ mspells1.c mspells2.c scores.c mind.c mane.c hissatsu.c \ - bldg.c obj_kind.c wild.c avatar.c japanese.c mspells3.c \ + bldg.c bldg2.c obj_kind.c wild.c avatar.c japanese.c mspells3.c \ + ability_card.c new_class_power.c random_unique_monster.c straygod.c \ main-cap.c main-gcu.c main-x11.c main-xaw.c main.c chuukei.c OBJS = \ @@ -65,14 +66,15 @@ OBJS = \ object1.o object2.o monster1.o monster2.o \ xtra1.o xtra2.o spells1.o spells2.o \ melee1.o melee2.o save.o files.o floors.o \ - cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \ + cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o cmd7.o cmd_junko.o \ do-spell.o store.o birth.o load.o \ wizard1.o wizard2.o grid.o streams.o rooms.o \ generate.o dungeon.o init1.o init2.o \ effects.o racial.o inet.o report.o snipe.o hex.o \ artifact.o autopick.o mutation.o flavor.o spells3.o \ mspells1.o mspells2.o scores.o mind.o mane.o hissatsu.o \ - bldg.o obj_kind.o wild.o avatar.o japanese.o mspells3.o \ + bldg.o bldg2.o obj_kind.o wild.o avatar.o japanese.o mspells3.o \ + ability_card.c new_class_power.o random_unique_monster.o straygod.o \ main-cap.o main-gcu.o main-x11.o main-xaw.o main.o chuukei.o @@ -109,7 +111,7 @@ CC = gcc # # Options for Japanese version (comment out for English version) -JP_OPT= -D"JP" -D"EUC" -DDEFAULT_LOCALE="\"ja_JP.eucJP\"" +#JP_OPT= -D"JP" -D"EUC" -DDEFAULT_LOCALE="\"ja_JP.eucJP\"" ################################################################### @@ -135,7 +137,7 @@ JP_OPT= -D"JP" -D"EUC" -DDEFAULT_LOCALE="\"ja_JP.eucJP\"" #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" #LIBS = -lX11 -lcurses -ltermcap -CFLAGS = -Wall -O2 -fno-strength-reduce -m486 -pipe -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include +CFLAGS = -Wall -O2 -fno-strength-reduce -pipe -g -D"USE_X11" -DANGBAND_2_8_1 $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include LIBS = -L/usr/X11R6/lib -lX11 -lncurses @@ -254,6 +256,13 @@ LIBS = -L/usr/X11R6/lib -lX11 -lncurses +# +# Hack -- convert Japanese encoding (shift JIS?) in .c files to EUC-JP so +# Unix compilers don't choke. +# +.c.o: + ./gcc-wrap $(CC) $(CFLAGS) -c -o $@ $< + # # Hack -- "install" as the base target # @@ -301,9 +310,11 @@ INCS = \ z-term.h z-rand.h z-util.h z-virt.h z-form.h $(HDRS) +ability_card.o: ability_card.c $(INCS) artifact.o: artifact.c $(INCS) avatar.o: avatar.c $(INCS) bldg.o: bldg.c $(INCS) +bld2.o: bld2.c $(INCS) birth.o: birth.c $(INCS) cave.o: cave.c $(INCS) chuukei.o: chuukei.c $(INCS) @@ -313,6 +324,8 @@ cmd3.o: cmd3.c $(INCS) cmd4.o: cmd4.c $(INCS) cmd5.o: cmd5.c $(INCS) cmd6.o: cmd6.c $(INCS) +cmd7.o: cmd7.c $(INCS) +cmd_junko.o: cmd_junko.c $(INCS) do-spell.o: do-spell.c $(INCS) dungeon.o: dungeon.c $(INCS) effects.o: effects.c $(INCS) @@ -320,7 +333,9 @@ files.o: files.c $(INCS) flavor.o: flavor.c $(INCS) generate.o: generate.c $(INCS) generate.h grid.h rooms.h streams.h grid.o: grid.c $(INCS) grid.h generate.h +new_class_power.o: new_class_power.c $(INCS) player/player-log.h rooms.o: rooms.c $(INCS) grid.h rooms.h generate.h +straygod.o: straygod.c $(INCS) streams.o: streams.c $(INCS) grid.h generate.h hissatsu.o: hissatsu.c $(INCS) hex.o: hex.c $(INCS) @@ -348,6 +363,7 @@ object1.o: object1.c $(INCS) object2.o: object2.c $(INCS) kajitips.h obj_kind.o: obj_kind.c $(INCS) racial.o: racial.c $(INCS) +random_unique_monster.o: random_unique_monster.c $(INCS) report.o: report.c $(INCS) scores.o: scores.c $(INCS) save.o: save.c $(INCS) -- 2.30.2