Makefile 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= ffmpeg
  5. PKG_VERSION:= 4.4.1
  6. PKG_RELEASE:= 1
  7. PKG_HASH:= 8fc9f20ac5ed95115a9e285647add0eedd5cc1a98a039ada14c132452f98ac42
  8. PKG_DESCR:= record, convert and stream audio & video
  9. PKG_SECTION:= libs/video
  10. PKG_NEEDS:= threads
  11. PKG_DEPENDS:= libncurses libressl
  12. PKG_BUILDDEP:= ncurses libressl
  13. PKG_URL:= http://www.ffmpeg.org/
  14. PKG_SITES:= http://www.ffmpeg.org/releases/
  15. PKG_LIBNAME:= libffmpeg
  16. PKG_OPTS:= dev
  17. PKG_SUBPKGS:= LIBFFMPEG FFSERVER FFPROBE FFMPEG
  18. PKGSD_FFMPEG:= video converter
  19. PKGSC_FFMPEG:= mm/video
  20. PKGSS_FFMPEG:= libffmpeg
  21. PKGSD_FFSERVER:= streaming server
  22. PKGSC_FFSERVER:= mm/video
  23. PKGSS_FFSERVER:= libffmpeg
  24. PKGSD_FFPROBE:= simple multimedia stream analyzer
  25. PKGSC_FFPROBE:= mm/video
  26. PKGSS_FFPROBE:= libffmpeg
  27. PKGSD_LIBFFMPEG:= video library
  28. PKGSC_LIBFFMPEG:= libs/video
  29. PKG_FLAVOURS_LIBFFMPEG:= WITH_MP3 WITH_VP8 WITH_THEORA
  30. PKG_FLAVOURS_LIBFFMPEG+= WITH_XVID WITH_VORBIS WITH_X264 WITH_X265
  31. PKG_FLAVOURS_LIBFFMPEG+= WITH_ZLIB WITH_BZIP2
  32. PKGFD_WITH_BZIP2:= with bzip2 compression support
  33. PKGFS_WITH_BZIP2:= bzip2
  34. PKGFB_WITH_BZIP2:= bzip2
  35. PKGFD_WITH_ZLIB:= with zlib compression support
  36. PKGFS_WITH_ZLIB:= zlib
  37. PKGFB_WITH_ZLIB:= zlib
  38. PKGFD_WITH_X264:= with x264 decoding support
  39. PKGFS_WITH_X264:= libx264
  40. PKGFB_WITH_X264:= libx264
  41. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
  42. PKG_FDEPENDS+= libx264
  43. endif
  44. PKGFD_WITH_X265:= with x265 decoding support
  45. PKGFS_WITH_X265:= libx265
  46. PKGFB_WITH_X265:= libx265
  47. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X265),y)
  48. PKG_FDEPENDS+= libx265
  49. endif
  50. PKGFD_WITH_MP3:= with mp3 encoding support
  51. PKGFS_WITH_MP3:= libmp3lame
  52. PKGFB_WITH_MP3:= lame
  53. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  54. PKG_FDEPENDS+= libmp3lame
  55. endif
  56. PKGFD_WITH_VP8:= with vp8 encoding support
  57. PKGFS_WITH_VP8:= libvpx
  58. PKGFB_WITH_VP8:= libvpx
  59. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  60. PKG_FDEPENDS+= libvpx
  61. endif
  62. PKGFD_WITH_THEORA:= with theora encoding support
  63. PKGFS_WITH_THEORA:= libtheora
  64. PKGFB_WITH_THEORA:= libtheora
  65. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  66. PKG_FDEPENDS+= libtheora
  67. endif
  68. PKGFD_WITH_XVID:= with xvid encoding support
  69. PKGFS_WITH_XVID:= libxvid
  70. PKGFB_WITH_XVID:= xvidcore
  71. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  72. PKG_FDEPENDS+= libxvid
  73. endif
  74. PKGFD_WITH_VORBIS:= with vorbis encoding support
  75. PKGFS_WITH_VORBIS:= libvorbisenc
  76. PKGFB_WITH_VORBIS:= libvorbis
  77. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  78. PKG_FDEPENDS+= libvorbisenc
  79. endif
  80. DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
  81. include $(ADK_TOPDIR)/mk/package.mk
  82. $(eval $(call PKG_template,LIBFFMPEG,libffmpeg,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_FDEPENDS),$(PKGSD_LIBFFMPEG),$(PKGSC_LIBFFMPEG),$(PKG_OPTS)))
  83. $(eval $(call PKG_template,FFMPEG,ffmpeg,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKGSD_FFMPEG),$(PKGSC_FFMPEG)))
  84. $(eval $(call PKG_template,FFSERVER,ffserver,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKGSD_FFSERVER),$(PKGSC_FFSERVER)))
  85. $(eval $(call PKG_template,FFPROBE,ffprobe,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKGSD_FFPROBE),$(PKGSC_FFPROBE)))
  86. ifeq ($(ADK_DEBUG),y)
  87. TARGET_CFLAGS:= $(subst O0,O2,$(TARGET_CFLAGS))
  88. else
  89. TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
  90. endif
  91. TARGET_CPPFLAGS+= -D_POSIX_SOURCE -D_GNU_SOURCE
  92. ifeq ($(ADK_TARGET_CPU_WITH_MMX),y)
  93. CONFIGURE_CPU_OPTS+= --enable-mmx
  94. else
  95. CONFIGURE_CPU_OPTS+= --disable-mmx
  96. endif
  97. ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT),y)
  98. CONFIGURE_CPU_OPTS+= --enable-mmxext
  99. else
  100. CONFIGURE_CPU_OPTS+= --disable-mmxext
  101. endif
  102. ifeq ($(ADK_TARGET_CPU_WITH_SSE4_2),y)
  103. CONFIGURE_CPU_OPTS+= --enable-sse42 \
  104. --disable-sse4 \
  105. --disable-ssse3 \
  106. --disable-sse3 \
  107. --disable-sse2 \
  108. --disable-sse
  109. else
  110. CONFIGURE_CPU_OPTS+= --disable-sse42
  111. ifeq ($(ADK_TARGET_CPU_WITH_SSE4_1),y)
  112. CONFIGURE_CPU_OPTS+= --enable-sse4 \
  113. --disable-ssse3 \
  114. --disable-sse3 \
  115. --disable-sse2 \
  116. --disable-sse
  117. else
  118. CONFIGURE_CPU_OPTS+= --disable-sse4
  119. ifeq ($(ADK_TARGET_CPU_WITH_SSSE3),y)
  120. CONFIGURE_CPU_OPTS+= --enable-ssse3 \
  121. --disable-sse3 \
  122. --disable-sse2 \
  123. --disable-sse
  124. else
  125. CONFIGURE_CPU_OPTS+= --disable-ssse3
  126. ifeq ($(ADK_TARGET_CPU_WITH_SSE3),y)
  127. CONFIGURE_CPU_OPTS+= --enable-sse3 \
  128. --disable-sse2 \
  129. --disable-sse
  130. else
  131. CONFIGURE_CPU_OPTS+= --disable-sse3
  132. ifeq ($(ADK_TARGET_CPU_WITH_SSE2),y)
  133. CONFIGURE_CPU_OPTS+= --enable-sse2 \
  134. --disable-sse
  135. else
  136. CONFIGURE_CPU_OPTS+= --disable-sse2
  137. ifeq ($(ADK_TARGET_CPU_WITH_SSE),y)
  138. CONFIGURE_CPU_OPTS+= --enable-sse
  139. else
  140. CONFIGURE_CPU_OPTS+= --disable-sse
  141. endif
  142. endif
  143. endif
  144. endif
  145. endif
  146. endif
  147. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  148. CONFIGURE_CPU_OPTS:= --enable-armv6
  149. endif
  150. ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32),y)
  151. CONFIGURE_CPU_OPTS+= --disable-mipsdsp --disable-mipsdspr2
  152. endif
  153. ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y)
  154. CONFIGURE_CPU_OPTS+= --enable-neon
  155. else ifeq ($(ADK_TARGET_ARCH_AARCH64),y)
  156. CONFIGURE_CPU_OPTS+= --enable-neon
  157. else
  158. CONFIGURE_CPU_OPTS+= --disable-neon
  159. endif
  160. CONFIG_STYLE:= minimal
  161. CONFIGURE_ARGS:= --prefix=/usr \
  162. --target-os=linux \
  163. --arch=$(ADK_TARGET_CPU_ARCH) \
  164. --enable-cross-compile \
  165. --sysroot=$(STAGING_TARGET_DIR) \
  166. --cross-prefix=$(TARGET_CROSS) \
  167. --cc='$(TARGET_CC)' \
  168. --host-cc='$(HOST_CC)' \
  169. --pkg-config='$(STAGING_HOST_DIR)/usr/bin/pkg-config' \
  170. --disable-doc \
  171. --disable-debug \
  172. --disable-iconv \
  173. --disable-yasm \
  174. --disable-optimizations \
  175. --disable-stripping \
  176. --enable-shared \
  177. --enable-static \
  178. --enable-gpl \
  179. --enable-nonfree \
  180. --enable-swscale \
  181. --enable-postproc \
  182. --enable-openssl \
  183. $(CONFIGURE_CPU_OPTS)
  184. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_BZIP2),y)
  185. CONFIGURE_ARGS+= --enable-bzlib
  186. else
  187. CONFIGURE_ARGS+= --disable-bzlib
  188. endif
  189. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_ZLIB),y)
  190. CONFIGURE_ARGS+= --enable-zlib
  191. else
  192. CONFIGURE_ARGS+= --disable-zlib
  193. endif
  194. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
  195. CONFIGURE_ARGS+= --enable-libx264
  196. endif
  197. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X265),y)
  198. CONFIGURE_ARGS+= --enable-libx265
  199. endif
  200. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  201. CONFIGURE_ARGS+= --enable-libmp3lame
  202. endif
  203. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  204. CONFIGURE_ARGS+= --enable-libvpx
  205. endif
  206. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  207. CONFIGURE_ARGS+= --enable-libtheora
  208. endif
  209. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  210. CONFIGURE_ARGS+= --enable-libxvid
  211. endif
  212. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  213. CONFIGURE_ARGS+= --enable-libvorbis \
  214. --enable-muxer=ogg \
  215. --enable-encoder=libvorbis
  216. endif
  217. libffmpeg-install:
  218. $(INSTALL_DIR) $(IDIR_LIBFFMPEG)/usr/lib
  219. $(CP) $(WRKINST)/usr/lib/libavdevice.so* $(IDIR_LIBFFMPEG)/usr/lib
  220. $(CP) $(WRKINST)/usr/lib/libavformat.so* $(IDIR_LIBFFMPEG)/usr/lib
  221. $(CP) $(WRKINST)/usr/lib/libavfilter.so* $(IDIR_LIBFFMPEG)/usr/lib
  222. $(CP) $(WRKINST)/usr/lib/libavcodec.so* $(IDIR_LIBFFMPEG)/usr/lib
  223. $(CP) $(WRKINST)/usr/lib/libavutil.so* $(IDIR_LIBFFMPEG)/usr/lib
  224. $(CP) $(WRKINST)/usr/lib/libpostproc.so* $(IDIR_LIBFFMPEG)/usr/lib
  225. $(CP) $(WRKINST)/usr/lib/libswscale.so* $(IDIR_LIBFFMPEG)/usr/lib
  226. $(CP) $(WRKINST)/usr/lib/libswresample.so* $(IDIR_LIBFFMPEG)/usr/lib
  227. ffmpeg-install:
  228. $(INSTALL_DIR) $(IDIR_FFMPEG)/usr/bin
  229. $(INSTALL_BIN) $(WRKINST)/usr/bin/ffmpeg \
  230. $(IDIR_FFMPEG)/usr/bin
  231. ffserver-install:
  232. $(INSTALL_DIR) $(IDIR_FFSERVER)/usr/bin
  233. $(INSTALL_BIN) $(WRKINST)/usr/bin/ffserver \
  234. $(IDIR_FFSERVER)/usr/bin
  235. ffprobe-install:
  236. $(INSTALL_DIR) $(IDIR_FFPROBE)/usr/bin
  237. $(INSTALL_BIN) $(WRKINST)/usr/bin/ffprobe \
  238. $(IDIR_FFPROBE)/usr/bin
  239. include $(ADK_TOPDIR)/mk/pkg-bottom.mk