Makefile 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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:= 0.8.3
  6. PKG_RELEASE:= 2
  7. PKG_MD5SUM:= 556870ccfd6c9c0426c7dd86dd5beb62
  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. PKG_ARCH_DEPENDS:= !cris
  14. PKG_SUBPKGS:= LIBFFMPEG FFPLAY FFSERVER FFPROBE FFMPEG
  15. PKGSD_FFPLAY:= ffmpeg based video player
  16. PKGSC_FFPLAY:= multimedia
  17. PKGSS_FFPLAY:= libsdl libpthread libffmpeg
  18. PKGSB_FFPLAY:= sdl
  19. PKGSD_FFMPEG:= ffmpeg video converter
  20. PKGSC_FFMPEG:= multimedia
  21. PKGSD_FFSERVER:= streaming server
  22. PKGSC_FFSERVER:= multimedia
  23. PKGSD_FFPROBE:= simple multimedia stream analyzer
  24. PKGSC_FFPROBE:= multimedia
  25. PKG_FLAVOURS_LIBFFMPEG:= WITH_AAC WITH_MP3 WITH_VP8 WITH_THEORA
  26. PKG_FLAVOURS_LIBFFMPEG+= WITH_XVID WITH_VORBIS
  27. PKGFD_WITH_AAC:= with AAC encoding support
  28. PKGFS_WITH_AAC:= libfaac
  29. PKGFB_WITH_AAC:= faac
  30. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_AAC),y)
  31. PKG_FDEPENDS+= libfaac
  32. endif
  33. PKGFD_WITH_MP3:= with MP3 encoding support
  34. PKGFS_WITH_MP3:= libmp3lame
  35. PKGFB_WITH_MP3:= lame
  36. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  37. PKG_FDEPENDS+= libmp3lame
  38. endif
  39. PKGFD_WITH_VP8:= with VP8 encoding support
  40. PKGFS_WITH_VP8:= libvpx
  41. PKGFB_WITH_VP8:= libvpx
  42. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  43. PKG_FDEPENDS+= libvpx
  44. endif
  45. PKGFD_WITH_THEORA:= with Theora encoding support
  46. PKGFS_WITH_THEORA:= libtheora
  47. PKGFB_WITH_THEORA:= libtheora
  48. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  49. PKG_FDEPENDS+= libtheora
  50. endif
  51. PKGFD_WITH_XVID:= with Xvid encoding support
  52. PKGFS_WITH_XVID:= libxvid
  53. PKGFB_WITH_XVID:= xvidcore
  54. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  55. PKG_FDEPENDS+= libxvid
  56. endif
  57. PKGFD_WITH_VORBIS:= with Vorbis encoding support
  58. PKGFS_WITH_VORBIS:= libvorbisenc
  59. PKGFB_WITH_VORBIS:= libvorbis
  60. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  61. PKG_FDEPENDS+= libvorbisenc
  62. endif
  63. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  64. include ${TOPDIR}/mk/package.mk
  65. $(eval $(call PKG_template,LIBFFMPEG,libffmpeg,${PKG_VERSION}-${PKG_RELEASE},${PKG_FDEPENDS},${PKG_DESCR},${PKG_SECTION}))
  66. $(eval $(call PKG_template,FFMPEG,ffmpeg,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFMPEG},${PKGSC_FFMPEG}))
  67. $(eval $(call PKG_template,FFSERVER,ffserver,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFSERVER},${PKGSC_FFSERVER}))
  68. $(eval $(call PKG_template,FFPROBE,ffprobe,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FFPROBE},${PKGSC_FFPROBE}))
  69. $(eval $(call PKG_template,FFPLAY,ffplay,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_FFPLAY},${PKGSD_FFPLAY},${PKGSC_FFPLAY}))
  70. TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
  71. TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
  72. ifeq ($(ADK_TARGET_CPU_WITH_MMX),y)
  73. CONFIGURE_CPU_OPTS:= --enable-mmx
  74. else
  75. CONFIGURE_CPU_OPTS:= --disable-mmx
  76. endif
  77. ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT),y)
  78. CONFIGURE_CPU_OPTS:= --enable-mmx2
  79. else
  80. CONFIGURE_CPU_OPTS:= --disable-mmx2
  81. endif
  82. ifeq ($(ADK_TARGET_CPU_WITH_SSE),y)
  83. CONFIGURE_CPU_OPTS:= --enable-sse
  84. else
  85. CONFIGURE_CPU_OPTS:= --disable-sse
  86. endif
  87. CONFIG_STYLE:= minimal
  88. CONFIGURE_ARGS:= --prefix=/usr \
  89. --target-os=linux \
  90. --arch=${CPU_ARCH} \
  91. --enable-cross-compile \
  92. --sysroot=${STAGING_TARGET_DIR} \
  93. --cross-prefix=${TARGET_CROSS} \
  94. --cc='$(TARGET_CC)' \
  95. --host-cc=$(CC_FOR_BUILD) \
  96. --disable-doc \
  97. --disable-debug \
  98. --disable-optimizations \
  99. --disable-stripping \
  100. --enable-shared \
  101. --enable-static \
  102. --enable-gpl \
  103. --enable-swscale \
  104. --enable-postproc \
  105. ${CONFIGURE_CPU_OPTS}
  106. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_AAC),y)
  107. CONFIGURE_ARGS+= --enable-nonfree --enable-libfaac
  108. endif
  109. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
  110. CONFIGURE_ARGS+= --enable-libmp3lame
  111. endif
  112. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
  113. CONFIGURE_ARGS+= --enable-libvpx
  114. endif
  115. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
  116. CONFIGURE_ARGS+= --enable-libtheora
  117. endif
  118. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
  119. CONFIGURE_ARGS+= --enable-libxvid
  120. endif
  121. ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
  122. CONFIGURE_ARGS+= --enable-libvorbis
  123. endif
  124. libffmpeg-install:
  125. ${INSTALL_DIR} ${IDIR_LIBFFMPEG}/usr/lib
  126. ${CP} ${WRKINST}/usr/lib/libavdevice.so* ${IDIR_LIBFFMPEG}/usr/lib
  127. ${CP} ${WRKINST}/usr/lib/libavformat.so* ${IDIR_LIBFFMPEG}/usr/lib
  128. ${CP} ${WRKINST}/usr/lib/libavfilter.so* ${IDIR_LIBFFMPEG}/usr/lib
  129. ${CP} ${WRKINST}/usr/lib/libavcodec.so* ${IDIR_LIBFFMPEG}/usr/lib
  130. ${CP} ${WRKINST}/usr/lib/libavutil.so* ${IDIR_LIBFFMPEG}/usr/lib
  131. ${CP} ${WRKINST}/usr/lib/libpostproc.so* ${IDIR_LIBFFMPEG}/usr/lib
  132. ${CP} ${WRKINST}/usr/lib/libswscale.so* ${IDIR_LIBFFMPEG}/usr/lib
  133. ffplay-install:
  134. ${INSTALL_DIR} ${IDIR_FFPLAY}/usr/bin
  135. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffplay ${IDIR_FFPLAY}/usr/bin
  136. ffmpeg-install:
  137. ${INSTALL_DIR} ${IDIR_FFMPEG}/usr/bin
  138. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffmpeg ${IDIR_FFMPEG}/usr/bin
  139. ffserver-install:
  140. ${INSTALL_DIR} ${IDIR_FFSERVER}/etc
  141. $(INSTALL_DATA) $(WRKBUILD)/doc/ffserver.conf ${IDIR_FFSERVER}/etc
  142. ${INSTALL_DIR} ${IDIR_FFSERVER}/usr/bin
  143. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffserver ${IDIR_FFSERVER}/usr/bin
  144. ffprobe-install:
  145. ${INSTALL_DIR} ${IDIR_FFPROBE}/usr/bin
  146. ${INSTALL_BIN} ${WRKINST}/usr/bin/ffprobe ${IDIR_FFPROBE}/usr/bin
  147. include ${TOPDIR}/mk/pkg-bottom.mk