From: Vadim Zeitlin Date: Tue, 30 Aug 2005 23:28:35 +0000 (+0000) Subject: (blind) fix for wxSound link problem under NetBSD with OSS X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/aca2d2de32edecfc4f160ffec094d827dbf79aa7?ds=inline (blind) fix for wxSound link problem under NetBSD with OSS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/configure.in b/configure.in index 810b4d8464..448a03cda7 100644 --- a/configure.in +++ b/configure.in @@ -5070,8 +5070,41 @@ fi dnl Unix implementation needs additional checks because audio support dnl comes in many favours: if test "$USE_UNIX" = "1" ; then - AC_CHECK_HEADERS([sys/soundcard.h],, - [DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia"]) + dnl it's not enough to check for just the header because OSS under NetBSD + dnl redefines ioctl as oss_ioctrl inside it and so we also need to test + dnl whether we need -lossaudio at link-time + AC_CACHE_CHECK([for ioctl() in sys/soundcard.h], ac_cv_header_sys_soundcard, [ + AC_TRY_LINK([ + #include + ], + [ + ioctl(0, SNDCTL_DSP_SYNC, 0); + ], + ac_cv_header_sys_soundcard=yes, + [ + saveLibs="$LIBS" + LIBS="$saveLibs -lossaudio" + AC_TRY_LINK([ + #include + ], + [ + ioctl(0, SNDCTL_DSP_SYNC, 0); + ], + ac_cv_header_sys_soundcard=yes, + [ + LIBS="$saveLibs" + ac_cv_header_sys_soundcard=no + ] + ) + ] + ) + ]) + + if test "$ac_cv_header_sys_soundcard" = "yes"; then + AC_DEFINE(HAVE_SYS_SOUNDCARD_H) + else + DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia" + fi fi WITH_PLUGIN_SDL=0 if test "$wxUSE_SOUND" = "yes"; then