$NetBSD: patch-ac,v 1.1.1.1 2009/01/13 00:12:29 jmcneill Exp $ --- Makefile.orig 2009-01-12 12:28:41.000000000 -0500 +++ Makefile @@ -644,24 +644,109 @@ ifeq ($(PLATFORM),netbsd) ifeq ($(shell uname -m),i386) ARCH=i386 + else + ifeq ($(shell uname -m),amd64) + ARCH=x86_64 + endif + endif + + USE_MUMBLE=0 + + BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ + -pipe -DUSE_ICON $(shell sdl-config --cflags) + + ifeq ($(USE_OPENAL),1) + BASE_CFLAGS += -DUSE_OPENAL + ifeq ($(USE_OPENAL_DLOPEN),1) + BASE_CFLAGS += -DUSE_OPENAL_DLOPEN + endif + endif + + ifeq ($(USE_CURL),1) + BASE_CFLAGS += -DUSE_CURL + ifeq ($(USE_CURL_DLOPEN),1) + BASE_CFLAGS += -DUSE_CURL_DLOPEN + endif + endif + + ifeq ($(USE_CODEC_VORBIS),1) + BASE_CFLAGS += -DUSE_CODEC_VORBIS + endif + + OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer + + ifeq ($(ARCH),x86_64) + OPTIMIZE = -O3 -fomit-frame-pointer -ffast-math -funroll-loops \ + -falign-loops=2 -falign-jumps=2 -falign-functions=2 \ + -fstrength-reduce + # experimental x86_64 jit compiler! you need GNU as + HAVE_VM_COMPILED = true + else + ifeq ($(ARCH),i386) + OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \ + -funroll-loops -falign-loops=2 -falign-jumps=2 \ + -falign-functions=2 -fstrength-reduce + HAVE_VM_COMPILED=true + else + ifeq ($(ARCH),ppc) + BASE_CFLAGS += -maltivec + HAVE_VM_COMPILED=true + endif + ifeq ($(ARCH),ppc64) + BASE_CFLAGS += -maltivec + HAVE_VM_COMPILED=true + endif + endif + endif + + ifneq ($(HAVE_VM_COMPILED),true) + BASE_CFLAGS += -DNO_VM_COMPILED endif - LIBS=-lm SHLIBEXT=so SHLIBCFLAGS=-fPIC SHLIBLDFLAGS=-shared $(LDFLAGS) + THREAD_LIBS=-lpthread + LIBS=-lm - BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes + CLIENT_LIBS=$(shell sdl-config --libs) -lGL - ifneq ($(ARCH),i386) - BASE_CFLAGS += -DNO_VM_COMPILED + ifeq ($(USE_OPENAL),1) + ifneq ($(USE_OPENAL_DLOPEN),1) + CLIENT_LIBS += -lopenal + endif endif - DEBUG_CFLAGS=$(BASE_CFLAGS) -g + ifeq ($(USE_CURL),1) + ifneq ($(USE_CURL_DLOPEN),1) + CLIENT_LIBS += -lcurl + endif + endif - BUILD_CLIENT = 0 - BUILD_GAME_QVM = 0 + ifeq ($(USE_CODEC_VORBIS),1) + CLIENT_LIBS += -lvorbisfile -lvorbis -logg + endif + + ifeq ($(USE_MUMBLE),1) + CLIENT_LIBS += -lrt + endif + + ifeq ($(USE_LOCAL_HEADERS),1) + BASE_CFLAGS += -I$(SDLHDIR)/include + endif + + ifeq ($(ARCH),i386) + # linux32 make ... + BASE_CFLAGS += -m32 + else + ifeq ($(ARCH),ppc64) + BASE_CFLAGS += -m64 + endif + endif + + DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0 + RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE) else # ifeq netbsd