SDL: autotools, cmake: fix the sys/audioio.h checks.

From 74df61530fd13eaf4e9b943ef7a6d858094f2bfd Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 28 Jul 2025 12:40:30 +0300
Subject: [PATCH] autotools, cmake: fix the sys/audioio.h checks.

Reference issue: https://github.com/libsdl-org/SDL/issues/13405.
---
 CMakeLists.txt |  2 +-
 configure      | 11 ++++++-----
 configure.ac   |  6 +++---
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a324434eba7b8..6c66a0d94c231 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1471,7 +1471,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
   if(SDL_AUDIO)
     if(SYSV5 OR SOLARIS OR HPUX)
         # Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
-        check_include_file(sys/audioio HAVE_SYS_AUDIOIO_H)
+        check_include_file(sys/audioio.h HAVE_SYS_AUDIOIO_H)
         if(HAVE_SYS_AUDIOIO_H)
             set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
             file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
diff --git a/configure b/configure
index e4c8cdd793f57..0eb9208c9b89b 100755
--- a/configure
+++ b/configure
@@ -28741,15 +28741,16 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
         if test x$enable_audio = xyes; then
           case $ARCH in
             sysv5|solaris|hpux)
-                                ac_fn_c_check_header_compile "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default"
-if test "x$ac_cv_header_audio_audiolib_h" = xyes
+                # Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
+                ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_audioio_h" = xyes
 then :
-  have_sys_audiolib=yes
+  have_sys_audioio_h=yes
 else $as_nop
-  have_sys_audiolib=no
+  have_sys_audioio_h=no
 fi
 
-                if test x$have_sys_audiolib = xyes; then
+                if test x$have_sys_audioio_h = xyes; then
 
 printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h
 
diff --git a/configure.ac b/configure.ac
index 45dfa96d4cd5b..d91550ac84f19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3869,9 +3869,9 @@ case "$host" in
         if test x$enable_audio = xyes; then
           case $ARCH in
             sysv5|solaris|hpux)
-                dnl Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
-                AC_CHECK_HEADER(audio/audiolib.h,have_sys_audiolib=yes,have_sys_audiolib=no)
-                if test x$have_sys_audiolib = xyes; then
+                # Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first.
+                AC_CHECK_HEADER(sys/audioio.h, have_sys_audioio_h=yes, have_sys_audioio_h=no)
+                if test x$have_sys_audioio_h = xyes; then
                     AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
                     SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
                     SUMMARY_audio="${SUMMARY_audio} sun"