Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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:= 2.2.3
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= dbb5b6b69bd010916f17df0ae596e0b1
  8. PKG_DESCR:= record, convert and stream audio & video
  9. PKG_SECTION:= libs/video
  10. PKG_FDEPENDS:= libpthread
  11. PKG_URL:= http://www.ffmpeg.org/
  12. PKG_SITES:= http://www.ffmpeg.org/releases/
  13. PKG_LIBNAME:= libffmpeg
  14. PKG_OPTS:= dev
  15. PKG_SUBPKGS:= LIBFFMPEG FFSERVER FFPROBE FFMPEG
  16. #PKGSD_FFPLAY:= video player
  17. #PKGSC_FFPLAY:= mm/video
  18. #PKGSS_FFPLAY:= libsdl libpthread libffmpeg
  19. #PKGSB_FFPLAY:= sdl
  20. PKGSD_FFMPEG:= video converter
  21. PKGSC_FFMPEG:= mm/video
  22. PKGSS_FFMPEG:= libffmpeg
  23. PKGSD_FFSERVER:= streaming server
  24. PKGSC_FFSERVER:= mm/video
  25. PKGSS_FFSERVER:= libffmpeg
  26. PKGSD_FFPROBE:= simple multimedia stream analyzer
  27. PKGSC_FFPROBE:= mm/video
  28. PKGSS_FFPROBE:= libffmpeg
  29. PKGSD_LIBFFMPEG:= video library
  30. PKGSC_LIBFFMPEG:= libs/video
  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. include ${ADK_TOPDIR}/mk/package.mk
  77. $(eval $(call PKG_template,LIBFFMPEG,libffmpeg,${PKG_VERSION}-${PKG_RELEASE},${PKG_FDEPENDS},${PKGSD_LIBFFMPEG},${PKGSC_LIBFFMPEG},${PKG_OPTS}))
  78. $(eval $(call PKG_template,FFMPEG,ffmpeg,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFMPEG},${PKGSC_FFMPEG}))
  79. $(eval $(call PKG_template,FFSERVER,ffserver,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFSERVER},${PKGSC_FFSERVER}))
  80. $(eval $(call PKG_template,FFPROBE,ffprobe,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFPROBE},${PKGSC_FFPROBE}))
  81. #$(eval $(call PKG_template,FFPLAY,ffplay,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_FFPLAY},${PKGSD_FFPLAY},${PKGSC_FFPLAY}))
  82. ifeq ($(ADK_DEBUG),y)
  83. TARGET_CFLAGS:= $(subst O0,O2,$(TARGET_CFLAGS))
  84. else
  85. TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
  86. endif
  87. TARGET_CPPFLAGS+= -D_POSIX_SOURCE -D_GNU_SOURCE
  88. ifeq ($(ADK_TARGET_CPU_WITH_MMX),y)
  89. CONFIGURE_CPU_OPTS:= --enable-mmx
  90. else
  91. CONFIGURE_CPU_OPTS:= --disable-mmx
  92. endif
  93. ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT),y)
  94. CONFIGURE_CPU_OPTS:= --enable-mmx2
  95. else
  96. CONFIGURE_CPU_OPTS:= --disable-mmx2
  97. endif
  98. ifeq ($(ADK_TARGET_CPU_WITH_SSE),y)
  99. CONFIGURE_CPU_OPTS:= --enable-sse
  100. else
  101. CONFIGURE_CPU_OPTS:= --disable-sse
  102. endif
  103. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  104. CONFIGURE_CPU_OPTS:= --enable-armv6
  105. endif
  106. CONFIG_STYLE:= minimal
  107. CONFIGURE_ARGS:= --prefix=/usr \
  108. --target-os=linux \
  109. --arch=${ADK_TARGET_CPU_ARCH} \
  110. --enable-cross-compile \
  111. --sysroot=${STAGING_TARGET_DIR} \
  112. --cross-prefix=${TARGET_CROSS} \
  113. --cc='$(TARGET_CC)' \
  114. --host-cc=$(CC_FOR_BUILD) \
  115. --disable-bzlib \
  116. --disable-doc \
  117. --disable-debug \
  118. --disable-yasm \
  119. --disable-optimizations \
  120. --disable-stripping \
  121. --enable-shared \
  122. --enable-static \
  123. --enable-gpl \
  124. --enable-nonfree \
  125. --enable-swscale \
  126. --enable-postproc \
  127. ${CONFIGURE_CPU_OPTS}
  128. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
  129. CONFIGURE_ARGS+= --enable-libx264
  130. endif
  131. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_AAC),y)
  132. CONFIGURE_ARGS+= --enable-libfaac
  133. endif
  134. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  135. CONFIGURE_ARGS+= --enable-libmp3lame
  136. endif
  137. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  138. CONFIGURE_ARGS+= --enable-libvpx
  139. endif
  140. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  141. CONFIGURE_ARGS+= --enable-libtheora
  142. endif
  143. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  144. CONFIGURE_ARGS+= --enable-libxvid
  145. endif
  146. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  147. CONFIGURE_ARGS+= --enable-libvorbis
  148. endif
  149. libffmpeg-install:
  150. ${INSTALL_DIR} ${IDIR_LIBFFMPEG}/usr/lib
  151. ${CP} ${WRKINST}/usr/lib/libavdevice.so* ${IDIR_LIBFFMPEG}/usr/lib
  152. ${CP} ${WRKINST}/usr/lib/libavformat.so* ${IDIR_LIBFFMPEG}/usr/lib
  153. ${CP} ${WRKINST}/usr/lib/libavfilter.so* ${IDIR_LIBFFMPEG}/usr/lib
  154. ${CP} ${WRKINST}/usr/lib/libavcodec.so* ${IDIR_LIBFFMPEG}/usr/lib
  155. ${CP} ${WRKINST}/usr/lib/libavutil.so* ${IDIR_LIBFFMPEG}/usr/lib
  156. ${CP} ${WRKINST}/usr/lib/libpostproc.so* ${IDIR_LIBFFMPEG}/usr/lib
  157. ${CP} ${WRKINST}/usr/lib/libswscale.so* ${IDIR_LIBFFMPEG}/usr/lib
  158. ${CP} ${WRKINST}/usr/lib/libswresample.so* ${IDIR_LIBFFMPEG}/usr/lib
  159. #ffplay-install:
  160. # ${INSTALL_DIR} ${IDIR_FFPLAY}/usr/bin
  161. # ${INSTALL_BIN} ${WRKINST}/usr/bin/ffplay ${IDIR_FFPLAY}/usr/bin
  162. ffmpeg-install:
  163. ${INSTALL_DIR} ${IDIR_FFMPEG}/usr/bin
  164. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffmpeg ${IDIR_FFMPEG}/usr/bin
  165. ffserver-install:
  166. ${INSTALL_DIR} ${IDIR_FFSERVER}/etc
  167. $(INSTALL_DATA) $(WRKBUILD)/doc/ffserver.conf ${IDIR_FFSERVER}/etc
  168. ${INSTALL_DIR} ${IDIR_FFSERVER}/usr/bin
  169. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffserver ${IDIR_FFSERVER}/usr/bin
  170. ffprobe-install:
  171. ${INSTALL_DIR} ${IDIR_FFPROBE}/usr/bin
  172. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffprobe ${IDIR_FFPROBE}/usr/bin
  173. include ${ADK_TOPDIR}/mk/pkg-bottom.mk