diff options
author | alepulver <alepulver@FreeBSD.org> | 2006-05-28 01:14:10 +0800 |
---|---|---|
committer | alepulver <alepulver@FreeBSD.org> | 2006-05-28 01:14:10 +0800 |
commit | 37c995a13e7485765fa52ae91aab526a15bd383f (patch) | |
tree | 83db0f05447e44c0e620c676983b5b789c4887ed | |
parent | c9630e24757793c63b4f86997ca625eea5e97383 (diff) | |
download | freebsd-ports-gnome-37c995a13e7485765fa52ae91aab526a15bd383f.tar.gz freebsd-ports-gnome-37c995a13e7485765fa52ae91aab526a15bd383f.tar.zst freebsd-ports-gnome-37c995a13e7485765fa52ae91aab526a15bd383f.zip |
- Fix building on non i386 architectures.
- Add X86_ASM options.
Approved by: garga (mentor, implicitly)
-rw-r--r-- | games/nehquake/Makefile | 13 | ||||
-rw-r--r-- | games/nehquake/files/patch-Makefile | 44 |
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 |