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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
--- openarena-engine-0.8.1/Makefile 2008-08-09 22:22:37.000000000 +0200
+++ openarena-engine-0.8.1/Makefile.new 2009-01-07 19:33:31.000000000 +0100
@@ -67,6 +67,10 @@
ifndef ARCH
ARCH=$(COMPILE_ARCH)
+else
+ ifeq ($(ARCH),amd64)
+ ARCH=x86_64
+ endif
endif
export ARCH
@@ -231,8 +231,7 @@
endif
endif
- BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
- -pipe -DUSE_ICON $(shell sdl-config --cflags)
+ BASE_CFLAGS = -fno-strict-aliasing -DUSE_ICON $(shell sdl-config --cflags)
ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL
@@ -283,29 +283,29 @@
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)
- THREAD_LDFLAGS=-lpthread
- LDFLAGS=-ldl -lm
+ THREAD_LIBS=-lpthread
+ LDLIBS=-ldl -lm -lz
- CLIENT_LDFLAGS=$(shell sdl-config --libs) -lGL
+ CLIENT_LIBS=$(shell sdl-config --libs) -lGL -ljpeg
ifeq ($(USE_OPENAL),1)
ifneq ($(USE_OPENAL_DLOPEN),1)
- CLIENT_LDFLAGS += -lopenal
+ CLIENT_LIBS += -lopenal
endif
endif
ifeq ($(USE_CURL),1)
ifneq ($(USE_CURL_DLOPEN),1)
- CLIENT_LDFLAGS += -lcurl
+ CLIENT_LIBS += -lcurl
endif
endif
ifeq ($(USE_CODEC_VORBIS),1)
- CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
+ CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif
ifeq ($(USE_MUMBLE),1)
- CLIENT_LDFLAGS += -lrt
+ CLIENT_LIBS += -lrt
endif
ifeq ($(USE_LOCAL_HEADERS),1)
@@ -323,7 +322,7 @@
endif
DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
+ RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG
else # ifeq Linux
@@ -336,7 +336,7 @@
ifeq ($(PLATFORM),darwin)
HAVE_VM_COMPILED=true
- CLIENT_LDFLAGS=
+ CLIENT_LIBS=
OPTIMIZE=
BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes
@@ -357,7 +357,7 @@
ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL
ifneq ($(USE_OPENAL_DLOPEN),1)
- CLIENT_LDFLAGS += -framework OpenAL
+ CLIENT_LIBS += -framework OpenAL
else
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN
endif
@@ -366,7 +366,7 @@
ifeq ($(USE_CURL),1)
BASE_CFLAGS += -DUSE_CURL
ifneq ($(USE_CURL_DLOPEN),1)
- CLIENT_LDFLAGS += -lcurl
+ CLIENT_LIBS += -lcurl
else
BASE_CFLAGS += -DUSE_CURL_DLOPEN
endif
@@ -374,7 +374,7 @@
ifeq ($(USE_CODEC_VORBIS),1)
BASE_CFLAGS += -DUSE_CODEC_VORBIS
- CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
+ CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif
BASE_CFLAGS += -D_THREAD_SAFE=1
@@ -387,7 +387,7 @@
# the file has been modified by each build.
LIBSDLMAIN=$(B)/libSDLmain.a
LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a
- CLIENT_LDFLAGS += -framework Cocoa -framework IOKit -framework OpenGL \
+ CLIENT_LIBS += -framework Cocoa -framework IOKit -framework OpenGL \
$(LIBSDIR)/macosx/libSDL-1.2.0.dylib
OPTIMIZE += -ffast-math -falign-loops=16
@@ -441,7 +441,7 @@
ifeq ($(USE_OPENAL_DLOPEN),1)
BASE_CFLAGS += -DUSE_OPENAL_DLOPEN
else
- CLIENT_LDFLAGS += $(OPENAL_LDFLAGS)
+ CLIENT_LIBS += $(OPENAL_LDFLAGS)
endif
endif
@@ -461,8 +461,8 @@
BINEXT=.exe
- LDFLAGS= -lws2_32 -lwinmm
- CLIENT_LDFLAGS = -mwindows -lgdi32 -lole32 -lopengl32
+ LDLIBS= -lws2_32 -lwinmm
+ CLIENT_LIBS = -mwindows -lgdi32 -lole32 -lopengl32
ifeq ($(USE_CURL),1)
BASE_CFLAGS += -DUSE_CURL
@@ -470,9 +470,9 @@
ifneq ($(USE_CURL_DLOPEN),1)
ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -DCURL_STATICLIB
- CLIENT_LDFLAGS += $(LIBSDIR)/win32/libcurl.a
+ CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a
else
- CLIENT_LDFLAGS += $(CURL_LIBS)
+ CLIENT_LIBS += $(CURL_LIBS)
endif
endif
endif
@@ -480,9 +480,9 @@
ifeq ($(USE_CODEC_VORBIS),1)
#Sago: Here I get vorbis to compile in Windows:
ifeq ($(PLATFORM),mingw32)
- CLIENT_LDFLAGS += $(LIBSDIR)/win32/libvorbisfile.a $(LIBSDIR)/win32/libvorbis.a $(LIBSDIR)/win32/libogg.a
+ CLIENT_LIBS += $(LIBSDIR)/win32/libvorbisfile.a $(LIBSDIR)/win32/libvorbis.a $(LIBSDIR)/win32/libogg.a
else
- CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
+ CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif
endif
@@ -496,14 +496,14 @@
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
# libmingw32 must be linked before libSDLmain
- CLIENT_LDFLAGS += -lmingw32
+ CLIENT_LIBS += -lmingw32
ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -I$(SDLHDIR)/include
- CLIENT_LDFLAGS += $(LIBSDIR)/win32/libSDLmain.a \
+ CLIENT_LIBS += $(LIBSDIR)/win32/libSDLmain.a \
$(LIBSDIR)/win32/libSDL.dll.a
else
BASE_CFLAGS += $(SDL_CFLAGS)
- CLIENT_LDFLAGS += $(SDL_LIBS)
+ CLIENT_LIBS += $(SDL_LIBS)
endif
@@ -561,22 +561,22 @@
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)
- THREAD_LDFLAGS=-lpthread
+ THREAD_LIBS=-lpthread
# don't need -ldl (FreeBSD)
- LDFLAGS=-lm
+ LDLIBS=-lm -lz
- CLIENT_LDFLAGS =
+ CLIENT_LIBS =
- CLIENT_LDFLAGS += $(shell sdl-config --libs) -lGL
+ CLIENT_LIBS += $(shell sdl-config --libs) -lGL
ifeq ($(USE_OPENAL),1)
ifneq ($(USE_OPENAL_DLOPEN),1)
- CLIENT_LDFLAGS += $(THREAD_LDFLAGS) -lopenal
+ CLIENT_LIBS += $(THREAD_LIBS) -lopenal
endif
endif
ifeq ($(USE_CODEC_VORBIS),1)
- CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
+ CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif
else # ifeq freebsd
@@ -618,21 +618,21 @@
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)
- THREAD_LDFLAGS=-lpthread
- LDFLAGS=-lm
+ THREAD_LIBS=-lpthread
+ LDLIBS=-lm -lz
- CLIENT_LDFLAGS =
+ CLIENT_LIBS =
- CLIENT_LDFLAGS += $(shell sdl-config --libs) -lGL
+ CLIENT_LIBS += $(shell sdl-config --libs) -lGL
ifeq ($(USE_OPENAL),1)
ifneq ($(USE_OPENAL_DLOPEN),1)
- CLIENT_LDFLAGS += $(THREAD_LDFLAGS) -lossaudio -lopenal
+ CLIENT_LIBS += $(THREAD_LIBS) -lossaudio -lopenal
endif
endif
ifeq ($(USE_CODEC_VORBIS),1)
- CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
+ CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif
else # ifeq openbsd
@@ -647,11 +647,11 @@
ARCH=i386
endif
- LDFLAGS=-lm
+ LDLIBS=-lm -lz
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)
- THREAD_LDFLAGS=-lpthread
+ THREAD_LIBS=-lpthread
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
@@ -686,9 +686,9 @@
SHLIBCFLAGS=
SHLIBLDFLAGS=-shared
- LDFLAGS=-ldl -lm -lgen
+ LDLIBS=-ldl -lm -lgen -lz
# FIXME: The X libraries probably aren't necessary?
- CLIENT_LDFLAGS=-L/usr/X11/$(LIB) $(shell sdl-config --libs) -lGL \
+ CLIENT_LIBS=-L/usr/X11/$(LIB) $(shell sdl-config --libs) -lGL \
- -lX11 -lXext -lm
+ -lX11 -lXext -lm -ljpeg
else # ifeq IRIX
@@ -736,7 +736,7 @@
BASE_CFLAGS += -m32
LDFLAGS += -m32
BASE_CFLAGS += -I/usr/X11/include/NVIDIA
- CLIENT_LDFLAGS += -L/usr/X11/lib/NVIDIA -R/usr/X11/lib/NVIDIA
+ CLIENT_LIBS += -L/usr/X11/lib/NVIDIA -R/usr/X11/lib/NVIDIA
endif
endif
@@ -752,12 +752,12 @@
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)
- THREAD_LDFLAGS=-lpthread
- LDFLAGS=-lsocket -lnsl -ldl -lm
+ THREAD_LIBS=-lpthread
+ LDLIBS=-lsocket -lnsl -ldl -lm -lz
BOTCFLAGS=-O0
- CLIENT_LDFLAGS +=$(shell sdl-config --libs) -lGL
+ CLIENT_LIBS +=$(shell sdl-config --libs) -lGL -ljpeg
else # ifeq sunos
@@ -825,7 +825,7 @@
ifeq ($(USE_INTERNAL_SPEEX),1)
BASE_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include
else
- CLIENT_LDFLAGS += -lspeex
+ CLIENT_LIBS += -lspeex -lspeexdsp
endif
endif
@@ -1421,13 +1421,13 @@
$(B)/openarena.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
$(echo_cmd) "LD $@"
- $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \
- $(LDFLAGS) $(LIBSDLMAIN)
+ $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) \
+ $(LDFLAGS) $(LIBSDLMAIN) $(CLIENT_LIBS) $(LDLIBS)
$(B)/openarena-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
$(echo_cmd) "LD $@"
- $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
- $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
+ $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) \
+ $(LDFLAGS) $(THREAD_LIBS) $(LIBSDLMAIN) $(CLIENT_LIBS) $(LDLIBS)
ifneq ($(strip $(LIBSDLMAIN)),)
ifneq ($(strip $(LIBSDLMAINSRC)),)
@@ -1553,7 +1553,7 @@
$(B)/oa_ded.$(ARCH)$(BINEXT): $(Q3DOBJ)
$(echo_cmd) "LD $@"
- $(Q)$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
+ $(Q)$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS) $(LDLIBS)
|