]> git.sesse.net Git - vlc/blob - Makefile.opts.in
cbd594dfb1eaaac8d2840b675454640316c3729e
[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 MOC = @MOC@
49
50
51 # Installation environment
52
53 exec_prefix = @exec_prefix@
54 prefix = @prefix@
55 bindir = @bindir@
56 datadir = @datadir@
57 libdir = @libdir@
58
59 #
60 # Libraries for special cases
61 #
62 LIB_ALSA = @LIB_ALSA@
63 LIB_BEOS = @LIB_BEOS@
64 LIB_DARWIN = @LIB_DARWIN@
65 LIB_ESD = @LIB_ESD@
66 LIB_GGI = @LIB_GGI@
67 LIB_GLIDE = @LIB_GLIDE@
68 LIB_GNOME = @LIB_GNOME@
69 LIB_GTK = @LIB_GTK@
70 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
71 LIB_MACOSX = @LIB_MACOSX@
72 LIB_NCURSES = @LIB_NCURSES@
73 LIB_QT = @LIB_QT@
74 LIB_TS = @LIB_TS@
75 LIB_SDL = @LIB_SDL@
76 LIB_X11 = @LIB_X11@
77 LIB_XVIDEO = @LIB_XVIDEO@
78 LIB_YUV = @LIB_YUV@
79
80 #
81 # CFLAGS for special cases
82 #
83 CFLAGS_GTK = @CFLAGS_GTK@
84 CFLAGS_X11 = @CFLAGS_X11@
85
86 ###############################################################################
87 # Configuration pre-processing
88 ###############################################################################
89
90 # PROGRAM_OPTIONS is an identification string of the compilation options
91 PROGRAM_OPTIONS = $(SYS) $(ARCH)
92 ifeq ($(DEBUG),1)
93 PROGRAM_OPTIONS += DEBUG
94 DEFINE += -DDEBUG
95 endif
96 ifeq ($(TRACE),1)
97 PROGRAM_OPTIONS += TRACE
98 DEFINE += -DTRACE
99 endif
100 ifeq ($(STATS),1)
101 PROGRAM_OPTIONS += STATS
102 DEFINE += -DSTATS
103 endif
104
105 # PROGRAM_BUILD is a complete identification of the build
106 # (we can't use fancy options with date since OSes like Solaris
107 # or FreeBSD have strange date implementations)
108 ifeq ($(SYS),beos)
109 # XXX: beos does not support hostname (how lame...)
110 PROGRAM_BUILD = `date` $(USER)
111 else
112 PROGRAM_BUILD = `date` $(USER)@`hostname`
113 endif
114
115 # PROGRAM_VERSION is the current vlc version
116 PROGRAM_VERSION=@VLC_VERSION@
117
118 # DEFINE will contain some of the constants definitions decided in Makefile, 
119 # including SYS_xx. It will be passed to C compiler.
120 DEFINE += -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
121
122 # On Linux activate 64-bit off_t (by default under BSD)
123 ifneq (,$(findstring linux,$(SYS)))
124 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
125 endif
126
127 ###############################################################################
128 # Tuning and other variables - do not change anything except if you know
129 # exactly what you are doing
130 ###############################################################################
131
132 #
133 # C headers directories
134 #
135 INCLUDE += @INCLUDE@
136 INCLUDE += -Iinclude -Iextras -I/usr/local/include
137
138 #
139 # Libraries
140 #
141 LIB += @LIB@ -L/usr/local/lib
142
143 ifneq (,$(findstring mingw32,$(SYS)))
144 LIB += -lws2_32 -lnetapi32
145 endif
146
147 #
148 # Libraries needed by built-in modules
149 #
150 ifneq (,$(BUILTINS))
151 LIB += $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
152 endif
153
154 #
155 # C compiler flags: mainstream compilation
156 #
157 DEFINE += @DEFINE@
158 CFLAGS += $(DEFINE) $(INCLUDE)
159 CFLAGS += -Wall -Winline
160 CFLAGS += -D_REENTRANT
161 CFLAGS += -D_GNU_SOURCE
162
163 # flags needed for clean beos compilation
164 ifeq ($(SYS),beos)
165 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
166 endif
167
168 ifneq (,$(findstring darwin,$(SYS)))
169 CFLAGS += -traditional-cpp
170 endif
171
172 # Optimizations : don't compile debug versions with them
173 ifeq ($(OPTIMS),1)
174 CFLAGS += -O3
175 CFLAGS += -ffast-math -funroll-loops
176 ifneq ($(DEBUG),1)
177 CFLAGS += -fomit-frame-pointer
178 endif
179
180 # Optimizations for x86 familiy
181 ifneq (,$(findstring 86,$(ARCH)))
182 # Optional Pentium Pro optimizations
183 ifneq (,$(findstring ppro,$(ARCH)))
184 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
185 else
186 CFLAGS += -march=pentium -mcpu=pentium
187 endif
188 endif
189
190 # Optimizations for PowerPC
191 ifneq (,$(findstring powerpc,$(ARCH)))
192 CFLAGS += -mmultiple -mhard-float -mstring
193 endif
194
195 # Optimizations for Sparc
196 ifneq (,$(findstring sparc,$(ARCH)))
197 CFLAGS += -mhard-float
198 endif
199
200 #end of optimisations
201 endif
202
203 #
204 # C compiler flags: dependancies
205 #
206 DCFLAGS += $(INCLUDE)
207 DCFLAGS += -MM
208
209 #
210 # C compiler flags: linking
211 #
212 LCFLAGS += @LCFLAGS@ $(LIB)
213 LCFLAGS += -Wall
214 #LCFLAGS += -s
215 ifneq (,$(findstring mingw32,$(SYS)))
216 LCFLAGS += -Xlinker --force-exe-suffix
217 endif
218
219 #
220 # Debugging and profiling support
221 #
222 ifeq ($(DEBUG),1)
223 CFLAGS += -g
224 endif
225