1 ################################################################################
5 ################################################################################
7 MPLAYER_VERSION = 1.1.1
8 MPLAYER_SOURCE = MPlayer-$(MPLAYER_VERSION).tar.xz
9 MPLAYER_SITE = http://www.mplayerhq.hu/MPlayer/releases
11 MPLAYER_CFLAGS = $(TARGET_CFLAGS)
12 MPLAYER_LDFLAGS = $(TARGET_LDFLAGS)
14 MPLAYER_DEPENDENCIES += host-pkgconf
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
21 MPLAYER_CONF_OPTS += --disable-alsa
24 ifeq ($(BR2_ENDIAN),"BIG")
25 MPLAYER_CONF_OPTS += --enable-big-endian
27 MPLAYER_CONF_OPTS += --disable-big-endian
30 ifeq ($(BR2_PACKAGE_SDL),y)
31 MPLAYER_CONF_OPTS += \
33 --with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config
34 MPLAYER_DEPENDENCIES += sdl
36 MPLAYER_CONF_OPTS += --disable-sdl
39 ifeq ($(BR2_PACKAGE_FREETYPE),y)
40 MPLAYER_CONF_OPTS += \
42 --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config
43 MPLAYER_DEPENDENCIES += freetype
45 MPLAYER_CONF_OPTS += --disable-freetype
48 # We intentionally don't pass --enable-fontconfig, to let the
49 # autodetection find which library to link with.
50 ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
51 MPLAYER_DEPENDENCIES += fontconfig
53 MPLAYER_CONF_OPTS += --disable-fontconfig
56 ifeq ($(BR2_PACKAGE_LIBENCA),y)
57 MPLAYER_CONF_OPTS += --enable-enca
58 MPLAYER_DEPENDENCIES += libenca
60 MPLAYER_CONF_OPTS += --disable-enca
63 # We intentionally don't pass --enable-fribidi, to let the
64 # autodetection find which library to link with.
65 ifeq ($(BR2_PACKAGE_LIBFRIBIDI),y)
66 MPLAYER_DEPENDENCIES += libfribidi
68 MPLAYER_CONF_OPTS += --disable-fribidi
71 # We intentionally don't pass --enable-libiconv, to let the
72 # autodetection find which library to link with.
73 ifeq ($(BR2_PACKAGE_LIBICONV),y)
74 MPLAYER_DEPENDENCIES += libiconv
76 MPLAYER_CONF_OPTS += --disable-iconv
79 # We intentionally don't pass --enable-termcap, in order to let the
80 # autodetection find with which library to link with. Otherwise, we
81 # would have to pass it manually.
82 ifeq ($(BR2_PACKAGE_NCURSES),y)
83 MPLAYER_DEPENDENCIES += ncurses
85 MPLAYER_CONF_OPTS += --disable-termcap
88 ifeq ($(BR2_PACKAGE_SAMBA_SMBCLIENT),y)
89 MPLAYER_CONF_OPTS += --enable-smb
90 MPLAYER_DEPENDENCIES += samba
92 MPLAYER_CONF_OPTS += --disable-smb
95 ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
96 MPLAYER_CONF_OPTS += --enable-bluray
97 MPLAYER_DEPENDENCIES += libbluray
99 MPLAYER_CONF_OPTS += --disable-bluray
102 # cdio support is broken in buildroot atm due to missing libcdio-paranoia
103 # package and this patch
104 # https://github.com/pld-linux/mplayer/blob/master/mplayer-libcdio.patch
105 MPLAYER_CONF_OPTS += --disable-libcdio
107 ifeq ($(BR2_PACKAGE_LIBDVDREAD),y)
108 MPLAYER_CONF_OPTS += \
110 --disable-dvdread-internal \
111 --with-dvdread-config=$(STAGING_DIR)/usr/bin/dvdread-config
112 MPLAYER_DEPENDENCIES += libdvdread
115 ifeq ($(BR2_PACKAGE_LIBDVDNAV),y)
116 MPLAYER_CONF_OPTS += \
118 --with-dvdnav-config=$(STAGING_DIR)/usr/bin/dvdnav-config
119 MPLAYER_DEPENDENCIES += libdvdnav
122 ifeq ($(BR2_PACKAGE_MPLAYER_MPLAYER),y)
123 MPLAYER_CONF_OPTS += --enable-mplayer
125 MPLAYER_CONF_OPTS += --disable-mplayer
128 ifeq ($(BR2_PACKAGE_MPLAYER_MENCODER),y)
129 MPLAYER_CONF_OPTS += --enable-mencoder
131 MPLAYER_CONF_OPTS += --disable-mencoder
134 ifeq ($(BR2_PACKAGE_FAAD2),y)
135 MPLAYER_DEPENDENCIES += faad2
136 MPLAYER_CONF_OPTS += --enable-faad
138 MPLAYER_CONF_OPTS += --disable-faad
141 ifeq ($(BR2_PACKAGE_LAME),y)
142 MPLAYER_DEPENDENCIES += lame
143 MPLAYER_CONF_OPTS += --enable-mp3lame
145 MPLAYER_CONF_OPTS += --disable-mp3lame
148 # We intentionally don't pass --disable-ass-internal --enable-ass and
149 # let autodetection find which library to link with.
150 ifeq ($(BR2_PACKAGE_LIBASS),y)
151 MPLAYER_DEPENDENCIES += libass
154 # We intentionally don't pass --enable-libmpeg2 and let autodetection
155 # find which library to link with.
156 ifeq ($(BR2_PACKAGE_LIBMPEG2),y)
157 MPLAYER_DEPENDENCIES += libmpeg2
158 MPLAYER_CONF_OPTS += --disable-libmpeg2-internal
161 ifeq ($(BR2_PACKAGE_TREMOR),y)
162 MPLAYER_DEPENDENCIES += tremor
163 MPLAYER_CONF_OPTS += --disable-tremor-internal --enable-tremor
166 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
167 MPLAYER_DEPENDENCIES += libvorbis
168 MPLAYER_CONF_OPTS += --enable-libvorbis
171 ifeq ($(BR2_PACKAGE_LIBMAD),y)
172 MPLAYER_DEPENDENCIES += libmad
173 MPLAYER_CONF_OPTS += --enable-mad
175 MPLAYER_CONF_OPTS += --disable-mad
178 ifeq ($(BR2_PACKAGE_LIVE555),y)
179 MPLAYER_DEPENDENCIES += live555
180 MPLAYER_CONF_OPTS += --enable-live
181 MPLAYER_LIVE555 = liveMedia groupsock UsageEnvironment BasicUsageEnvironment
183 $(addprefix -I$(STAGING_DIR)/usr/include/,$(MPLAYER_LIVE555))
184 MPLAYER_LDFLAGS += $(addprefix -l,$(MPLAYER_LIVE555)) -lstdc++
186 MPLAYER_CONF_OPTS += --disable-live
189 ifeq ($(BR2_PACKAGE_GIFLIB),y)
190 MPLAYER_DEPENDENCIES += giflib
191 MPLAYER_CONF_OPTS += --enable-gif
193 MPLAYER_CONF_OPTS += --disable-gif
196 # We intentionally don't pass --enable-librtmp to let autodetection
197 # find which library to link with.
198 ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
199 MPLAYER_DEPENDENCIES += rtmpdump
201 MPLAYER_CONF_OPTS += --disable-librtmp
204 ifeq ($(BR2_PACKAGE_SPEEX),y)
205 MPLAYER_DEPENDENCIES += speex
206 MPLAYER_CONF_OPTS += --enable-speex
208 MPLAYER_CONF_OPTS += --disable-speex
211 ifeq ($(BR2_PACKAGE_LZO),y)
212 MPLAYER_DEPENDENCIES += lzo
213 MPLAYER_CONF_OPTS += --enable-liblzo
215 MPLAYER_CONF_OPTS += --disable-liblzo
218 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_BZIP2),bzip2)
219 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBTHEORA),libtheora)
220 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBPNG),libpng)
221 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
222 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBX11),xlib_libX11)
223 MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBXV),xlib_libXv)
226 ifeq ($(BR2_ARM_CPU_ARMV5),y)
227 MPLAYER_CONF_OPTS += --enable-armv5te
230 ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
231 MPLAYER_CONF_OPTS += --enable-armv6
234 ifeq ($(BR2_ARM_SOFT_FLOAT),)
235 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
236 MPLAYER_CONF_OPTS += --enable-neon
237 MPLAYER_CFLAGS += -mfpu=neon
242 # inline asm breaks with "can't find a register in class 'GENERAL_REGS'"
243 # inless we free up ebp
244 MPLAYER_CFLAGS += -fomit-frame-pointer
247 define MPLAYER_CONFIGURE_CMDS
248 (cd $(@D); rm -rf config.cache; \
249 $(TARGET_CONFIGURE_OPTS) \
250 $(TARGET_CONFIGURE_ARGS) \
254 --target=$(GNU_TARGET_NAME) \
255 --host-cc="$(HOSTCC)" \
256 --cc="$(TARGET_CC)" \
257 --as="$(TARGET_AS)" \
259 --extra-cflags="$(MPLAYER_CFLAGS)" \
260 --extra-ldflags="$(MPLAYER_LDFLAGS)" \
263 $(MPLAYER_CONF_OPTS) \
264 --enable-cross-compile \
266 --enable-dynamic-plugins \
271 define MPLAYER_BUILD_CMDS
275 define MPLAYER_INSTALL_TARGET_CMDS
276 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
279 $(eval $(generic-package))