From f60a0f5e565ab9ec5f13b6b489e03b6b22ebf8f7 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 2 May 2011 20:06:49 +0200 Subject: [PATCH] configure: Improve the detection of OSS v4. --- configure | 42 ++++++++++++++++++++---------------- configure.ac | 35 +++++++++++++++--------------- dlls/wineoss.drv/Makefile.in | 1 + dlls/wineoss.drv/audio.c | 8 +------ dlls/wineoss.drv/dscapture.c | 8 +------ dlls/wineoss.drv/dsrender.c | 8 +------ dlls/wineoss.drv/midi.c | 8 +------ dlls/wineoss.drv/mixer.c | 8 +------ dlls/wineoss.drv/mmaux.c | 8 +------ dlls/wineoss.drv/mmdevdrv.c | 32 +++++++++++---------------- include/config.h.in | 13 ++--------- 11 files changed, 61 insertions(+), 110 deletions(-) diff --git a/configure b/configure index 7b19dd85f64..b742bfdd49c 100755 --- a/configure +++ b/configure @@ -625,6 +625,7 @@ LIBMPG123 PNGINCL FONTCONFIGINCL CUPSINCL +OSS4INCL ALSALIBS GSTREAMER_INCL GSTREAMER_LIBS @@ -2674,7 +2675,7 @@ fi # Check whether --with-oss was given. if test "${with_oss+set}" = set; then : - withval=$with_oss; if test "x$withval" = "xno"; then ac_cv_header_soundcard_h=no; ac_cv_header_sys_soundcard_h=no; ac_cv_header_machine_soundcard_h=no; fi + withval=$with_oss; fi @@ -5846,7 +5847,6 @@ for ac_header in \ mach/machine.h \ machine/cpu.h \ machine/limits.h \ - machine/soundcard.h \ machine/sysarch.h \ mntent.h \ mpg123.h \ @@ -5869,7 +5869,6 @@ for ac_header in \ scsi/scsi.h \ scsi/scsi_ioctl.h \ scsi/sg.h \ - soundcard.h \ stdbool.h \ stdint.h \ strings.h \ @@ -5904,7 +5903,6 @@ for ac_header in \ sys/socket.h \ sys/socketvar.h \ sys/sockio.h \ - sys/soundcard.h \ sys/statvfs.h \ sys/strtio.h \ sys/syscall.h \ @@ -11027,28 +11025,34 @@ fi fi -if test "$ac_cv_header_sys_soundcard_h" = "yes" -o \ - "$ac_cv_header_machine_soundcard_h" = "yes" -o \ - "$ac_cv_header_soundcard_h" = "yes" +if test "x$with_oss" != xno then - ac_fn_c_check_type "$LINENO" "oss_sysinfo" "ac_cv_type_oss_sysinfo" "#if defined(HAVE_SYS_SOUNDCARD_H) -#include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -#include -#elif defined(HAVE_SOUNDCARD_H) -#include -#endif + ac_save_CPPFLAGS="$CPPFLAGS" + if test -f /etc/oss.conf + then + . /etc/oss.conf + fi + ac_oss_incl="-I${OSSLIBDIR:-/usr/lib/oss}/include" + CPPFLAGS="$CPPFLAGS $ac_oss_incl" + ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_soundcard_h" = xyes; then : + ac_fn_c_check_member "$LINENO" "oss_sysinfo" "numaudioengines" "ac_cv_member_oss_sysinfo_numaudioengines" "#include " -if test "x$ac_cv_type_oss_sysinfo" = xyes; then : +if test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_OSS_SYSINFO 1 +#define HAVE_OSS_SYSINFO_NUMAUDIOENGINES 1 _ACEOF +OSS4INCL="$ac_oss_incl" fi - if test "x$ac_cv_type_oss_sysinfo" != xyes +fi + + + CPPFLAGS="$ac_save_CPPFLAGS" + if test "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes then as_fn_append wine_notices "|OSS sound system found but too old (OSSv4 needed), OSS won't be supported." fi @@ -12134,11 +12138,11 @@ test -n "$COREAUDIO" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} test -n "$NASLIBS" || enable_winenas_drv=${enable_winenas_drv:-no} test -n "$ESDLIBS" || enable_wineesd_drv=${enable_wineesd_drv:-no} test -n "$ac_cv_lib_soname_jack" || enable_winejack_drv=${enable_winejack_drv:-no} -test "x$ac_cv_type_oss_sysinfo" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} +test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} test "$ac_cv_header_linux_joystick_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no} if test "x$ALSALIBS$COREAUDIO$NASLIBS$ESDLIBS$ac_cv_lib_soname_jack" = "x" -a \ - "x$ac_cv_type_oss_sysinfo" != xyes -a \ + "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -a \ "x$with_alsa$with_coreaudio$with_nas$with_esd$with_jack$with_oss" != xnononononono then as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." diff --git a/configure.ac b/configure.ac index 7637c331f73..7fe1a836fdd 100644 --- a/configure.ac +++ b/configure.ac @@ -73,8 +73,7 @@ AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]), AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) AC_ARG_WITH(openssl, AS_HELP_STRING([--without-openssl],[do not use OpenSSL]), [if test "x$withval" = "xno"; then ac_cv_header_openssl_err_h=no; ac_cv_header_openssl_ssl_h=no; fi]) -AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support]), - [if test "x$withval" = "xno"; then ac_cv_header_soundcard_h=no; ac_cv_header_sys_soundcard_h=no; ac_cv_header_machine_soundcard_h=no; fi]) +AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support])) AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG]), [if test "x$withval" = "xno"; then ac_cv_header_png_h=no; fi]) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), @@ -433,7 +432,6 @@ AC_CHECK_HEADERS(\ mach/machine.h \ machine/cpu.h \ machine/limits.h \ - machine/soundcard.h \ machine/sysarch.h \ mntent.h \ mpg123.h \ @@ -456,7 +454,6 @@ AC_CHECK_HEADERS(\ scsi/scsi.h \ scsi/scsi_ioctl.h \ scsi/sg.h \ - soundcard.h \ stdbool.h \ stdint.h \ strings.h \ @@ -491,7 +488,6 @@ AC_CHECK_HEADERS(\ sys/socket.h \ sys/socketvar.h \ sys/sockio.h \ - sys/soundcard.h \ sys/statvfs.h \ sys/strtio.h \ sys/syscall.h \ @@ -1525,18 +1521,21 @@ then fi dnl **** Check for OSSv4 **** -if test "$ac_cv_header_sys_soundcard_h" = "yes" -o \ - "$ac_cv_header_machine_soundcard_h" = "yes" -o \ - "$ac_cv_header_soundcard_h" = "yes" +if test "x$with_oss" != xno then - AC_CHECK_TYPES([oss_sysinfo],,,[#if defined(HAVE_SYS_SOUNDCARD_H) -#include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -#include -#elif defined(HAVE_SOUNDCARD_H) -#include -#endif]) - if test "x$ac_cv_type_oss_sysinfo" != xyes + ac_save_CPPFLAGS="$CPPFLAGS" + if test -f /etc/oss.conf + then + . /etc/oss.conf + fi + ac_oss_incl="-I${OSSLIBDIR:-/usr/lib/oss}/include" + CPPFLAGS="$CPPFLAGS $ac_oss_incl" + AC_CHECK_HEADER([sys/soundcard.h], + [AC_CHECK_MEMBERS([oss_sysinfo.numaudioengines], + [AC_SUBST(OSS4INCL,"$ac_oss_incl")],, + [#include ])]) + CPPFLAGS="$ac_save_CPPFLAGS" + if test "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes then WINE_NOTICE([OSS sound system found but too old (OSSv4 needed), OSS won't be supported.]) fi @@ -1691,12 +1690,12 @@ test -n "$COREAUDIO" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} test -n "$NASLIBS" || enable_winenas_drv=${enable_winenas_drv:-no} test -n "$ESDLIBS" || enable_wineesd_drv=${enable_wineesd_drv:-no} test -n "$ac_cv_lib_soname_jack" || enable_winejack_drv=${enable_winejack_drv:-no} -test "x$ac_cv_type_oss_sysinfo" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} +test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} test "$ac_cv_header_linux_joystick_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no} dnl **** Check for any sound system **** if test "x$ALSALIBS$COREAUDIO$NASLIBS$ESDLIBS$ac_cv_lib_soname_jack" = "x" -a \ - "x$ac_cv_type_oss_sysinfo" != xyes -a \ + "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -a \ "x$with_alsa$with_coreaudio$with_nas$with_esd$with_jack$with_oss" != xnononononono then WINE_WARNING([No sound system was found. Windows applications will be silent.]) diff --git a/dlls/wineoss.drv/Makefile.in b/dlls/wineoss.drv/Makefile.in index c89499e2cc6..3696a7a155e 100644 --- a/dlls/wineoss.drv/Makefile.in +++ b/dlls/wineoss.drv/Makefile.in @@ -1,5 +1,6 @@ MODULE = wineoss.drv IMPORTS = dxguid uuid winmm ole32 user32 +EXTRAINCL = @OSS4INCL@ C_SRCS = \ audio.c \ diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c index eb3dc1e717a..fcf59235840 100644 --- a/dlls/wineoss.drv/audio.c +++ b/dlls/wineoss.drv/audio.c @@ -55,16 +55,10 @@ #ifdef HAVE_SYS_POLL_H # include #endif -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif #ifdef HAVE_SYS_ERRNO_H #include #endif +#include #include "windef.h" #include "winbase.h" diff --git a/dlls/wineoss.drv/dscapture.c b/dlls/wineoss.drv/dscapture.c index 1607e5a7119..ca1f3374235 100644 --- a/dlls/wineoss.drv/dscapture.c +++ b/dlls/wineoss.drv/dscapture.c @@ -42,16 +42,10 @@ #ifdef HAVE_SYS_POLL_H # include #endif -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif #ifdef HAVE_SYS_ERRNO_H #include #endif +#include #include "windef.h" #include "winbase.h" diff --git a/dlls/wineoss.drv/dsrender.c b/dlls/wineoss.drv/dsrender.c index 8161c88b84a..afcc1dfcca2 100644 --- a/dlls/wineoss.drv/dsrender.c +++ b/dlls/wineoss.drv/dsrender.c @@ -45,16 +45,10 @@ #ifdef HAVE_SYS_POLL_H # include #endif -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif #ifdef HAVE_SYS_ERRNO_H #include #endif +#include #include "windef.h" #include "winbase.h" diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 5b3fd5d72a6..3b28213c85b 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -60,16 +60,10 @@ #ifdef HAVE_SYS_POLL_H #include #endif -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif #ifdef HAVE_SYS_ERRNO_H #include #endif +#include #include "windef.h" #include "winbase.h" diff --git a/dlls/wineoss.drv/mixer.c b/dlls/wineoss.drv/mixer.c index e2c33a0f9e0..5256cb8748d 100644 --- a/dlls/wineoss.drv/mixer.c +++ b/dlls/wineoss.drv/mixer.c @@ -41,16 +41,10 @@ #ifdef HAVE_SYS_IOCTL_H # include #endif -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif #ifdef HAVE_SYS_ERRNO_H #include #endif +#include #define NONAMELESSUNION #define NONAMELESSSTRUCT diff --git a/dlls/wineoss.drv/mmaux.c b/dlls/wineoss.drv/mmaux.c index bb8f35b4b45..3dbc6a0c352 100644 --- a/dlls/wineoss.drv/mmaux.c +++ b/dlls/wineoss.drv/mmaux.c @@ -31,16 +31,10 @@ #ifdef HAVE_SYS_IOCTL_H # include #endif -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif #ifdef HAVE_SYS_ERRNO_H #include #endif +#include #include "windef.h" #include "winbase.h" diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index c6baee98eb6..c66955fce9d 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -21,6 +21,18 @@ #include "config.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "windef.h" #include "winbase.h" @@ -41,26 +53,6 @@ #include "audiopolicy.h" #include "audioclient.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif - WINE_DEFAULT_DEBUG_CHANNEL(oss); #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) diff --git a/include/config.h.in b/include/config.h.in index 9e2866ca6ea..4bdbc38ddd4 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -461,9 +461,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_LIMITS_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_SOUNDCARD_H - /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_SYSARCH_H @@ -599,8 +596,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SSL_H -/* Define to 1 if the system has the type `oss_sysinfo'. */ -#undef HAVE_OSS_SYSINFO +/* Define to 1 if `numaudioengines' is a member of `oss_sysinfo'. */ +#undef HAVE_OSS_SYSINFO_NUMAUDIOENGINES /* Define to 1 if you have the `pclose' function. */ #undef HAVE_PCLOSE @@ -755,9 +752,6 @@ /* Define to 1 if you have the `socketpair' function. */ #undef HAVE_SOCKETPAIR -/* Define to 1 if you have the header file. */ -#undef HAVE_SOUNDCARD_H - /* Define to 1 if you have the `spawnvp' function. */ #undef HAVE_SPAWNVP @@ -977,9 +971,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOUNDCARD_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATFS_H