summaryrefslogtreecommitdiffstats
path: root/package/multimedia/ffmpeg/ffmpeg.mk
blob: 1f9f47295ffc27eae8105719738a862254a62027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#############################################################
#
# ffmpeg
#
#############################################################
FFMPEG_VERSION := 0.5.2
FFMPEG_SOURCE := ffmpeg-$(FFMPEG_VERSION).tar.bz2
FFMPEG_SITE := http://ffmpeg.org/releases
FFMPEG_INSTALL_STAGING = YES
FFMPEG_INSTALL_TARGET = YES

FFMPEG_CONF_OPT = \
	--prefix=/usr		\
	--enable-shared 	\
	--disable-avfilter	\
	--disable-postproc	\
	--disable-swscale	\
	--disable-vhook		\

ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
FFMPEG_CONF_OPT += --enable-gpl
else
FFMPEG_CONF_OPT += --disable-gpl
endif

ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
FFMPEG_CONF_OPT += --enable-nonfree
else
FFMPEG_CONF_OPT += --disable-nonfree
endif

ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
FFMPEG_CONF_OPT += --enable-ffmpeg
else
FFMPEG_CONF_OPT += --disable-ffmpeg
endif

ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
FFMPEG_DEPENDENCIES += sdl
FFMPEG_CONF_OPT += --enable-ffplay
FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config
else
FFMPEG_CONF_OPT += --disable-ffplay
endif

ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
FFMPEG_CONF_OPT += --enable-ffserver
else
FFMPEG_CONF_OPT += --disable-ffserver
endif

ifeq ($(BR2_PTHREADS_NONE),y)
FFMPEG_CONF_OPT += --disable-pthreads
else
FFMPEG_CONF_OPT += --enable-pthreads
endif

ifeq ($(BR2_PACKAGE_ZLIB),y)
FFMPEG_CONF_OPT += --enable-zlib
FFMPEG_DEPENDENCIES += zlib
else
FFMPEG_CONF_OPT += --disable-zlib
endif

# Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
define FFMPEG_CONFIGURE_CMDS
	(cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
	$(TARGET_CONFIGURE_OPTS) \
	$(TARGET_CONFIGURE_ARGS) \
	$(TARGET_CONFIGURE_ENV) \
	$(FFMPEG_CONF_ENV) \
	./configure \
		--enable-cross-compile	\
		--cross-prefix=$(TARGET_CROSS) \
		--sysroot=$(STAGING_DIR) \
		--host-cc=$(HOSTCC) \
		--arch=$(BR2_ARCH) \
		--extra-cflags=-fPIC \
		$(DISABLE_IPV6) \
		$(FFMPEG_CONF_OPT) \
	)
endef

# Override FFMPEG_INSTALL_TARGET_OPT: FFmpeg does not support install-strip
FFMPEG_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install

$(eval $(call AUTOTARGETS,package/multimedia,ffmpeg))