SDL: add missing strcasestr checks to cmake and autotools build systems,

From 3bc4bad8fb2b0be328f1c00628867a81a089aa2f Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 20 Nov 2022 23:50:10 +0300
Subject: [PATCH] add missing strcasestr checks to cmake and autotools build
 systems,

and update config files.
---
 CMakeLists.txt                | 2 +-
 configure                     | 6 ++++++
 configure.ac                  | 2 +-
 include/SDL_config.h.cmake    | 1 +
 include/SDL_config.h.in       | 1 +
 include/SDL_config_android.h  | 1 +
 include/SDL_config_iphoneos.h | 1 +
 include/SDL_config_macosx.h   | 1 +
 8 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 408bc2f1427b..05bbac494e83 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1045,7 +1045,7 @@ if(SDL_LIBC)
             bsearch qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
             _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r
             itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
-            atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp
+            atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr
             wcscmp _wcsdup wcsdup wcslcat wcslcpy wcslen wcsncmp wcsstr
             wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp
             sscanf vsscanf vsnprintf fopen64 fseeko fseeko64 _Exit
diff --git a/configure b/configure
index 9461408e86c5..59d347f3ea49 100755
--- a/configure
+++ b/configure
@@ -19535,6 +19535,12 @@ if test "x$ac_cv_func_strncasecmp" = xyes
 then :
   printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr"
+if test "x$ac_cv_func_strcasestr" = xyes
+then :
+  printf "%s\n" "#define HAVE_STRCASESTR 1" >>confdefs.h
+
 fi
 ac_fn_c_check_func "$LINENO" "vsscanf" "ac_cv_func_vsscanf"
 if test "x$ac_cv_func_vsscanf" = xyes
diff --git a/configure.ac b/configure.ac
index a4252d2ed5b8..d8e3dc3daa91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,7 +348,7 @@ dnl Checks for library functions.
         AC_DEFINE(HAVE_MPROTECT, 1, [ ])
         ],[]),
     )
-    AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit)
+    AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit)
 
     AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
     AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index b85c5672b160..8fcb63d18fbe 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -140,6 +140,7 @@
 #cmakedefine HAVE_STRCASECMP 1
 #cmakedefine HAVE__STRNICMP 1
 #cmakedefine HAVE_STRNCASECMP 1
+#cmakedefine HAVE_STRCASESTR 1
 #cmakedefine HAVE_SSCANF 1
 #cmakedefine HAVE_VSSCANF 1
 #cmakedefine HAVE_VSNPRINTF 1
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 67e50745b4e4..7b8d848e0b1b 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -143,6 +143,7 @@
 #undef HAVE_STRCASECMP
 #undef HAVE__STRNICMP
 #undef HAVE_STRNCASECMP
+#undef HAVE_STRCASESTR
 #undef HAVE_SSCANF
 #undef HAVE_VSSCANF
 #undef HAVE_SNPRINTF
diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h
index 5a9cfc04590a..64918ae0b8a5 100644
--- a/include/SDL_config_android.h
+++ b/include/SDL_config_android.h
@@ -85,6 +85,7 @@
 #define HAVE_STRNCMP    1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRNCASECMP 1
+#define HAVE_STRCASESTR 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_ACOS   1
diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h
index 48f9f9f9befd..6db16eb4ccfb 100644
--- a/include/SDL_config_iphoneos.h
+++ b/include/SDL_config_iphoneos.h
@@ -85,6 +85,7 @@
 #define HAVE_STRNCMP    1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRNCASECMP 1
+#define HAVE_STRCASESTR 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_M_PI   1
diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h
index 023ecaae3294..e7189f3a14b0 100644
--- a/include/SDL_config_macosx.h
+++ b/include/SDL_config_macosx.h
@@ -88,6 +88,7 @@
 #define HAVE_STRNCMP    1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRNCASECMP 1
+#define HAVE_STRCASESTR 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_M_PI   1