]> git.sesse.net Git - vlc/blob - Makefile.opts.in
db53505c810baf859141a27fefde567825b20b5c
[vlc] / Makefile.opts.in
1 ###############################################################################
2 # vlc (VideoLAN Client) options Makefile
3 # (c)1998 VideoLAN
4 ###############################################################################
5
6 HAVE_MAKEFILE_OPTS = 1
7
8 ###############################################################################
9 # Configuration
10 ###############################################################################
11
12
13 # Plugins to build
14 # WARNING: if you do not have a dynamic loader on your platform, remove
15 # the plugins in this line and put them as built-ins, otherwise your
16 # application won't be able to load them.
17
18 PLUGINS :=@PLUGINS@
19
20
21 # Built-in modules to build
22 # WARNING: do NOT put gtk and gnome together in this rule.
23
24 BUILTINS :=@BUILTINS@
25
26
27 # Additional build options
28
29 SYS = @SYS@
30 ALIASES =@ALIASES@
31 INSTALL = @INSTALL@
32 ARCH = @ARCH@
33
34 #
35 # Compilation options
36 #
37 DEBUG = @DEBUG@
38 TRACE = @TRACE@
39 CPROF = @CPROF@
40 GPROF = @GPROF@
41 OPTIMS = @OPTIMS@
42 TUNING = @TUNING@
43 RELEASE = @RELEASE@
44
45
46 # Build environment
47
48 CC = @CC@
49 CFLAGS = @CFLAGS@
50 SHELL = @SHELL@
51 RANLIB = @RANLIB@
52 WINDRES = @WINDRES@
53 MOC = @MOC@
54 DLL_PATH = @DLL_PATH@
55
56
57 # Installation environment
58
59 exec_prefix = @exec_prefix@
60 prefix = @prefix@
61 bindir = @bindir@
62 datadir = @datadir@
63 libdir = @libdir@
64 includedir = @includedir@
65
66 #
67 # Libraries for special cases
68 #
69 LIB_ALSA = @LIB_ALSA@
70 LIB_ALTIVEC = @LIB_ALTIVEC@
71 LIB_ARTS = @LIB_ARTS@
72 LIB_BEOS = @LIB_BEOS@
73 LIB_DARWIN = @LIB_DARWIN@
74 LIB_DIRECTX = @LIB_DIRECTX@
75 LIB_DVD = @LIB_DVD@
76 LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
77 LIB_DVDREAD = @LIB_DVDREAD@
78 LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@
79 LIB_ESD = @LIB_ESD@
80 LIB_GGI = @LIB_GGI@
81 LIB_GLIDE = @LIB_GLIDE@
82 LIB_GNOME = @LIB_GNOME@
83 LIB_GTK = @LIB_GTK@
84 LIB_IMDCT = @LIB_IMDCT@
85 LIB_IMDCT3DN = @LIB_IMDCT3DN@
86 LIB_IMDCTSSE = @LIB_IMDCTSSE@
87 LIB_KDE = @LIB_KDE@
88 LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
89 LIB_MACOSX = @LIB_MACOSX@
90 LIB_MAD = @LIB_MAD@
91 LIB_MPEG_TS = @LIB_MPEG_TS@
92 LIB_NCURSES = @LIB_NCURSES@
93 LIB_QNX = @LIB_QNX@
94 LIB_QT = @LIB_QT@
95 LIB_RC = @LIB_RC@
96 LIB_SDL = @LIB_SDL@
97 LIB_X11 = @LIB_X11@
98 LIB_XVIDEO = @LIB_XVIDEO@
99
100 #
101 # CFLAGS for special cases
102 #
103 CFLAGS_ALTIVEC = @CFLAGS_ALTIVEC@
104 CFLAGS_DVD = @CFLAGS_DVD@
105 CFLAGS_DVDREAD = @CFLAGS_DVDREAD@
106 CFLAGS_ARTS = @CFLAGS_ARTS@
107 CFLAGS_ESD = @CFLAGS_ESD@
108 CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
109 CFLAGS_ESD = @CFLAGS_ESD@
110 CFLAGS_GTK = @CFLAGS_GTK@
111 CFLAGS_MAD = @CFLAGS_MAD@
112 CFLAGS_SDL = @CFLAGS_SDL@
113 CFLAGS_X11 = @CFLAGS_X11@
114 CFLAGS_XVIDEO = @CFLAGS_XVIDEO@
115
116 #
117 # Additional objects
118 #
119 OBJ_DVD = @OBJ_DVD@
120 OBJ_LIBDVDCSS = @OBJ_LIBDVDCSS@
121
122 #
123 # Other special cases
124 #
125 NEED_GETOPT = @NEED_GETOPT@
126 NEED_LIBDVDCSS = @NEED_LIBDVDCSS@
127
128 ###############################################################################
129 # Configuration pre-processing
130 ###############################################################################
131
132 # PROGRAM_OPTIONS is an identification string of the compilation options
133 PROGRAM_OPTIONS = $(SYS) $(ARCH)
134 ifeq ($(DEBUG),1)
135 PROGRAM_OPTIONS += DEBUG
136 DEFINE += -DDEBUG
137 endif
138 ifeq ($(TRACE),1)
139 PROGRAM_OPTIONS += TRACE
140 DEFINE += -DTRACE
141 endif
142 ifeq ($(CPROF),1)
143 PROGRAM_OPTIONS += CPROF
144 DEFINE += -DCPROF
145 endif
146 ifeq ($(GPROF),1)
147 PROGRAM_OPTIONS += GPROF
148 DEFINE += -DGPROF
149 endif
150
151 # PROGRAM_BUILD is a complete identification of the build
152 # (we can't use fancy options with date since OSes like Solaris
153 # or FreeBSD have strange date implementations)
154 ifeq ($(SYS),beos)
155 # XXX: beos does not support hostname (how lame...)
156 PROGRAM_BUILD = `date` $(USER)
157 else
158 PROGRAM_BUILD = `date` $(USER)@`hostname`
159 endif
160
161 # PROGRAM_VERSION is the current vlc version
162 PROGRAM_VERSION=@VLC_VERSION@
163 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
164
165 # DEFINE will contain some of the constants definitions decided in Makefile, 
166 # including SYS_xx. It will be passed to C compiler.
167 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
168 DEFINE += $(DEFINE_CONSTANTS)
169
170 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
171 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 
172
173 # Gettext support
174 DEFINE += -DLOCALEDIR=\"$(datadir)/locale\"
175
176 ###############################################################################
177 # Tuning and other variables - do not change anything except if you know
178 # exactly what you are doing
179 ###############################################################################
180
181 #
182 # C headers directories
183 #
184 INCLUDE += @INCLUDE@
185 INCLUDE += -Iinclude -Iextras
186
187 #
188 # Libraries needed by built-in modules
189 #
190 # Let's go for a crude hack !
191 LIB_MOTIONALTIVEC := $(LIB_ALTIVEC)
192 LIB_IDCTALTIVEC := $(LIB_ALTIVEC)
193 ifneq (,$(BUILTINS))
194 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
195 LIB += $(LIB_BUILTINS)
196 endif
197
198 #
199 # Libraries
200 #
201 ifneq (,$(findstring mingw32,$(SYS)))
202 LIB += -lws2_32 -lnetapi32
203 endif
204
205 LIB += @LIB@
206
207 #
208 # C compiler flags: mainstream compilation
209 #
210 DEFINE += @DEFINE@
211 CFLAGS += $(DEFINE) $(INCLUDE)
212 CFLAGS += -Wall -Winline
213 CFLAGS += -pipe
214 CFLAGS += -D_REENTRANT
215 CFLAGS += -D_GNU_SOURCE
216
217 ifeq ($(RELEASE),1)
218 CFLAGS += -DRELEASE
219 endif
220
221 # flags needed for clean beos compilation
222 ifeq ($(SYS),beos)
223 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
224 endif
225
226 ifneq (,$(findstring darwin,$(SYS)))
227 CFLAGS += -no-cpp-precomp
228 endif
229
230 ifneq (,$(findstring mingw32,$(SYS)))
231 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
232 endif
233
234 ifneq (,$(findstring bsd,$(SYS)))
235 CFLAGS += -pthread
236 endif
237
238 # Optimizations : don't compile debug versions with them
239 ifeq ($(OPTIMS),1)
240 CFLAGS += -O3
241 CFLAGS += -ffast-math -funroll-loops
242 ifneq ($(DEBUG),1)
243 ifneq ($(GPROF),1)
244 ifneq ($(CPROF),1)
245 CFLAGS += -fomit-frame-pointer
246 endif
247 endif
248 endif
249
250 ifneq (,$(findstring powerpc,$(ARCH)))
251 # Optimizations for PowerPC
252 CFLAGS += -mmultiple -mhard-float -mstring -mcpu=powerpc
253 ifneq (,$(TUNING))
254 CFLAGS += -mtune=$(TUNING)
255 endif
256 else
257 ifneq (,$(findstring sparc,$(ARCH)))
258 # Optimizations for Sparc
259 CFLAGS += -mhard-float
260 ifneq (,$(TUNING))
261 CFLAGS += -mcpu=$(TUNING)
262 endif
263 else
264 # Generic optimizations
265 ifneq (,$(TUNING))
266 CFLAGS += -mcpu=$(TUNING)
267 endif
268 endif
269 endif
270
271 #end of optimisations
272 endif
273
274 #
275 # C compiler flags: dependancies
276 #
277 DCFLAGS += $(INCLUDE)
278 DCFLAGS += -MM
279
280 #
281 # C compiler flags: linking
282 #
283 LCFLAGS += @LCFLAGS@ $(LIB)
284 LCFLAGS += -Wall
285 ifneq ($(DEBUG),1)
286 ifneq ($(GPROF),1)
287 ifneq ($(CPROF),1)
288 #LCFLAGS += -s
289 endif
290 endif
291 endif
292 ifneq (,$(findstring mingw32,$(SYS)))
293 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
294 endif
295
296 #
297 # C compiler and linker flags: setting soname
298 #
299 SOFLAGS = @SOFLAGS@
300
301 #
302 # C compiler flags: plugin compilation
303 #
304 ifneq (,$(findstring mingw32,$(SYS)))
305 PCFLAGS += -fnative-struct
306 else
307 PCFLAGS += -fPIC
308 endif
309
310 #
311 # C compiler flags: plugin linking
312 #
313 PLCFLAGS += @PLCFLAGS@
314
315 #
316 # Debugging and profiling support
317 #
318 ifeq ($(DEBUG),1)
319 CFLAGS += -g
320 endif
321
322 ifeq ($(CPROF),1)
323 CFLAGS += -finstrument-functions
324 endif
325
326 ifeq ($(GPROF),1)
327 CFLAGS += -pg
328 endif
329
330