configure.in
changeset 2271 60b4c52a7906
parent 2264 f7f80b822c1f
child 2290 323a5af2924b
     1.1 --- a/configure.in	Sun Aug 19 16:36:51 2007 +0000
     1.2 +++ b/configure.in	Mon Aug 20 01:02:37 2007 +0000
     1.3 @@ -644,6 +644,63 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl Find PulseAudio
     1.8 +CheckPulseAudio()
     1.9 +{
    1.10 +    AC_ARG_ENABLE(pulseaudio,
    1.11 +AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
    1.12 +                  , enable_pulseaudio=yes)
    1.13 +    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
    1.14 +        audio_pulseaudio=no
    1.15 +
    1.16 +        PULSEAUDIO_REQUIRED_VERSION=0.9
    1.17 +
    1.18 +        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    1.19 +        AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
    1.20 +        if test x$PKG_CONFIG != xno; then
    1.21 +        if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
    1.22 +                PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
    1.23 +                PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
    1.24 +                audio_pulseaudio=yes
    1.25 +        fi
    1.26 +        fi
    1.27 +        AC_MSG_RESULT($audio_pulseaudio)
    1.28 +
    1.29 +        if test x$audio_pulseaudio = xyes; then
    1.30 +            AC_ARG_ENABLE(pulseaudio-shared,
    1.31 +AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
    1.32 +                          , enable_pulseaudio_shared=yes)
    1.33 +            if test "x`echo $PULSEAUDIO_LIBS | grep -- -L`" = "x"; then
    1.34 +                if test "x`ls /lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
    1.35 +                    PULSEAUDIO_LIBS="-L/lib $PULSEAUDIO_LIBS"
    1.36 +                elif test "x`ls /usr/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
    1.37 +                    PULSEAUDIO_LIBS="-L/usr/lib $PULSEAUDIO_LIBS"
    1.38 +                elif test "x`ls /usr/local/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
    1.39 +                    PULSEAUDIO_LIBS="-L/usr/local/lib $PULSEAUDIO_LIBS"
    1.40 +                fi
    1.41 +            fi
    1.42 +            pulseaudio_lib_spec=`echo $PULSEAUDIO_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libpulse-simple.so.*/'`
    1.43 +            pulseaudio_lib=`ls -- $pulseaudio_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
    1.44 +            echo "-- $pulseaudio_lib_spec -> $pulseaudio_lib"
    1.45 +
    1.46 +            AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO)
    1.47 +            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
    1.48 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
    1.49 +            if test x$have_loadso != xyes && \
    1.50 +               test x$enable_pulseaudio_shared = xyes; then
    1.51 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
    1.52 +            fi
    1.53 +            if test x$have_loadso = xyes && \
    1.54 +               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
    1.55 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib")
    1.56 +            else
    1.57 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
    1.58 +            fi
    1.59 +            have_audio=yes
    1.60 +        fi
    1.61 +    fi
    1.62 +}
    1.63 +
    1.64  CheckARTSC()
    1.65  {
    1.66      AC_ARG_ENABLE(arts,
    1.67 @@ -2065,6 +2122,7 @@
    1.68          CheckDMEDIA
    1.69          CheckMME
    1.70          CheckALSA
    1.71 +        CheckPulseAudio
    1.72          CheckARTSC
    1.73          CheckESD
    1.74          CheckNAS