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@
132 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
134 # DEFINE will contain some of the constants definitions decided in Makefile,
135 # including SYS_xx. It will be passed to C compiler.
136 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
137 DEFINE += $(DEFINE_CONSTANTS)
139 # On Linux activate 64-bit off_t (by default under BSD)
140 ifneq (,$(findstring linux,$(SYS)))
141 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
144 ###############################################################################
145 # Tuning and other variables - do not change anything except if you know
146 # exactly what you are doing
147 ###############################################################################
150 # C headers directories
153 INCLUDE += -Iinclude -Iextras -I/usr/local/include
156 # Libraries needed by built-in modules
159 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
160 LIB += $(LIB_BUILTINS)
166 ifeq (1,$(LOCAL_LIBDVDCSS))
167 ifneq (,$(findstring dvd,$(BUILTINS)))
168 LIB += lib/libdvdcss.a
172 ifneq (,$(findstring mingw32,$(SYS)))
173 LIB += -lws2_32 -lnetapi32
176 LIB += -L/usr/local/lib @LIB@
179 # C compiler flags: mainstream compilation
182 CFLAGS += $(DEFINE) $(INCLUDE)
183 CFLAGS += -Wall -Winline
184 CFLAGS += -D_REENTRANT
185 CFLAGS += -D_GNU_SOURCE
187 # flags needed for clean beos compilation
189 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
192 ifneq (,$(findstring darwin,$(SYS)))
193 CFLAGS += -traditional-cpp
196 ifneq (,$(findstring mingw32,$(SYS)))
197 CFLAGS += -fnative-struct
200 # Optimizations : don't compile debug versions with them
203 CFLAGS += -ffast-math -funroll-loops
205 ifneq ($(PROFILING),1)
206 CFLAGS += -fomit-frame-pointer
210 # Optimizations for x86 familiy
211 ifneq (,$(findstring 86,$(ARCH)))
212 # Optional Pentium Pro optimizations
213 ifneq (,$(findstring ppro,$(ARCH)))
214 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
216 CFLAGS += -march=pentium -mcpu=pentium
220 # Optimizations for PowerPC
221 ifneq (,$(findstring powerpc,$(ARCH)))
222 CFLAGS += -mmultiple -mhard-float -mstring
225 # Optimizations for Sparc
226 ifneq (,$(findstring sparc,$(ARCH)))
227 CFLAGS += -mhard-float
230 #end of optimisations
234 # C compiler flags: dependancies
236 DCFLAGS += $(INCLUDE)
240 # C compiler flags: linking
242 LCFLAGS += @LCFLAGS@ $(LIB)
245 ifneq (,$(findstring mingw32,$(SYS)))
246 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
250 # C compiler flags: plugin compilation
252 ifneq (,$(findstring mingw32,$(SYS)))
253 PCFLAGS += -fnative-struct
259 # C compiler flags: plugin linking
261 PLCFLAGS += @PLCFLAGS@
264 # Debugging and profiling support
270 ifeq ($(PROFILING),1)