ffmpeg.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. ################################################################################
  2. #
  3. # ffmpeg
  4. #
  5. ################################################################################
  6. FFMPEG_VERSION = 4.3.1
  7. FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
  8. FFMPEG_SITE = http://ffmpeg.org/releases
  9. FFMPEG_INSTALL_STAGING = YES
  10. FFMPEG_LICENSE = LGPL-2.1+, libjpeg license
  11. FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
  12. ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
  13. FFMPEG_LICENSE += and GPL-2.0+
  14. FFMPEG_LICENSE_FILES += COPYING.GPLv2
  15. endif
  16. FFMPEG_CONF_OPTS = \
  17. --prefix=/usr \
  18. --enable-avfilter \
  19. --disable-version3 \
  20. --enable-logging \
  21. --enable-optimizations \
  22. --disable-extra-warnings \
  23. --enable-avdevice \
  24. --enable-avcodec \
  25. --enable-avformat \
  26. --enable-network \
  27. --disable-gray \
  28. --enable-swscale-alpha \
  29. --disable-small \
  30. --enable-dct \
  31. --enable-fft \
  32. --enable-mdct \
  33. --enable-rdft \
  34. --disable-crystalhd \
  35. --disable-dxva2 \
  36. --enable-runtime-cpudetect \
  37. --disable-hardcoded-tables \
  38. --disable-mipsdsp \
  39. --disable-mipsdspr2 \
  40. --disable-msa \
  41. --enable-hwaccels \
  42. --disable-cuda \
  43. --disable-cuvid \
  44. --disable-nvenc \
  45. --disable-avisynth \
  46. --disable-frei0r \
  47. --disable-libopencore-amrnb \
  48. --disable-libopencore-amrwb \
  49. --disable-libdc1394 \
  50. --disable-libgsm \
  51. --disable-libilbc \
  52. --disable-libvo-amrwbenc \
  53. --disable-symver \
  54. --disable-doc
  55. FFMPEG_DEPENDENCIES += host-pkgconf
  56. ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
  57. FFMPEG_CONF_OPTS += --enable-gpl
  58. else
  59. FFMPEG_CONF_OPTS += --disable-gpl
  60. endif
  61. ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
  62. FFMPEG_CONF_OPTS += --enable-nonfree
  63. else
  64. FFMPEG_CONF_OPTS += --disable-nonfree
  65. endif
  66. ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
  67. FFMPEG_CONF_OPTS += --enable-ffmpeg
  68. else
  69. FFMPEG_CONF_OPTS += --disable-ffmpeg
  70. endif
  71. ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
  72. FFMPEG_DEPENDENCIES += sdl2
  73. FFMPEG_CONF_OPTS += --enable-ffplay
  74. FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl2-config
  75. else
  76. FFMPEG_CONF_OPTS += --disable-ffplay
  77. endif
  78. ifeq ($(BR2_PACKAGE_LIBV4L),y)
  79. FFMPEG_DEPENDENCIES += libv4l
  80. FFMPEG_CONF_OPTS += --enable-libv4l2
  81. else
  82. FFMPEG_CONF_OPTS += --disable-libv4l2
  83. endif
  84. ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
  85. FFMPEG_CONF_OPTS += --enable-avresample
  86. else
  87. FFMPEG_CONF_OPTS += --disable-avresample
  88. endif
  89. ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
  90. FFMPEG_CONF_OPTS += --enable-ffprobe
  91. else
  92. FFMPEG_CONF_OPTS += --disable-ffprobe
  93. endif
  94. ifeq ($(BR2_PACKAGE_FFMPEG_XCBGRAB),y)
  95. FFMPEG_CONF_OPTS += \
  96. --enable-libxcb \
  97. --enable-libxcb-shape \
  98. --enable-libxcb-shm \
  99. --enable-libxcb-xfixes
  100. FFMPEG_DEPENDENCIES += libxcb
  101. else
  102. FFMPEG_CONF_OPTS += --disable-libxcb
  103. endif
  104. ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
  105. FFMPEG_CONF_OPTS += --enable-postproc
  106. else
  107. FFMPEG_CONF_OPTS += --disable-postproc
  108. endif
  109. ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
  110. FFMPEG_CONF_OPTS += --enable-swscale
  111. else
  112. FFMPEG_CONF_OPTS += --disable-swscale
  113. endif
  114. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
  115. FFMPEG_CONF_OPTS += --disable-encoders \
  116. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
  117. endif
  118. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
  119. FFMPEG_CONF_OPTS += --disable-decoders \
  120. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
  121. endif
  122. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
  123. FFMPEG_CONF_OPTS += --disable-muxers \
  124. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
  125. endif
  126. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
  127. FFMPEG_CONF_OPTS += --disable-demuxers \
  128. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
  129. endif
  130. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
  131. FFMPEG_CONF_OPTS += --disable-parsers \
  132. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
  133. endif
  134. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
  135. FFMPEG_CONF_OPTS += --disable-bsfs \
  136. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsf=$(x))
  137. endif
  138. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
  139. FFMPEG_CONF_OPTS += --disable-protocols \
  140. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
  141. endif
  142. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
  143. FFMPEG_CONF_OPTS += --disable-filters \
  144. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
  145. endif
  146. ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
  147. FFMPEG_CONF_OPTS += --enable-indevs
  148. ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
  149. FFMPEG_CONF_OPTS += --enable-alsa
  150. FFMPEG_DEPENDENCIES += alsa-lib
  151. else
  152. FFMPEG_CONF_OPTS += --disable-alsa
  153. endif
  154. else
  155. FFMPEG_CONF_OPTS += --disable-indevs
  156. endif
  157. ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
  158. FFMPEG_CONF_OPTS += --enable-outdevs
  159. ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
  160. FFMPEG_DEPENDENCIES += alsa-lib
  161. endif
  162. else
  163. FFMPEG_CONF_OPTS += --disable-outdevs
  164. endif
  165. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  166. FFMPEG_CONF_OPTS += --enable-pthreads
  167. else
  168. FFMPEG_CONF_OPTS += --disable-pthreads
  169. endif
  170. ifeq ($(BR2_PACKAGE_ZLIB),y)
  171. FFMPEG_CONF_OPTS += --enable-zlib
  172. FFMPEG_DEPENDENCIES += zlib
  173. else
  174. FFMPEG_CONF_OPTS += --disable-zlib
  175. endif
  176. ifeq ($(BR2_PACKAGE_BZIP2),y)
  177. FFMPEG_CONF_OPTS += --enable-bzlib
  178. FFMPEG_DEPENDENCIES += bzip2
  179. else
  180. FFMPEG_CONF_OPTS += --disable-bzlib
  181. endif
  182. ifeq ($(BR2_PACKAGE_FDK_AAC)$(BR2_PACKAGE_FFMPEG_NONFREE),yy)
  183. FFMPEG_CONF_OPTS += --enable-libfdk-aac
  184. FFMPEG_DEPENDENCIES += fdk-aac
  185. else
  186. FFMPEG_CONF_OPTS += --disable-libfdk-aac
  187. endif
  188. ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBCDIO_PARANOIA),yy)
  189. FFMPEG_CONF_OPTS += --enable-libcdio
  190. FFMPEG_DEPENDENCIES += libcdio-paranoia
  191. else
  192. FFMPEG_CONF_OPTS += --disable-libcdio
  193. endif
  194. ifeq ($(BR2_PACKAGE_GNUTLS),y)
  195. FFMPEG_CONF_OPTS += --enable-gnutls --disable-openssl
  196. FFMPEG_DEPENDENCIES += gnutls
  197. else
  198. FFMPEG_CONF_OPTS += --disable-gnutls
  199. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  200. # openssl isn't license compatible with GPL
  201. ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
  202. FFMPEG_CONF_OPTS += --disable-openssl
  203. else
  204. FFMPEG_CONF_OPTS += --enable-openssl
  205. FFMPEG_DEPENDENCIES += openssl
  206. endif
  207. else
  208. FFMPEG_CONF_OPTS += --disable-openssl
  209. endif
  210. endif
  211. ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBEBUR128),yy)
  212. FFMPEG_DEPENDENCIES += libebur128
  213. endif
  214. ifeq ($(BR2_PACKAGE_LIBDRM),y)
  215. FFMPEG_CONF_OPTS += --enable-libdrm
  216. FFMPEG_DEPENDENCIES += libdrm
  217. else
  218. FFMPEG_CONF_OPTS += --disable-libdrm
  219. endif
  220. ifeq ($(BR2_PACKAGE_LIBOPENH264),y)
  221. FFMPEG_CONF_OPTS += --enable-libopenh264
  222. FFMPEG_DEPENDENCIES += libopenh264
  223. else
  224. FFMPEG_CONF_OPTS += --disable-libopenh264
  225. endif
  226. ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
  227. FFMPEG_DEPENDENCIES += libvorbis
  228. FFMPEG_CONF_OPTS += \
  229. --enable-libvorbis \
  230. --enable-muxer=ogg \
  231. --enable-encoder=libvorbis
  232. endif
  233. ifeq ($(BR2_PACKAGE_LIBVA),y)
  234. FFMPEG_CONF_OPTS += --enable-vaapi
  235. FFMPEG_DEPENDENCIES += libva
  236. else
  237. FFMPEG_CONF_OPTS += --disable-vaapi
  238. endif
  239. ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
  240. FFMPEG_CONF_OPTS += --enable-vdpau
  241. FFMPEG_DEPENDENCIES += libvdpau
  242. else
  243. FFMPEG_CONF_OPTS += --disable-vdpau
  244. endif
  245. ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
  246. FFMPEG_CONF_OPTS += --enable-mmal --enable-omx --enable-omx-rpi \
  247. --extra-cflags=-I$(STAGING_DIR)/usr/include/IL
  248. FFMPEG_DEPENDENCIES += rpi-userland
  249. else
  250. FFMPEG_CONF_OPTS += --disable-mmal --disable-omx --disable-omx-rpi
  251. endif
  252. # To avoid a circular dependency only use opencv if opencv itself does
  253. # not depend on ffmpeg.
  254. ifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG),yx)
  255. FFMPEG_CONF_OPTS += --enable-libopencv
  256. FFMPEG_DEPENDENCIES += opencv3
  257. else
  258. FFMPEG_CONF_OPTS += --disable-libopencv
  259. endif
  260. ifeq ($(BR2_PACKAGE_OPUS),y)
  261. FFMPEG_CONF_OPTS += --enable-libopus
  262. FFMPEG_DEPENDENCIES += opus
  263. else
  264. FFMPEG_CONF_OPTS += --disable-libopus
  265. endif
  266. ifeq ($(BR2_PACKAGE_LIBVPX),y)
  267. FFMPEG_CONF_OPTS += --enable-libvpx
  268. FFMPEG_DEPENDENCIES += libvpx
  269. else
  270. FFMPEG_CONF_OPTS += --disable-libvpx
  271. endif
  272. ifeq ($(BR2_PACKAGE_LIBASS),y)
  273. FFMPEG_CONF_OPTS += --enable-libass
  274. FFMPEG_DEPENDENCIES += libass
  275. else
  276. FFMPEG_CONF_OPTS += --disable-libass
  277. endif
  278. ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
  279. FFMPEG_CONF_OPTS += --enable-libbluray
  280. FFMPEG_DEPENDENCIES += libbluray
  281. else
  282. FFMPEG_CONF_OPTS += --disable-libbluray
  283. endif
  284. ifeq ($(BR2_PACKAGE_INTEL_MEDIASDK),y)
  285. FFMPEG_CONF_OPTS += --enable-libmfx
  286. FFMPEG_DEPENDENCIES += intel-mediasdk
  287. else
  288. FFMPEG_CONF_OPTS += --disable-libmfx
  289. endif
  290. ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
  291. FFMPEG_CONF_OPTS += --enable-librtmp
  292. FFMPEG_DEPENDENCIES += rtmpdump
  293. else
  294. FFMPEG_CONF_OPTS += --disable-librtmp
  295. endif
  296. ifeq ($(BR2_PACKAGE_LAME),y)
  297. FFMPEG_CONF_OPTS += --enable-libmp3lame
  298. FFMPEG_DEPENDENCIES += lame
  299. else
  300. FFMPEG_CONF_OPTS += --disable-libmp3lame
  301. endif
  302. ifeq ($(BR2_PACKAGE_LIBMODPLUG),y)
  303. FFMPEG_CONF_OPTS += --enable-libmodplug
  304. FFMPEG_DEPENDENCIES += libmodplug
  305. else
  306. FFMPEG_CONF_OPTS += --disable-libmodplug
  307. endif
  308. ifeq ($(BR2_PACKAGE_SPEEX),y)
  309. FFMPEG_CONF_OPTS += --enable-libspeex
  310. FFMPEG_DEPENDENCIES += speex
  311. else
  312. FFMPEG_CONF_OPTS += --disable-libspeex
  313. endif
  314. ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
  315. FFMPEG_CONF_OPTS += --enable-libtheora
  316. FFMPEG_DEPENDENCIES += libtheora
  317. else
  318. FFMPEG_CONF_OPTS += --disable-libtheora
  319. endif
  320. ifeq ($(BR2_PACKAGE_WAVPACK),y)
  321. FFMPEG_CONF_OPTS += --enable-libwavpack
  322. FFMPEG_DEPENDENCIES += wavpack
  323. else
  324. FFMPEG_CONF_OPTS += --disable-libwavpack
  325. endif
  326. ifeq ($(BR2_PACKAGE_LIBICONV),y)
  327. FFMPEG_CONF_OPTS += --enable-iconv
  328. FFMPEG_DEPENDENCIES += libiconv
  329. else
  330. FFMPEG_CONF_OPTS += --disable-iconv
  331. endif
  332. # ffmpeg freetype support require fenv.h which is only
  333. # available/working on glibc.
  334. # The microblaze variant doesn't provide the needed exceptions
  335. ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
  336. FFMPEG_CONF_OPTS += --enable-libfreetype
  337. FFMPEG_DEPENDENCIES += freetype
  338. else
  339. FFMPEG_CONF_OPTS += --disable-libfreetype
  340. endif
  341. ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
  342. FFMPEG_CONF_OPTS += --enable-fontconfig
  343. FFMPEG_DEPENDENCIES += fontconfig
  344. else
  345. FFMPEG_CONF_OPTS += --disable-fontconfig
  346. endif
  347. ifeq ($(BR2_PACKAGE_OPENJPEG),y)
  348. FFMPEG_CONF_OPTS += --enable-libopenjpeg
  349. FFMPEG_DEPENDENCIES += openjpeg
  350. else
  351. FFMPEG_CONF_OPTS += --disable-libopenjpeg
  352. endif
  353. ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
  354. FFMPEG_CONF_OPTS += --enable-libx264
  355. FFMPEG_DEPENDENCIES += x264
  356. else
  357. FFMPEG_CONF_OPTS += --disable-libx264
  358. endif
  359. ifeq ($(BR2_PACKAGE_X265)$(BR2_PACKAGE_FFMPEG_GPL),yy)
  360. FFMPEG_CONF_OPTS += --enable-libx265
  361. FFMPEG_DEPENDENCIES += x265
  362. else
  363. FFMPEG_CONF_OPTS += --disable-libx265
  364. endif
  365. ifeq ($(BR2_PACKAGE_DAV1D),y)
  366. FFMPEG_CONF_OPTS += --enable-libdav1d
  367. FFMPEG_DEPENDENCIES += dav1d
  368. else
  369. FFMPEG_CONF_OPTS += --disable-libdav1d
  370. endif
  371. ifeq ($(BR2_X86_CPU_HAS_MMX),y)
  372. FFMPEG_CONF_OPTS += --enable-x86asm
  373. FFMPEG_DEPENDENCIES += host-nasm
  374. else
  375. FFMPEG_CONF_OPTS += --disable-x86asm
  376. FFMPEG_CONF_OPTS += --disable-mmx
  377. endif
  378. ifeq ($(BR2_X86_CPU_HAS_SSE),y)
  379. FFMPEG_CONF_OPTS += --enable-sse
  380. else
  381. FFMPEG_CONF_OPTS += --disable-sse
  382. endif
  383. ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
  384. FFMPEG_CONF_OPTS += --enable-sse2
  385. else
  386. FFMPEG_CONF_OPTS += --disable-sse2
  387. endif
  388. ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
  389. FFMPEG_CONF_OPTS += --enable-sse3
  390. else
  391. FFMPEG_CONF_OPTS += --disable-sse3
  392. endif
  393. ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
  394. FFMPEG_CONF_OPTS += --enable-ssse3
  395. else
  396. FFMPEG_CONF_OPTS += --disable-ssse3
  397. endif
  398. ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
  399. FFMPEG_CONF_OPTS += --enable-sse4
  400. else
  401. FFMPEG_CONF_OPTS += --disable-sse4
  402. endif
  403. ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
  404. FFMPEG_CONF_OPTS += --enable-sse42
  405. else
  406. FFMPEG_CONF_OPTS += --disable-sse42
  407. endif
  408. ifeq ($(BR2_X86_CPU_HAS_AVX),y)
  409. FFMPEG_CONF_OPTS += --enable-avx
  410. else
  411. FFMPEG_CONF_OPTS += --disable-avx
  412. endif
  413. ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
  414. FFMPEG_CONF_OPTS += --enable-avx2
  415. else
  416. FFMPEG_CONF_OPTS += --disable-avx2
  417. endif
  418. # Explicitly disable everything that doesn't match for ARM
  419. # FFMPEG "autodetects" by compiling an extended instruction via AS
  420. # This works on compilers that aren't built for generic by default
  421. ifeq ($(BR2_ARM_CPU_ARMV4),y)
  422. FFMPEG_CONF_OPTS += --disable-armv5te
  423. endif
  424. ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
  425. FFMPEG_CONF_OPTS += --enable-armv6
  426. else
  427. FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
  428. endif
  429. ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
  430. FFMPEG_CONF_OPTS += --enable-vfp
  431. else
  432. FFMPEG_CONF_OPTS += --disable-vfp
  433. endif
  434. ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
  435. FFMPEG_CONF_OPTS += --enable-neon
  436. else ifeq ($(BR2_aarch64),y)
  437. FFMPEG_CONF_OPTS += --enable-neon
  438. else
  439. FFMPEG_CONF_OPTS += --disable-neon
  440. endif
  441. ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
  442. ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
  443. FFMPEG_CONF_OPTS += --disable-mipsfpu
  444. else
  445. FFMPEG_CONF_OPTS += --enable-mipsfpu
  446. endif
  447. # Fix build failure on "addi opcode not supported"
  448. ifeq ($(BR2_mips_32r6)$(BR2_mips_64r6),y)
  449. FFMPEG_CONF_OPTS += --disable-asm
  450. endif
  451. endif # MIPS
  452. ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
  453. FFMPEG_CONF_OPTS += --enable-altivec
  454. else
  455. FFMPEG_CONF_OPTS += --disable-altivec
  456. endif
  457. # Uses __atomic_fetch_add_4
  458. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  459. FFMPEG_CONF_OPTS += --extra-libs=-latomic
  460. endif
  461. ifeq ($(BR2_STATIC_LIBS),)
  462. FFMPEG_CONF_OPTS += --enable-pic
  463. else
  464. FFMPEG_CONF_OPTS += --disable-pic
  465. endif
  466. # Default to --cpu=generic for MIPS architecture, in order to avoid a
  467. # warning from ffmpeg's configure script.
  468. ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
  469. FFMPEG_CONF_OPTS += --cpu=generic
  470. else ifneq ($(GCC_TARGET_CPU),)
  471. FFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_CPU)"
  472. else ifneq ($(GCC_TARGET_ARCH),)
  473. FFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_ARCH)"
  474. endif
  475. FFMPEG_CFLAGS = $(TARGET_CFLAGS)
  476. ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
  477. FFMPEG_CONF_OPTS += --disable-optimizations
  478. FFMPEG_CFLAGS += -O0
  479. endif
  480. FFMPEG_CONF_ENV += CFLAGS="$(FFMPEG_CFLAGS)"
  481. FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
  482. # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
  483. define FFMPEG_CONFIGURE_CMDS
  484. (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
  485. $(TARGET_CONFIGURE_OPTS) \
  486. $(TARGET_CONFIGURE_ARGS) \
  487. $(FFMPEG_CONF_ENV) \
  488. ./configure \
  489. --enable-cross-compile \
  490. --cross-prefix=$(TARGET_CROSS) \
  491. --sysroot=$(STAGING_DIR) \
  492. --host-cc="$(HOSTCC)" \
  493. --arch=$(BR2_ARCH) \
  494. --target-os="linux" \
  495. --disable-stripping \
  496. --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
  497. $(SHARED_STATIC_LIBS_OPTS) \
  498. $(FFMPEG_CONF_OPTS) \
  499. )
  500. endef
  501. define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
  502. rm -rf $(TARGET_DIR)/usr/share/ffmpeg/examples
  503. endef
  504. FFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES
  505. $(eval $(autotools-package))