ffmpeg.mk 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #############################################################
  2. #
  3. # ffmpeg
  4. #
  5. #############################################################
  6. FFMPEG_VERSION := 0.5.2
  7. FFMPEG_SOURCE := ffmpeg-$(FFMPEG_VERSION).tar.bz2
  8. FFMPEG_SITE := http://ffmpeg.org/releases
  9. FFMPEG_INSTALL_STAGING = YES
  10. FFMPEG_INSTALL_TARGET = YES
  11. FFMPEG_CONF_OPT = \
  12. --prefix=/usr \
  13. --enable-shared \
  14. --disable-avfilter \
  15. --disable-vhook \
  16. ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
  17. FFMPEG_CONF_OPT += --enable-gpl
  18. else
  19. FFMPEG_CONF_OPT += --disable-gpl
  20. endif
  21. ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
  22. FFMPEG_CONF_OPT += --enable-nonfree
  23. else
  24. FFMPEG_CONF_OPT += --disable-nonfree
  25. endif
  26. ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
  27. FFMPEG_CONF_OPT += --enable-ffmpeg
  28. else
  29. FFMPEG_CONF_OPT += --disable-ffmpeg
  30. endif
  31. ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
  32. FFMPEG_DEPENDENCIES += sdl
  33. FFMPEG_CONF_OPT += --enable-ffplay
  34. FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config
  35. else
  36. FFMPEG_CONF_OPT += --disable-ffplay
  37. endif
  38. ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
  39. FFMPEG_CONF_OPT += --enable-ffserver
  40. else
  41. FFMPEG_CONF_OPT += --disable-ffserver
  42. endif
  43. ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
  44. FFMPEG_CONF_OPT += --enable-postproc
  45. else
  46. FFMPEG_CONF_OPT += --disable-postproc
  47. endif
  48. ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
  49. FFMPEG_CONF_OPT += --enable-swscale
  50. else
  51. FFMPEG_CONF_OPT += --disable-swscale
  52. endif
  53. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
  54. FFMPEG_CONF_OPT += --disable-encoders \
  55. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
  56. endif
  57. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
  58. FFMPEG_CONF_OPT += --disable-decoders \
  59. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
  60. endif
  61. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
  62. FFMPEG_CONF_OPT += --disable-muxers \
  63. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
  64. endif
  65. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
  66. FFMPEG_CONF_OPT += --disable-demuxers \
  67. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
  68. endif
  69. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
  70. FFMPEG_CONF_OPT += --disable-parsers \
  71. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
  72. endif
  73. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
  74. FFMPEG_CONF_OPT += --disable-bsfs \
  75. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsf=$(x))
  76. endif
  77. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
  78. FFMPEG_CONF_OPT += --disable-protocols \
  79. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
  80. endif
  81. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
  82. FFMPEG_CONF_OPT += --disable-filters \
  83. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
  84. endif
  85. ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
  86. FFMPEG_CONF_OPT += --enable-indevs
  87. else
  88. FFMPEG_CONF_OPT += --disable-indevs
  89. endif
  90. ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
  91. FFMPEG_CONF_OPT += --enable-outdevs
  92. else
  93. FFMPEG_CONF_OPT += --disable-outdevs
  94. endif
  95. ifeq ($(BR2_PTHREADS_NONE),y)
  96. FFMPEG_CONF_OPT += --disable-pthreads
  97. else
  98. FFMPEG_CONF_OPT += --enable-pthreads
  99. endif
  100. ifeq ($(BR2_PACKAGE_ZLIB),y)
  101. FFMPEG_CONF_OPT += --enable-zlib
  102. FFMPEG_DEPENDENCIES += zlib
  103. else
  104. FFMPEG_CONF_OPT += --disable-zlib
  105. endif
  106. FFMPEG_CONF_OPT += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
  107. # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
  108. define FFMPEG_CONFIGURE_CMDS
  109. (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
  110. $(TARGET_CONFIGURE_OPTS) \
  111. $(TARGET_CONFIGURE_ARGS) \
  112. $(FFMPEG_CONF_ENV) \
  113. ./configure \
  114. --enable-cross-compile \
  115. --cross-prefix=$(TARGET_CROSS) \
  116. --sysroot=$(STAGING_DIR) \
  117. --host-cc=$(HOSTCC) \
  118. --arch=$(BR2_ARCH) \
  119. --extra-cflags=-fPIC \
  120. $(DISABLE_IPV6) \
  121. $(FFMPEG_CONF_OPT) \
  122. )
  123. endef
  124. $(eval $(call AUTOTARGETS,package/multimedia,ffmpeg))