aboutsummaryrefslogtreecommitdiff
path: root/games/nehquake
diff options
context:
space:
mode:
authorAlejandro Pulver <alepulver@FreeBSD.org>2006-05-27 17:14:10 +0000
committerAlejandro Pulver <alepulver@FreeBSD.org>2006-05-27 17:14:10 +0000
commit690c842abc2f0cfdf5d1af039a9218663cf864a0 (patch)
treef83112e8732007f8b7f5ddda7383b7b4f2c79553 /games/nehquake
parent21912230929308e3549a6aaf8002d9873cc18e0c (diff)
downloadports-690c842abc2f0cfdf5d1af039a9218663cf864a0.tar.gz
ports-690c842abc2f0cfdf5d1af039a9218663cf864a0.zip
- Fix building on non i386 architectures.
- Add X86_ASM options. Approved by: garga (mentor, implicitly)
Notes
Notes: svn path=/head/; revision=163628
Diffstat (limited to 'games/nehquake')
-rw-r--r--games/nehquake/Makefile13
-rw-r--r--games/nehquake/files/patch-Makefile44
2 files changed, 46 insertions, 11 deletions
diff --git a/games/nehquake/Makefile b/games/nehquake/Makefile
index f0b225c46b6f..69ce3c86c75d 100644
--- a/games/nehquake/Makefile
+++ b/games/nehquake/Makefile
@@ -21,7 +21,8 @@ USE_GL= yes
USE_GMAKE= yes
OPTIONS= OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
- SDL "Build SDL client" on
+ SDL "Build SDL client" on \
+ X86_ASM "Enable x86 assembly code" on
ALL_TARGET= release
SUB_FILES= pkg-message
@@ -30,9 +31,13 @@ SUB_FILES= pkg-message
.include <bsd.port.pre.mk>
-.if !defined(WITHOUT_OPTIMIZED_CFLAGS)
-MAKE_ENV+= OPTIMIZED_CFLAGS=YES
-.endif
+.for f in OPTIMIZED_CFLAGS X86_ASM
+. if !defined(WITHOUT_${f})
+MAKE_ENV+= USE_${f}=YES
+. else
+MAKE_ENV+= USE_${f}=NO
+. endif
+.endfor
.if !defined(WITHOUT_SDL)
USE_SDL= sdl
diff --git a/games/nehquake/files/patch-Makefile b/games/nehquake/files/patch-Makefile
index 2ca60fd73b91..1d40a6b42932 100644
--- a/games/nehquake/files/patch-Makefile
+++ b/games/nehquake/files/patch-Makefile
@@ -1,5 +1,5 @@
---- ./Makefile.orig Thu Nov 10 11:57:23 2005
-+++ ./Makefile Tue May 16 17:36:22 2006
+--- Makefile.orig Sat May 27 13:47:34 2006
++++ Makefile Sat May 27 14:04:12 2006
@@ -9,9 +9,9 @@
#
@@ -12,7 +12,7 @@
ifneq (,$(findstring libc6,$(shell if [ -e /lib/libc.so.6 ];then echo libc6;fi)))
GLIBC=-glibc
-@@ -28,32 +28,33 @@
+@@ -28,32 +28,45 @@
MOUNT_DIR=./src
@@ -23,14 +23,26 @@
-CC=gcc
+CC?=gcc
++ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/)
++USE_OPTIMIZED_CFLAGS?=YES
-BASE_CFLAGS=-Dstricmp=strcasecmp #-Wall
-+BASE_CFLAGS=$(CFLAGS) -Dstricmp=strcasecmp #-Wall
++ifeq ($(ARCH),i386)
++USE_X86_ASM?=YES
++else
++USE_X86_ASM=NO
++endif
-RELEASE_CFLAGS=$(BASE_CFLAGS) -march=i686 -O2 -ffast-math -funroll-loops \
++BASE_CFLAGS=$(CFLAGS) -Dstricmp=strcasecmp #-Wall
++
++ifeq ($(strip $(USE_X86_ASM)),YES)
++BASE_CFLAGS+=-Did386
++endif
++
+RELEASE_CFLAGS=$(BASE_CFLAGS)
+
-+ifdef OPTIMIZED_CFLAGS
++ifeq ($(strip $(USE_OPTIMIZED_CFLAGS)),YES)
+RELEASE_CFLAGS+=-O2 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing
-DEBUG_CFLAGS=$(BASE_CFLAGS) -g
@@ -60,7 +72,7 @@
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -o $@ -c $<
-@@ -70,10 +71,10 @@
+@@ -70,10 +83,10 @@
#############################################################################
@@ -73,7 +85,25 @@
endif
all:
-@@ -182,10 +183,10 @@
+@@ -165,12 +178,15 @@
+ $(BUILDDIR)/glquake/sys_linux.o \
+ $(BUILDDIR)/glquake/snd_dma.o \
+ $(BUILDDIR)/glquake/snd_mem.o \
+- $(BUILDDIR)/glquake/snd_mix.o \
+- \
++ $(BUILDDIR)/glquake/snd_mix.o
++
++ifeq ($(strip $(USE_X86_ASM)),YES)
++GLQUAKE_OBJS+= \
+ $(BUILDDIR)/glquake/math.o \
+ $(BUILDDIR)/glquake/worlda.o \
+ $(BUILDDIR)/glquake/snd_mixa.o \
+ $(BUILDDIR)/glquake/sys_dosa.o
++endif
+
+ GLQUAKE_LNX_OBJS = \
+ $(BUILDDIR)/glquake/cd_linux.o \
+@@ -182,10 +198,10 @@
GLX_OBJS=$(BUILDDIR)/glquake/gl_vidlinuxglx.o