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@
53 # Installation environment
55 exec_prefix = @exec_prefix@
60 includedir = @includedir@
63 # Libraries for special cases
67 LIB_DARWIN = @LIB_DARWIN@
69 LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
72 LIB_GLIDE = @LIB_GLIDE@
73 LIB_GNOME = @LIB_GNOME@
75 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
77 LIB_MACOSX = @LIB_MACOSX@
79 LIB_NCURSES = @LIB_NCURSES@
83 LIB_DIRECTX = @LIB_DIRECTX@
85 LIB_XVIDEO = @LIB_XVIDEO@
89 # CFLAGS for special cases
91 CFLAGS_DVD = @CFLAGS_DVD@
92 CFLAGS_GTK = @CFLAGS_GTK@
93 CFLAGS_SDL = @CFLAGS_SDL@
94 CFLAGS_X11 = @CFLAGS_X11@
99 LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
101 ###############################################################################
102 # Configuration pre-processing
103 ###############################################################################
105 # PROGRAM_OPTIONS is an identification string of the compilation options
106 PROGRAM_OPTIONS = $(SYS) $(ARCH)
108 PROGRAM_OPTIONS += DEBUG
112 PROGRAM_OPTIONS += TRACE
115 ifeq ($(PROFILING),1)
116 PROGRAM_OPTIONS += PROFILING
117 DEFINE += -DPROFILING
120 PROGRAM_OPTIONS += STATS
124 # PROGRAM_BUILD is a complete identification of the build
125 # (we can't use fancy options with date since OSes like Solaris
126 # or FreeBSD have strange date implementations)
128 # XXX: beos does not support hostname (how lame...)
129 PROGRAM_BUILD = `date` $(USER)
131 PROGRAM_BUILD = `date` $(USER)@`hostname`
134 # PROGRAM_VERSION is the current vlc version
135 PROGRAM_VERSION=@VLC_VERSION@
136 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
138 # DEFINE will contain some of the constants definitions decided in Makefile,
139 # including SYS_xx. It will be passed to C compiler.
140 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
141 DEFINE += $(DEFINE_CONSTANTS)
143 # On Linux activate 64-bit off_t (by default under BSD)
144 ifneq (,$(findstring linux,$(SYS)))
145 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
148 ###############################################################################
149 # Tuning and other variables - do not change anything except if you know
150 # exactly what you are doing
151 ###############################################################################
154 # C headers directories
157 INCLUDE += -Iinclude -Iextras -I/usr/local/include
160 # Libraries needed by built-in modules
163 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
164 LIB += $(LIB_BUILTINS)
170 ifneq (,$(findstring mingw32,$(SYS)))
171 LIB += -lws2_32 -lnetapi32
174 LIB += -L/usr/local/lib @LIB@
177 # C compiler flags: mainstream compilation
180 CFLAGS += $(DEFINE) $(INCLUDE)
181 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 -D_OFF_T_ -D_off_t=long
199 ifneq (,$(findstring bsd,$(SYS)))
203 # Optimizations : don't compile debug versions with them
206 CFLAGS += -ffast-math -funroll-loops
208 ifneq ($(PROFILING),1)
209 CFLAGS += -fomit-frame-pointer
213 # Optimizations for x86 familiy
214 ifneq (,$(findstring 86,$(ARCH)))
215 # Optional Pentium Pro optimizations
216 ifneq (,$(findstring ppro,$(ARCH)))
217 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
219 CFLAGS += -march=pentium -mcpu=pentium
223 # Optimizations for PowerPC
224 ifneq (,$(findstring powerpc,$(ARCH)))
225 CFLAGS += -mmultiple -mhard-float -mstring
228 # Optimizations for Sparc
229 ifneq (,$(findstring sparc,$(ARCH)))
230 CFLAGS += -mhard-float
233 #end of optimisations
237 # C compiler flags: dependancies
239 DCFLAGS += $(INCLUDE)
243 # C compiler flags: linking
245 LCFLAGS += @LCFLAGS@ $(LIB)
248 ifneq (,$(findstring mingw32,$(SYS)))
249 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
253 # C compiler flags: plugin compilation
255 ifneq (,$(findstring mingw32,$(SYS)))
256 PCFLAGS += -fnative-struct
262 # C compiler flags: plugin linking
264 PLCFLAGS += @PLCFLAGS@
267 # Debugging and profiling support
273 ifeq ($(PROFILING),1)