--- a/iortcw-1.51c/SP/Makefile 2019-03-16 18:09:48.000000000 +0000 +++ b/iortcw-1.51c/SP/Makefile 2021-03-08 17:23:21.000000000 +0000 @@ -5,7 +5,7 @@ # COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g') -COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/') +COMPILE_ARCH=$(shell grep -Eo '^CARCH="[^"]+' /etc/makepkg.conf | sed s/'CARCH="'//) ARM_VER_CHECK=$(shell uname -m) ifeq ($(COMPILE_PLATFORM),sunos) @@ -151,7 +151,7 @@ endif ifndef COPYDIR -COPYDIR="/usr/local/games/wolf" +COPYDIR="/opt/return_to_castle_wolfenstein" endif ifndef COPYBINDIR @@ -266,7 +266,11 @@ USE_BLOOM=1 endif -ifndef USE_OPENGLES +ifeq ($(ARCH),armv7h) +USE_OPENGLES=1 +else ifeq ($(ARCH),aarch64) +USE_OPENGLES=1 +else USE_OPENGLES=0 endif @@ -375,8 +379,12 @@ OPTIMIZEVM = -O3 OPTIMIZE = $(OPTIMIZEVM) -ffast-math endif - ifeq ($(ARCH),x86) - OPTIMIZEVM = -O3 -march=i586 + ifeq ($(ARCH),i686) + OPTIMIZEVM = -O3 + OPTIMIZE = $(OPTIMIZEVM) -ffast-math + endif + ifeq ($(ARCH),pentium4) + OPTIMIZEVM = -O3 OPTIMIZE = $(OPTIMIZEVM) -ffast-math endif ifeq ($(ARCH),ppc) @@ -412,7 +420,11 @@ ifeq ($(USE_INTERNAL_LIBS),1) ifeq ($(CROSS_COMPILING),1) - ifeq ($(ARCH),x86) + ifeq ($(ARCH),pentium4) + SDL_LIBS = $(LIBSDIR)/linux32/libSDL2main.a \ + $(LIBSDIR)/linux32/libSDL2-2.0.so.0.9.0 + endif + ifeq ($(ARCH),i686) SDL_LIBS = $(LIBSDIR)/linux32/libSDL2main.a \ $(LIBSDIR)/linux32/libSDL2-2.0.so.0.9.0 endif @@ -911,7 +923,10 @@ RANLIB=ranlib endif -ifeq ($(ARCH),x86) +ifeq ($(ARCH),i686) + BASE_CFLAGS += -m32 +endif +ifeq ($(ARCH),pentium4) BASE_CFLAGS += -m32 endif ifeq ($(ARCH),x86_64) @@ -929,12 +944,18 @@ ifeq ($(ARCH),sparc64) BASE_CFLAGS += -m64 endif +ifeq ($(ARCH),armv7h) + BASE_CFLAGS += -m32 +endif +ifeq ($(ARCH),aarch64) + BASE_CFLAGS += -m64 +endif ifndef HAVE_VM_COMPILED HAVE_VM_COMPILED=false endif -ifneq ($(findstring $(ARCH),x86 x86_64 ppc ppc64 sparc sparc64),) +ifneq ($(findstring $(ARCH),i686 pentium4 x86_64 armv7h aarch64 ppc ppc64 sparc sparc64),) HAVE_VM_COMPILED=true endif @@ -1908,7 +1929,13 @@ endif endif -ifeq ($(ARCH),x86) +ifeq ($(ARCH),i686) + Q3OBJ += \ + $(B)/client/snd_mixa.o \ + $(B)/client/matha.o \ + $(B)/client/snapvector.o \ + $(B)/client/ftola.o +else ifeq ($(ARCH),pentium4) Q3OBJ += \ $(B)/client/snd_mixa.o \ $(B)/client/matha.o \ @@ -2120,7 +2147,7 @@ endif ifeq ($(HAVE_VM_COMPILED),true) - ifneq ($(findstring $(ARCH),x86 x86_64),) + ifneq ($(findstring $(ARCH),i686 pentium4 x86_64),) Q3OBJ += $(B)/client/vm_x86.o endif ifneq ($(findstring $(ARCH),ppc ppc64),) @@ -2129,7 +2156,7 @@ ifneq ($(findstring $(ARCH),sparc sparc64),) Q3OBJ += $(B)/client/vm_sparc.o endif - ifeq ($(ARM_VER_CHECK),armv7l) + ifneq ($(findstring $(ARCH),armv7h aarch64),) Q3OBJ += $(B)/client/vm_armv7l.o endif endif @@ -2268,7 +2295,12 @@ $(B)/ded/con_log.o \ $(B)/ded/sys_main.o -ifeq ($(ARCH),x86) +ifeq ($(ARCH),i686) + Q3DOBJ += \ + $(B)/ded/matha.o \ + $(B)/ded/snapvector.o \ + $(B)/ded/ftola.o +else ifeq ($(ARCH),pentium4) Q3DOBJ += \ $(B)/ded/matha.o \ $(B)/ded/snapvector.o \ @@ -2291,7 +2323,7 @@ endif ifeq ($(HAVE_VM_COMPILED),true) - ifneq ($(findstring $(ARCH),x86 x86_64),) + ifneq ($(findstring $(ARCH),i686 pentium4 x86_64),) Q3DOBJ += $(B)/ded/vm_x86.o endif ifneq ($(findstring $(ARCH),ppc ppc64),) @@ -2300,7 +2332,7 @@ ifneq ($(findstring $(ARCH),sparc sparc64),) Q3DOBJ += $(B)/ded/vm_sparc.o endif - ifeq ($(ARM_VER_CHECK),armv7l) + ifneq ($(findstring $(ARCH),armv7h aarch64),) Q3DOBJ += $(B)/ded/vm_armv7l.o endif endif