1 ###############################################################################
2 # vlc (VideoLAN Client) options Makefile
4 ###############################################################################
6 ###############################################################################
8 ###############################################################################
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.
19 # Built-in modules to build
20 # WARNING: do NOT put gtk and gnome together in this rule.
25 # Additional build options
38 PROFILING = @PROFILING@
52 # Installation environment
54 exec_prefix = @exec_prefix@
59 includedir = @includedir@
62 # Libraries for special cases
66 LIB_DARWIN = @LIB_DARWIN@
70 LIB_GLIDE = @LIB_GLIDE@
71 LIB_GNOME = @LIB_GNOME@
73 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
74 LIB_MACOSX = @LIB_MACOSX@
75 LIB_NCURSES = @LIB_NCURSES@
79 LIB_DIRECTX = @LIB_DIRECTX@
81 LIB_XVIDEO = @LIB_XVIDEO@
85 # CFLAGS for special cases
87 CFLAGS_DVD = @CFLAGS_DVD@
88 CFLAGS_GTK = @CFLAGS_GTK@
89 CFLAGS_SDL = @CFLAGS_SDL@
90 CFLAGS_X11 = @CFLAGS_X11@
95 LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
97 ###############################################################################
98 # Configuration pre-processing
99 ###############################################################################
101 # PROGRAM_OPTIONS is an identification string of the compilation options
102 PROGRAM_OPTIONS = $(SYS) $(ARCH)
104 PROGRAM_OPTIONS += DEBUG
108 PROGRAM_OPTIONS += TRACE
111 ifeq ($(PROFILING),1)
112 PROGRAM_OPTIONS += PROFILING
113 DEFINE += -DPROFILING
116 PROGRAM_OPTIONS += STATS
120 # PROGRAM_BUILD is a complete identification of the build
121 # (we can't use fancy options with date since OSes like Solaris
122 # or FreeBSD have strange date implementations)
124 # XXX: beos does not support hostname (how lame...)
125 PROGRAM_BUILD = `date` $(USER)
127 PROGRAM_BUILD = `date` $(USER)@`hostname`
130 # PROGRAM_VERSION is the current vlc version
131 PROGRAM_VERSION=@VLC_VERSION@
133 # DEFINE will contain some of the constants definitions decided in Makefile,
134 # including SYS_xx. It will be passed to C compiler.
135 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
136 DEFINE += $(DEFINE_CONSTANTS)
138 # On Linux activate 64-bit off_t (by default under BSD)
139 ifneq (,$(findstring linux,$(SYS)))
140 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
143 ###############################################################################
144 # Tuning and other variables - do not change anything except if you know
145 # exactly what you are doing
146 ###############################################################################
149 # C headers directories
152 INCLUDE += -Iinclude -Iextras -I/usr/local/include
155 # Libraries needed by built-in modules
158 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
159 LIB += $(LIB_BUILTINS)
165 ifeq (1,$(LOCAL_LIBDVDCSS))
166 ifneq (,$(findstring dvd,$(BUILTINS)))
167 LIB += lib/libdvdcss.a
171 ifneq (,$(findstring mingw32,$(SYS)))
172 LIB += -lws2_32 -lnetapi32
175 LIB += -L/usr/local/lib @LIB@
178 # C compiler flags: mainstream compilation
181 CFLAGS += $(DEFINE) $(INCLUDE)
182 CFLAGS += -Wall -Winline
183 CFLAGS += -D_REENTRANT
184 CFLAGS += -D_GNU_SOURCE
186 # flags needed for clean beos compilation
188 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
191 ifneq (,$(findstring darwin,$(SYS)))
192 CFLAGS += -traditional-cpp
195 ifneq (,$(findstring mingw32,$(SYS)))
196 CFLAGS += -fnative-struct
199 # Optimizations : don't compile debug versions with them
202 CFLAGS += -ffast-math -funroll-loops
204 ifneq ($(PROFILING),1)
205 CFLAGS += -fomit-frame-pointer
209 # Optimizations for x86 familiy
210 ifneq (,$(findstring 86,$(ARCH)))
211 # Optional Pentium Pro optimizations
212 ifneq (,$(findstring ppro,$(ARCH)))
213 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
215 CFLAGS += -march=pentium -mcpu=pentium
219 # Optimizations for PowerPC
220 ifneq (,$(findstring powerpc,$(ARCH)))
221 CFLAGS += -mmultiple -mhard-float -mstring
224 # Optimizations for Sparc
225 ifneq (,$(findstring sparc,$(ARCH)))
226 CFLAGS += -mhard-float
229 #end of optimisations
233 # C compiler flags: dependancies
235 DCFLAGS += $(INCLUDE)
239 # C compiler flags: linking
241 LCFLAGS += @LCFLAGS@ $(LIB)
244 ifneq (,$(findstring mingw32,$(SYS)))
245 LCFLAGS += -Xlinker --force-exe-suffix
249 # C compiler flags: plugin compilation
251 ifneq (,$(findstring mingw32,$(SYS)))
252 PCFLAGS += -fnative-struct
258 # C compiler flags: plugin linking
260 PLCFLAGS += @PLCFLAGS@
263 # Debugging and profiling support
269 ifeq ($(PROFILING),1)