configure.in
changeset 7367 d6eabafa8776
parent 7307 5d6b7b9432d3
child 7379 b27c778a2bdb
     1.1 --- a/configure.in	Sun Jul 07 02:04:19 2013 -0400
     1.2 +++ b/configure.in	Sun Jul 07 02:03:07 2013 -0400
     1.3 @@ -910,6 +910,52 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl See if the sndio audio interface is supported
     1.8 +CheckSNDIO()
     1.9 +{
    1.10 +    AC_ARG_ENABLE(sndio,
    1.11 +AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
    1.12 +                  , enable_sndio=yes)
    1.13 +    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
    1.14 +        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
    1.15 +        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
    1.16 +
    1.17 +        AC_MSG_CHECKING(for sndio audio support)
    1.18 +        have_sndio=no
    1.19 +
    1.20 +        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
    1.21 +            have_sndio=yes
    1.22 +            SNDIO_LIBS="-lsndio"
    1.23 +        fi
    1.24 +
    1.25 +        AC_MSG_RESULT($have_sndio)
    1.26 +
    1.27 +        if test x$have_sndio = xyes; then
    1.28 +            AC_ARG_ENABLE(sndio-shared,
    1.29 +AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
    1.30 +                          , enable_sndio_shared=yes)
    1.31 +            sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
    1.32 +
    1.33 +            if test x$have_loadso != xyes && \
    1.34 +               test x$enable_sndio_shared = xyes; then
    1.35 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
    1.36 +            fi
    1.37 +            if test x$have_loadso = xyes && \
    1.38 +               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
    1.39 +                echo "-- dynamic libsndio -> $sndio_lib"
    1.40 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
    1.41 +            else
    1.42 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
    1.43 +            fi
    1.44 +
    1.45 +            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
    1.46 +            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
    1.47 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
    1.48 +            have_audio=yes
    1.49 +        fi
    1.50 +    fi
    1.51 +}
    1.52 +
    1.53  dnl rcg07142001 See if the user wants the disk writer audio driver...
    1.54  CheckDiskAudio()
    1.55  {
    1.56 @@ -2262,6 +2308,7 @@
    1.57          CheckARTSC
    1.58          CheckESD
    1.59          CheckNAS
    1.60 +        CheckSNDIO
    1.61          CheckX11
    1.62          CheckDirectFB
    1.63          CheckFusionSound