# HG changeset patch # User Mike Miller # Date 1380687249 14400 # Node ID 97c9ba013ed1892fe6a1bd8711ccc09366b18064 # Parent 1f551d169db2017d4a56799519d94ebe7ef924b3 configure.ac: Add --without-portaudio and --without-sndfile options * configure.ac: Add --without-portaudio and --without-sndfile options to bypass checking for audio library dependencies. diff -r 1f551d169db2 -r 97c9ba013ed1 configure.ac --- a/configure.ac Tue Oct 01 23:42:43 2013 -0400 +++ b/configure.ac Wed Oct 02 00:14:09 2013 -0400 @@ -936,56 +936,70 @@ ### Check for sndfile -SNDFILE_CPPFLAGS= -SNDFILE_LDFLAGS= -SNDFILE_LIBS= - warn_sndfile="sndfile library fails tests. The audioinfo, audioread and audiowrite functions for reading and writing audio files will not be fully functional." -PKG_CHECK_EXISTS([sndfile], [ - SNDFILE_CPPFLAGS=`$PKG_CONFIG --cflags-only-I sndfile` - SNDFILE_LDFLAGS=`$PKG_CONFIG --libs-only-L sndfile` - SNDFILE_LIBS=`$PKG_CONFIG --libs-only-l sndfile` - warn_sndfile= -]) +check_sndfile=no +AC_ARG_WITH([sndfile], + [AS_HELP_STRING([--without-sndfile], + [don't use sndfile library, disable audio file I/O])], + [if test x"$withval" = x"no"; then + warn_sndfile="--without-sndfile specified. The audioinfo, audioread and audiowrite functions for reading and writing audio files will not be fully functional." + else + check_sndfile=yes + fi], + [check_sndfile=yes]) + +if test $check_sndfile = yes; then + PKG_CHECK_EXISTS([sndfile], [ + SNDFILE_CPPFLAGS=`$PKG_CONFIG --cflags-only-I sndfile` + SNDFILE_LDFLAGS=`$PKG_CONFIG --libs-only-L sndfile` + SNDFILE_LIBS=`$PKG_CONFIG --libs-only-l sndfile` + warn_sndfile= + ]) +fi if test -z "$warn_sndfile"; then - AC_DEFINE(HAVE_SNDFILE, 1, - [Define to 1 if sndfile is available.]) + AC_DEFINE(HAVE_SNDFILE, 1, [Define to 1 if sndfile is available.]) else SNDFILE_CPPFLAGS= SNDFILE_LDFLAGS= SNDFILE_LIBS= fi - AC_SUBST(SNDFILE_CPPFLAGS) AC_SUBST(SNDFILE_LDFLAGS) AC_SUBST(SNDFILE_LIBS) ### Check for PortAudio -PORTAUDIO_CPPFLAGS= -PORTAUDIO_LDFLAGS= -PORTAUDIO_LIBS= - warn_portaudio="PortAudio library fails tests. The audioplayer, audiorecorder classes and audiodevinfo function for audio playback and recording will not be fully functional." -PKG_CHECK_EXISTS([portaudio-2.0 >= 19], [ - PORTAUDIO_CPPFLAGS=`$PKG_CONFIG --cflags-only-I portaudio-2.0` - PORTAUDIO_LDFLAGS=`$PKG_CONFIG --libs-only-L portaudio-2.0` - PORTAUDIO_LIBS=`$PKG_CONFIG --libs-only-l portaudio-2.0` - warn_portaudio= -]) +check_portaudio=no +AC_ARG_WITH([portaudio], + [AS_HELP_STRING([--without-portaudio], + [don't use PortAudio library, disable audio playback and recording])], + [if test x"$withval" = x"no"; then + warn_portaudio="--without-portaudio specified. The audioplayer, audiorecorder classes and audiodevinfo function for audio playback and recording will not be fully functional." + else + check_portaudio=yes + fi], + [check_portaudio=yes]) + +if test $check_portaudio = yes; then + PKG_CHECK_EXISTS([portaudio-2.0 >= 19], [ + PORTAUDIO_CPPFLAGS=`$PKG_CONFIG --cflags-only-I portaudio-2.0` + PORTAUDIO_LDFLAGS=`$PKG_CONFIG --libs-only-L portaudio-2.0` + PORTAUDIO_LIBS=`$PKG_CONFIG --libs-only-l portaudio-2.0` + warn_portaudio= + ]) +fi if test -z "$warn_portaudio"; then - AC_DEFINE(HAVE_PORTAUDIO, 1, - [Define to 1 if PortAudio is available.]) + AC_DEFINE(HAVE_PORTAUDIO, 1, [Define to 1 if PortAudio is available.]) else PORTAUDIO_CPPFLAGS= PORTAUDIO_LDFLAGS= PORTAUDIO_LIBS= fi - AC_SUBST(PORTAUDIO_CPPFLAGS) AC_SUBST(PORTAUDIO_LDFLAGS) AC_SUBST(PORTAUDIO_LIBS)