summaryrefslogtreecommitdiffstats
path: root/rules/ffmpeg.make
blob: 4ec726209bd4ba5e1b47bf3d91a2a08129b07f0e (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# -*-makefile-*-
#
# Copyright (C) 2006 by Erwin Rol
#           (C) 2010 by Michael Olbrich <m.olbrich@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#
#
#
# We provide this package
#
PACKAGES-$(PTXCONF_FFMPEG) += ffmpeg

#
# Paths and names
#
FFMPEG_VERSION	:= r12314
FFMPEG_MD5	:=
FFMPEG		:= ffmpeg-$(FFMPEG_VERSION)
FFMPEG_SUFFIX	:= tar.bz2
FFMPEG_URL	:= http://www.pengutronix.de/software/ptxdist/temporary-src/$(FFMPEG).$(FFMPEG_SUFFIX)
FFMPEG_SOURCE	:= $(SRCDIR)/$(FFMPEG).$(FFMPEG_SUFFIX)
FFMPEG_DIR	:= $(BUILDDIR)/$(FFMPEG)


# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

FFMPEG_PATH	:= PATH=$(CROSS_PATH)
FFMPEG_ENV 	:= $(CROSS_ENV)

#
# autoconf
# Carefull, ffmpeg has a home grown configure, and not all autoconf options work!!! :-/
# for example it enables things by default and than only has a --disable-BLA option and no
# --enable-BLA option.
#
FFMPEG_AUTOCONF := --prefix=/usr
FFMPEG_AUTOCONF += --cross-prefix=$(COMPILER_PREFIX)
#FFMPEG_AUTOCONF += --cc=$(CROSS_CC)
#FFMPEG_AUTOCONF += --make=$(MAKE)
FFMPEG_AUTOCONF += --source-path=$(FFMPEG_DIR)
#FFMPEG_AUTOCONF += --build-suffix=SUFFIX
FFMPEG_AUTOCONF += --extra-cflags="$(CROSS_CPPFLAGS) $(CROSS_CFLAGS) -L$(SYSROOT)/usr/lib"
FFMPEG_AUTOCONF += --extra-ldflags="$(CROSS_LDFLAGS) -L$(SYSROOT)/usr/lib"
FFMPEG_AUTOCONF += --extra-libs="$(CROSS_LIBS) -lm"
#FFMPEG_AUTOCONF += --enable-mingw32
#FFMPEG_AUTOCONF += --enable-mingwce
#FFMPEG_AUTOCONF += --enable-sunmlib
#FFMPEG_AUTOCONF += --disable-audio-beos

ifdef PTXCONF_ARCH_X86
 FFMPEG_AUTOCONF += --disable-altivec
 FFMPEG_AUTOCONF += --disable-iwmmxt
 ifdef PTXCONF_ARCH_X86_I386
  FFMPEG_AUTOCONF += \
	--arch=x86_32 \
	--cpu=i386 \
	--tune=i386 \
	--disable-mmx
 endif
 ifdef PTXCONF_ARCH_X86_I486
  FFMPEG_AUTOCONF += \
	--arch=x86_32 \
	--cpu=i486 \
	--tune=i486 \
	--disable-mmx
 endif
 ifdef PTXCONF_ARCH_X86_I586
  FFMPEG_AUTOCONF += \
	--arch=x86_32 \
	--cpu=i386 \
	--cpu=i586 \
	--tune=i586
 endif
 ifdef PTXCONF_ARCH_X86_I686
  FFMPEG_AUTOCONF += \
	--arch=x86_32 \
	--cpu=i386 \
	--cpu=i686 \
	--tune=i686
 endif
 ifdef PTXCONF_ARCH_X86_P2
  FFMPEG_AUTOCONF += \
	--arch=x86_32 \
	--cpu=i386 \
	--cpu=i686 \
	--tune=pentium2
 endif
 ifdef PTXCONF_ARCH_X86_P3M
  FFMPEG_AUTOCONF += \
	--arch=x86_32 \
	--cpu=i386 \
	--cpu=i686 \
	--tune=pentium3
 endif
endif

ifdef PTXCONF_ARCH_ALPHA
FFMPEG_AUTOCONF += \
	--arch=alpha \
        --cpu=alpha \
        --disable-altivec \
        --disable-mmx \
        --disable-iwmmxt
endif

ifdef PTXCONF_ARCH_ARM
 ifdef PTXCONF_ARCH_ARM_IWMMXT
   FFMPEG_AUTOCONF += \
	--arch=arm \
	--cpu=iwmmxt \
	--disable-altivec \
	--disable-mmx
 else
# v5 fallback. Will not run on v4.
   FFMPEG_AUTOCONF += \
	--arch=arm \
	--cpu=arm926ej-s \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
 endif
endif

ifdef PTXCONF_ARCH_PPC
FFMPEG_AUTOCONF += \
	--cpu=powerpc \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
# FFMPEG_AUTOCONF += --powerpc-perf-enable
endif

ifdef PTXCONF_ARCH_M68K
FFMPEG_AUTOCONF += \
	--cpu=m68k \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
endif

ifdef PTXCONF_ARCH_SPARC
FFMPEG_AUTOCONF += \
	--cpu=sparc \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
endif

ifdef PTXCONF_ARCH_MIPS
FFMPEG_AUTOCONF += \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
endif

ifdef PTXCONF_ARCH_CRIS
FFMPEG_AUTOCONF += \
	--cpu=cris \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
endif

ifdef PTXCONF_ARCH_PARISC
FFMPEG_AUTOCONF += \
	--cpu=parisc \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
endif

ifdef PTXCONF_ARCH_SH
FFMPEG_AUTOCONF += \
	--cpu=sh4 \
	--disable-altivec \
	--disable-mmx \
	--disable-iwmmxt
endif

ifdef PTXCONF_FFMPEG_SHARED
FFMPEG_AUTOCONF += --enable-shared
else
FFMPEG_AUTOCONF += --disable-shared
endif

ifdef PTXCONF_FFMPEG_STATIC
FFMPEG_AUTOCONF += --enable-static
else
FFMPEG_AUTOCONF += --disable-static
endif

ifdef PTXCONF_FFMPEG_PTHREADS
FFMPEG_AUTOCONF += --enable-pthreads
endif

ifndef PTXCONF_FFMPEG_FFSERVER
FFMPEG_AUTOCONF += --disable-ffserver
endif

ifndef PTXCONF_FFMPEG_FFPLAY
FFMPEG_AUTOCONF += --disable-ffplay
endif

ifdef PTXCONF_FFMPEG_SMALL
FFMPEG_AUTOCONF += --enable-small
endif

ifdef PTXCONF_FFMPEG_MEMALIGN_HACK
FFMPEG_AUTOCONF += --enable-memalign-hack
endif

ifndef PTXCONF_FFMPEG_STRIP
FFMPEG_AUTOCONF += --disable-strip
endif

ifdef PTXCONF_FFMPEG_GPROF
FFMPEG_AUTOCONF += --enable-gprof
endif

ifndef PTXCONF_FFMPEG_DEBUG
FFMPEG_AUTOCONF += --disable-debug
endif

ifndef PTXCONF_FFMPEG_OPTS
FFMPEG_AUTOCONF += --disable-opts
endif

ifdef PTXCONF_FFMPEG_GPL
FFMPEG_AUTOCONF += --enable-gpl
endif

ifdef PTXCONF_FFMPEG_MP3LAME
FFMPEG_AUTOCONF += --enable-mp3lame
endif

ifdef PTXCONF_FFMPEG_LIBOGG
FFMPEG_AUTOCONF += --enable-libogg
endif

ifdef PTXCONF_FFMPEG_VORBIS
FFMPEG_AUTOCONF += --enable-vorbis
endif

ifdef PTXCONF_FFMPEG_THEORA
FFMPEG_AUTOCONF += --enable-theora
endif

ifdef PTXCONF_FFMPEG_FAAD
FFMPEG_AUTOCONF += --enable-faad
endif

ifdef PTXCONF_FFMPEG_FAADBIN
FFMPEG_AUTOCONF += --enable-faadbin
endif

ifdef PTXCONF_FFMPEG_FAAC
FFMPEG_AUTOCONF += --enable-faac
endif

ifdef PTXCONF_FFMPEG_LIBGSM
FFMPEG_AUTOCONF += --enable-libgsm
endif

ifdef PTXCONF_FFMPEG_XVID
FFMPEG_AUTOCONF += --enable-xvid
endif

ifdef PTXCONF_FFMPEG_X264
FFMPEG_AUTOCONF += --enable-x264
endif

ifdef PTXCONF_FFMPEG_A52
FFMPEG_AUTOCONF += --enable-a52
endif

ifdef PTXCONF_FFMPEG_A52BIN
FFMPEG_AUTOCONF += --enable-a52bin
endif

ifdef PTXCONF_FFMPEG_DTS
FFMPEG_AUTOCONF += --enable-dts
endif

ifdef PTXCONF_FFMPEG_PP
FFMPEG_AUTOCONF += --enable-pp
endif

ifdef PTXCONF_FFMPEG_AMR_NB
FFMPEG_AUTOCONF += --enable-amr_nb
endif

ifdef PTXCONF_FFMPEG_AMR_NB_FIXED
FFMPEG_AUTOCONF += --enable-amr_nb-fixed
endif

ifdef PTXCONF_FFMPEG_AMR_WB
FFMPEG_AUTOCONF += --enable-amr_wb
endif

ifdef PTXCONF_FFMPEG_AMR_IF2
FFMPEG_AUTOCONF += --enable-amr_if2
endif

ifdef PTXCONF_FFMPEG_DC1394
FFMPEG_AUTOCONF += --enable-dc1394
endif

ifndef PTXCONF_FFMPEG_AUDIO_OSS
FFMPEG_AUTOCONF += --disable-audio-oss
endif

ifndef PTXCONF_FFMPEG_V4L
FFMPEG_AUTOCONF += --disable-v4l
endif

ifndef PTXCONF_FFMPEG_V4L2
FFMPEG_AUTOCONF += --disable-v4l2
endif

ifndef PTXCONF_FFMPEG_BKTR
FFMPEG_AUTOCONF += --disable-bktr
endif

ifndef PTXCONF_FFMPEG_DV1394
FFMPEG_AUTOCONF += --disable-dv1394
endif

ifndef PTXCONF_FFMPEG_NETWORK
FFMPEG_AUTOCONF += --disable-network
endif

ifndef PTXCONF_FFMPEG_ZLIB
FFMPEG_AUTOCONF += --disable-zlib
endif

ifndef PTXCONF_FFMPEG_SIMPLE_IDCT
FFMPEG_AUTOCONF += --disable-simple_idct
endif

ifndef PTXCONF_FFMPEG_VHOOK
FFMPEG_AUTOCONF += --disable-vhook
endif

ifndef PTXCONF_FFMPEG_MPEGAUDIO_HP
FFMPEG_AUTOCONF += --disable-mpegaudio-hp
endif

ifndef PTXCONF_FFMPEG_PROTOCOL
FFMPEG_AUTOCONF += --disable-protocols
endif

# FIXME selectivly enable/disable decoders to reduce library size

#--disable-encoder=NAME   disables encoder NAME
#--enable-encoder=NAME    enables encoder NAME
#--disable-decoder=NAME   disables decoder NAME
#--enable-decoder=NAME    enables decoder NAME
#--disable-encoders       disables all encoders
#--disable-decoders       disables all decoders
#--disable-muxers         disables all muxers
#--disable-demuxers       disables all demuxers

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/ffmpeg.targetinstall:
	@$(call targetinfo)

	@$(call install_init, ffmpeg)
	@$(call install_fixup, ffmpeg,PRIORITY,optional)
	@$(call install_fixup, ffmpeg,SECTION,base)
	@$(call install_fixup, ffmpeg,AUTHOR,"Erwin Rol <ero@pengutronix.de>")
	@$(call install_fixup, ffmpeg,DESCRIPTION,missing)

	@$(call install_copy, ffmpeg, 0, 0, 0644, -, \
		/usr/lib/libavcodec.so, n)
	@$(call install_link, ffmpeg, \
		libavcodec.so, \
		/usr/lib/libavcodec.so.51)
	@$(call install_link, ffmpeg, \
		libavcodec.so, \
		/usr/lib/libavcodec.so.51.7.0)

	@$(call install_copy, ffmpeg, 0, 0, 0644, -, \
		/usr/lib/libavformat.so, n)
	@$(call install_link, ffmpeg, \
		libavformat.so, \
		/usr/lib/libavformat.so.50)
	@$(call install_link, ffmpeg, \
		libavformat.so, \
		/usr/lib/libavformat.so.50.3.0)

	@$(call install_copy, ffmpeg, 0, 0, 0644, -, \
		/usr/lib/libavutil.so, n)
	@$(call install_link, ffmpeg, \
		libavutil.so, \
		/usr/lib/libavutil.so.49)
	@$(call install_link, ffmpeg, \
		libavcodec.so, \
		/usr/lib/libavutil.so.49.0.0)

ifdef PTXCONF_FFMPEG_PP
	@$(call install_copy, ffmpeg, 0, 0, 0644, -, \
		/usr/lib/libpostproc.so, n)
	@$(call install_link, ffmpeg, \
		libpostproc.so, \
		/usr/lib/libpostproc.so.51)
	@$(call install_link, ffmpeg, \
		libpostproc.so, \
		/usr/lib/libpostproc.so.51.0.0)
endif

	@$(call install_finish, ffmpeg)

	@$(call touch)

# vim: syntax=make