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