ffmpeg.mk 14 KB

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