configure.ac 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. AC_INIT([audiowmark], [0.4.2])
  2. AC_CONFIG_SRCDIR([src/audiowmark.cc])
  3. AC_CONFIG_AUX_DIR([build-aux])
  4. AC_CONFIG_MACRO_DIR([m4])
  5. AC_CONFIG_HEADER([config.h])
  6. AM_INIT_AUTOMAKE([foreign])
  7. AC_PROG_CXX
  8. AC_PROG_LIBTOOL
  9. dnl
  10. dnl sndfile
  11. dnl
  12. AC_DEFUN([AC_SNDFILE_REQUIREMENTS],
  13. [
  14. PKG_CHECK_MODULES(SNDFILE, [sndfile])
  15. AC_SUBST(SNDFILE_CFLAGS)
  16. AC_SUBST(SNDFILE_LIBS)
  17. ])
  18. dnl
  19. dnl libmpg123
  20. dnl
  21. AC_DEFUN([AC_LIBMPG123_REQUIREMENTS],
  22. [
  23. PKG_CHECK_MODULES(LIBMPG123, [libmpg123])
  24. AC_SUBST(LIBMPG123_CFLAGS)
  25. AC_SUBST(LIBMPG123_LIBS)
  26. ])
  27. dnl
  28. dnl zita resampler
  29. dnl
  30. AC_DEFUN([AC_ZITA_REQUIREMENTS],
  31. [
  32. AC_CHECK_LIB(zita-resampler, _Z28zita_resampler_major_versionv,[],
  33. [
  34. AC_MSG_ERROR([You need to install libzita-resampler to build this package.])
  35. ]
  36. )
  37. ])
  38. dnl ffmpeg stuff
  39. AC_DEFUN([AC_FFMPEG_REQUIREMENTS],
  40. [
  41. PKG_CHECK_MODULES(FFMPEG, libavcodec libavformat libavutil libswresample)
  42. ])
  43. dnl FFTW3
  44. AC_DEFUN([AC_FFTW_CHECK],
  45. [
  46. dnl this used to be optional, but is currently required
  47. PKG_CHECK_MODULES(FFTW, [fftw3f])
  48. SPECTMORPH_HAVE_FFTW=1
  49. if test $SPECTMORPH_HAVE_FFTW -gt 0; then
  50. fftw_save_CFLAGS="$CFLAGS"
  51. CFLAGS="$CFLAGS $FFTW_CFLAGS"
  52. AC_MSG_CHECKING([whether FFTW is recent enough])
  53. AC_COMPILE_IFELSE([
  54. AC_LANG_SOURCE([
  55. #include "fftw3.h"
  56. int x = FFTW_WISDOM_ONLY;
  57. ])
  58. ],[
  59. AC_MSG_RESULT([yes])
  60. ],[
  61. AC_MSG_RESULT([no])
  62. SPECTMORPH_HAVE_FFTW=0
  63. ])
  64. fi
  65. CFLAGS="$fftw_save_CFLAGS"
  66. AC_DEFINE_UNQUOTED(SPECTMORPH_HAVE_FFTW, $SPECTMORPH_HAVE_FFTW, [Whether libfftw3 is available])
  67. ])
  68. AC_SNDFILE_REQUIREMENTS
  69. AC_LIBMPG123_REQUIREMENTS
  70. AC_FFMPEG_REQUIREMENTS
  71. AC_ZITA_REQUIREMENTS
  72. AC_FFTW_CHECK
  73. AM_PATH_LIBGCRYPT
  74. # need c++14 mode
  75. AX_CXX_COMPILE_STDCXX_14(ext)
  76. # use -Wall
  77. AC_LANG_PUSH([C++])
  78. AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
  79. AC_LANG_POP([C++])
  80. AC_CONFIG_FILES([Makefile src/Makefile])
  81. AC_OUTPUT