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