configure.in
changeset 11365 a9bd2625fa01
parent 11337 d9f24e95e8ba
child 11367 e8fc755a89e8
     1.1 --- a/configure.in	Sun Aug 27 19:10:30 2017 -0700
     1.2 +++ b/configure.in	Sun Aug 27 22:15:57 2017 -0400
     1.3 @@ -2401,6 +2401,62 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl Check to see if Vulkan surface support is desired
     1.8 +AC_ARG_ENABLE(video-vulkan,
     1.9 +AC_HELP_STRING([--enable-video-vulkan], [include Vulkan surface support [[default=yes]]]),
    1.10 +              , enable_video_vulkan=yes)
    1.11 +
    1.12 +dnl Find Vulkan Header
    1.13 +CheckVulkan()
    1.14 +{
    1.15 +    have_vulkan_hdr=no
    1.16 +    if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
    1.17 +        case "$host" in
    1.18 +            *-*-androideabi*)
    1.19 +                AC_TRY_COMPILE([
    1.20 +                  #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
    1.21 +                  #error Vulkan doesn't work on this configuration
    1.22 +                  #endif
    1.23 +                  int main()
    1.24 +                  {
    1.25 +                     return 0;
    1.26 +                  }
    1.27 +                ],[
    1.28 +                    enable_video_vulkan=no
    1.29 +                ],[
    1.30 +                ])
    1.31 +                ;;
    1.32 +            *)
    1.33 +                ;;
    1.34 +        esac
    1.35 +        if test x$enable_video_vulkan = xno; then
    1.36 +            # For reasons I am totally unable to see, I get an undefined macro error if
    1.37 +            # I put this in the AC_TRY_COMPILE.
    1.38 +            AC_MSG_WARN([Sorry, Vulkan does not work on this configuration.])
    1.39 +        fi
    1.40 +        if test x$enable_video_vulkan = xyes; then
    1.41 +            vsdk_include_dir="${VULKAN_SDK}/include"
    1.42 +            vulkan_header="vulkan/vulkan.h"
    1.43 +            save_CPPFLAGS="$CPPFLAGS"
    1.44 +            CPPFLAGS="${save_CPPFLAGS} -I$vsdk_include_dir"
    1.45 +            AC_CHECK_HEADER($vulkan_header,
    1.46 +                            have_vulkan_hdr=yes,
    1.47 +                            have_vulkan_hdr=no)
    1.48 +            CPPFLAGS="$save_CPPFLAGS"
    1.49 +        fi
    1.50 +    fi
    1.51 +    if test x$have_vulkan_hdr = xyes; then
    1.52 +        # vulkan.h has been found in either $VULKAN_SDK/include or along the
    1.53 +        # the standard include path. Unfortunately there seems no easy
    1.54 +        # way to find out which, so...
    1.55 +        if test -n "$VULKAN_SDK" -a -f "$vsdk_include_dir/$vulkan_header"; then 
    1.56 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$vsdk_include_dir"
    1.57 +        fi
    1.58 +        AC_DEFINE(SDL_VIDEO_VULKAN_SURFACE, 1, [ ])
    1.59 +        SUMMARY_video="${SUMMARY_video} vulkan"
    1.60 +    fi
    1.61 +}
    1.62 +
    1.63  dnl See if we can use the new unified event interface in Linux 2.4
    1.64  CheckInputEvents()
    1.65  {
    1.66 @@ -3230,6 +3286,7 @@
    1.67          CheckKMSDRM
    1.68          CheckOpenGLX11
    1.69          CheckOpenGLESX11
    1.70 +        CheckVulkan
    1.71          CheckMir
    1.72          CheckWayland
    1.73          CheckLibUDev
    1.74 @@ -3375,6 +3432,7 @@
    1.75          CheckWINDOWS
    1.76          CheckWINDOWSGL
    1.77          CheckWINDOWSGLES
    1.78 +        CheckVulkan
    1.79          CheckDIRECTX
    1.80  
    1.81          # Set up the core platform files
    1.82 @@ -3559,6 +3617,7 @@
    1.83          CheckDummyAudio
    1.84          CheckDLOPEN
    1.85          CheckPTHREAD
    1.86 +        CheckVulkan
    1.87  
    1.88          # Set up files for the audio library
    1.89          if test x$enable_audio = xyes; then
    1.90 @@ -3621,6 +3680,9 @@
    1.91          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
    1.92          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
    1.93          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
    1.94 +        if test x$ac_cv_header_vulkan_vulkan_h = xyes; then
    1.95 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
    1.96 +        fi
    1.97          ;;
    1.98      *-*-darwin* )
    1.99          # This could be either full "Mac OS X", or plain "Darwin" which is
   1.100 @@ -3642,6 +3704,7 @@
   1.101          CheckX11
   1.102          CheckMacGL
   1.103          CheckOpenGLX11
   1.104 +        CheckVulkan
   1.105          CheckPTHREAD
   1.106  
   1.107          # Set up files for the audio library
   1.108 @@ -3695,6 +3758,9 @@
   1.109          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
   1.110          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
   1.111          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
   1.112 +        if test x$ac_cv_header_vulkan_vulkan_h = xyes; then
   1.113 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
   1.114 +        fi
   1.115          ;;
   1.116      *-nacl|*-pnacl)
   1.117          ARCH=nacl