]> git.sesse.net Git - vlc/blob - Makefile.opts.in
98d9be81297ad8a891739701e3ccfb0149a1578f
[vlc] / Makefile.opts.in
1 ###############################################################################
2 # vlc (VideoLAN Client) options Makefile
3 # (c)1998 VideoLAN
4 ###############################################################################
5
6 ###############################################################################
7 # Configuration
8 ###############################################################################
9
10
11 # Plugins to build
12 # WARNING: if you do not have a dynamic loader on your platform, remove
13 # the plugins in this line and put them as built-ins, otherwise your
14 # application won't be able to load them.
15
16 PLUGINS :=@PLUGINS@
17
18
19 # Built-in modules to build
20 # WARNING: do NOT put gtk and gnome together in this rule.
21
22 BUILTINS :=@BUILTINS@
23
24
25 # Additional build options
26
27 SYS = @SYS@
28 ALIASES =@ALIASES@
29 INSTALL = @INSTALL@
30 ARCH = @ARCH@
31
32 #
33 # Compilation options
34 #
35 DEBUG = @DEBUG@
36 STATS = @STATS@
37 TRACE = @TRACE@
38 OPTIMS = @OPTIMS@
39 GETOPT = @GETOPT@
40
41
42 # Build environment
43
44 CC = @CC@
45 CFLAGS = @CFLAGS@
46 SHELL = @SHELL@
47 RANLIB = @RANLIB@
48
49
50 # Installation environment
51
52 exec_prefix = @exec_prefix@
53 prefix = @prefix@
54 bindir = @bindir@
55 datadir = @datadir@
56 libdir = @libdir@
57
58 #
59 # Libraries for special cases
60 #
61 LIB_ALSA = @LIB_ALSA@
62 LIB_BEOS = @LIB_BEOS@
63 LIB_DARWIN = @LIB_DARWIN@
64 LIB_ESD = @LIB_ESD@
65 LIB_GGI = @LIB_GGI@
66 LIB_GLIDE = @LIB_GLIDE@
67 LIB_GNOME = @LIB_GNOME@
68 LIB_GTK = @LIB_GTK@
69 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
70 LIB_MACOSX = @LIB_MACOSX@
71 LIB_NCURSES = @LIB_NCURSES@
72 LIB_QT = @LIB_QT@
73 LIB_TS = @LIB_TS@
74 LIB_SDL = @LIB_SDL@
75 LIB_X11 = @LIB_X11@
76 LIB_XVIDEO = @LIB_XVIDEO@
77 LIB_YUV = @LIB_YUV@
78
79 #
80 # CFLAGS for special cases
81 #
82 CFLAGS_GTK = @CFLAGS_GTK@
83 CFLAGS_X11 = @CFLAGS_X11@
84
85 ###############################################################################
86 # Configuration pre-processing
87 ###############################################################################
88
89 # PROGRAM_OPTIONS is an identification string of the compilation options
90 PROGRAM_OPTIONS = $(SYS) $(ARCH)
91 ifeq ($(DEBUG),1)
92 PROGRAM_OPTIONS += DEBUG
93 DEFINE += -DDEBUG
94 endif
95 ifeq ($(TRACE),1)
96 PROGRAM_OPTIONS += TRACE
97 DEFINE += -DTRACE
98 endif
99 ifeq ($(STATS),1)
100 PROGRAM_OPTIONS += STATS
101 DEFINE += -DSTATS
102 endif
103
104 # PROGRAM_BUILD is a complete identification of the build
105 # (we can't use fancy options with date since OSes like Solaris
106 # or FreeBSD have strange date implementations)
107 ifeq ($(SYS),beos)
108 # XXX: beos does not support hostname (how lame...)
109 PROGRAM_BUILD = `date` $(USER)
110 else
111 PROGRAM_BUILD = `date` $(USER)@`hostname`
112 endif
113
114 # PROGRAM_VERSION is the current vlc version
115 PROGRAM_VERSION=@VLC_VERSION@
116
117 # DEFINE will contain some of the constants definitions decided in Makefile, 
118 # including SYS_xx. It will be passed to C compiler.
119 DEFINE += -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
120
121 # On Linux activate 64-bit off_t (by default under BSD)
122 ifneq (,$(findstring linux,$(SYS)))
123 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
124 endif
125
126 ###############################################################################
127 # Tuning and other variables - do not change anything except if you know
128 # exactly what you are doing
129 ###############################################################################
130
131 #
132 # C headers directories
133 #
134 INCLUDE += @INCLUDE@
135 INCLUDE += -Iinclude -Iextras -I/usr/local/include
136
137 #
138 # Libraries
139 #
140 LIB += @LIB@ -L/usr/local/lib
141
142 ifneq (,$(findstring mingw32,$(SYS)))
143 LIB += -lws2_32
144 endif
145
146 #
147 # Libraries needed by built-in modules
148 #
149 ifneq (,$(BUILTINS))
150 LIB += $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
151 endif
152
153 #
154 # C compiler flags: mainstream compilation
155 #
156 DEFINE += @DEFINE@
157 CFLAGS += $(DEFINE) $(INCLUDE)
158 CFLAGS += -Wall -Winline
159 CFLAGS += -D_REENTRANT
160 CFLAGS += -D_GNU_SOURCE
161
162 # flags needed for clean beos compilation
163 ifeq ($(SYS),beos)
164 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
165 endif
166
167 ifneq (,$(findstring darwin,$(SYS)))
168 CFLAGS += -traditional-cpp
169 endif
170
171 # Optimizations : don't compile debug versions with them
172 ifeq ($(OPTIMS),1)
173 CFLAGS += -O3
174 CFLAGS += -ffast-math -funroll-loops
175 ifneq ($(DEBUG),1)
176 CFLAGS += -fomit-frame-pointer
177 endif
178
179 # Optimizations for x86 familiy
180 ifneq (,$(findstring 86,$(ARCH)))
181 # Optional Pentium Pro optimizations
182 ifneq (,$(findstring ppro,$(ARCH)))
183 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
184 else
185 CFLAGS += -march=pentium -mcpu=pentium
186 endif
187 endif
188
189 # Optimizations for PowerPC
190 ifneq (,$(findstring powerpc,$(ARCH)))
191 CFLAGS += -mmultiple -mhard-float -mstring
192 endif
193
194 # Optimizations for Sparc
195 ifneq (,$(findstring sparc,$(ARCH)))
196 CFLAGS += -mhard-float
197 endif
198
199 #end of optimisations
200 endif
201
202 # Optional MMX optimizations for x86
203 ifneq (,$(findstring mmx,$(ARCH)))
204 CFLAGS += -DHAVE_MMX
205 endif
206
207 #
208 # C compiler flags: dependancies
209 #
210 DCFLAGS += $(INCLUDE)
211 DCFLAGS += -MM
212
213 #
214 # C compiler flags: linking
215 #
216 LCFLAGS += @LCFLAGS@ $(LIB)
217 LCFLAGS += -Wall
218 #LCFLAGS += -s
219
220 ifeq ($(SYS),beos)
221 LCFLAGS += -Xlinker -soname=_APP_
222 else
223 ifneq (,$(findstring qnx,$(SYS)))
224 LCFLAGS += -Xlinker -export-dynamic
225 else
226 ifneq (,$(findstring darwin,$(SYS)))
227 LCFLAGS += -dyn
228 else
229 LCFLAGS += --export-dynamic
230 endif
231 endif
232 endif
233
234 #
235 # Debugging and profiling support
236 #
237 ifeq ($(DEBUG),1)
238 CFLAGS += -g
239 endif
240