Fixed Vulkan configure check for Android and added one for Mac OS X
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
diff --git a/configure b/configure
index f15e262..dd15e3f 100755
--- a/configure
+++ b/configure
@@ -745,7 +745,6 @@ infodir
docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -922,7 +921,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1175,15 +1173,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1321,7 +1310,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1474,7 +1463,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -21921,20 +21909,48 @@ CheckVulkan()
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
- #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
+ #if defined(__ARM_ARCH) && __ARM_ARCH < 7
#error Vulkan doesn't work on this configuration
#endif
- int main()
- {
- return 0;
- }
int
main ()
{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+
+else
+
enable_video_vulkan=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ *-*-darwin*)
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -x objective-c"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <Cocoa/Cocoa.h>
+ #include <Metal/Metal.h>
+ #include <QuartzCore/CAMetalLayer.h>
+
+ #if !TARGET_CPU_X86_64
+ #error Vulkan doesn't work on this configuration
+ #endif
+
+int
+main ()
+{
+
+
;
return 0;
}
@@ -21942,8 +21958,13 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+else
+
+ enable_video_vulkan=no
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
;;
*)
;;
@@ -21951,8 +21972,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test x$enable_video_vulkan = xno; then
# For reasons I am totally unable to see, I get an undefined macro error if
# I put this in the AC_TRY_COMPILE.
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sorry, Vulkan does not work on this configuration." >&5
-$as_echo "$as_me: WARNING: Sorry, Vulkan does not work on this configuration." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Vulkan does not work on this configuration." >&5
+$as_echo "$as_me: WARNING: Vulkan does not work on this configuration." >&2;}
fi
fi
if test x$enable_video_vulkan = xyes; then
diff --git a/configure.in b/configure.in
index 6e0c354..16498f3 100644
--- a/configure.in
+++ b/configure.in
@@ -1983,7 +1983,7 @@ AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]])
, enable_video_cocoa=yes)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
save_CFLAGS="$CFLAGS"
- dnl work around that we don't have Objective-C support in autoconf
+ dnl Work around that we don't have Objective-C support in autoconf
CFLAGS="$CFLAGS -x objective-c"
AC_MSG_CHECKING(for Cocoa framework)
have_cocoa=no
@@ -2401,7 +2401,7 @@ CheckEmscriptenGLES()
fi
}
-dnl Check to see if Vulkan surface support is desired
+dnl Check to see if Vulkan support is desired
AC_ARG_ENABLE(video-vulkan,
AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
, enable_video_vulkan=yes)
@@ -2413,17 +2413,33 @@ CheckVulkan()
case "$host" in
*-*-androideabi*)
AC_TRY_COMPILE([
- #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
+ #if defined(__ARM_ARCH) && __ARM_ARCH < 7
#error Vulkan doesn't work on this configuration
#endif
- int main()
- {
- return 0;
- }
+ ],[
+ ],[
],[
enable_video_vulkan=no
+ ])
+ ;;
+ *-*-darwin*)
+ save_CFLAGS="$CFLAGS"
+ dnl Work around that we don't have Objective-C support in autoconf
+ CFLAGS="$CFLAGS -x objective-c"
+ AC_TRY_COMPILE([
+ #include <Cocoa/Cocoa.h>
+ #include <Metal/Metal.h>
+ #include <QuartzCore/CAMetalLayer.h>
+
+ #if !TARGET_CPU_X86_64
+ #error Vulkan doesn't work on this configuration
+ #endif
+ ],[
],[
+ ],[
+ enable_video_vulkan=no
])
+ CFLAGS="$save_CFLAGS"
;;
*)
;;
@@ -2431,7 +2447,7 @@ CheckVulkan()
if test x$enable_video_vulkan = xno; then
# For reasons I am totally unable to see, I get an undefined macro error if
# I put this in the AC_TRY_COMPILE.
- AC_MSG_WARN([Sorry, Vulkan does not work on this configuration.])
+ AC_MSG_WARN([Vulkan does not work on this configuration.])
fi
fi
if test x$enable_video_vulkan = xyes; then
diff --git a/src/video/cocoa/SDL_cocoametalview.h b/src/video/cocoa/SDL_cocoametalview.h
index 75751c0..745dea3 100644
--- a/src/video/cocoa/SDL_cocoametalview.h
+++ b/src/video/cocoa/SDL_cocoametalview.h
@@ -34,9 +34,9 @@
#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
-#import <Cocoa/Cocoa.h>
-#import <Metal/Metal.h>
-#import <QuartzCore/CAMetalLayer.h>
+#include <Cocoa/Cocoa.h>
+#include <Metal/Metal.h>
+#include <QuartzCore/CAMetalLayer.h>
#define METALVIEW_TAG 255