package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / mplayer / mplayer.mk
blob3051afab17cbe72a48a4f739c9976f5a56b4910e
1 ################################################################################
3 # mplayer
5 ################################################################################
7 MPLAYER_VERSION = 1.2
8 MPLAYER_SOURCE = MPlayer-$(MPLAYER_VERSION).tar.xz
9 MPLAYER_SITE = http://www.mplayerhq.hu/MPlayer/releases
10 MPLAYER_DEPENDENCIES = host-pkgconf
11 MPLAYER_LICENSE = GPLv2
12 MPLAYER_LICENSE_FILES = LICENSE Copyright
13 MPLAYER_CFLAGS = $(TARGET_CFLAGS)
14 MPLAYER_LDFLAGS = $(TARGET_LDFLAGS)
16 # mplayer needs pcm+mixer support, but configure fails to check for it
17 ifeq ($(BR2_PACKAGE_ALSA_LIB)$(BR2_PACKAGE_ALSA_LIB_MIXER)$(BR2_PACKAGE_ALSA_LIB_PCM),yyy)
18 MPLAYER_DEPENDENCIES += alsa-lib
19 MPLAYER_CONF_OPTS += --enable-alsa
20 else
21 MPLAYER_CONF_OPTS += --disable-alsa
22 endif
24 ifeq ($(BR2_ENDIAN),"BIG")
25 MPLAYER_CONF_OPTS += --enable-big-endian
26 else
27 MPLAYER_CONF_OPTS += --disable-big-endian
28 endif
30 ifeq ($(BR2_PACKAGE_ZLIB),y)
31 MPLAYER_DEPENDENCIES += zlib
32 MPLAYER_CONF_OPTS += \
33 --enable-decoder=apng \
34 --enable-encoder=apng \
35 --enable-decoder=tdsc
36 else
37 MPLAYER_CONF_OPTS += \
38 --disable-decoder=apng \
39 --disable-encoder=apng \
40 --disable-decoder=tdsc
41 endif
43 ifeq ($(BR2_PACKAGE_SDL),y)
44 MPLAYER_CONF_OPTS += \
45 --enable-sdl \
46 --with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config
47 MPLAYER_DEPENDENCIES += sdl
48 else
49 MPLAYER_CONF_OPTS += --disable-sdl
50 endif
52 ifeq ($(BR2_PACKAGE_FREETYPE),y)
53 MPLAYER_CONF_OPTS += \
54 --enable-freetype \
55 --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config
56 MPLAYER_DEPENDENCIES += freetype
57 else
58 MPLAYER_CONF_OPTS += --disable-freetype
59 endif
61 # We intentionally don't pass --enable-fontconfig, to let the
62 # autodetection find which library to link with.
63 ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
64 MPLAYER_DEPENDENCIES += fontconfig
65 else
66 MPLAYER_CONF_OPTS += --disable-fontconfig
67 endif
69 ifeq ($(BR2_PACKAGE_LIBENCA),y)
70 MPLAYER_CONF_OPTS += --enable-enca
71 MPLAYER_DEPENDENCIES += libenca
72 else
73 MPLAYER_CONF_OPTS += --disable-enca
74 endif
76 # We intentionally don't pass --enable-fribidi, to let the
77 # autodetection find which library to link with.
78 ifeq ($(BR2_PACKAGE_LIBFRIBIDI),y)
79 MPLAYER_DEPENDENCIES += libfribidi
80 else
81 MPLAYER_CONF_OPTS += --disable-fribidi
82 endif
84 # We intentionally don't pass --enable-libiconv, to let the
85 # autodetection find which library to link with.
86 ifeq ($(BR2_PACKAGE_LIBICONV),y)
87 MPLAYER_DEPENDENCIES += libiconv
88 else
89 MPLAYER_CONF_OPTS += --disable-iconv
90 endif
92 # We intentionally don't pass --enable-termcap, in order to let the
93 # autodetection find with which library to link with. Otherwise, we
94 # would have to pass it manually.
95 ifeq ($(BR2_PACKAGE_NCURSES),y)
96 MPLAYER_DEPENDENCIES += ncurses
97 else
98 MPLAYER_CONF_OPTS += --disable-termcap
99 endif
101 ifeq ($(BR2_PACKAGE_SAMBA_SMBCLIENT),y)
102 MPLAYER_CONF_OPTS += --enable-smb
103 MPLAYER_DEPENDENCIES += samba
104 else
105 MPLAYER_CONF_OPTS += --disable-smb
106 endif
108 ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
109 MPLAYER_CONF_OPTS += --enable-bluray
110 MPLAYER_DEPENDENCIES += libbluray
111 else
112 MPLAYER_CONF_OPTS += --disable-bluray
113 endif
115 # cdio support is broken in buildroot atm due to missing libcdio-paranoia
116 # package and this patch
117 # https://github.com/pld-linux/mplayer/blob/master/mplayer-libcdio.patch
118 MPLAYER_CONF_OPTS += --disable-libcdio
120 # We intentionally don't pass --enable-dvdread, to let the
121 # autodetection find which library to link with.
122 ifeq ($(BR2_PACKAGE_LIBDVDREAD),y)
123 MPLAYER_CONF_OPTS += \
124 --with-dvdread-config=$(STAGING_DIR)/usr/bin/dvdread-config
125 MPLAYER_DEPENDENCIES += libdvdread
126 endif
128 # We intentionally don't pass --enable-dvdnav to let the autodetection
129 # find which library to link with.
130 ifeq ($(BR2_PACKAGE_LIBDVDNAV),y)
131 MPLAYER_CONF_OPTS += \
132 --with-dvdnav-config=$(STAGING_DIR)/usr/bin/dvdnav-config
133 MPLAYER_DEPENDENCIES += libdvdnav
134 endif
136 ifeq ($(BR2_PACKAGE_MPLAYER_MPLAYER),y)
137 MPLAYER_CONF_OPTS += --enable-mplayer
138 else
139 MPLAYER_CONF_OPTS += --disable-mplayer
140 endif
142 ifeq ($(BR2_PACKAGE_MPLAYER_MENCODER),y)
143 MPLAYER_CONF_OPTS += --enable-mencoder
144 else
145 MPLAYER_CONF_OPTS += --disable-mencoder
146 endif
148 ifeq ($(BR2_PACKAGE_FAAD2),y)
149 MPLAYER_DEPENDENCIES += faad2
150 MPLAYER_CONF_OPTS += --enable-faad
151 else
152 MPLAYER_CONF_OPTS += --disable-faad
153 endif
155 ifeq ($(BR2_PACKAGE_LAME),y)
156 MPLAYER_DEPENDENCIES += lame
157 MPLAYER_CONF_OPTS += --enable-mp3lame
158 else
159 MPLAYER_CONF_OPTS += --disable-mp3lame
160 endif
162 # We intentionally don't pass --disable-ass-internal --enable-ass and
163 # let autodetection find which library to link with.
164 ifeq ($(BR2_PACKAGE_LIBASS),y)
165 MPLAYER_DEPENDENCIES += libass
166 endif
168 # We intentionally don't pass --enable-libmpeg2 and let autodetection
169 # find which library to link with.
170 ifeq ($(BR2_PACKAGE_LIBMPEG2),y)
171 MPLAYER_DEPENDENCIES += libmpeg2
172 MPLAYER_CONF_OPTS += --disable-libmpeg2-internal
173 endif
175 ifeq ($(BR2_PACKAGE_TREMOR),y)
176 MPLAYER_DEPENDENCIES += tremor
177 MPLAYER_CONF_OPTS += --enable-tremor
178 endif
180 # We intentionally don't pass --enable-libvorbis, to let the
181 # autodetection find which library to link with.
182 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
183 MPLAYER_DEPENDENCIES += libvorbis
184 endif
186 ifeq ($(BR2_PACKAGE_LIBMAD),y)
187 MPLAYER_DEPENDENCIES += libmad
188 MPLAYER_CONF_OPTS += --enable-mad
189 else
190 MPLAYER_CONF_OPTS += --disable-mad
191 endif
193 ifeq ($(BR2_PACKAGE_LIVE555),y)
194 MPLAYER_DEPENDENCIES += live555
195 MPLAYER_CONF_OPTS += --enable-live
196 MPLAYER_LIVE555 = liveMedia groupsock UsageEnvironment BasicUsageEnvironment
197 MPLAYER_CFLAGS += \
198 $(addprefix -I$(STAGING_DIR)/usr/include/,$(MPLAYER_LIVE555))
199 MPLAYER_LDFLAGS += $(addprefix -l,$(MPLAYER_LIVE555)) -lstdc++
200 else
201 MPLAYER_CONF_OPTS += --disable-live
202 endif
204 ifeq ($(BR2_PACKAGE_GIFLIB),y)
205 MPLAYER_DEPENDENCIES += giflib
206 MPLAYER_CONF_OPTS += --enable-gif
207 else
208 MPLAYER_CONF_OPTS += --disable-gif
209 endif
211 # We intentionally don't pass --enable-librtmp to let autodetection
212 # find which library to link with.
213 ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
214 MPLAYER_DEPENDENCIES += rtmpdump
215 else
216 MPLAYER_CONF_OPTS += --disable-librtmp
217 endif
219 ifeq ($(BR2_PACKAGE_SPEEX),y)
220 MPLAYER_DEPENDENCIES += speex
221 MPLAYER_CONF_OPTS += --enable-speex
222 else
223 MPLAYER_CONF_OPTS += --disable-speex
224 endif
226 ifeq ($(BR2_PACKAGE_LZO),y)
227 MPLAYER_DEPENDENCIES += lzo
228 MPLAYER_CONF_OPTS += --enable-liblzo
229 else
230 MPLAYER_CONF_OPTS += --disable-liblzo
231 endif
233 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_BZIP2),bzip2)
234 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBTHEORA),libtheora)
235 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBPNG),libpng)
236 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
237 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBX11),xlib_libX11)
238 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBXEXT),xlib_libXext)
239 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBXINERAMA),xlib_libXinerama)
240 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBXV),xlib_libXv)
241 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBXXF86VM),xlib_libXxf86vm)
243 # ARM optimizations
244 ifeq ($(BR2_ARM_CPU_ARMV5),y)
245 MPLAYER_CONF_OPTS += --enable-armv5te
246 endif
248 ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
249 MPLAYER_CONF_OPTS += --enable-armv6
250 endif
252 ifeq ($(BR2_ARM_SOFT_FLOAT),)
253 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
254 MPLAYER_CONF_OPTS += --enable-neon
255 MPLAYER_CFLAGS += -mfpu=neon
256 endif
257 endif
259 ifeq ($(BR2_i386),y)
260 # inline asm breaks with "can't find a register in class 'GENERAL_REGS'"
261 # inless we free up ebp
262 MPLAYER_CFLAGS += -fomit-frame-pointer
263 endif
265 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
266 MPLAYER_CONF_OPTS += --yasm=$(HOST_DIR)/usr/bin/yasm
267 MPLAYER_DEPENDENCIES += host-yasm
268 else
269 MPLAYER_CONF_OPTS += --yasm=''
270 endif
272 define MPLAYER_CONFIGURE_CMDS
273 (cd $(@D); rm -rf config.cache; \
274 $(TARGET_CONFIGURE_OPTS) \
275 $(TARGET_CONFIGURE_ARGS) \
276 ./configure \
277 --prefix=/usr \
278 --confdir=/etc \
279 --target=$(GNU_TARGET_NAME) \
280 --host-cc="$(HOSTCC)" \
281 --cc="$(TARGET_CC)" \
282 --as="$(TARGET_AS)" \
283 --charset=UTF-8 \
284 --extra-cflags="$(MPLAYER_CFLAGS)" \
285 --extra-ldflags="$(MPLAYER_LDFLAGS)" \
286 --enable-fbdev \
287 $(MPLAYER_CONF_OPTS) \
288 --enable-cross-compile \
289 --disable-ivtv \
290 --enable-dynamic-plugins \
291 --enable-inet6 \
293 endef
295 define MPLAYER_BUILD_CMDS
296 $(MAKE) -C $(@D)
297 endef
299 define MPLAYER_INSTALL_TARGET_CMDS
300 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
301 endef
303 $(eval $(generic-package))