You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 line
2.0 KiB

  1. dnl
  2. dnl Lol Engine
  3. dnl
  4. dnl Copyright © 2010—2017 Sam Hocevar <sam@hocevar.net>
  5. dnl
  6. dnl Lol Engine is free software. It comes without any warranty, to
  7. dnl the extent permitted by applicable law. You can redistribute it
  8. dnl and/or modify it under the terms of the Do What the Fuck You Want
  9. dnl to Public License, Version 2, as published by the WTFPL Task Force.
  10. dnl See http://www.wtfpl.net/ for more details.
  11. dnl
  12. # LOL_AC_CHECK_FFMPEG()
  13. # ---------------------
  14. AC_DEFUN([LOL_AC_CHECK_FFMPEG],
  15. [
  16. ac_cv_my_have_ffmpeg="no"
  17. if test "${enable_ffmpeg}" != "no"; then
  18. LOL_AC_CHECK_FFMPEG_INNER()
  19. fi
  20. AM_CONDITIONAL(LOL_USE_FFMPEG, test "${ac_cv_my_have_ffmpeg}" != "no")
  21. ])
  22. # LOL_AC_CHECK_FFMPEG_INNER()
  23. # ---------------------------
  24. AC_DEFUN([LOL_AC_CHECK_FFMPEG_INNER],
  25. [
  26. ac_cv_my_have_ffmpeg="yes"
  27. PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec], [:], [ac_cv_my_have_ffmpeg=no])
  28. PKG_CHECK_MODULES([LIBAVUTIL], [libavutil], [:], [ac_cv_my_have_ffmpeg=no])
  29. PKG_CHECK_MODULES([LIBAVFORMAT], [libavformat], [:], [ac_cv_my_have_ffmpeg=no])
  30. PKG_CHECK_MODULES([LIBSWSCALE], [libswscale], [:], [ac_cv_my_have_ffmpeg=no])
  31. if test "${ac_cv_my_have_ffmpeg}" != "yes"; then
  32. ac_cv_my_have_ffmpeg="yes"
  33. AC_CHECK_HEADERS(libavcodec/avcodec.h, [:], [ac_cv_my_have_ffmpeg=no])
  34. AC_CHECK_HEADERS(libavformat/avformat.h, [:], [ac_cv_my_have_ffmpeg=no])
  35. AC_CHECK_HEADERS(libswscale/swscale.h, [:], [ac_cv_my_have_ffmpeg=no])
  36. if test "${ac_cv_my_have_ffmpeg}" = "yes"; then
  37. LIBAVCODEC_LIBS="-lavcodec"
  38. LIBAVUTIL_LIBS="-lavutil"
  39. LIBAVFORMAT_LIBS="-lavformat"
  40. LIBSWSCALE_LIBS="-lswscale"
  41. AC_CHECK_LIB(ws2_32, main, LOL_LIBS="${LOL_LIBS} -lws2_32")
  42. fi
  43. fi
  44. if test "${ac_cv_my_have_ffmpeg}" = "yes"; then
  45. AC_DEFINE(LOL_USE_FFMPEG, 1, Define to 1 to use FFmpeg)
  46. LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVUTIL_CFLAGS} ${LIBAVCODEC_CFLAGS} ${LIBSWSCALE_CFLAGS}"
  47. LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVUTIL_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}"
  48. fi
  49. ]) # LOL_AC_CHECK_FFMPEG_INNER