configure.ac 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. AC_INIT([audiowmark], [0.0.1])
  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 FFTW3
  28. AC_DEFUN([AC_FFTW_CHECK],
  29. [
  30. dnl this used to be optional, but is currently required
  31. PKG_CHECK_MODULES(FFTW, [fftw3f])
  32. SPECTMORPH_HAVE_FFTW=1
  33. if test $SPECTMORPH_HAVE_FFTW -gt 0; then
  34. fftw_save_CFLAGS="$CFLAGS"
  35. CFLAGS="$CFLAGS $FFTW_CFLAGS"
  36. AC_MSG_CHECKING([whether FFTW is recent enough])
  37. AC_COMPILE_IFELSE([
  38. AC_LANG_SOURCE([
  39. #include "fftw3.h"
  40. int x = FFTW_WISDOM_ONLY;
  41. ])
  42. ],[
  43. AC_MSG_RESULT([yes])
  44. ],[
  45. AC_MSG_RESULT([no])
  46. SPECTMORPH_HAVE_FFTW=0
  47. ])
  48. fi
  49. CFLAGS="$fftw_save_CFLAGS"
  50. AC_DEFINE_UNQUOTED(SPECTMORPH_HAVE_FFTW, $SPECTMORPH_HAVE_FFTW, [Whether libfftw3 is available])
  51. ])
  52. AC_SNDFILE_REQUIREMENTS
  53. AC_LIBMPG123_REQUIREMENTS
  54. AC_FFTW_CHECK
  55. AM_PATH_LIBGCRYPT
  56. # need c++11 mode
  57. AX_CXX_COMPILE_STDCXX_11(ext)
  58. # use -Wall
  59. AC_LANG_PUSH([C++])
  60. AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
  61. AC_LANG_POP([C++])
  62. AC_CONFIG_FILES([Makefile src/Makefile 3rdparty/Makefile 3rdparty/zita-resampler/Makefile])
  63. AC_OUTPUT