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@
54 # Installation environment
56 exec_prefix = @exec_prefix@
61 includedir = @includedir@
64 # Libraries for special cases
68 LIB_DARWIN = @LIB_DARWIN@
70 LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
73 LIB_GLIDE = @LIB_GLIDE@
74 LIB_GNOME = @LIB_GNOME@
76 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
77 LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
79 LIB_MACOSX = @LIB_MACOSX@
81 LIB_NCURSES = @LIB_NCURSES@
85 LIB_DIRECTX = @LIB_DIRECTX@
87 LIB_XVIDEO = @LIB_XVIDEO@
91 # CFLAGS for special cases
93 CFLAGS_DVD = @CFLAGS_DVD@
94 CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
95 CFLAGS_GTK = @CFLAGS_GTK@
96 CFLAGS_SDL = @CFLAGS_SDL@
97 CFLAGS_X11 = @CFLAGS_X11@
103 OBJ_LIBDVDCSS = @OBJ_LIBDVDCSS@
106 # Other special cases
108 NEED_GETOPT = @NEED_GETOPT@
109 NEED_LIBDVDCSS = @NEED_LIBDVDCSS@
111 ###############################################################################
112 # Configuration pre-processing
113 ###############################################################################
115 # PROGRAM_OPTIONS is an identification string of the compilation options
116 PROGRAM_OPTIONS = $(SYS) $(ARCH)
118 PROGRAM_OPTIONS += DEBUG
122 PROGRAM_OPTIONS += TRACE
125 ifeq ($(PROFILING),1)
126 PROGRAM_OPTIONS += PROFILING
127 DEFINE += -DPROFILING
130 PROGRAM_OPTIONS += STATS
134 # PROGRAM_BUILD is a complete identification of the build
135 # (we can't use fancy options with date since OSes like Solaris
136 # or FreeBSD have strange date implementations)
138 # XXX: beos does not support hostname (how lame...)
139 PROGRAM_BUILD = `date` $(USER)
141 PROGRAM_BUILD = `date` $(USER)@`hostname`
144 # PROGRAM_VERSION is the current vlc version
145 PROGRAM_VERSION=@VLC_VERSION@
146 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
148 # DEFINE will contain some of the constants definitions decided in Makefile,
149 # including SYS_xx. It will be passed to C compiler.
150 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
151 DEFINE += $(DEFINE_CONSTANTS)
153 # On Linux activate 64-bit off_t (by default under BSD)
154 ifneq (,$(findstring linux,$(SYS)))
155 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
158 ###############################################################################
159 # Tuning and other variables - do not change anything except if you know
160 # exactly what you are doing
161 ###############################################################################
164 # C headers directories
167 INCLUDE += -Iinclude -Iextras -I/usr/local/include
170 # Libraries needed by built-in modules
173 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
174 LIB += $(LIB_BUILTINS)
180 ifneq (,$(findstring mingw32,$(SYS)))
181 LIB += -lws2_32 -lnetapi32 -lmsvcrt40
184 LIB += -L/usr/local/lib @LIB@
187 # C compiler flags: mainstream compilation
190 CFLAGS += $(DEFINE) $(INCLUDE)
191 CFLAGS += -Wall -Winline
193 CFLAGS += -D_REENTRANT
194 CFLAGS += -D_GNU_SOURCE
196 # flags needed for clean beos compilation
198 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
201 ifneq (,$(findstring darwin,$(SYS)))
202 CFLAGS += -traditional-cpp
205 ifneq (,$(findstring mingw32,$(SYS)))
206 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
209 ifneq (,$(findstring bsd,$(SYS)))
213 # Optimizations : don't compile debug versions with them
216 CFLAGS += -ffast-math -funroll-loops
218 ifneq ($(PROFILING),1)
219 CFLAGS += -fomit-frame-pointer
223 # Optimizations for x86 familiy
224 ifneq (,$(findstring 86,$(ARCH)))
225 # Optional Pentium Pro optimizations
226 ifneq (,$(findstring ppro,$(ARCH)))
227 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
229 CFLAGS += -march=pentium -mcpu=pentium
233 # Optimizations for PowerPC
234 ifneq (,$(findstring powerpc,$(ARCH)))
235 CFLAGS += -mmultiple -mhard-float -mstring
238 # Optimizations for Sparc
239 ifneq (,$(findstring sparc,$(ARCH)))
240 CFLAGS += -mhard-float
243 #end of optimisations
247 # C compiler flags: dependancies
249 DCFLAGS += $(INCLUDE)
253 # C compiler flags: linking
255 LCFLAGS += @LCFLAGS@ $(LIB)
258 ifneq (,$(findstring mingw32,$(SYS)))
259 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
263 # C compiler and linker flags: setting soname
268 # C compiler flags: plugin compilation
270 ifneq (,$(findstring mingw32,$(SYS)))
271 PCFLAGS += -fnative-struct
277 # C compiler flags: plugin linking
279 PLCFLAGS += @PLCFLAGS@
282 # Debugging and profiling support
288 ifeq ($(PROFILING),1)