--- Makefile.orig 2011-12-12 22:48:49 UTC +++ Makefile @@ -16,6 +16,10 @@ ifeq ($(COMPILE_PLATFORM),darwin) # Apple does some things a little differently... COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/) endif +ifeq ($(COMPILE_PLATFORM),freebsd) + # FreeBSD does some things a little differently... + COMPILE_ARCH=$(shell uname -p) +endif ifeq ($(COMPILE_PLATFORM),mingw32) ifeq ($(COMPILE_ARCH),i386) @@ -70,6 +74,9 @@ ifeq ($(COMPILE_ARCH),powerpc64) COMPILE_ARCH=ppc64 endif +ifeq ($(COMPILE_ARCH),powerpc64le) + COMPILE_ARCH=ppc64le +endif ifndef ARCH ARCH=$(COMPILE_ARCH) @@ -205,6 +209,8 @@ ifneq ($(BUILD_CLIENT),0) OPENAL_LIBS=$(shell pkg-config --silence-errors --libs openal) SDL_CFLAGS=$(shell pkg-config --silence-errors --cflags sdl|sed 's/-Dmain=SDL_main//') SDL_LIBS=$(shell pkg-config --silence-errors --libs sdl) + VORBIS_CFLAGS=$(shell pkg-config --silence-errors --cflags vorbis vorbisfile) + VORBIS_LIBS=$(shell pkg-config --silence-errors --libs vorbis vorbisfile) endif # Use sdl-config if all else fails ifeq ($(SDL_CFLAGS),) @@ -570,9 +576,15 @@ else # ifeq mingw32 ifeq ($(PLATFORM),freebsd) + # system integration + ifndef DEFAULT_LIBDIR + DEFAULT_LIBDIR = /usr/local/lib/openarena + endif + # flags BASE_CFLAGS = $(shell env MACHINE_ARCH=$(ARCH) make -f /dev/null -VCFLAGS) \ -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ + -DDEFAULT_LIBDIR=\\\"$(DEFAULT_LIBDIR)\\\" \ -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON CLIENT_CFLAGS = $(SDL_CFLAGS) SERVER_CFLAGS = @@ -595,29 +607,26 @@ ifeq ($(PLATFORM),freebsd) # optional features/libraries ifeq ($(USE_OPENAL),1) - CLIENT_CFLAGS += -DUSE_OPENAL + CLIENT_CFLAGS += -DUSE_OPENAL $(OPENAL_CFLAGS) + CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS) ifeq ($(USE_OPENAL_DLOPEN),1) CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN - CLIENT_LIBS += $(THREAD_LIBS) -lopenal endif endif ifeq ($(USE_CURL),1) - CLIENT_CFLAGS += -DUSE_CURL + CLIENT_CFLAGS += -DUSE_CURL $(CURL_CFLAGS) + CLIENT_LIBS += $(CURL_LIBS) ifeq ($(USE_CURL_DLOPEN),1) CLIENT_CFLAGS += -DUSE_CURL_DLOPEN - CLIENT_LIBS += -lcurl endif endif ifeq ($(USE_CODEC_VORBIS),1) - CLIENT_CFLAGS += -DUSE_CODEC_VORBIS + CLIENT_CFLAGS += -DUSE_CODEC_VORBIS $(VORBIS_CFLAGS) + CLIENT_LIBS += $(VORBIS_LIBS) endif - ifeq ($(USE_CODEC_VORBIS),1) - CLIENT_LIBS += -lvorbisfile -lvorbis -logg - endif - # cross-compiling tweaks ifeq ($(ARCH),i386) ifeq ($(CROSS_COMPILING),1) @@ -897,7 +906,7 @@ ifeq ($(USE_VOIP),1) CLIENT_CFLAGS += -DUSE_VOIP SERVER_CFLAGS += -DUSE_VOIP ifeq ($(USE_INTERNAL_SPEEX),1) - CLIENT_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include + CLIENT_CFLAGS := -I$(SPEEXDIR)/include -DFLOATING_POINT -DUSE_ALLOCA $(CLIENT_CFLAGS) else CLIENT_LIBS += -lspeex -lspeexdsp endif @@ -1564,9 +1576,12 @@ ifeq ($(ARCH),ppc) Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o endif - ifeq ($(ARCH),ppc64) + ifeq ($(COMPILE_ARCH),ppc64) Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o endif + ifeq ($(COMPILE_ARCH),ppc64le) + Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o + endif ifeq ($(ARCH),sparc) Q3OBJ += $(B)/client/vm_sparc.o endif @@ -1732,7 +1747,10 @@ ifeq ($(ARCH),ppc) Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o endif - ifeq ($(ARCH),ppc64) + ifeq ($(COMPILE_ARCH),ppc64) + Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o + endif + ifeq ($(COMPILE_ARCH),ppc64le) Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o endif ifeq ($(ARCH),sparc)