configure.in
changeset 11408 0783887749f6
parent 11395 a8c29f5b679f
child 11409 3a5c77515d55
equal deleted inserted replaced
11407:ff9e8ae4d4fb 11408:0783887749f6
  1981     AC_ARG_ENABLE(video-cocoa,
  1981     AC_ARG_ENABLE(video-cocoa,
  1982 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
  1982 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
  1983                   , enable_video_cocoa=yes)
  1983                   , enable_video_cocoa=yes)
  1984     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  1984     if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
  1985         save_CFLAGS="$CFLAGS"
  1985         save_CFLAGS="$CFLAGS"
  1986         dnl work around that we don't have Objective-C support in autoconf
  1986         dnl Work around that we don't have Objective-C support in autoconf
  1987         CFLAGS="$CFLAGS -x objective-c"
  1987         CFLAGS="$CFLAGS -x objective-c"
  1988         AC_MSG_CHECKING(for Cocoa framework)
  1988         AC_MSG_CHECKING(for Cocoa framework)
  1989         have_cocoa=no
  1989         have_cocoa=no
  1990         AC_TRY_COMPILE([
  1990         AC_TRY_COMPILE([
  1991           #import <Cocoa/Cocoa.h>
  1991           #import <Cocoa/Cocoa.h>
  2399             SUMMARY_video="${SUMMARY_video} opengl_es2"
  2399             SUMMARY_video="${SUMMARY_video} opengl_es2"
  2400         fi
  2400         fi
  2401     fi
  2401     fi
  2402 }
  2402 }
  2403 
  2403 
  2404 dnl Check to see if Vulkan surface support is desired
  2404 dnl Check to see if Vulkan support is desired
  2405 AC_ARG_ENABLE(video-vulkan,
  2405 AC_ARG_ENABLE(video-vulkan,
  2406 AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
  2406 AC_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
  2407               , enable_video_vulkan=yes)
  2407               , enable_video_vulkan=yes)
  2408 
  2408 
  2409 dnl Find Vulkan Header
  2409 dnl Find Vulkan Header
  2411 {
  2411 {
  2412     if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
  2412     if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
  2413         case "$host" in
  2413         case "$host" in
  2414             *-*-androideabi*)
  2414             *-*-androideabi*)
  2415                 AC_TRY_COMPILE([
  2415                 AC_TRY_COMPILE([
  2416                   #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
  2416                   #if defined(__ARM_ARCH) && __ARM_ARCH < 7
  2417                   #error Vulkan doesn't work on this configuration
  2417                   #error Vulkan doesn't work on this configuration
  2418                   #endif
  2418                   #endif
  2419                   int main()
  2419                 ],[
  2420                   {
  2420                 ],[
  2421                      return 0;
       
  2422                   }
       
  2423                 ],[
  2421                 ],[
  2424                     enable_video_vulkan=no
  2422                     enable_video_vulkan=no
       
  2423                 ])
       
  2424                 ;;
       
  2425             *-*-darwin*)
       
  2426                 save_CFLAGS="$CFLAGS"
       
  2427                 dnl Work around that we don't have Objective-C support in autoconf
       
  2428                 CFLAGS="$CFLAGS -x objective-c"
       
  2429                 AC_TRY_COMPILE([
       
  2430                   #include <Cocoa/Cocoa.h>
       
  2431                   #include <Metal/Metal.h>
       
  2432                   #include <QuartzCore/CAMetalLayer.h>
       
  2433 
       
  2434                   #if !TARGET_CPU_X86_64
       
  2435                   #error Vulkan doesn't work on this configuration
       
  2436                   #endif
  2425                 ],[
  2437                 ],[
       
  2438                 ],[
       
  2439                 ],[
       
  2440                     enable_video_vulkan=no
  2426                 ])
  2441                 ])
       
  2442                 CFLAGS="$save_CFLAGS"
  2427                 ;;
  2443                 ;;
  2428             *)
  2444             *)
  2429                 ;;
  2445                 ;;
  2430         esac
  2446         esac
  2431         if test x$enable_video_vulkan = xno; then
  2447         if test x$enable_video_vulkan = xno; then
  2432             # For reasons I am totally unable to see, I get an undefined macro error if
  2448             # For reasons I am totally unable to see, I get an undefined macro error if
  2433             # I put this in the AC_TRY_COMPILE.
  2449             # I put this in the AC_TRY_COMPILE.
  2434             AC_MSG_WARN([Sorry, Vulkan does not work on this configuration.])
  2450             AC_MSG_WARN([Vulkan does not work on this configuration.])
  2435         fi
  2451         fi
  2436     fi
  2452     fi
  2437     if test x$enable_video_vulkan = xyes; then
  2453     if test x$enable_video_vulkan = xyes; then
  2438         AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
  2454         AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
  2439         SUMMARY_video="${SUMMARY_video} vulkan"
  2455         SUMMARY_video="${SUMMARY_video} vulkan"