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)
6 # Fill GXX with something before test.
7 AC_SUBST( GXX, ["no"] )
11 AC_PROG_CXX(g++ CC c++ cxx)
13 # Checks for libraries.
14 AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
16 # Checks for header files.
18 AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
20 # Checks for typedefs, structures, and compiler characteristics.
24 AC_MSG_CHECKING(whether to compile debug version)
26 [ --enable-debug = enable various debug output],
27 [AC_SUBST( debug, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cflags, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
28 [AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
30 # Check compiler and use -Wall if gnu.
31 if [test $GXX = "yes" ;] then
32 AC_SUBST( warn, [-Wall] )
35 # Checks for package options and external software
37 AC_MSG_CHECKING(for audio API)
40 AC_SUBST( sound_api, [_NO_API_] )
41 AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_JACK__] ) AC_MSG_RESULT(using JACK)], )
42 if [test $sound_api = -D__LINUX_JACK__;] then
44 AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))
45 AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))
46 LIBS="`pkg-config --cflags --libs jack` $TEMP_LIBS -lasound"
47 audio_apis="-D__LINUX_JACK__"
51 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)], )
52 if [test $sound_api = -D__LINUX_ALSA__;] then
53 AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
54 audio_apis="-D__LINUX_ALSA__ $audio_apis"
58 AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)], )
59 if test $sound_api = -D__LINUX_OSS__; then
60 audio_apis="-D__LINUX_OSS__ $audio_apis"
63 # If no audio api flags specified, use OSS
64 if [test $sound_api = _NO_API_;] then
65 AC_SUBST( sound_api, [-D__LINUX_OSS__] )
66 AC_MSG_RESULT(using OSS)
67 AC_SUBST( audio_apis, [-D__LINUX_OSS__] )
72 AC_SUBST( audio_apis, ["-D__IRIX_AL__ -LANG:std -w"] )
73 AC_MSG_RESULT(using IRIX AL)
74 AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) )
78 # Check for CoreAudio framework
79 AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
80 [AC_SUBST( audio_apis, [-D__MACOSX_CORE__] )],
81 [AC_MSG_ERROR(CoreAudio header files not found!)] )
82 AC_SUBST( frameworks, ["-framework CoreAudio"] )
83 AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(RtAudio requires the C++ library!) )
87 # Default case for unknown realtime systems.
88 AC_MSG_ERROR(Unknown system type for realtime support!)
92 # Checks for library functions.
93 AC_PROG_GCC_TRADITIONAL