SDL: cmake: make sure check_* uses 2 different variables in CheckX11

From 81d3266766e6b87fa8c27e508e6606b442956300 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 27 Sep 2022 01:59:37 +0200
Subject: [PATCH] cmake: make sure check_* uses 2 different variables in
 CheckX11

---
 cmake/sdlchecks.cmake | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index cfc0c664afd..040029db722 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -457,13 +457,13 @@ macro(CheckX11)
         set(SDL_X11_SHARED OFF)
       endif()
 
-      check_symbol_exists(shmat "sys/shm.h" HAVE_SHMAT)
-      if(NOT HAVE_SHMAT)
-        check_library_exists(ipc shmat "" HAVE_SHMAT)
-        if(HAVE_SHMAT)
+      check_symbol_exists(shmat "sys/shm.h" HAVE_SHMAT_IN_LIBC)
+      if(NOT HAVE_SHMAT_IN_LIBC)
+        check_library_exists(ipc shmat "" HAVE_SHMAT_IN_LIBIPC)
+        if(HAVE_SHMAT_IN_LIBIPC)
           list(APPEND EXTRA_LIBS ipc)
         endif()
-        if(NOT HAVE_SHMAT)
+        if(NOT HAVE_SHMAT_IN_LIBIPC)
           list(APPEND EXTRA_CFLAGS "-DNO_SHARED_MEMORY")
         endif()
       endif()