1 ################################################################################
5 ################################################################################
7 MPLAYER_VERSION
= 1.3.0
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 # Adding $(STAGING_DIR)/usr/include in the header path is normally not
17 # needed. Except that mplayer's configure script has a completely
18 # brain-damaged way of looking for X11/Xlib.h (it parses extra-cflags
20 MPLAYER_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include
22 # mplayer needs pcm+mixer support, but configure fails to check for it
23 ifeq ($(BR2_PACKAGE_ALSA_LIB
)$(BR2_PACKAGE_ALSA_LIB_MIXER
)$(BR2_PACKAGE_ALSA_LIB_PCM
),yyy
)
24 MPLAYER_DEPENDENCIES
+= alsa-lib
25 MPLAYER_CONF_OPTS
+= --enable-alsa
27 MPLAYER_CONF_OPTS
+= --disable-alsa
30 ifeq ($(BR2_ENDIAN
),"BIG")
31 MPLAYER_CONF_OPTS
+= --enable-big-endian
33 MPLAYER_CONF_OPTS
+= --disable-big-endian
36 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
37 MPLAYER_DEPENDENCIES
+= zlib
38 MPLAYER_CONF_OPTS
+= \
39 --enable-decoder
=apng \
40 --enable-encoder
=apng \
43 MPLAYER_CONF_OPTS
+= \
44 --disable-decoder
=apng \
45 --disable-encoder
=apng \
46 --disable-decoder
=tdsc
49 ifeq ($(BR2_PACKAGE_SDL
),y
)
50 MPLAYER_CONF_OPTS
+= \
52 --with-sdl-config
=$(STAGING_DIR
)/usr
/bin
/sdl-config
53 MPLAYER_DEPENDENCIES
+= sdl
55 MPLAYER_CONF_OPTS
+= --disable-sdl
58 ifeq ($(BR2_PACKAGE_FREETYPE
),y
)
59 MPLAYER_CONF_OPTS
+= \
61 --with-freetype-config
=$(STAGING_DIR
)/usr
/bin
/freetype-config
62 MPLAYER_DEPENDENCIES
+= freetype
64 MPLAYER_CONF_OPTS
+= --disable-freetype
67 # We intentionally don't pass --enable-fontconfig, to let the
68 # autodetection find which library to link with.
69 ifeq ($(BR2_PACKAGE_FONTCONFIG
),y
)
70 MPLAYER_DEPENDENCIES
+= fontconfig
72 MPLAYER_CONF_OPTS
+= --disable-fontconfig
75 ifeq ($(BR2_PACKAGE_LIBENCA
),y
)
76 MPLAYER_CONF_OPTS
+= --enable-enca
77 MPLAYER_DEPENDENCIES
+= libenca
79 MPLAYER_CONF_OPTS
+= --disable-enca
82 # We intentionally don't pass --enable-fribidi, to let the
83 # autodetection find which library to link with.
84 ifeq ($(BR2_PACKAGE_LIBFRIBIDI
),y
)
85 MPLAYER_DEPENDENCIES
+= libfribidi
87 MPLAYER_CONF_OPTS
+= --disable-fribidi
90 # We intentionally don't pass --enable-libiconv, to let the
91 # autodetection find which library to link with.
92 ifeq ($(BR2_PACKAGE_LIBICONV
),y
)
93 MPLAYER_DEPENDENCIES
+= libiconv
95 MPLAYER_CONF_OPTS
+= --disable-iconv
98 # We intentionally don't pass --enable-termcap, in order to let the
99 # autodetection find with which library to link with. Otherwise, we
100 # would have to pass it manually.
101 ifeq ($(BR2_PACKAGE_NCURSES
),y
)
102 MPLAYER_DEPENDENCIES
+= ncurses
104 MPLAYER_CONF_OPTS
+= --disable-termcap
107 # mplayer doesn't pick up libsmbclient cflags
108 ifeq ($(BR2_PACKAGE_SAMBA4
),y
)
109 MPLAYER_CFLAGS
+= `$(PKG_CONFIG_HOST_BINARY) --cflags smbclient`
110 MPLAYER_CONF_OPTS
+= --enable-smb
111 MPLAYER_DEPENDENCIES
+= samba4
113 MPLAYER_CONF_OPTS
+= --disable-smb
116 ifeq ($(BR2_PACKAGE_LIBBLURAY
),y
)
117 MPLAYER_CONF_OPTS
+= --enable-bluray
118 MPLAYER_DEPENDENCIES
+= libbluray
120 MPLAYER_CONF_OPTS
+= --disable-bluray
123 # cdio support is broken in buildroot atm due to missing libcdio-paranoia
124 # package and this patch
125 # https://github.com/pld-linux/mplayer/blob/master/mplayer-libcdio.patch
126 MPLAYER_CONF_OPTS
+= --disable-libcdio
128 # We intentionally don't pass --enable-dvdread, to let the
129 # autodetection find which library to link with.
130 ifeq ($(BR2_PACKAGE_LIBDVDREAD
),y
)
131 MPLAYER_CONF_OPTS
+= \
132 --with-dvdread-config
="$(PKG_CONFIG_HOST_BINARY) dvdread"
133 MPLAYER_DEPENDENCIES
+= libdvdread
136 # We intentionally don't pass --enable-dvdnav to let the autodetection
137 # find which library to link with.
138 ifeq ($(BR2_PACKAGE_LIBDVDNAV
),y
)
139 MPLAYER_CONF_OPTS
+= \
140 --with-dvdnav-config
="$(PKG_CONFIG_HOST_BINARY) dvdnav"
141 MPLAYER_DEPENDENCIES
+= libdvdnav
144 ifeq ($(BR2_PACKAGE_MPLAYER_MPLAYER
),y
)
145 MPLAYER_CONF_OPTS
+= --enable-mplayer
147 MPLAYER_CONF_OPTS
+= --disable-mplayer
150 ifeq ($(BR2_PACKAGE_MPLAYER_MENCODER
),y
)
151 MPLAYER_CONF_OPTS
+= --enable-mencoder
153 MPLAYER_CONF_OPTS
+= --disable-mencoder
156 ifeq ($(BR2_PACKAGE_FAAD2
),y
)
157 MPLAYER_DEPENDENCIES
+= faad2
158 MPLAYER_CONF_OPTS
+= --enable-faad
160 MPLAYER_CONF_OPTS
+= --disable-faad
163 ifeq ($(BR2_PACKAGE_LAME
),y
)
164 MPLAYER_DEPENDENCIES
+= lame
165 MPLAYER_CONF_OPTS
+= --enable-mp3lame
167 MPLAYER_CONF_OPTS
+= --disable-mp3lame
170 # We intentionally don't pass --disable-ass-internal --enable-ass and
171 # let autodetection find which library to link with.
172 ifeq ($(BR2_PACKAGE_LIBASS
),y
)
173 MPLAYER_DEPENDENCIES
+= libass
176 # We intentionally don't pass --enable-libmpeg2 and let autodetection
177 # find which library to link with.
178 ifeq ($(BR2_PACKAGE_LIBMPEG2
),y
)
179 MPLAYER_DEPENDENCIES
+= libmpeg2
180 MPLAYER_CONF_OPTS
+= --disable-libmpeg2-internal
183 # We intentionally don't pass --enable-mpg123, to let the
184 # autodetection find which library to link with.
185 ifeq ($(BR2_PACKAGE_MPG123
),y
)
186 MPLAYER_DEPENDENCIES
+= mpg123
188 MPLAYER_CONF_OPTS
+= --disable-mpg123
191 ifeq ($(BR2_PACKAGE_TREMOR
),y
)
192 MPLAYER_DEPENDENCIES
+= tremor
193 MPLAYER_CONF_OPTS
+= --enable-tremor
196 # We intentionally don't pass --enable-libvorbis, to let the
197 # autodetection find which library to link with.
198 ifeq ($(BR2_PACKAGE_LIBVORBIS
),y
)
199 MPLAYER_DEPENDENCIES
+= libvorbis
202 ifeq ($(BR2_PACKAGE_LIBMAD
),y
)
203 MPLAYER_DEPENDENCIES
+= libmad
204 MPLAYER_CONF_OPTS
+= --enable-mad
206 MPLAYER_CONF_OPTS
+= --disable-mad
209 ifeq ($(BR2_PACKAGE_LIVE555
),y
)
210 MPLAYER_DEPENDENCIES
+= live555
211 MPLAYER_CONF_OPTS
+= --enable-live
212 MPLAYER_LIVE555
= liveMedia groupsock UsageEnvironment BasicUsageEnvironment
214 $(addprefix -I
$(STAGING_DIR
)/usr
/include/,$(MPLAYER_LIVE555
))
215 MPLAYER_LDFLAGS
+= $(addprefix -l
,$(MPLAYER_LIVE555
)) -lstdc
++
217 MPLAYER_CONF_OPTS
+= --disable-live
220 ifeq ($(BR2_PACKAGE_GIFLIB
),y
)
221 MPLAYER_DEPENDENCIES
+= giflib
222 MPLAYER_CONF_OPTS
+= --enable-gif
224 MPLAYER_CONF_OPTS
+= --disable-gif
227 # We intentionally don't pass --enable-librtmp to let autodetection
228 # find which library to link with.
229 ifeq ($(BR2_PACKAGE_RTMPDUMP
),y
)
230 MPLAYER_DEPENDENCIES
+= rtmpdump
232 MPLAYER_CONF_OPTS
+= --disable-librtmp
235 ifeq ($(BR2_PACKAGE_SPEEX
),y
)
236 MPLAYER_DEPENDENCIES
+= speex
237 MPLAYER_CONF_OPTS
+= --enable-speex
239 MPLAYER_CONF_OPTS
+= --disable-speex
242 ifeq ($(BR2_PACKAGE_LZO
),y
)
243 MPLAYER_DEPENDENCIES
+= lzo
244 MPLAYER_CONF_OPTS
+= --enable-liblzo
246 MPLAYER_CONF_OPTS
+= --disable-liblzo
249 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_BZIP2
),bzip2
)
250 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_HAS_LIBGL
),libgl
)
251 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBTHEORA
),libtheora
)
252 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBPNG
),libpng
)
253 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBVPX
),libvpx
)
254 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_JPEG
),jpeg
)
255 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_OPUS
),opus
)
256 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBX11
),xlib_libX11
)
257 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXEXT
),xlib_libXext
)
258 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXINERAMA
),xlib_libXinerama
)
259 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXV
),xlib_libXv
)
260 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXXF86VM
),xlib_libXxf86vm
)
263 ifeq ($(BR2_ARM_CPU_ARMV5
),y
)
264 MPLAYER_CONF_OPTS
+= --enable-armv5te
267 ifeq ($(BR2_ARM_CPU_ARMV6
)$(BR2_ARM_CPU_ARMV7A
),y
)
268 MPLAYER_CONF_OPTS
+= --enable-armv6
271 ifeq ($(BR2_aarch64
),y
)
272 MPLAYER_CONF_OPTS
+= --enable-armv8
275 ifeq ($(BR2_ARM_SOFT_FLOAT
),)
276 ifeq ($(BR2_ARM_CPU_HAS_NEON
),y
)
277 MPLAYER_CONF_OPTS
+= --enable-neon
278 MPLAYER_CFLAGS
+= -mfpu
=neon
283 # inline asm breaks with "can't find a register in class 'GENERAL_REGS'"
284 # inless we free up ebp
285 MPLAYER_CFLAGS
+= -fomit-frame-pointer
288 ifeq ($(BR2_X86_CPU_HAS_MMX
),y
)
289 MPLAYER_CONF_OPTS
+= \
291 --yasm
=$(HOST_DIR
)/usr
/bin
/yasm
292 MPLAYER_DEPENDENCIES
+= host-yasm
294 MPLAYER_CONF_OPTS
+= \
299 ifeq ($(BR2_X86_CPU_HAS_SSE
),y
)
300 MPLAYER_CONF_OPTS
+= --enable-sse
302 MPLAYER_CONF_OPTS
+= --disable-sse
305 ifeq ($(BR2_X86_CPU_HAS_SSE2
),y
)
306 MPLAYER_CONF_OPTS
+= --enable-sse2
308 MPLAYER_CONF_OPTS
+= --disable-sse2
311 ifeq ($(BR2_X86_CPU_HAS_SSE3
),y
)
312 MPLAYER_CONF_OPTS
+= --enable-sse3
314 MPLAYER_CONF_OPTS
+= --disable-sse3
317 ifeq ($(BR2_X86_CPU_HAS_SSSE3
),y
)
318 MPLAYER_CONF_OPTS
+= --enable-ssse3
320 MPLAYER_CONF_OPTS
+= --disable-ssse3
323 ifeq ($(BR2_X86_CPU_HAS_SSE4
),y
)
324 MPLAYER_CONF_OPTS
+= --enable-sse4
326 MPLAYER_CONF_OPTS
+= --disable-sse4
329 ifeq ($(BR2_X86_CPU_HAS_SSE42
),y
)
330 MPLAYER_CONF_OPTS
+= --enable-sse42
332 MPLAYER_CONF_OPTS
+= --disable-sse42
335 ifeq ($(BR2_X86_CPU_HAS_AVX
),y
)
336 MPLAYER_CONF_OPTS
+= --enable-avx
338 MPLAYER_CONF_OPTS
+= --disable-avx
341 ifeq ($(BR2_X86_CPU_HAS_AVX2
),y
)
342 MPLAYER_CONF_OPTS
+= --enable-avx2
344 MPLAYER_CONF_OPTS
+= --disable-avx2
347 define MPLAYER_CONFIGURE_CMDS
348 (cd
$(@D
); rm -rf config.cache
; \
349 $(TARGET_CONFIGURE_OPTS
) \
350 $(TARGET_CONFIGURE_ARGS
) \
354 --target
=$(GNU_TARGET_NAME
) \
355 --host-cc
="$(HOSTCC)" \
356 --cc="$(TARGET_CC)" \
357 --as="$(TARGET_AS)" \
359 --extra-cflags
="$(MPLAYER_CFLAGS)" \
360 --extra-ldflags
="$(MPLAYER_LDFLAGS)" \
362 $(MPLAYER_CONF_OPTS
) \
363 --enable-cross-compile \
365 --enable-dynamic-plugins \
370 define MPLAYER_BUILD_CMDS
371 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
)
374 define MPLAYER_INSTALL_TARGET_CMDS
375 $(TARGET_MAKE_ENV
) $(MAKE
) DESTDIR
=$(TARGET_DIR
) -C
$(@D
) install
378 $(eval
$(generic-package
))