Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 ${TOPDIR}/rules.mk
  4. PKG_NAME:= ffmpeg
  5. PKG_VERSION:= 2.2.2
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 581affe5d820d89ce21fe3f0316ef2c3
  8. PKG_DESCR:= record, convert and stream audio & video
  9. PKG_SECTION:= libs
  10. PKG_FDEPENDS:= libpthread
  11. PKG_URL:= http://www.ffmpeg.org/
  12. PKG_SITES:= http://www.ffmpeg.org/releases/
  13. PKH_LIBNAME:= libffmpeg
  14. PKG_OPTS:= dev
  15. PKG_SUBPKGS:= LIBFFMPEG FFSERVER FFPROBE FFMPEG
  16. #PKGSD_FFPLAY:= ffmpeg based video player
  17. #PKGSC_FFPLAY:= multimedia
  18. #PKGSS_FFPLAY:= libsdl libpthread libffmpeg
  19. #PKGSB_FFPLAY:= sdl
  20. PKGSD_FFMPEG:= ffmpeg video converter
  21. PKGSC_FFMPEG:= multimedia
  22. PKGSS_FFMPEG:= libffmpeg
  23. PKGSD_FFSERVER:= streaming server
  24. PKGSC_FFSERVER:= multimedia
  25. PKGSS_FFSERVER:= libffmpeg
  26. PKGSD_FFPROBE:= simple multimedia stream analyzer
  27. PKGSC_FFPROBE:= multimedia
  28. PKGSS_FFPROBE:= libffmpeg
  29. PKGSD_LIBFFMPEG:= ffmpeg library
  30. PKGSC_LIBFFMPEG:= libs
  31. PKG_FLAVOURS_LIBFFMPEG:= WITH_AAC WITH_MP3 WITH_VP8 WITH_THEORA
  32. PKG_FLAVOURS_LIBFFMPEG+= WITH_XVID WITH_VORBIS WITH_X264
  33. PKGFD_WITH_X264:= with X264 decoding support
  34. PKGFS_WITH_X264:= libx264
  35. PKGFB_WITH_X264:= libx264
  36. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
  37. PKG_FDEPENDS+= libx264
  38. endif
  39. PKGFD_WITH_AAC:= with AAC encoding support
  40. PKGFS_WITH_AAC:= libfaac
  41. PKGFB_WITH_AAC:= faac
  42. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_AAC),y)
  43. PKG_FDEPENDS+= libfaac
  44. endif
  45. PKGFD_WITH_MP3:= with MP3 encoding support
  46. PKGFS_WITH_MP3:= libmp3lame
  47. PKGFB_WITH_MP3:= lame
  48. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  49. PKG_FDEPENDS+= libmp3lame
  50. endif
  51. PKGFD_WITH_VP8:= with VP8 encoding support
  52. PKGFS_WITH_VP8:= libvpx
  53. PKGFB_WITH_VP8:= libvpx
  54. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  55. PKG_FDEPENDS+= libvpx
  56. endif
  57. PKGFD_WITH_THEORA:= with Theora encoding support
  58. PKGFS_WITH_THEORA:= libtheora
  59. PKGFB_WITH_THEORA:= libtheora
  60. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  61. PKG_FDEPENDS+= libtheora
  62. endif
  63. PKGFD_WITH_XVID:= with Xvid encoding support
  64. PKGFS_WITH_XVID:= libxvid
  65. PKGFB_WITH_XVID:= xvidcore
  66. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  67. PKG_FDEPENDS+= libxvid
  68. endif
  69. PKGFD_WITH_VORBIS:= with Vorbis encoding support
  70. PKGFS_WITH_VORBIS:= libvorbisenc
  71. PKGFB_WITH_VORBIS:= libvorbis
  72. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  73. PKG_FDEPENDS+= libvorbisenc
  74. endif
  75. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  76. ifeq ($(ADK_STATIC),y)
  77. PKG_OPTS+= libmix
  78. endif
  79. include ${TOPDIR}/mk/package.mk
  80. $(eval $(call PKG_template,LIBFFMPEG,libffmpeg,${PKG_VERSION}-${PKG_RELEASE},${PKG_FDEPENDS},${PKGSD_LIBFFMPEG},${PKGSC_LIBFFMPEG},${PKG_OPTS}))
  81. $(eval $(call PKG_template,FFMPEG,ffmpeg,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFMPEG},${PKGSC_FFMPEG}))
  82. $(eval $(call PKG_template,FFSERVER,ffserver,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFSERVER},${PKGSC_FFSERVER}))
  83. $(eval $(call PKG_template,FFPROBE,ffprobe,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFPROBE},${PKGSC_FFPROBE}))
  84. #$(eval $(call PKG_template,FFPLAY,ffplay,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_FFPLAY},${PKGSD_FFPLAY},${PKGSC_FFPLAY}))
  85. ifeq ($(ADK_DEBUG),y)
  86. TARGET_CFLAGS:= $(subst O0,O2,$(TARGET_CFLAGS))
  87. else
  88. TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
  89. endif
  90. TARGET_CPPFLAGS+= -D_POSIX_SOURCE -D_GNU_SOURCE
  91. ifeq ($(ADK_TARGET_CPU_WITH_MMX),y)
  92. CONFIGURE_CPU_OPTS:= --enable-mmx
  93. else
  94. CONFIGURE_CPU_OPTS:= --disable-mmx
  95. endif
  96. ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT),y)
  97. CONFIGURE_CPU_OPTS:= --enable-mmx2
  98. else
  99. CONFIGURE_CPU_OPTS:= --disable-mmx2
  100. endif
  101. ifeq ($(ADK_TARGET_CPU_WITH_SSE),y)
  102. CONFIGURE_CPU_OPTS:= --enable-sse
  103. else
  104. CONFIGURE_CPU_OPTS:= --disable-sse
  105. endif
  106. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  107. CONFIGURE_CPU_OPTS:= --enable-armv6
  108. endif
  109. CONFIG_STYLE:= minimal
  110. CONFIGURE_ARGS:= --prefix=/usr \
  111. --target-os=linux \
  112. --arch=${CPU_ARCH} \
  113. --enable-cross-compile \
  114. --sysroot=${STAGING_TARGET_DIR} \
  115. --cross-prefix=${TARGET_CROSS} \
  116. --cc='$(TARGET_CC)' \
  117. --host-cc=$(CC_FOR_BUILD) \
  118. --disable-bzlib \
  119. --disable-doc \
  120. --disable-debug \
  121. --disable-yasm \
  122. --disable-optimizations \
  123. --disable-stripping \
  124. --enable-shared \
  125. --enable-static \
  126. --enable-gpl \
  127. --enable-nonfree \
  128. --enable-swscale \
  129. --enable-postproc \
  130. ${CONFIGURE_CPU_OPTS}
  131. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
  132. CONFIGURE_ARGS+= --enable-libx264
  133. endif
  134. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_AAC),y)
  135. CONFIGURE_ARGS+= --enable-libfaac
  136. endif
  137. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  138. CONFIGURE_ARGS+= --enable-libmp3lame
  139. endif
  140. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  141. CONFIGURE_ARGS+= --enable-libvpx
  142. endif
  143. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  144. CONFIGURE_ARGS+= --enable-libtheora
  145. endif
  146. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  147. CONFIGURE_ARGS+= --enable-libxvid
  148. endif
  149. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  150. CONFIGURE_ARGS+= --enable-libvorbis
  151. endif
  152. libffmpeg-install:
  153. ${INSTALL_DIR} ${IDIR_LIBFFMPEG}/usr/lib
  154. ${CP} ${WRKINST}/usr/lib/libavdevice.so* ${IDIR_LIBFFMPEG}/usr/lib
  155. ${CP} ${WRKINST}/usr/lib/libavformat.so* ${IDIR_LIBFFMPEG}/usr/lib
  156. ${CP} ${WRKINST}/usr/lib/libavfilter.so* ${IDIR_LIBFFMPEG}/usr/lib
  157. ${CP} ${WRKINST}/usr/lib/libavcodec.so* ${IDIR_LIBFFMPEG}/usr/lib
  158. ${CP} ${WRKINST}/usr/lib/libavutil.so* ${IDIR_LIBFFMPEG}/usr/lib
  159. ${CP} ${WRKINST}/usr/lib/libpostproc.so* ${IDIR_LIBFFMPEG}/usr/lib
  160. ${CP} ${WRKINST}/usr/lib/libswscale.so* ${IDIR_LIBFFMPEG}/usr/lib
  161. ${CP} ${WRKINST}/usr/lib/libswresample.so* ${IDIR_LIBFFMPEG}/usr/lib
  162. #ffplay-install:
  163. # ${INSTALL_DIR} ${IDIR_FFPLAY}/usr/bin
  164. # ${INSTALL_BIN} ${WRKINST}/usr/bin/ffplay ${IDIR_FFPLAY}/usr/bin
  165. ffmpeg-install:
  166. ${INSTALL_DIR} ${IDIR_FFMPEG}/usr/bin
  167. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffmpeg ${IDIR_FFMPEG}/usr/bin
  168. ffserver-install:
  169. ${INSTALL_DIR} ${IDIR_FFSERVER}/etc
  170. $(INSTALL_DATA) $(WRKBUILD)/doc/ffserver.conf ${IDIR_FFSERVER}/etc
  171. ${INSTALL_DIR} ${IDIR_FFSERVER}/usr/bin
  172. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffserver ${IDIR_FFSERVER}/usr/bin
  173. ffprobe-install:
  174. ${INSTALL_DIR} ${IDIR_FFPROBE}/usr/bin
  175. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffprobe ${IDIR_FFPROBE}/usr/bin
  176. include ${TOPDIR}/mk/pkg-bottom.mk