configure.ac 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 FFTW3
  19. AC_DEFUN([AC_FFTW_CHECK],
  20. [
  21. dnl this used to be optional, but is currently required
  22. PKG_CHECK_MODULES(FFTW, [fftw3f])
  23. SPECTMORPH_HAVE_FFTW=1
  24. if test $SPECTMORPH_HAVE_FFTW -gt 0; then
  25. fftw_save_CFLAGS="$CFLAGS"
  26. CFLAGS="$CFLAGS $FFTW_CFLAGS"
  27. AC_MSG_CHECKING([whether FFTW is recent enough])
  28. AC_COMPILE_IFELSE([
  29. AC_LANG_SOURCE([
  30. #include "fftw3.h"
  31. int x = FFTW_WISDOM_ONLY;
  32. ])
  33. ],[
  34. AC_MSG_RESULT([yes])
  35. ],[
  36. AC_MSG_RESULT([no])
  37. SPECTMORPH_HAVE_FFTW=0
  38. ])
  39. fi
  40. CFLAGS="$fftw_save_CFLAGS"
  41. AC_DEFINE_UNQUOTED(SPECTMORPH_HAVE_FFTW, $SPECTMORPH_HAVE_FFTW, [Whether libfftw3 is available])
  42. ])
  43. AC_SNDFILE_REQUIREMENTS
  44. AC_FFTW_CHECK
  45. AM_PATH_LIBGCRYPT
  46. # need c++11 mode
  47. AX_CXX_COMPILE_STDCXX_11(ext)
  48. # use -Wall
  49. AC_LANG_PUSH([C++])
  50. AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
  51. AC_LANG_POP([C++])
  52. AC_CONFIG_FILES([Makefile src/Makefile])
  53. AC_OUTPUT