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.

139 lines
4.6KB

  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT(RtMidi, 2.0, gary@music.mcgill.ca, rtmidi)
  3. AC_CONFIG_AUX_DIR(config)
  4. AC_CONFIG_SRCDIR(RtMidi.cpp)
  5. AC_CONFIG_FILES(rtmidi-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__RTMIDI_DEBUG__] ) AC_SUBST( cxxflag, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
  23. [AC_SUBST( cppflag, [] ) AC_SUBST( cxxflag, [-O3] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
  24. # For -I and -D flags
  25. CPPFLAGS="$CPPFLAGS $cppflag"
  26. # For debugging and optimization ... overwrite default because it has both -g and -O2
  27. #CXXFLAGS="$CXXFLAGS $cxxflag"
  28. CXXFLAGS="$cxxflag"
  29. # Check compiler and use -Wall if gnu.
  30. if [test $GXX = "yes" ;] then
  31. AC_SUBST( cxxflag, [-Wall] )
  32. fi
  33. CXXFLAGS="$CXXFLAGS $cxxflag"
  34. # Checks for package options and external software
  35. AC_CANONICAL_HOST
  36. AC_SUBST( sharedlib, ["librtmidi.so"] )
  37. AC_SUBST( sharedname, ["librtmidi.so.\$(RELEASE)"] )
  38. AC_SUBST( libflags, ["-shared -Wl,-soname,\$(SHARED).\$(MAJOR) -o \$(SHARED).\$(RELEASE)"] )
  39. case $host in
  40. *-apple*)
  41. AC_SUBST( sharedlib, ["librtmidi.dylib"] )
  42. AC_SUBST( sharedname, ["librtmidi.\$(RELEASE).dylib"] )
  43. AC_SUBST( libflags, ["-dynamiclib -o librtmidi.\$(RELEASE).dylib"] )
  44. esac
  45. AC_SUBST( api, [""] )
  46. AC_MSG_CHECKING(for MIDI API)
  47. case $host in
  48. *-*-linux*)
  49. AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)], [
  50. api="$api -D__UNIX_JACK__"
  51. AC_MSG_RESULT(using JACK)
  52. AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], )
  53. # Look for ALSA flag
  54. AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA sequencer API support (linux only)], [
  55. api="$api -D__LINUX_ALSA__"
  56. AC_MSG_RESULT(using ALSA)
  57. AC_CHECK_LIB(asound, snd_seq_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], )
  58. if [test "$api" == "";] then
  59. AC_MSG_RESULT(using ALSA)
  60. AC_SUBST( api, [-D__LINUX_ALSA__] )
  61. AC_CHECK_LIB(asound, snd_seq_open, , AC_MSG_ERROR(ALSA sequencer support requires the asound library!))
  62. fi
  63. # Checks for pthread library.
  64. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtMidi requires the pthread library!))
  65. ;;
  66. *-apple*)
  67. AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)], [
  68. api="$api -D__UNIX_JACK__"
  69. AC_MSG_RESULT(using JACK)
  70. AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], )
  71. # Look for Core flag
  72. AC_ARG_WITH(core, [ --with-core = choose CoreMidi API support (mac only)], [
  73. api="$api -D__MACOSX_CORE__"
  74. AC_MSG_RESULT(using CoreMidi)
  75. AC_CHECK_HEADER(CoreMIDI/CoreMIDI.h, [], [AC_MSG_ERROR(CoreMIDI header files not found!)] )
  76. LIBS="$LIBS -framework CoreMIDI -framework CoreFoundation -framework CoreAudio" ], )
  77. # If no api flags specified, use CoreMidi
  78. if [test "$api" == ""; ] then
  79. AC_SUBST( api, [-D__MACOSX_CORE__] )
  80. AC_MSG_RESULT(using CoreMidi)
  81. AC_CHECK_HEADER(CoreMIDI/CoreMIDI.h,
  82. [],
  83. [AC_MSG_ERROR(CoreMIDI header files not found!)] )
  84. AC_SUBST( LIBS, ["-framework CoreMIDI -framework CoreFoundation -framework CoreAudio"] )
  85. fi
  86. ;;
  87. *-mingw32*)
  88. # Look for WinMM flag
  89. AC_ARG_WITH(winmm, [ --with-winmm = choose Windows MultiMedia (MM) API support (windoze only)], [
  90. api="$api -D__WINDOWS_MM__"
  91. AC_MSG_RESULT(using WinMM)
  92. AC_SUBST( LIBS, [-lwinmm] )], )
  93. AC_ARG_WITH(winks, [ --with-winks = choose kernel streaming support (windoze only)], [
  94. api="$api -D__WINDOWS_KS__"
  95. AC_SUBST( LIBS, ["-lsetupapi -lksuser"] )
  96. AC_MSG_RESULT(using kernel streaming) ], )
  97. # I can't get the following check to work so just manually add the library
  98. # or could try the following? AC_LIB_WINMM([midiOutGetNumDevs])
  99. # AC_CHECK_LIB(winmm, midiInGetNumDevs, , AC_MSG_ERROR(Windows MIDI support requires the winmm library!) )],)
  100. # If no api flags specified, use WinMM
  101. if [test "$api" == "";] then
  102. AC_SUBST( api, [-D__WINDOWS_MM__] )
  103. AC_MSG_RESULT(using WinMM)
  104. AC_SUBST( LIBS, [-lwinmm] )
  105. fi
  106. ;;
  107. *)
  108. # Default case for unknown realtime systems.
  109. AC_MSG_ERROR(Unknown system type for MIDI support!)
  110. ;;
  111. esac
  112. CPPFLAGS="$CPPFLAGS $api"
  113. AC_OUTPUT
  114. chmod oug+x rtmidi-config