1 ###############################################################################
2 # vlc (VideoLAN Client) options Makefile
4 ###############################################################################
8 ###############################################################################
10 ###############################################################################
14 # WARNING: if you do not have a dynamic loader on your platform, remove
15 # the plugins in this line and put them as built-ins, otherwise your
16 # application won't be able to load them.
21 # Built-in modules to build
22 # WARNING: do NOT put gtk and gnome together in this rule.
27 # Additional build options
40 PROFILING = @PROFILING@
55 # Installation environment
57 exec_prefix = @exec_prefix@
62 includedir = @includedir@
65 # Libraries for special cases
69 LIB_DARWIN = @LIB_DARWIN@
71 LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
74 LIB_GLIDE = @LIB_GLIDE@
75 LIB_GNOME = @LIB_GNOME@
77 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
78 LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
80 LIB_MACOSX = @LIB_MACOSX@
82 LIB_NCURSES = @LIB_NCURSES@
86 LIB_DIRECTX = @LIB_DIRECTX@
88 LIB_XVIDEO = @LIB_XVIDEO@
92 # CFLAGS for special cases
94 CFLAGS_DVD = @CFLAGS_DVD@
95 CFLAGS_GTK = @CFLAGS_GTK@
96 CFLAGS_SDL = @CFLAGS_SDL@
97 CFLAGS_X11 = @CFLAGS_X11@
100 # Other special cases
103 LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
105 ###############################################################################
106 # Configuration pre-processing
107 ###############################################################################
109 # PROGRAM_OPTIONS is an identification string of the compilation options
110 PROGRAM_OPTIONS = $(SYS) $(ARCH)
112 PROGRAM_OPTIONS += DEBUG
116 PROGRAM_OPTIONS += TRACE
119 ifeq ($(PROFILING),1)
120 PROGRAM_OPTIONS += PROFILING
121 DEFINE += -DPROFILING
124 PROGRAM_OPTIONS += STATS
128 # PROGRAM_BUILD is a complete identification of the build
129 # (we can't use fancy options with date since OSes like Solaris
130 # or FreeBSD have strange date implementations)
132 # XXX: beos does not support hostname (how lame...)
133 PROGRAM_BUILD = `date` $(USER)
135 PROGRAM_BUILD = `date` $(USER)@`hostname`
138 # PROGRAM_VERSION is the current vlc version
139 PROGRAM_VERSION=@VLC_VERSION@
140 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
142 # DEFINE will contain some of the constants definitions decided in Makefile,
143 # including SYS_xx. It will be passed to C compiler.
144 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
145 DEFINE += $(DEFINE_CONSTANTS)
147 # On Linux activate 64-bit off_t (by default under BSD)
148 ifneq (,$(findstring linux,$(SYS)))
149 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
152 ###############################################################################
153 # Tuning and other variables - do not change anything except if you know
154 # exactly what you are doing
155 ###############################################################################
158 # C headers directories
161 INCLUDE += -Iinclude -Iextras -I/usr/local/include
164 # Libraries needed by built-in modules
167 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
168 LIB += $(LIB_BUILTINS)
174 ifneq (,$(findstring mingw32,$(SYS)))
175 LIB += -lws2_32 -lnetapi32 -lmsvcrt40
178 LIB += -L/usr/local/lib @LIB@
181 # C compiler flags: mainstream compilation
184 CFLAGS += $(DEFINE) $(INCLUDE)
185 CFLAGS += -Wall -Winline
187 CFLAGS += -D_REENTRANT
188 CFLAGS += -D_GNU_SOURCE
190 # flags needed for clean beos compilation
192 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
195 ifneq (,$(findstring darwin,$(SYS)))
196 CFLAGS += -traditional-cpp
199 ifneq (,$(findstring mingw32,$(SYS)))
200 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
203 ifneq (,$(findstring bsd,$(SYS)))
207 # Optimizations : don't compile debug versions with them
210 CFLAGS += -ffast-math -funroll-loops
212 ifneq ($(PROFILING),1)
213 CFLAGS += -fomit-frame-pointer
217 # Optimizations for x86 familiy
218 ifneq (,$(findstring 86,$(ARCH)))
219 # Optional Pentium Pro optimizations
220 ifneq (,$(findstring ppro,$(ARCH)))
221 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
223 CFLAGS += -march=pentium -mcpu=pentium
227 # Optimizations for PowerPC
228 ifneq (,$(findstring powerpc,$(ARCH)))
229 CFLAGS += -mmultiple -mhard-float -mstring
232 # Optimizations for Sparc
233 ifneq (,$(findstring sparc,$(ARCH)))
234 CFLAGS += -mhard-float
237 #end of optimisations
241 # C compiler flags: dependancies
243 DCFLAGS += $(INCLUDE)
247 # C compiler flags: linking
249 LCFLAGS += @LCFLAGS@ $(LIB)
252 ifneq (,$(findstring mingw32,$(SYS)))
253 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
257 # C compiler and linker flags: setting soname
262 # C compiler flags: plugin compilation
264 ifneq (,$(findstring mingw32,$(SYS)))
265 PCFLAGS += -fnative-struct
271 # C compiler flags: plugin linking
273 PLCFLAGS += @PLCFLAGS@
276 # Debugging and profiling support
282 ifeq ($(PROFILING),1)