-AS_CASE(["$systems"], [*" ds "*], [
- api="$api -D__WINDOWS_DS__"
- need_ole32=yes
- found="$found DirectSound"
- LIBS="-ldsound -lwinmm $LIBS"
+AS_CASE(["$systems"], [*" dsound "*], [
+ AC_CHECK_HEADERS(windows.h)
+ AC_CHECK_HEADERS(mmsystem.h mmreg.h dsound.h, [], [],
+[#ifdef HAVE_WINDOWS_H
+# include <windows.h>
+#endif])
+ AS_IF([test "x$ac_cv_header_windows_h" = xyes \
+ && test "x$ac_cv_header_mmsystem_h" = xyes \
+ && test "x$ac_cv_header_mmreg_h" = xyes \
+ && test "x$ac_cv_header_dsound_h" = xyes],
+ [api="$api -D__WINDOWS_DS__"
+ need_ole32=yes
+ found="$found DirectSound"
+ LIBS="-ldsound -lwinmm $LIBS"])