Only check for libossaudio if compiling wineossi.drv and the headers are recent enough. Disable building wineoss.drv if the library is missing. Only link with libossaudio when needed.
From: zerous zerous@nocebo.space Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
Linking with libossaudio is troublesome on NetBSD but what makes matters worse is that Wine links every library with it. Zerous fixed the build system so only wineoss.drv is linked with it.
But then I noticed that configure checks for libossaudio even if given --without-oss. So I took his patch and tweaked it some more.
configure.ac | 12 ++++++------ dlls/wineoss.drv/Makefile.in | 1 + 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac index e58a9242397..921bcd36f31 100644 --- a/configure.ac +++ b/configure.ac @@ -407,8 +407,6 @@ dnl **** Check for some libraries ****
dnl Check for -li386 for NetBSD and OpenBSD AC_CHECK_LIB(i386,i386_set_ldt) -dnl Check for -lossaudio for NetBSD -AC_CHECK_LIB(ossaudio,_oss_ioctl)
AC_SUBST(OPENGL_LIBS,"")
@@ -1655,13 +1653,15 @@ then CPPFLAGS="$CPPFLAGS $ac_oss_incl" AC_CHECK_HEADER([sys/soundcard.h], [AC_CHECK_MEMBERS([oss_sysinfo.numaudioengines], - [AC_SUBST(OSS4_CFLAGS,"$ac_oss_incl")],, - [#include <sys/soundcard.h>])]) + [AC_CHECK_LIB(ossaudio,_oss_ioctl, + [AC_SUBST(OSS4_CFLAGS,"$ac_oss_incl") + AC_SUBST(OSS4_LIBS,"-lossaudio")])],, + [#include <sys/soundcard.h>])]) CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_NOTICE_WITH(oss,[test "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes], - [OSS sound system found but too old (OSSv4 needed), OSS won't be supported.], - [enable_wineoss_drv]) + [OSS sound system found but too old (OSSv4 needed), OSS won't be supported.]) +test -n "$OSS4_LIBS" || enable_wineoss_drv=${enable_wineoss_drv:-no}
dnl **** Check for libudev **** if test "x$with_udev" != "xno" diff --git a/dlls/wineoss.drv/Makefile.in b/dlls/wineoss.drv/Makefile.in index d129f13fa19..a2ae5f53a5c 100644 --- a/dlls/wineoss.drv/Makefile.in +++ b/dlls/wineoss.drv/Makefile.in @@ -1,6 +1,7 @@ MODULE = wineoss.drv IMPORTS = uuid ole32 user32 advapi32 DELAYIMPORTS = winmm +EXTRALIBS = $(OSS4_LIBS) EXTRAINCL = $(OSS4_CFLAGS)
C_SRCS = \
Francois Gouget fgouget@codeweavers.com writes:
Only check for libossaudio if compiling wineossi.drv and the headers are recent enough. Disable building wineoss.drv if the library is missing.
That library is not needed on Linux.