configure.ac 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT(RtMidi, 1.0, gary@music.mcgill.ca, rtmidi)
  3. AC_CONFIG_SRCDIR(RtMidi.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 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__RTMIDI_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 MIDI API)
  28. case $host in
  29. *-*-linux*)
  30. AC_SUBST( midi_api, [_D__LINUX_ALSA__] )
  31. AC_CHECK_LIB(asound, snd_seq_open, , AC_MSG_ERROR(RtMidi in Linux requires the ALSA asound library!))
  32. # Checks for pthread library.
  33. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtMidi requires the pthread library!))
  34. ;;
  35. *-sgi*)
  36. AC_SUBST( midi_api, ["-D__IRIX_MD__ -LANG:std -w"] )
  37. AC_MSG_RESULT(using IRIX MD)
  38. AC_CHECK_LIB(md, mdInit, , AC_MSG_ERROR(IRIX MIDI support requires the md library!) )
  39. # Checks for pthread library.
  40. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtMidi requires the pthread library!))
  41. ;;
  42. *-apple*)
  43. # Check for CoreAudio framework
  44. AC_CHECK_HEADER(CoreMIDI/CoreMIDI.h, [AC_SUBST( midi_api, [-D__MACOSX_CORE__] )], [AC_MSG_ERROR(CoreMIDI header files not found!)] )
  45. AC_SUBST( frameworks, ["-framework CoreMIDI -framework CoreFoundation -framework CoreAudio"] )
  46. ;;
  47. *)
  48. # Default case for unknown realtime systems.
  49. AC_MSG_ERROR(Unknown system type for MIDI support!)
  50. ;;
  51. esac
  52. # Checks for library functions.
  53. AC_PROG_GCC_TRADITIONAL
  54. AC_OUTPUT