configure.in
changeset 2049 5f6550e5184f
parent 2040 be848c07f0b9
child 2066 8f8066b84b3e
     1.1 --- a/configure.in	Sun Oct 01 16:10:41 2006 +0000
     1.2 +++ b/configure.in	Tue Oct 17 09:15:21 2006 +0000
     1.3 @@ -511,9 +511,17 @@
     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 -        if test -r /usr/X11R6/include/audio/audiolib.h; then
    1.13 +
    1.14 +        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
    1.15 +            have_nas=yes
    1.16 +            NAS_LIBS="-laudio"
    1.17 +
    1.18 +        elif test -r /usr/X11R6/include/audio/audiolib.h; then
    1.19              have_nas=yes
    1.20              NAS_CFLAGS="-I/usr/X11R6/include/"
    1.21              NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
    1.22 @@ -525,12 +533,40 @@
    1.23              have_nas=yes
    1.24              NAS_LIBS="-lnas -lXt"
    1.25          fi
    1.26 +
    1.27          AC_MSG_RESULT($have_nas)
    1.28 +
    1.29          if test x$have_nas = xyes; then
    1.30 +            AC_ARG_ENABLE(nas-shared,
    1.31 +AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
    1.32 +                          , enable_nas_shared=yes)
    1.33 +            if test "x`echo $NAS_LIBS | grep -- -L`" = "x"; then
    1.34 +                if test "x`ls /lib/libaudio.so.* 2> /dev/null`" != "x"; then
    1.35 +                    NAS_LIBS="-L/lib $NAS_LIBS"
    1.36 +                elif test "x`ls /usr/lib/libaudio.so.* 2> /dev/null`" != "x"; then
    1.37 +                    NAS_LIBS="-L/usr/lib $NAS_LIBS"
    1.38 +                elif test "x`ls /usr/local/lib/libaudio.so.* 2> /dev/null`" != "x"; then
    1.39 +                    NAS_LIBS="-L/usr/local/lib $NAS_LIBS"
    1.40 +                fi
    1.41 +            fi
    1.42 +            nas_lib_spec=`echo $NAS_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libaudio.so.*/'`
    1.43 +            nas_lib=`ls -- $nas_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
    1.44 +            echo "-- $nas_lib_spec -> $nas_lib"
    1.45 +
    1.46 +            if test x$have_loadso != xyes && \
    1.47 +               test x$enable_nas_shared = xyes; then
    1.48 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
    1.49 +            fi
    1.50 +            if test x$have_loadso = xyes && \
    1.51 +               test x$enable_nas_shared = xyes && test x$alsa_lib != x; then
    1.52 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
    1.53 +            else
    1.54 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
    1.55 +            fi
    1.56 +
    1.57              AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
    1.58              SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
    1.59              EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
    1.60 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
    1.61              have_audio=yes
    1.62          fi
    1.63      fi
    1.64 @@ -2006,7 +2042,7 @@
    1.65                  have_audio=yes
    1.66              ;;
    1.67              aix)
    1.68 -                AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
    1.69 +                AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO)
    1.70                  SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
    1.71                  have_audio=yes
    1.72              ;;
    1.73 @@ -2206,7 +2242,7 @@
    1.74          CheckBeGL
    1.75          # Set up files for the audio library
    1.76          if test x$enable_audio = xyes; then
    1.77 -            AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
    1.78 +            AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO)
    1.79              SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
    1.80              have_audio=yes
    1.81          fi
    1.82 @@ -2323,7 +2359,7 @@
    1.83          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    1.84          # If either the audio or CD driver is used, add the AudioUnit framework
    1.85          if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
    1.86 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
    1.87 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -framework,AudioToolbox -Wl,-framework,AudioUnit"
    1.88          fi
    1.89          ;;
    1.90      *-*-mint*)