Makefile 6.0 KB

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