package/aubio: add libsndfile optional dependency
[buildroot-gz.git] / package / vlc / vlc.mk
blobcf0b557bb1de637980e7fd0f88257b86ba0a2e98
1 ################################################################################
3 # vlc
5 ################################################################################
7 VLC_VERSION = 2.2.4
8 VLC_SITE = http://get.videolan.org/vlc/$(VLC_VERSION)
9 VLC_SOURCE = vlc-$(VLC_VERSION).tar.xz
10 VLC_LICENSE = GPLv2+ LGPLv2.1+
11 VLC_LICENSE_FILES = COPYING COPYING.LIB
12 VLC_DEPENDENCIES = host-pkgconf
13 VLC_AUTORECONF = YES
15 # Install vlc libraries in staging.
16 VLC_INSTALL_STAGING = YES
18 # VLC defines two autoconf functions which are also defined by our own pkg.m4
19 # from pkgconf. Unfortunately, they are defined in a different way: VLC adds
20 # --enable- options, but pkg.m4 adds --with- options. To make sure we use
21 # VLC's definition, rename these two functions.
22 define VLC_OVERRIDE_PKG_M4
23 $(SED) 's/PKG_WITH_MODULES/VLC_PKG_WITH_MODULES/g' \
24 -e 's/PKG_HAVE_WITH_MODULES/VLC_PKG_HAVE_WITH_MODULES/g' \
25 $(@D)/configure.ac $(@D)/m4/with_pkg.m4
26 endef
27 VLC_POST_PATCH_HOOKS += VLC_OVERRIDE_PKG_M4
29 VLC_CONF_OPTS += \
30 --disable-gles1 \
31 --disable-a52 \
32 --disable-shout \
33 --disable-twolame \
34 --disable-dca \
35 --disable-schroedinger \
36 --disable-fluidsynth \
37 --disable-zvbi \
38 --disable-kate \
39 --disable-caca \
40 --disable-jack \
41 --disable-samplerate \
42 --disable-chromaprint \
43 --disable-goom \
44 --disable-projectm \
45 --disable-vsxu \
46 --disable-mtp \
47 --disable-mmal-codec \
48 --disable-mmal-vout \
49 --disable-dvdnav \
50 --disable-vpx \
51 --disable-jpeg \
52 --disable-x262 \
53 --disable-x265 \
54 --disable-mfx \
55 --disable-vdpau \
56 --disable-addonmanagermodules \
57 --enable-run-as-root \
59 # Uses __atomic_fetch_add_4
60 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
61 VLC_CONF_ENV += LIBS="-latomic"
62 endif
64 # Building static and shared doesn't work, so force static off.
65 ifeq ($(BR2_STATIC_LIBS),)
66 VLC_CONF_OPTS += --disable-static
67 endif
69 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
70 VLC_CONF_OPTS += --enable-altivec
71 else
72 VLC_CONF_OPTS += --disable-altivec
73 endif
75 ifeq ($(BR2_X86_CPU_HAS_SSE),y)
76 VLC_CONF_OPTS += --enable-sse
77 else
78 VLC_CONF_OPTS += --disable-sse
79 endif
81 ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
82 VLC_CONF_OPTS += --enable-alsa
83 VLC_DEPENDENCIES += alsa-lib
84 else
85 VLC_CONF_OPTS += --disable-alsa
86 endif
88 # bonjour support needs avahi-client, which needs avahi-daemon and dbus
89 ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_DBUS),yyy)
90 VLC_CONF_OPTS += --enable-bonjour
91 VLC_DEPENDENCIES += avahi dbus
92 else
93 VLC_CONF_OPTS += --disable-bonjour
94 endif
96 ifeq ($(BR2_PACKAGE_DBUS),y)
97 VLC_CONF_OPTS += --enable-dbus
98 VLC_DEPENDENCIES += dbus
99 else
100 VLC_CONF_OPTS += --disable-dbus
101 endif
103 ifeq ($(BR2_PACKAGE_DIRECTFB),y)
104 VLC_CONF_OPTS += --enable-directfb
105 VLC_CONF_ENV += ac_cv_path_DIRECTFB_CONFIG=$(STAGING_DIR)/usr/bin/directfb-config
106 VLC_DEPENDENCIES += directfb
107 else
108 VLC_CONF_OPTS += --disable-directfb
109 endif
111 ifeq ($(BR2_PACKAGE_FAAD2),y)
112 VLC_CONF_OPTS += --enable-faad
113 VLC_DEPENDENCIES += faad2
114 else
115 VLC_CONF_OPTS += --disable-faad
116 endif
118 ifeq ($(BR2_PACKAGE_FFMPEG),y)
119 VLC_CONF_OPTS += --enable-avcodec
120 VLC_DEPENDENCIES += ffmpeg
121 else
122 VLC_CONF_OPTS += --disable-avcodec
123 endif
125 ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
126 VLC_CONF_OPTS += --enable-postproc
127 else
128 VLC_CONF_OPTS += --disable-postproc
129 endif
131 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
132 VLC_CONF_OPTS += --enable-swscale
133 else
134 VLC_CONF_OPTS += --disable-swscale
135 endif
137 ifeq ($(BR2_PACKAGE_FLAC),y)
138 VLC_CONF_OPTS += --enable-flac
139 VLC_DEPENDENCIES += flac
140 else
141 VLC_CONF_OPTS += --disable-flac
142 endif
144 ifeq ($(BR2_PACKAGE_FREERDP),y)
145 VLC_DEPENDENCIES += freerdp
146 endif
148 ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
149 VLC_DEPENDENCIES += libgl
150 endif
152 ifeq ($(BR2_PACKAGE_HAS_LIBGLES),y)
153 VLC_CONF_OPTS += --enable-gles2
154 VLC_DEPENDENCIES += libgles
155 else
156 VLC_CONF_OPTS += --disable-gles2
157 endif
159 ifeq ($(BR2_PACKAGE_OPENCV)$(BR2_PACKAGE_OPENCV3),y)
160 VLC_CONF_OPTS += --enable-opencv
161 ifeq ($(BR2_PACKAGE_OPENCV),y)
162 VLC_DEPENDENCIES += opencv
163 else
164 VLC_DEPENDENCIES += opencv3
165 endif
166 else
167 VLC_CONF_OPTS += --disable-opencv
168 endif
170 ifeq ($(BR2_PACKAGE_OPUS),y)
171 VLC_CONF_OPTS += --enable-opus
172 VLC_DEPENDENCIES += libvorbis opus
173 else
174 VLC_CONF_OPTS += --disable-opus
175 endif
177 ifeq ($(BR2_PACKAGE_LIBASS),y)
178 VLC_CONF_OPTS += --enable-libass
179 VLC_DEPENDENCIES += libass
180 else
181 VLC_CONF_OPTS += --disable-libass
182 endif
184 ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
185 VLC_CONF_OPTS += --enable-bluray
186 VLC_DEPENDENCIES += libbluray
187 else
188 VLC_CONF_OPTS += --disable-bluray
189 endif
191 ifeq ($(BR2_PACKAGE_LIBCDDB),y)
192 VLC_CONF_OPTS += --enable-libcddb
193 VLC_DEPENDENCIES += libcddb
194 else
195 VLC_CONF_OPTS += --disable-libcddb
196 endif
198 ifeq ($(BR2_PACKAGE_LIBDVBPSI),y)
199 VLC_CONF_OPTS += --enable-dvbpsi
200 VLC_DEPENDENCIES += libdvbpsi
201 else
202 VLC_CONF_OPTS += --disable-dvbpsi
203 endif
205 ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
206 VLC_CONF_OPTS += --enable-libgcrypt
207 VLC_DEPENDENCIES += libgcrypt
208 VLC_CONF_ENV += \
209 GCRYPT_CONFIG="$(STAGING_DIR)/usr/bin/libgcrypt-config"
210 else
211 VLC_CONF_OPTS += --disable-libgcrypt
212 endif
214 ifeq ($(BR2_PACKAGE_LIBMAD),y)
215 VLC_CONF_OPTS += --enable-mad
216 VLC_DEPENDENCIES += libmad
217 else
218 VLC_CONF_OPTS += --disable-mad
219 endif
221 ifeq ($(BR2_PACKAGE_LIBMATROSKA),y)
222 VLC_CONF_OPTS += --enable-mkv
223 VLC_DEPENDENCIES += libmatroska
224 else
225 VLC_CONF_OPTS += --disable-mkv
226 endif
228 ifeq ($(BR2_PACKAGE_LIBMODPLUG),y)
229 VLC_CONF_OPTS += --enable-mod
230 VLC_DEPENDENCIES += libmodplug
231 else
232 VLC_CONF_OPTS += --disable-mod
233 endif
235 ifeq ($(BR2_PACKAGE_LIBMPEG2),y)
236 VLC_CONF_OPTS += --enable-libmpeg2
237 VLC_DEPENDENCIES += libmpeg2
238 else
239 VLC_CONF_OPTS += --disable-libmpeg2
240 endif
242 ifeq ($(BR2_PACKAGE_LIBPNG),y)
243 VLC_CONF_OPTS += --enable-png
244 VLC_DEPENDENCIES += libpng
245 else
246 VLC_CONF_OPTS += --disable-png
247 endif
249 ifeq ($(BR2_PACKAGE_LIBRSVG),y)
250 VLC_CONF_OPTS += --enable-svg --enable-svgdec
251 VLC_DEPENDENCIES += librsvg
252 else
253 VLC_CONF_OPTS += --disable-svg --disable-svgdec
254 endif
256 ifeq ($(BR2_PACKAGE_LIBSSH2),y)
257 VLC_CONF_OPTS += --enable-sftp
258 VLC_DEPENDENCIES += libssh2
259 else
260 VLC_CONF_OPTS += --disable-sftp
261 endif
263 ifeq ($(BR2_PACKAGE_LIBSIDPLAY2),y)
264 VLC_CONF_OPTS += --enable-sid
265 VLC_DEPENDENCIES += libsidplay2
266 else
267 VLC_CONF_OPTS += --disable-sid
268 endif
270 ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
271 VLC_CONF_OPTS += --enable-theora
272 VLC_DEPENDENCIES += libtheora
273 else
274 VLC_CONF_OPTS += --disable-theora
275 endif
277 ifeq ($(BR2_PACKAGE_LIBUPNP),y)
278 VLC_CONF_OPTS += --enable-upnp
279 VLC_DEPENDENCIES += libupnp
280 else
281 VLC_CONF_OPTS += --disable-upnp
282 endif
284 ifeq ($(BR2_PACKAGE_LIBVNCSERVER),y)
285 VLC_CONF_OPTS += --enable-vnc
286 VLC_DEPENDENCIES += libvncserver
287 else
288 VLC_CONF_OPTS += --disable-vnc
289 endif
291 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
292 VLC_CONF_OPTS += --enable-vorbis
293 VLC_DEPENDENCIES += libvorbis
294 else
295 VLC_CONF_OPTS += --disable-vorbis
296 endif
298 ifeq ($(BR2_PACKAGE_LIBV4L),y)
299 VLC_CONF_OPTS += --enable-v4l2
300 VLC_DEPENDENCIES += libv4l
301 else
302 VLC_CONF_OPTS += --disable-v4l2
303 endif
305 ifeq ($(BR2_PACKAGE_LIBXCB),y)
306 VLC_CONF_OPTS += --enable-xcb
307 VLC_DEPENDENCIES += libxcb
308 else
309 VLC_CONF_OPTS += --disable-xcb
310 endif
312 ifeq ($(BR2_PACKAGE_LIBXML2),y)
313 VLC_CONF_OPTS += --enable-libxml2
314 VLC_DEPENDENCIES += libxml2
315 else
316 VLC_CONF_OPTS += --disable-libxml2
317 endif
319 ifeq ($(BR2_PACKAGE_LIVE555),y)
320 VLC_CONF_OPTS += --enable-live555
321 VLC_DEPENDENCIES += live555
322 VLC_CONF_ENV += \
323 LIVE555_CFLAGS="\
324 -I$(STAGING_DIR)/usr/include/BasicUsageEnvironment \
325 -I$(STAGING_DIR)/usr/include/groupsock \
326 -I$(STAGING_DIR)/usr/include/liveMedia \
327 -I$(STAGING_DIR)/usr/include/UsageEnvironment \
329 LIVE555_LIBS="-L$(STAGING_DIR)/usr/lib -lliveMedia"
330 else
331 VLC_CONF_OPTS += --disable-live555
332 endif
334 ifeq ($(BR2_PACKAGE_LUA),y)
335 VLC_CONF_OPTS += --enable-lua
336 VLC_DEPENDENCIES += lua host-lua
337 else
338 VLC_CONF_OPTS += --disable-lua
339 endif
341 ifeq ($(BR2_PACKAGE_MINIZIP),y)
342 VLC_DEPENDENCIES += minizip
343 endif
345 ifeq ($(BR2_PACKAGE_MUSEPACK),y)
346 VLC_CONF_OPTS += --enable-mpc
347 VLC_DEPENDENCIES += musepack
348 else
349 VLC_CONF_OPTS += --disable-mpc
350 endif
352 ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
353 VLC_CONF_OPTS += --enable-qt
354 VLC_CONF_ENV += \
355 ac_cv_path_MOC=$(HOST_DIR)/usr/bin/moc \
356 ac_cv_path_RCC=$(HOST_DIR)/usr/bin/rcc \
357 ac_cv_path_UIC=$(HOST_DIR)/usr/bin/uic
358 VLC_DEPENDENCIES += qt
359 else
360 VLC_CONF_OPTS += --disable-qt
361 endif
363 ifeq ($(BR2_PACKAGE_SDL_X11),y)
364 VLC_CONF_OPTS += --enable-sdl
365 VLC_DEPENDENCIES += sdl
366 else
367 VLC_CONF_OPTS += --disable-sdl
368 endif
370 ifeq ($(BR2_PACKAGE_SDL_IMAGE),y)
371 VLC_CONF_OPTS += --enable-sdl-image
372 VLC_DEPENDENCIES += sdl_image
373 else
374 VLC_CONF_OPTS += --disable-sdl-image
375 endif
377 ifeq ($(BR2_PACKAGE_SPEEX),y)
378 VLC_CONF_OPTS += --enable-speex
379 VLC_DEPENDENCIES += speex
380 else
381 VLC_CONF_OPTS += --disable-speex
382 endif
384 ifeq ($(BR2_PACKAGE_TAGLIB),y)
385 VLC_CONF_OPTS += --enable-taglib
386 VLC_DEPENDENCIES += taglib
387 else
388 VLC_CONF_OPTS += --disable-taglib
389 endif
391 ifeq ($(BR2_PACKAGE_TREMOR),y)
392 VLC_CONF_OPTS += --enable-tremor
393 VLC_DEPENDENCIES += tremor
394 else
395 VLC_CONF_OPTS += --disable-tremor
396 endif
398 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
399 VLC_CONF_OPTS += --enable-udev
400 VLC_DEPENDENCIES += udev
401 else
402 VLC_CONF_OPTS += --disable-udev
403 endif
405 ifeq ($(BR2_PACKAGE_XCB_UTIL_KEYSYMS),y)
406 VLC_CONF_OPTS += --enable-xcb
407 VLC_DEPENDENCIES += xcb-util-keysyms
408 else
409 VLC_CONF_OPTS += --disable-xcb
410 endif
412 ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
413 VLC_CONF_OPTS += --with-x
414 VLC_DEPENDENCIES += xlib_libX11
415 else
416 VLC_CONF_OPTS += --without-x
417 endif
419 ifeq ($(BR2_PACKAGE_ZLIB),y)
420 VLC_DEPENDENCIES += zlib
421 endif
423 $(eval $(autotools-package))