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.

69 lines
2.2KB

  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT(RtAudio, 2.1, gary@ccrma.stanford.edu, rtaudio)
  3. AC_CONFIG_SRCDIR(RtAudio.cpp)
  4. AC_CONFIG_FILES(tests/Makefile)
  5. # Checks for programs.
  6. AC_PROG_CC
  7. AC_PROG_CXX(CC g++ c++ cxx)
  8. # Checks for libraries.
  9. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
  10. # Checks for header files.
  11. AC_HEADER_STDC
  12. AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
  13. # Checks for typedefs, structures, and compiler characteristics.
  14. AC_C_CONST
  15. # Check for debug
  16. AC_MSG_CHECKING(whether to compile debug version)
  17. AC_ARG_ENABLE(debug,
  18. [ --enable-debug = enable various debug output],
  19. [AC_SUBST( debug, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cflags, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
  20. [AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
  21. # Check compiler and use -Wall if gnu.
  22. if test $GXX = "yes" ; then
  23. AC_SUBST( warn, [-Wall] )
  24. fi
  25. # Checks for package options and external software
  26. AC_CANONICAL_HOST
  27. AC_MSG_CHECKING(for audio API)
  28. case $host in
  29. *-*-linux*)
  30. AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_ALSA__] ) AC_MSG_RESULT(using ALSA) ], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)])
  31. if test $sound_api = -D__LINUX_ALSA__; then
  32. AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
  33. fi
  34. ;;
  35. *-sgi*)
  36. AC_SUBST( sound_api, [-D__IRIX_AL__] )
  37. AC_MSG_RESULT(using IRIX AL)
  38. AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) )
  39. ;;
  40. *-apple*)
  41. # Check for CoreAudio framework
  42. AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
  43. [AC_SUBST( sound_api, [-D__MACOSX_CORE__] )],
  44. [AC_MSG_ERROR(CoreAudio header files not found!)] )
  45. AC_SUBST( frameworks, ["-framework CoreAudio"] )
  46. AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(RtAudio requires the C++ library!) )
  47. ;;
  48. *)
  49. # Default case for unknown realtime systems.
  50. AC_MSG_ERROR(Unknown system type for realtime support!)
  51. ;;
  52. esac
  53. # Checks for library functions.
  54. AC_PROG_GCC_TRADITIONAL
  55. AC_OUTPUT