]> git.sesse.net Git - vlc/blob - Makefile.opts.in
4e37cf91b43ab7b0609db80782aa5d6f02ee65f5
[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_FILTER_DISTORT = @LIB_FILTER_DISTORT@
81 LIB_GGI = @LIB_GGI@
82 LIB_GLIDE = @LIB_GLIDE@
83 LIB_GNOME = @LIB_GNOME@
84 LIB_GTK = @LIB_GTK@
85 LIB_IMDCT = @LIB_IMDCT@
86 LIB_IMDCT3DN = @LIB_IMDCT3DN@
87 LIB_IMDCTSSE = @LIB_IMDCTSSE@
88 LIB_KDE = @LIB_KDE@
89 LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
90 LIB_MACOSX = @LIB_MACOSX@
91 LIB_MAD = @LIB_MAD@
92 LIB_MPEG_TS = @LIB_MPEG_TS@
93 LIB_NCURSES = @LIB_NCURSES@
94 LIB_QNX = @LIB_QNX@
95 LIB_QT = @LIB_QT@
96 LIB_RC = @LIB_RC@
97 LIB_SDL = @LIB_SDL@
98 LIB_X11 = @LIB_X11@
99 LIB_XVIDEO = @LIB_XVIDEO@
100
101 #
102 # CFLAGS for special cases
103 #
104 CFLAGS_ALTIVEC = @CFLAGS_ALTIVEC@
105 CFLAGS_DVD = @CFLAGS_DVD@
106 CFLAGS_DVDREAD = @CFLAGS_DVDREAD@
107 CFLAGS_ARTS = @CFLAGS_ARTS@
108 CFLAGS_ESD = @CFLAGS_ESD@
109 CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
110 CFLAGS_ESD = @CFLAGS_ESD@
111 CFLAGS_GTK = @CFLAGS_GTK@
112 CFLAGS_MAD = @CFLAGS_MAD@
113 CFLAGS_SDL = @CFLAGS_SDL@
114 CFLAGS_X11 = @CFLAGS_X11@
115 CFLAGS_XVIDEO = @CFLAGS_XVIDEO@
116
117 #
118 # Additional objects
119 #
120 OBJ_DVD = @OBJ_DVD@
121 OBJ_LIBDVDCSS = @OBJ_LIBDVDCSS@
122
123 #
124 # Other special cases
125 #
126 NEED_GETOPT = @NEED_GETOPT@
127 NEED_LIBDVDCSS = @NEED_LIBDVDCSS@
128
129 ###############################################################################
130 # Configuration pre-processing
131 ###############################################################################
132
133 # PROGRAM_OPTIONS is an identification string of the compilation options
134 PROGRAM_OPTIONS = $(SYS) $(ARCH)
135 ifeq ($(DEBUG),1)
136 PROGRAM_OPTIONS += DEBUG
137 DEFINE += -DDEBUG
138 endif
139 ifeq ($(TRACE),1)
140 PROGRAM_OPTIONS += TRACE
141 DEFINE += -DTRACE
142 endif
143 ifeq ($(CPROF),1)
144 PROGRAM_OPTIONS += CPROF
145 DEFINE += -DCPROF
146 endif
147 ifeq ($(GPROF),1)
148 PROGRAM_OPTIONS += GPROF
149 DEFINE += -DGPROF
150 endif
151
152 # PROGRAM_BUILD is a complete identification of the build
153 # (we can't use fancy options with date since OSes like Solaris
154 # or FreeBSD have strange date implementations)
155 ifeq ($(SYS),beos)
156 # XXX: beos does not support hostname (how lame...)
157 PROGRAM_BUILD = `date` $(USER)
158 else
159 PROGRAM_BUILD = `date` $(USER)@`hostname`
160 endif
161
162 # PROGRAM_VERSION is the current vlc version
163 PROGRAM_VERSION=@VLC_VERSION@
164 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
165
166 # DEFINE will contain some of the constants definitions decided in Makefile, 
167 # including SYS_xx. It will be passed to C compiler.
168 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
169 DEFINE += $(DEFINE_CONSTANTS)
170
171 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
172 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 
173
174 # Gettext support
175 DEFINE += -DLOCALEDIR=\"$(datadir)/locale\"
176
177 ###############################################################################
178 # Tuning and other variables - do not change anything except if you know
179 # exactly what you are doing
180 ###############################################################################
181
182 #
183 # C headers directories
184 #
185 INCLUDE += @INCLUDE@
186 INCLUDE += -Iinclude -Iextras
187
188 #
189 # Libraries needed by built-in modules
190 #
191 # Let's go for a crude hack !
192 LIB_MOTIONALTIVEC := $(LIB_ALTIVEC)
193 LIB_IDCTALTIVEC := $(LIB_ALTIVEC)
194 ifneq (,$(BUILTINS))
195 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
196 LIB += $(LIB_BUILTINS)
197 endif
198
199 #
200 # Libraries
201 #
202 ifneq (,$(findstring mingw32,$(SYS)))
203 LIB += -lws2_32 -lnetapi32
204 endif
205
206 LIB += @LIB@
207
208 #
209 # C compiler flags: mainstream compilation
210 #
211 DEFINE += @DEFINE@
212 CFLAGS += $(DEFINE) $(INCLUDE)
213 CFLAGS += -Wall -Winline
214 CFLAGS += -pipe
215 CFLAGS += -D_REENTRANT
216 CFLAGS += -D_GNU_SOURCE
217
218 ifeq ($(RELEASE),1)
219 CFLAGS += -DRELEASE
220 endif
221
222 # flags needed for clean beos compilation
223 ifeq ($(SYS),beos)
224 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
225 endif
226
227 ifneq (,$(findstring darwin,$(SYS)))
228 CFLAGS += -no-cpp-precomp
229 endif
230
231 ifneq (,$(findstring mingw32,$(SYS)))
232 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
233 endif
234
235 ifneq (,$(findstring bsd,$(SYS)))
236 CFLAGS += -pthread
237 endif
238
239 # Optimizations : don't compile debug versions with them
240 ifeq ($(OPTIMS),1)
241 CFLAGS += -O3
242 CFLAGS += -ffast-math -funroll-loops
243 ifneq ($(DEBUG),1)
244 ifneq ($(GPROF),1)
245 ifneq ($(CPROF),1)
246 CFLAGS += -fomit-frame-pointer
247 endif
248 endif
249 endif
250
251 ifneq (,$(findstring powerpc,$(ARCH)))
252 # Optimizations for PowerPC
253 CFLAGS += -mmultiple -mhard-float -mstring -mcpu=powerpc
254 ifneq (,$(TUNING))
255 CFLAGS += -mtune=$(TUNING)
256 endif
257 else
258 ifneq (,$(findstring sparc,$(ARCH)))
259 # Optimizations for Sparc
260 CFLAGS += -mhard-float
261 ifneq (,$(TUNING))
262 CFLAGS += -mcpu=$(TUNING)
263 endif
264 else
265 # Generic optimizations
266 ifneq (,$(TUNING))
267 CFLAGS += -mcpu=$(TUNING)
268 endif
269 endif
270 endif
271
272 #end of optimisations
273 endif
274
275 #
276 # C compiler flags: dependancies
277 #
278 DCFLAGS += $(INCLUDE)
279 DCFLAGS += -MM
280
281 #
282 # C compiler flags: linking
283 #
284 LCFLAGS += @LCFLAGS@ $(LIB)
285 LCFLAGS += -Wall
286 ifneq ($(DEBUG),1)
287 ifneq ($(GPROF),1)
288 ifneq ($(CPROF),1)
289 #LCFLAGS += -s
290 endif
291 endif
292 endif
293 ifneq (,$(findstring mingw32,$(SYS)))
294 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
295 endif
296
297 #
298 # C compiler and linker flags: setting soname
299 #
300 SOFLAGS = @SOFLAGS@
301
302 #
303 # C compiler flags: plugin compilation
304 #
305 ifneq (,$(findstring mingw32,$(SYS)))
306 PCFLAGS += -fnative-struct
307 else
308 PCFLAGS += -fPIC
309 endif
310
311 #
312 # C compiler flags: plugin linking
313 #
314 PLCFLAGS += @PLCFLAGS@
315
316 #
317 # Debugging and profiling support
318 #
319 ifeq ($(DEBUG),1)
320 CFLAGS += -g
321 endif
322
323 ifeq ($(CPROF),1)
324 CFLAGS += -finstrument-functions
325 endif
326
327 ifeq ($(GPROF),1)
328 CFLAGS += -pg
329 endif
330
331