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.

96 lines
3.3KB

  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT(RtAudio, 3.0, gary@ccrma.stanford.edu, rtaudio)
  3. AC_CONFIG_SRCDIR(RtAudio.cpp)
  4. AC_CONFIG_FILES(tests/Makefile)
  5. # Fill GXX with something before test.
  6. AC_SUBST( GXX, ["no"] )
  7. # Checks for programs.
  8. AC_PROG_CC
  9. AC_PROG_CXX(g++ CC c++ cxx)
  10. # Checks for libraries.
  11. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
  12. # Checks for header files.
  13. AC_HEADER_STDC
  14. AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
  15. # Checks for typedefs, structures, and compiler characteristics.
  16. AC_C_CONST
  17. # Check for debug
  18. AC_MSG_CHECKING(whether to compile debug version)
  19. AC_ARG_ENABLE(debug,
  20. [ --enable-debug = enable various debug output],
  21. [AC_SUBST( debug, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cflags, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
  22. [AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
  23. # Check compiler and use -Wall if gnu.
  24. if [test $GXX = "yes" ;] then
  25. AC_SUBST( warn, [-Wall] )
  26. fi
  27. # Checks for package options and external software
  28. AC_CANONICAL_HOST
  29. AC_MSG_CHECKING(for audio API)
  30. case $host in
  31. *-*-linux*)
  32. AC_SUBST( sound_api, [_NO_API_] )
  33. AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_JACK__] ) AC_MSG_RESULT(using JACK)], )
  34. if [test $sound_api = -D__LINUX_JACK__;] then
  35. TEMP_LIBS=$LIBS
  36. AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))
  37. AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))
  38. LIBS="`pkg-config --cflags --libs jack` $TEMP_LIBS -lasound"
  39. audio_apis="-D__LINUX_JACK__"
  40. fi
  41. # Look for Alsa flag
  42. 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)], )
  43. if [test $sound_api = -D__LINUX_ALSA__;] then
  44. AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
  45. audio_apis="-D__LINUX_ALSA__ $audio_apis"
  46. fi
  47. # Look for OSS flag
  48. AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)], )
  49. if test $sound_api = -D__LINUX_OSS__; then
  50. audio_apis="-D__LINUX_OSS__ $audio_apis"
  51. fi
  52. # If no audio api flags specified, use OSS
  53. if [test $sound_api = _NO_API_;] then
  54. AC_SUBST( sound_api, [-D__LINUX_OSS__] )
  55. AC_MSG_RESULT(using OSS)
  56. AC_SUBST( audio_apis, [-D__LINUX_OSS__] )
  57. fi
  58. ;;
  59. *-sgi*)
  60. AC_SUBST( audio_apis, ["-D__IRIX_AL__ -LANG:std -w"] )
  61. AC_MSG_RESULT(using IRIX AL)
  62. AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) )
  63. ;;
  64. *-apple*)
  65. # Check for CoreAudio framework
  66. AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
  67. [AC_SUBST( audio_apis, [-D__MACOSX_CORE__] )],
  68. [AC_MSG_ERROR(CoreAudio header files not found!)] )
  69. AC_SUBST( frameworks, ["-framework CoreAudio"] )
  70. AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(RtAudio requires the C++ library!) )
  71. ;;
  72. *)
  73. # Default case for unknown realtime systems.
  74. AC_MSG_ERROR(Unknown system type for realtime support!)
  75. ;;
  76. esac
  77. # Checks for library functions.
  78. AC_PROG_GCC_TRADITIONAL
  79. AC_OUTPUT