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)
8 AC_PROG_CXX(CC g++ c++ cxx)
10 # Checks for libraries.
11 AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
13 # Checks for header files.
15 AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
17 # Checks for typedefs, structures, and compiler characteristics.
21 AC_MSG_CHECKING(whether to compile debug version)
23 [ --enable-debug = enable various debug output],
24 [AC_SUBST( debug, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cflags, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
25 [AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
27 # Check compiler and use -Wall if gnu.
28 if test $GXX = "yes" ; then
29 AC_SUBST( warn, [-Wall] )
32 # Checks for package options and external software
34 AC_MSG_CHECKING(for audio API)
37 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)])
39 if test $sound_api = -D__LINUX_ALSA__; then
40 AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
45 AC_SUBST( sound_api, [-D__IRIX_AL__] )
46 AC_MSG_RESULT(using IRIX AL)
47 AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) )
51 # Check for CoreAudio framework
52 AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
53 [AC_SUBST( sound_api, [-D__MACOSX_CORE__] )],
54 [AC_MSG_ERROR(CoreAudio header files not found!)] )
55 AC_SUBST( frameworks, ["-framework CoreAudio"] )
56 AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(RtAudio requires the C++ library!) )
60 # Default case for unknown realtime systems.
61 AC_MSG_ERROR(Unknown system type for realtime support!)
65 # Checks for library functions.
66 AC_PROG_GCC_TRADITIONAL