forked from ptitSeb/OpenArenaPandora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreebsd.patch
121 lines (113 loc) · 3.23 KB
/
freebsd.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
--- Makefile.orig 2010-04-24 23:29:15.000000000 +0200
+++ Makefile 2010-05-21 21:29:25.000000000 +0200
@@ -561,45 +561,16 @@
ifeq ($(PLATFORM),freebsd)
- ifneq (,$(findstring alpha,$(shell uname -m)))
- ARCH=axp
- else #default to i386
- ARCH=i386
- endif #alpha test
-
- BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
- -DUSE_ICON
+ # flags
+ BASE_CFLAGS = $(shell env MACHINE_ARCH=$(ARCH) make -f /dev/null -VCFLAGS) \
+ -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+ -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
CLIENT_CFLAGS = $(SDL_CFLAGS)
SERVER_CFLAGS =
+ HAVE_VM_COMPILED = true
- ifeq ($(USE_OPENAL),1)
- CLIENT_CFLAGS += -DUSE_OPENAL
- ifeq ($(USE_OPENAL_DLOPEN),1)
- CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
- endif
- endif
-
- ifeq ($(USE_CODEC_VORBIS),1)
- CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
- endif
-
- OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer
-
- ifeq ($(ARCH),axp)
- BASE_CFLAGS += -DNO_VM_COMPILED
- OPTIMIZEVM += -fexpensive-optimizations
- else
- ifeq ($(ARCH),i386)
- OPTIMIZEVM += -mtune=pentiumpro \
- -march=pentium -pipe -falign-loops=2 -falign-jumps=2 \
- -falign-functions=2 -funroll-loops -fstrength-reduce
- HAVE_VM_COMPILED=true
- else
- BASE_CFLAGS += -DNO_VM_COMPILED
- endif
- endif
-
- OPTIMIZE = $(OPTIMIZEVM) -ffast-math
+ OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer -ffast-math
+ OPTIMIZE = $(OPTIMIZEVM)
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
@@ -613,17 +584,40 @@
CLIENT_LIBS += $(SDL_LIBS) -lGL
+ # optional features/libraries
ifeq ($(USE_OPENAL),1)
- ifneq ($(USE_OPENAL_DLOPEN),1)
+ CLIENT_CFLAGS += -DUSE_OPENAL
+ 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
+ ifeq ($(USE_CURL_DLOPEN),1)
+ CLIENT_CFLAGS += -DUSE_CURL_DLOPEN
+ CLIENT_LIBS += -lcurl
+ endif
+ endif
+
ifeq ($(USE_CODEC_VORBIS),1)
- ifeq ($(PLATFORM),mingw32)
- CLIENT_LIBS += $(LIBSDIR)/win32/libvorbisfile.a $(LIBSDIR)/win32/libvorbis.a $(LIBSDIR)/win32/libogg.a
- else
- CLIENT_LIBS += -lvorbisfile -lvorbis -logg
+ CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
+ endif
+
+ ifeq ($(USE_CODEC_VORBIS),1)
+ CLIENT_LIBS += -lvorbisfile -lvorbis -logg
+ endif
+
+ # cross-compiling tweaks
+ ifeq ($(ARCH),i386)
+ ifeq ($(CROSS_COMPILING),1)
+ BASE_CFLAGS += -m32
+ endif
+ endif
+ ifeq ($(ARCH),amd64)
+ ifeq ($(CROSS_COMPILING),1)
+ BASE_CFLAGS += -m64
endif
endif
@@ -1555,6 +1549,9 @@
ifeq ($(ARCH),x86_64)
Q3OBJ += $(B)/client/vm_x86_64.o $(B)/client/vm_x86_64_assembler.o
endif
+ ifeq ($(ARCH),amd64)
+ Q3OBJ += $(B)/client/vm_x86_64.o $(B)/client/vm_x86_64_assembler.o
+ endif
ifeq ($(ARCH),ppc)
Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o
endif
@@ -1720,6 +1717,9 @@
ifeq ($(ARCH),x86_64)
Q3DOBJ += $(B)/ded/vm_x86_64.o $(B)/ded/vm_x86_64_assembler.o
endif
+ ifeq ($(ARCH),amd64)
+ Q3DOBJ += $(B)/ded/vm_x86_64.o $(B)/ded/vm_x86_64_assembler.o
+ endif
ifeq ($(ARCH),ppc)
Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o
endif