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
56 # Installation environment
58 exec_prefix = @exec_prefix@
63 includedir = @includedir@
66 # Libraries for special cases
69 LIB_ALTIVEC = @LIB_ALTIVEC@
71 LIB_DARWIN = @LIB_DARWIN@
73 LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
76 LIB_GLIDE = @LIB_GLIDE@
77 LIB_GNOME = @LIB_GNOME@
79 LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
81 LIB_MACOSX = @LIB_MACOSX@
83 LIB_NCURSES = @LIB_NCURSES@
87 LIB_DIRECTX = @LIB_DIRECTX@
89 LIB_XVIDEO = @LIB_XVIDEO@
93 # CFLAGS for special cases
95 CFLAGS_ALTIVEC = @CFLAGS_ALTIVEC@
96 CFLAGS_DVD = @CFLAGS_DVD@
97 CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
98 CFLAGS_GTK = @CFLAGS_GTK@
99 CFLAGS_SDL = @CFLAGS_SDL@
100 CFLAGS_X11 = @CFLAGS_X11@
106 OBJ_LIBDVDCSS = @OBJ_LIBDVDCSS@
109 # Other special cases
111 NEED_GETOPT = @NEED_GETOPT@
112 NEED_LIBDVDCSS = @NEED_LIBDVDCSS@
114 ###############################################################################
115 # Configuration pre-processing
116 ###############################################################################
118 # PROGRAM_OPTIONS is an identification string of the compilation options
119 PROGRAM_OPTIONS = $(SYS) $(ARCH)
121 PROGRAM_OPTIONS += DEBUG
125 PROGRAM_OPTIONS += TRACE
129 PROGRAM_OPTIONS += CPROF
133 PROGRAM_OPTIONS += GPROF
137 # PROGRAM_BUILD is a complete identification of the build
138 # (we can't use fancy options with date since OSes like Solaris
139 # or FreeBSD have strange date implementations)
141 # XXX: beos does not support hostname (how lame...)
142 PROGRAM_BUILD = `date` $(USER)
144 PROGRAM_BUILD = `date` $(USER)@`hostname`
147 # PROGRAM_VERSION is the current vlc version
148 PROGRAM_VERSION=@VLC_VERSION@
149 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
151 # DEFINE will contain some of the constants definitions decided in Makefile,
152 # including SYS_xx. It will be passed to C compiler.
153 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
154 DEFINE += $(DEFINE_CONSTANTS)
156 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
157 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
159 ###############################################################################
160 # Tuning and other variables - do not change anything except if you know
161 # exactly what you are doing
162 ###############################################################################
165 # C headers directories
168 INCLUDE += -Iinclude -Iextras
171 # Libraries needed by built-in modules
173 # Let's go for a crude hack !
174 LIB_MOTIONALTIVEC := $(LIB_ALTIVEC)
175 LIB_IDCTALTIVEC := $(LIB_ALTIVEC)
177 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
178 LIB += $(LIB_BUILTINS)
184 ifneq (,$(findstring mingw32,$(SYS)))
185 LIB += -lws2_32 -lnetapi32
191 # C compiler flags: mainstream compilation
194 CFLAGS += $(DEFINE) $(INCLUDE)
195 CFLAGS += -Wall -Winline
197 CFLAGS += -D_REENTRANT
198 CFLAGS += -D_GNU_SOURCE
204 # flags needed for clean beos compilation
206 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
209 ifneq (,$(findstring darwin,$(SYS)))
210 CFLAGS += -no-cpp-precomp
213 ifneq (,$(findstring mingw32,$(SYS)))
214 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
217 ifneq (,$(findstring bsd,$(SYS)))
221 # Optimizations : don't compile debug versions with them
224 CFLAGS += -ffast-math -funroll-loops
228 CFLAGS += -fomit-frame-pointer
233 ifneq (,$(findstring powerpc,$(ARCH)))
234 # Optimizations for PowerPC
235 CFLAGS += -mmultiple -mhard-float -mstring -mcpu=powerpc
237 CFLAGS += -mtune=$(TUNING)
240 ifneq (,$(findstring sparc,$(ARCH)))
241 # Optimizations for Sparc
242 CFLAGS += -mhard-float
244 CFLAGS += -mcpu=$(TUNING)
247 # Generic optimizations
249 CFLAGS += -mcpu=$(TUNING)
254 #end of optimisations
258 # C compiler flags: dependancies
260 DCFLAGS += $(INCLUDE)
264 # C compiler flags: linking
266 LCFLAGS += @LCFLAGS@ $(LIB)
275 ifneq (,$(findstring mingw32,$(SYS)))
276 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
280 # C compiler and linker flags: setting soname
285 # C compiler flags: plugin compilation
287 ifneq (,$(findstring mingw32,$(SYS)))
288 PCFLAGS += -fnative-struct
294 # C compiler flags: plugin linking
296 PLCFLAGS += @PLCFLAGS@
299 # Debugging and profiling support
306 CFLAGS += -finstrument-functions