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-pulse, to let the
228 # autodetection find which library to link with.
229 ifeq ($(BR2_PACKAGE_PULSEAUDIO
),y
)
230 MPLAYER_DEPENDENCIES
+= pulseaudio
233 # We intentionally don't pass --enable-librtmp to let autodetection
234 # find which library to link with.
235 ifeq ($(BR2_PACKAGE_RTMPDUMP
),y
)
236 MPLAYER_DEPENDENCIES
+= rtmpdump
238 MPLAYER_CONF_OPTS
+= --disable-librtmp
241 ifeq ($(BR2_PACKAGE_SPEEX
),y
)
242 MPLAYER_DEPENDENCIES
+= speex
243 MPLAYER_CONF_OPTS
+= --enable-speex
245 MPLAYER_CONF_OPTS
+= --disable-speex
248 ifeq ($(BR2_PACKAGE_LZO
),y
)
249 MPLAYER_DEPENDENCIES
+= lzo
250 MPLAYER_CONF_OPTS
+= --enable-liblzo
252 MPLAYER_CONF_OPTS
+= --disable-liblzo
255 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_BZIP2
),bzip2
)
256 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_HAS_LIBGL
),libgl
)
257 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBTHEORA
),libtheora
)
258 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBPNG
),libpng
)
259 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LIBVPX
),libvpx
)
260 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_JPEG
),jpeg
)
261 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_OPUS
),opus
)
262 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBX11
),xlib_libX11
)
263 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXEXT
),xlib_libXext
)
264 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXINERAMA
),xlib_libXinerama
)
265 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXV
),xlib_libXv
)
266 MPLAYER_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_XLIB_LIBXXF86VM
),xlib_libXxf86vm
)
269 ifeq ($(BR2_ARM_CPU_ARMV5
),y
)
270 MPLAYER_CONF_OPTS
+= --enable-armv5te
273 ifeq ($(BR2_ARM_CPU_ARMV6
)$(BR2_ARM_CPU_ARMV7A
),y
)
274 MPLAYER_CONF_OPTS
+= --enable-armv6
277 ifeq ($(BR2_aarch64
),y
)
278 MPLAYER_CONF_OPTS
+= --enable-armv8
281 ifeq ($(BR2_ARM_SOFT_FLOAT
),)
282 ifeq ($(BR2_ARM_CPU_HAS_NEON
),y
)
283 MPLAYER_CONF_OPTS
+= --enable-neon
284 MPLAYER_CFLAGS
+= -mfpu
=neon
289 # inline asm breaks with "can't find a register in class 'GENERAL_REGS'"
290 # inless we free up ebp
291 MPLAYER_CFLAGS
+= -fomit-frame-pointer
294 ifeq ($(BR2_X86_CPU_HAS_MMX
),y
)
295 MPLAYER_CONF_OPTS
+= \
297 --yasm
=$(HOST_DIR
)/usr
/bin
/yasm
298 MPLAYER_DEPENDENCIES
+= host-yasm
300 MPLAYER_CONF_OPTS
+= \
305 ifeq ($(BR2_X86_CPU_HAS_SSE
),y
)
306 MPLAYER_CONF_OPTS
+= --enable-sse
308 MPLAYER_CONF_OPTS
+= --disable-sse
311 ifeq ($(BR2_X86_CPU_HAS_SSE2
),y
)
312 MPLAYER_CONF_OPTS
+= --enable-sse2
314 MPLAYER_CONF_OPTS
+= --disable-sse2
317 ifeq ($(BR2_X86_CPU_HAS_SSE3
),y
)
318 MPLAYER_CONF_OPTS
+= --enable-sse3
320 MPLAYER_CONF_OPTS
+= --disable-sse3
323 ifeq ($(BR2_X86_CPU_HAS_SSSE3
),y
)
324 MPLAYER_CONF_OPTS
+= --enable-ssse3
326 MPLAYER_CONF_OPTS
+= --disable-ssse3
329 ifeq ($(BR2_X86_CPU_HAS_SSE4
),y
)
330 MPLAYER_CONF_OPTS
+= --enable-sse4
332 MPLAYER_CONF_OPTS
+= --disable-sse4
335 ifeq ($(BR2_X86_CPU_HAS_SSE42
),y
)
336 MPLAYER_CONF_OPTS
+= --enable-sse42
338 MPLAYER_CONF_OPTS
+= --disable-sse42
341 ifeq ($(BR2_X86_CPU_HAS_AVX
),y
)
342 MPLAYER_CONF_OPTS
+= --enable-avx
344 MPLAYER_CONF_OPTS
+= --disable-avx
347 ifeq ($(BR2_X86_CPU_HAS_AVX2
),y
)
348 MPLAYER_CONF_OPTS
+= --enable-avx2
350 MPLAYER_CONF_OPTS
+= --disable-avx2
353 define MPLAYER_CONFIGURE_CMDS
354 (cd
$(@D
); rm -rf config.cache
; \
355 $(TARGET_CONFIGURE_OPTS
) \
356 $(TARGET_CONFIGURE_ARGS
) \
360 --target
=$(GNU_TARGET_NAME
) \
361 --host-cc
="$(HOSTCC)" \
362 --cc="$(TARGET_CC)" \
363 --as="$(TARGET_AS)" \
365 --extra-cflags
="$(MPLAYER_CFLAGS)" \
366 --extra-ldflags
="$(MPLAYER_LDFLAGS)" \
368 $(MPLAYER_CONF_OPTS
) \
369 --enable-cross-compile \
371 --enable-dynamic-plugins \
376 define MPLAYER_BUILD_CMDS
377 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
)
380 define MPLAYER_INSTALL_TARGET_CMDS
381 $(TARGET_MAKE_ENV
) $(MAKE
) DESTDIR
=$(TARGET_DIR
) -C
$(@D
) install
384 $(eval
$(generic-package
))