Audio plugin host https://kx.studio/carla
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.

configure.ac 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT(RtAudio, 4.0, gary@music.mcgill.ca, rtaudio)
  3. AC_CONFIG_AUX_DIR(config)
  4. AC_CONFIG_SRCDIR(RtAudio.cpp)
  5. AC_CONFIG_FILES([rtaudio-config Makefile tests/Makefile])
  6. # Fill GXX with something before test.
  7. AC_SUBST( GXX, ["no"] )
  8. # Checks for programs.
  9. AC_PROG_CXX(g++ CC c++ cxx)
  10. AC_PROG_RANLIB
  11. AC_PATH_PROG(AR, ar, no)
  12. if [[ $AR = "no" ]] ; then
  13. AC_MSG_ERROR("Could not find ar - needed to create a library");
  14. fi
  15. # Checks for header files.
  16. AC_HEADER_STDC
  17. AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
  18. # Check for debug
  19. AC_MSG_CHECKING(whether to compile debug version)
  20. AC_ARG_ENABLE(debug,
  21. [ --enable-debug = enable various debug output],
  22. [AC_SUBST( cppflag, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cxxflag, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
  23. [AC_SUBST( cppflag, [] ) AC_SUBST( cxxflag, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
  24. # Checks for functions
  25. AC_CHECK_FUNC(gettimeofday, [cppflag="$cppflag -DHAVE_GETTIMEOFDAY"], )
  26. # For -I and -D flags
  27. CPPFLAGS="$CPPFLAGS $cppflag"
  28. # For debugging and optimization ... overwrite default because it has both -g and -O2
  29. #CXXFLAGS="$CXXFLAGS $cxxflag"
  30. CXXFLAGS="$cxxflag"
  31. # Check compiler and use -Wall if gnu.
  32. if [test $GXX = "yes" ;] then
  33. AC_SUBST( cxxflag, [-Wall] )
  34. fi
  35. CXXFLAGS="$CXXFLAGS $cxxflag"
  36. AC_CANONICAL_HOST
  37. AC_SUBST( sharedlib, ["librtaudio.so"] )
  38. AC_SUBST( sharedname, ["librtaudio.so.\$(RELEASE)"] )
  39. AC_SUBST( libflags, ["-shared -Wl,-soname,\$(SHARED).\$(MAJOR) -o \$(SHARED).\$(RELEASE)"] )
  40. case $host in
  41. *-apple*)
  42. AC_SUBST( sharedlib, ["librtaudio.dylib"] )
  43. AC_SUBST( sharedname, ["librtaudio.\$(RELEASE).dylib"] )
  44. AC_SUBST( libflags, ["-dynamiclib -o librtaudio.\$(RELEASE).dylib"] )
  45. esac
  46. # Checks for package options and external software
  47. AC_SUBST( api, [""] )
  48. AC_MSG_CHECKING(for audio API)
  49. case $host in
  50. *-*-netbsd*)
  51. AC_MSG_RESULT(using OSS)
  52. api="$api -D__LINUX_OSS__"
  53. LIBS="$LIBS -lossaudio"
  54. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
  55. ;;
  56. *-*-linux*)
  57. AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)], [
  58. api="$api -D__UNIX_JACK__"
  59. AC_MSG_RESULT(using JACK)
  60. AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))
  61. AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))], )
  62. # Look for ALSA flag
  63. AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [
  64. api="$api -D__LINUX_ALSA__"
  65. AC_MSG_RESULT(using ALSA)
  66. AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], )
  67. # Look for PULSE flag
  68. AC_ARG_WITH(pulse, [ --with-pulse = choose PulseAudio API support (linux only)], [
  69. api="$api -D__LINUX_PULSE__"
  70. AC_MSG_RESULT(using PulseAudio)
  71. AC_CHECK_LIB(pulse-simple, pa_simple_new, , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!))], )
  72. # Look for OSS flag
  73. AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [
  74. api="$api -D__LINUX_OSS__"
  75. AC_MSG_RESULT(using OSS)], )
  76. # If no audio api flags specified, use ALSA
  77. if [test "$api" == "";] then
  78. AC_MSG_RESULT(using ALSA)
  79. AC_SUBST( api, [-D__LINUX_ALSA__] )
  80. AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
  81. fi
  82. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
  83. ;;
  84. *-apple*)
  85. AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (unix only)], [
  86. api="$api -D__UNIX_JACK__"
  87. AC_MSG_RESULT(using JACK)
  88. AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], )
  89. # AC_CHECK_HEADER(jack/jack.h, [], [AC_MSG_ERROR(Jack header file not found!)] )
  90. # LIBS="$LIBS -framework jackmp" ], )
  91. # Look for Core flag
  92. AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)], [
  93. api="$api -D__MACOSX_CORE__"
  94. AC_MSG_RESULT(using CoreAudio)
  95. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR(CoreAudio header files not found!)] )
  96. LIBS="$LIBS -framework CoreAudio -framework CoreFoundation" ], )
  97. # If no audio api flags specified, use CoreAudio
  98. if [test "$api" == ""; ] then
  99. AC_SUBST( api, [-D__MACOSX_CORE__] )
  100. AC_MSG_RESULT(using CoreAudio)
  101. AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
  102. [],
  103. [AC_MSG_ERROR(CoreAudio header files not found!)] )
  104. AC_SUBST( LIBS, ["-framework CoreAudio -framework CoreFoundation"] )
  105. fi
  106. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
  107. ;;
  108. *-mingw32*)
  109. AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)], [
  110. api="$api -D__WINDOWS_ASIO__"
  111. AC_MSG_RESULT(using ASIO)
  112. AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ], )
  113. # Look for DirectSound flag
  114. AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)], [
  115. api="$api -D__WINDOWS_DS__"
  116. AC_MSG_RESULT(using DirectSound)
  117. LIBS="-ldsound -lwinmm $LIBS" ], )
  118. # If no audio api flags specified, use DirectSound
  119. if [test "$api" == "";] then
  120. AC_SUBST( api, [-D__WINDOWS_DS__] )
  121. AC_MSG_RESULT(using DirectSound)
  122. LIBS="-ldsound -lwinmm $LIBS"
  123. fi
  124. LIBS="-lole32 $LIBS"
  125. ;;
  126. *)
  127. # Default case for unknown realtime systems.
  128. AC_MSG_ERROR(Unknown system type for realtime support!)
  129. ;;
  130. esac
  131. CPPFLAGS="$CPPFLAGS $api"
  132. AC_OUTPUT
  133. chmod oug+x rtaudio-config