configure.in
branchSDL-1.2
changeset 3939 42e83d81224b
parent 3935 00959c391aa6
child 3950 9d9e15ab1697
     1.1 --- a/configure.in	Tue Apr 17 09:09:48 2007 +0000
     1.2 +++ b/configure.in	Sun May 13 23:12:46 2007 +0000
     1.3 @@ -459,6 +459,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_pulse=yes)
    1.13 +    if test x$enable_audio = xyes -a x$enable_pulse = xyes; then
    1.14 +        audio_pulse=no
    1.15 +
    1.16 +        PULSE_REQUIRED_VERSION=0.9
    1.17 +
    1.18 +        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    1.19 +        AC_MSG_CHECKING(for PulseAudio $PULSE_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 $PULSE_REQUIRED_VERSION libpulse-simple; then
    1.22 +                PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
    1.23 +                PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple`
    1.24 +                audio_pulse=yes
    1.25 +        fi
    1.26 +        fi
    1.27 +        AC_MSG_RESULT($audio_pulse)
    1.28 +
    1.29 +        if test x$audio_pulse = 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_pulse_shared=yes)
    1.33 +            if test "x`echo $PULSE_LIBS | grep -- -L`" = "x"; then
    1.34 +                if test "x`ls /lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
    1.35 +                    PULSE_LIBS="-L/lib $PULSE_LIBS"
    1.36 +                elif test "x`ls /usr/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
    1.37 +                    PULSE_LIBS="-L/usr/lib $PULSE_LIBS"
    1.38 +                elif test "x`ls /usr/local/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
    1.39 +                    PULSE_LIBS="-L/usr/local/lib $PULSE_LIBS"
    1.40 +                fi
    1.41 +            fi
    1.42 +            pulse_lib_spec=`echo $PULSE_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libpulse-simple.so.*/'`
    1.43 +            pulse_lib=`ls -- $pulse_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
    1.44 +            echo "-- $pulse_lib_spec -> $pulse_lib"
    1.45 +
    1.46 +            AC_DEFINE(SDL_AUDIO_DRIVER_PULSE)
    1.47 +            SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c"
    1.48 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS"
    1.49 +            if test x$have_loadso != xyes && \
    1.50 +               test x$enable_pulse_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_pulse_shared = xyes && test x$pulse_lib != x; then
    1.55 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib")
    1.56 +            else
    1.57 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_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 @@ -2150,6 +2207,7 @@
    1.68          CheckALSA
    1.69          CheckARTSC
    1.70          CheckESD
    1.71 +        CheckPulseAudio
    1.72          CheckNAS
    1.73          CheckX11
    1.74          CheckNANOX