The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / mplayer / mplayer.mk
1 ################################################################################
2 #
3 # mplayer
4 #
5 ################################################################################
6
7 MPLAYER_VERSION = 1.1.1
8 MPLAYER_SOURCE = MPlayer-$(MPLAYER_VERSION).tar.xz
9 MPLAYER_SITE = http://www.mplayerhq.hu/MPlayer/releases
10
11 MPLAYER_CFLAGS = $(TARGET_CFLAGS)
12 MPLAYER_LDFLAGS = $(TARGET_LDFLAGS)
13
14 MPLAYER_DEPENDENCIES += host-pkgconf
15
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
23
24 ifeq ($(BR2_ENDIAN),"BIG")
25 MPLAYER_CONF_OPTS += --enable-big-endian
26 else
27 MPLAYER_CONF_OPTS += --disable-big-endian
28 endif
29
30 ifeq ($(BR2_PACKAGE_SDL),y)
31 MPLAYER_CONF_OPTS += \
32         --enable-sdl \
33         --with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config
34 MPLAYER_DEPENDENCIES += sdl
35 else
36 MPLAYER_CONF_OPTS += --disable-sdl
37 endif
38
39 ifeq ($(BR2_PACKAGE_FREETYPE),y)
40 MPLAYER_CONF_OPTS +=  \
41         --enable-freetype \
42         --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config
43 MPLAYER_DEPENDENCIES += freetype
44 else
45 MPLAYER_CONF_OPTS += --disable-freetype
46 endif
47
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
52 else
53 MPLAYER_CONF_OPTS += --disable-fontconfig
54 endif
55
56 ifeq ($(BR2_PACKAGE_LIBENCA),y)
57 MPLAYER_CONF_OPTS += --enable-enca
58 MPLAYER_DEPENDENCIES += libenca
59 else
60 MPLAYER_CONF_OPTS += --disable-enca
61 endif
62
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
67 else
68 MPLAYER_CONF_OPTS += --disable-fribidi
69 endif
70
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
75 else
76 MPLAYER_CONF_OPTS += --disable-iconv
77 endif
78
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
84 else
85 MPLAYER_CONF_OPTS += --disable-termcap
86 endif
87
88 ifeq ($(BR2_PACKAGE_SAMBA_SMBCLIENT),y)
89 MPLAYER_CONF_OPTS += --enable-smb
90 MPLAYER_DEPENDENCIES += samba
91 else
92 MPLAYER_CONF_OPTS += --disable-smb
93 endif
94
95 ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
96 MPLAYER_CONF_OPTS += --enable-bluray
97 MPLAYER_DEPENDENCIES += libbluray
98 else
99 MPLAYER_CONF_OPTS += --disable-bluray
100 endif
101
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
106
107 ifeq ($(BR2_PACKAGE_LIBDVDREAD),y)
108 MPLAYER_CONF_OPTS +=  \
109         --enable-dvdread \
110         --disable-dvdread-internal \
111         --with-dvdread-config=$(STAGING_DIR)/usr/bin/dvdread-config
112 MPLAYER_DEPENDENCIES += libdvdread
113 endif
114
115 ifeq ($(BR2_PACKAGE_LIBDVDNAV),y)
116 MPLAYER_CONF_OPTS +=  \
117         --enable-dvdnav \
118         --with-dvdnav-config=$(STAGING_DIR)/usr/bin/dvdnav-config
119 MPLAYER_DEPENDENCIES += libdvdnav
120 endif
121
122 ifeq ($(BR2_PACKAGE_MPLAYER_MPLAYER),y)
123 MPLAYER_CONF_OPTS += --enable-mplayer
124 else
125 MPLAYER_CONF_OPTS += --disable-mplayer
126 endif
127
128 ifeq ($(BR2_PACKAGE_MPLAYER_MENCODER),y)
129 MPLAYER_CONF_OPTS += --enable-mencoder
130 else
131 MPLAYER_CONF_OPTS += --disable-mencoder
132 endif
133
134 ifeq ($(BR2_PACKAGE_FAAD2),y)
135 MPLAYER_DEPENDENCIES += faad2
136 MPLAYER_CONF_OPTS += --enable-faad
137 else
138 MPLAYER_CONF_OPTS += --disable-faad
139 endif
140
141 ifeq ($(BR2_PACKAGE_LAME),y)
142 MPLAYER_DEPENDENCIES += lame
143 MPLAYER_CONF_OPTS += --enable-mp3lame
144 else
145 MPLAYER_CONF_OPTS += --disable-mp3lame
146 endif
147
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
152 endif
153
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
159 endif
160
161 ifeq ($(BR2_PACKAGE_TREMOR),y)
162 MPLAYER_DEPENDENCIES += tremor
163 MPLAYER_CONF_OPTS += --disable-tremor-internal --enable-tremor
164 endif
165
166 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
167 MPLAYER_DEPENDENCIES += libvorbis
168 MPLAYER_CONF_OPTS += --enable-libvorbis
169 endif
170
171 ifeq ($(BR2_PACKAGE_LIBMAD),y)
172 MPLAYER_DEPENDENCIES += libmad
173 MPLAYER_CONF_OPTS += --enable-mad
174 else
175 MPLAYER_CONF_OPTS += --disable-mad
176 endif
177
178 ifeq ($(BR2_PACKAGE_LIVE555),y)
179 MPLAYER_DEPENDENCIES += live555
180 MPLAYER_CONF_OPTS += --enable-live
181 MPLAYER_LIVE555 = liveMedia groupsock UsageEnvironment BasicUsageEnvironment
182 MPLAYER_CFLAGS += \
183         $(addprefix -I$(STAGING_DIR)/usr/include/,$(MPLAYER_LIVE555))
184 MPLAYER_LDFLAGS += $(addprefix -l,$(MPLAYER_LIVE555)) -lstdc++
185 else
186 MPLAYER_CONF_OPTS += --disable-live
187 endif
188
189 ifeq ($(BR2_PACKAGE_GIFLIB),y)
190 MPLAYER_DEPENDENCIES += giflib
191 MPLAYER_CONF_OPTS += --enable-gif
192 else
193 MPLAYER_CONF_OPTS += --disable-gif
194 endif
195
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
200 else
201 MPLAYER_CONF_OPTS += --disable-librtmp
202 endif
203
204 ifeq ($(BR2_PACKAGE_SPEEX),y)
205 MPLAYER_DEPENDENCIES += speex
206 MPLAYER_CONF_OPTS += --enable-speex
207 else
208 MPLAYER_CONF_OPTS += --disable-speex
209 endif
210
211 ifeq ($(BR2_PACKAGE_LZO),y)
212 MPLAYER_DEPENDENCIES += lzo
213 MPLAYER_CONF_OPTS += --enable-liblzo
214 else
215 MPLAYER_CONF_OPTS += --disable-liblzo
216 endif
217
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)
224
225 # ARM optimizations
226 ifeq ($(BR2_ARM_CPU_ARMV5),y)
227 MPLAYER_CONF_OPTS += --enable-armv5te
228 endif
229
230 ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
231 MPLAYER_CONF_OPTS += --enable-armv6
232 endif
233
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
238 endif
239 endif
240
241 ifeq ($(BR2_i386),y)
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
245 endif
246
247 define MPLAYER_CONFIGURE_CMDS
248         (cd $(@D); rm -rf config.cache; \
249                 $(TARGET_CONFIGURE_OPTS) \
250                 $(TARGET_CONFIGURE_ARGS) \
251                 ./configure \
252                 --prefix=/usr \
253                 --confdir=/etc \
254                 --target=$(GNU_TARGET_NAME) \
255                 --host-cc="$(HOSTCC)" \
256                 --cc="$(TARGET_CC)" \
257                 --as="$(TARGET_AS)" \
258                 --charset=UTF-8 \
259                 --extra-cflags="$(MPLAYER_CFLAGS)" \
260                 --extra-ldflags="$(MPLAYER_LDFLAGS)" \
261                 --yasm='' \
262                 --enable-fbdev \
263                 $(MPLAYER_CONF_OPTS) \
264                 --enable-cross-compile \
265                 --disable-ivtv \
266                 --enable-dynamic-plugins \
267                 --enable-inet6 \
268         )
269 endef
270
271 define MPLAYER_BUILD_CMDS
272         $(MAKE) -C $(@D)
273 endef
274
275 define MPLAYER_INSTALL_TARGET_CMDS
276         $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
277 endef
278
279 $(eval $(generic-package))