configure.in
branchSDL-ryan-multiple-audio-device
changeset 3825 76c5a414b996
parent 3823 c562b1a12f82
child 3834 93326d2ceedb
     1.1 --- a/configure.in	Sat Oct 07 07:23:52 2006 +0000
     1.2 +++ b/configure.in	Sat Oct 07 07:25:30 2006 +0000
     1.3 @@ -511,10 +511,11 @@
     1.4  AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
     1.5                    , enable_nas=yes)
     1.6      if test x$enable_audio = xyes -a x$enable_nas = xyes; then
     1.7 +        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
     1.8 +        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
     1.9 +
    1.10          AC_MSG_CHECKING(for NAS audio support)
    1.11          have_nas=no
    1.12 -        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
    1.13 -        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
    1.14  
    1.15          if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
    1.16              have_nas=yes
    1.17 @@ -532,12 +533,40 @@
    1.18              have_nas=yes
    1.19              NAS_LIBS="-lnas -lXt"
    1.20          fi
    1.21 +
    1.22          AC_MSG_RESULT($have_nas)
    1.23 +
    1.24          if test x$have_nas = xyes; then
    1.25 +            AC_ARG_ENABLE(nas-shared,
    1.26 +AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
    1.27 +                          , enable_nas_shared=yes)
    1.28 +            if test "x`echo $NAS_LIBS | grep -- -L`" = "x"; then
    1.29 +                if test "x`ls /lib/libaudio.so.* 2> /dev/null`" != "x"; then
    1.30 +                    NAS_LIBS="-L/lib $NAS_LIBS"
    1.31 +                elif test "x`ls /usr/lib/libaudio.so.* 2> /dev/null`" != "x"; then
    1.32 +                    NAS_LIBS="-L/usr/lib $NAS_LIBS"
    1.33 +                elif test "x`ls /usr/local/lib/libaudio.so.* 2> /dev/null`" != "x"; then
    1.34 +                    NAS_LIBS="-L/usr/local/lib $NAS_LIBS"
    1.35 +                fi
    1.36 +            fi
    1.37 +            nas_lib_spec=`echo $NAS_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libaudio.so.*/'`
    1.38 +            nas_lib=`ls -- $nas_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
    1.39 +            echo "-- $nas_lib_spec -> $nas_lib"
    1.40 +
    1.41 +            if test x$have_loadso != xyes && \
    1.42 +               test x$enable_nas_shared = xyes; then
    1.43 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
    1.44 +            fi
    1.45 +            if test x$have_loadso = xyes && \
    1.46 +               test x$enable_nas_shared = xyes && test x$alsa_lib != x; then
    1.47 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
    1.48 +            else
    1.49 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
    1.50 +            fi
    1.51 +
    1.52              AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
    1.53              SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
    1.54              EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
    1.55 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
    1.56              have_audio=yes
    1.57          fi
    1.58      fi