diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2013-10-09 23:46:54 +0200 |
|---|---|---|
| committer | Stephen Sinclair <sinclair@music.mcgill.ca> | 2013-10-10 01:08:39 +0200 |
| commit | 8cd04dd6b77f05fe0f032959dfefda58b2ce38ae (patch) | |
| tree | 05ea4287636967811199897e9f6b23fedd87f946 /configure.ac | |
| parent | 45906f9f72aaf6578431e68a06a0cdb0bf6ccec8 (diff) | |
Version 3.0
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 909cf95..0ad7b37 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,14 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(RtAudio, 2.1, gary@ccrma.stanford.edu, rtaudio) +AC_INIT(RtAudio, 3.0, gary@ccrma.stanford.edu, rtaudio) AC_CONFIG_SRCDIR(RtAudio.cpp) AC_CONFIG_FILES(tests/Makefile) +# Fill GXX with something before test. +AC_SUBST( GXX, ["no"] ) + # Checks for programs. AC_PROG_CC -AC_PROG_CXX(CC g++ c++ cxx) +AC_PROG_CXX(g++ CC c++ cxx) # Checks for libraries. AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!)) @@ -25,7 +28,7 @@ AC_ARG_ENABLE(debug, [AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)]) # Check compiler and use -Wall if gnu. -if test $GXX = "yes" ; then +if [test $GXX = "yes" ;] then AC_SUBST( warn, [-Wall] ) fi @@ -34,15 +37,39 @@ AC_CANONICAL_HOST AC_MSG_CHECKING(for audio API) case $host in *-*-linux*) - 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)]) + AC_SUBST( sound_api, [_NO_API_] ) + AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_JACK__] ) AC_MSG_RESULT(using JACK)], ) + if [test $sound_api = -D__LINUX_JACK__;] then + TEMP_LIBS=$LIBS + AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!)) + AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!)) + LIBS="`pkg-config --cflags --libs jack` $TEMP_LIBS -lasound" + audio_apis="-D__LINUX_JACK__" + fi - if test $sound_api = -D__LINUX_ALSA__; then + # Look for Alsa flag + 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)], ) + if [test $sound_api = -D__LINUX_ALSA__;] then AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!)) + audio_apis="-D__LINUX_ALSA__ $audio_apis" + fi + + # Look for OSS flag + AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)], ) + if test $sound_api = -D__LINUX_OSS__; then + audio_apis="-D__LINUX_OSS__ $audio_apis" + fi + + # If no audio api flags specified, use OSS + if [test $sound_api = _NO_API_;] then + AC_SUBST( sound_api, [-D__LINUX_OSS__] ) + AC_MSG_RESULT(using OSS) + AC_SUBST( audio_apis, [-D__LINUX_OSS__] ) fi ;; *-sgi*) - AC_SUBST( sound_api, [-D__IRIX_AL__] ) + AC_SUBST( audio_apis, ["-D__IRIX_AL__ -LANG:std -w"] ) AC_MSG_RESULT(using IRIX AL) AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) ) ;; @@ -50,7 +77,7 @@ case $host in *-apple*) # Check for CoreAudio framework AC_CHECK_HEADER(CoreAudio/CoreAudio.h, - [AC_SUBST( sound_api, [-D__MACOSX_CORE__] )], + [AC_SUBST( audio_apis, [-D__MACOSX_CORE__] )], [AC_MSG_ERROR(CoreAudio header files not found!)] ) AC_SUBST( frameworks, ["-framework CoreAudio"] ) AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(RtAudio requires the C++ library!) ) |
