comparison configure.in @ 4192:2f5e884f0a9d SDL-1.2

Made NAS target dynamic, so you can safely include it in shipping binaries.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 13 Sep 2009 22:19:56 +0000
parents cb2d5514efb3
children 976bc19f8f6b
comparison
equal deleted inserted replaced
4191:caaa3cbf7b13 4192:2f5e884f0a9d
589 { 589 {
590 AC_ARG_ENABLE(nas, 590 AC_ARG_ENABLE(nas,
591 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]), 591 AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
592 , enable_nas=yes) 592 , enable_nas=yes)
593 if test x$enable_audio = xyes -a x$enable_nas = xyes; then 593 if test x$enable_audio = xyes -a x$enable_nas = xyes; then
594 save_LDFLAGS="$LDFLAGS" 594 AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
595 LDFLAGS="$LDFLAGS -lXt -lm" 595 AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
596 AC_CHECK_HEADER(audio/audiolib.h, have_audio_hdr=yes)
597 AC_CHECK_LIB(audio, AuOpenServer, have_audio_lib=yes)
598 AC_CHECK_HEADER(nas/audiolib.h, have_nas_hdr=yes)
599 AC_CHECK_LIB(nas, AuOpenServer, have_nas_lib=yes)
600 LDFLAGS="$save_LDFLAGS"
601 596
602 AC_MSG_CHECKING(for NAS audio support) 597 AC_MSG_CHECKING(for NAS audio support)
603 have_nas=no 598 have_nas=no
604 if test x$have_audio_hdr = xyes -a x$have_audio_lib = xyes; then 599
600 if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
605 have_nas=yes 601 have_nas=yes
606 NAS_LIBS="-laudio -lXt" 602 NAS_LIBS="-laudio"
607 elif test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then 603
604 elif test -r /usr/X11R6/include/audio/audiolib.h; then
605 have_nas=yes
606 NAS_CFLAGS="-I/usr/X11R6/include/"
607 NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
608
609 dnl On IRIX, the NAS includes are in a different directory,
610 dnl and libnas must be explicitly linked in
611
612 elif test -r /usr/freeware/include/nas/audiolib.h; then
608 have_nas=yes 613 have_nas=yes
609 NAS_LIBS="-lnas -lXt" 614 NAS_LIBS="-lnas -lXt"
610 fi 615 fi
616
611 AC_MSG_RESULT($have_nas) 617 AC_MSG_RESULT($have_nas)
612 618
613 if test x$have_nas = xyes; then 619 if test x$have_nas = xyes; then
620 AC_ARG_ENABLE(nas-shared,
621 AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
622 , enable_nas_shared=yes)
623 if test "x`echo $NAS_LIBS | grep -- -L`" = "x"; then
624 if test "x`ls /lib/libaudio.so.* 2> /dev/null`" != "x"; then
625 NAS_LIBS="-L/lib $NAS_LIBS"
626 elif test "x`ls /usr/lib/libaudio.so.* 2> /dev/null`" != "x"; then
627 NAS_LIBS="-L/usr/lib $NAS_LIBS"
628 elif test "x`ls /usr/local/lib/libaudio.so.* 2> /dev/null`" != "x"; then
629 NAS_LIBS="-L/usr/local/lib $NAS_LIBS"
630 fi
631 fi
632 nas_lib_spec=`echo $NAS_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libaudio.so.*/'`
633 nas_lib=`ls -- $nas_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
634 echo "-- $nas_lib_spec -> $nas_lib"
635
636 if test x$have_loadso != xyes && \
637 test x$enable_nas_shared = xyes; then
638 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
639 fi
640 if test x$have_loadso = xyes && \
641 test x$enable_nas_shared = xyes && test x$nas_lib != x; then
642 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
643 else
644 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
645 fi
646
614 AC_DEFINE(SDL_AUDIO_DRIVER_NAS) 647 AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
615 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" 648 SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
616 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" 649 EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
617 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
618 have_audio=yes 650 have_audio=yes
619 fi 651 fi
620 fi 652 fi
621 } 653 }
622 654