Updated configure with the sndio audio backend
authorSam Lantinga <slouken@libsdl.org>
Sun, 07 Jul 2013 10:15:10 -0700
changeset 7371a60970c28505
parent 7370 9af77b0c7c93
child 7372 f90f720b9e56
Updated configure with the sndio audio backend
configure
     1.1 --- a/configure	Sun Jul 07 16:15:21 2013 +0200
     1.2 +++ b/configure	Sun Jul 07 10:15:10 2013 -0700
     1.3 @@ -812,6 +812,8 @@
     1.4  enable_arts_shared
     1.5  enable_nas
     1.6  enable_nas_shared
     1.7 +enable_sndio
     1.8 +enable_sndio_shared
     1.9  enable_diskaudio
    1.10  enable_dummyaudio
    1.11  enable_video_x11
    1.12 @@ -1524,6 +1526,8 @@
    1.13    --enable-arts-shared    dynamically load aRts audio support [[default=yes]]
    1.14    --enable-nas            support the NAS audio API [[default=yes]]
    1.15    --enable-nas-shared     dynamically load NAS audio support [[default=yes]]
    1.16 +  --enable-sndio          support the sndio audio API [[default=yes]]
    1.17 +  --enable-sndio-shared   dynamically load sndio audio support [[default=yes]]
    1.18    --enable-diskaudio      support the disk writer audio driver [[default=yes]]
    1.19    --enable-dummyaudio     support the dummy audio driver [[default=yes]]
    1.20    --enable-video-x11      use X11 video driver [[default=yes]]
    1.21 @@ -18487,6 +18491,112 @@
    1.22      fi
    1.23  }
    1.24  
    1.25 +CheckSNDIO()
    1.26 +{
    1.27 +    # Check whether --enable-sndio was given.
    1.28 +if test "${enable_sndio+set}" = set; then :
    1.29 +  enableval=$enable_sndio;
    1.30 +else
    1.31 +  enable_sndio=yes
    1.32 +fi
    1.33 +
    1.34 +    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
    1.35 +        ac_fn_c_check_header_mongrel "$LINENO" "sndio.h" "ac_cv_header_sndio_h" "$ac_includes_default"
    1.36 +if test "x$ac_cv_header_sndio_h" = xyes; then :
    1.37 +  have_sndio_hdr=yes
    1.38 +fi
    1.39 +
    1.40 +
    1.41 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sio_open in -lsndio" >&5
    1.42 +$as_echo_n "checking for sio_open in -lsndio... " >&6; }
    1.43 +if ${ac_cv_lib_sndio_sio_open+:} false; then :
    1.44 +  $as_echo_n "(cached) " >&6
    1.45 +else
    1.46 +  ac_check_lib_save_LIBS=$LIBS
    1.47 +LIBS="-lsndio  $LIBS"
    1.48 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.49 +/* end confdefs.h.  */
    1.50 +
    1.51 +/* Override any GCC internal prototype to avoid an error.
    1.52 +   Use char because int might match the return type of a GCC
    1.53 +   builtin and then its argument prototype would still apply.  */
    1.54 +#ifdef __cplusplus
    1.55 +extern "C"
    1.56 +#endif
    1.57 +char sio_open ();
    1.58 +int
    1.59 +main ()
    1.60 +{
    1.61 +return sio_open ();
    1.62 +  ;
    1.63 +  return 0;
    1.64 +}
    1.65 +_ACEOF
    1.66 +if ac_fn_c_try_link "$LINENO"; then :
    1.67 +  ac_cv_lib_sndio_sio_open=yes
    1.68 +else
    1.69 +  ac_cv_lib_sndio_sio_open=no
    1.70 +fi
    1.71 +rm -f core conftest.err conftest.$ac_objext \
    1.72 +    conftest$ac_exeext conftest.$ac_ext
    1.73 +LIBS=$ac_check_lib_save_LIBS
    1.74 +fi
    1.75 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndio_sio_open" >&5
    1.76 +$as_echo "$ac_cv_lib_sndio_sio_open" >&6; }
    1.77 +if test "x$ac_cv_lib_sndio_sio_open" = xyes; then :
    1.78 +  have_sndio_lib=yes
    1.79 +fi
    1.80 +
    1.81 +
    1.82 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sndio audio support" >&5
    1.83 +$as_echo_n "checking for sndio audio support... " >&6; }
    1.84 +        have_sndio=no
    1.85 +
    1.86 +        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
    1.87 +            have_sndio=yes
    1.88 +            SNDIO_LIBS="-lsndio"
    1.89 +        fi
    1.90 +
    1.91 +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sndio" >&5
    1.92 +$as_echo "$have_sndio" >&6; }
    1.93 +
    1.94 +        if test x$have_sndio = xyes; then
    1.95 +            # Check whether --enable-sndio-shared was given.
    1.96 +if test "${enable_sndio_shared+set}" = set; then :
    1.97 +  enableval=$enable_sndio_shared;
    1.98 +else
    1.99 +  enable_sndio_shared=yes
   1.100 +fi
   1.101 +
   1.102 +            sndio_lib=`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
   1.103 +
   1.104 +            if test x$have_loadso != xyes && \
   1.105 +               test x$enable_sndio_shared = xyes; then
   1.106 +                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&5
   1.107 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&2;}
   1.108 +            fi
   1.109 +            if test x$have_loadso = xyes && \
   1.110 +               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
   1.111 +                echo "-- dynamic libsndio -> $sndio_lib"
   1.112 +
   1.113 +cat >>confdefs.h <<_ACEOF
   1.114 +#define SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "$sndio_lib"
   1.115 +_ACEOF
   1.116 +
   1.117 +            else
   1.118 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
   1.119 +            fi
   1.120 +
   1.121 +
   1.122 +$as_echo "#define SDL_AUDIO_DRIVER_SNDIO 1" >>confdefs.h
   1.123 +
   1.124 +            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
   1.125 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
   1.126 +            have_audio=yes
   1.127 +        fi
   1.128 +    fi
   1.129 +}
   1.130 +
   1.131  CheckDiskAudio()
   1.132  {
   1.133      # Check whether --enable-diskaudio was given.
   1.134 @@ -22069,6 +22179,7 @@
   1.135          CheckARTSC
   1.136          CheckESD
   1.137          CheckNAS
   1.138 +        CheckSNDIO
   1.139          CheckX11
   1.140          CheckDirectFB
   1.141          CheckFusionSound