configure: Add initial support for enabling Vulkan drivers
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Mar 2016 19:00:24 +0000 (12:00 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 14 Apr 2016 22:15:00 +0000 (15:15 -0700)
configure.ac
src/Makefile.am
src/intel/Makefile.am

index 24c069f23a36435b3f9c232516c47d8084328fc4..0d3f0ff3c9d80f113387f51261afcf9b9189d862 100644 (file)
@@ -1545,6 +1545,59 @@ if test -n "$with_dri_drivers"; then
     DRI_DIRS=`echo $DRI_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
 fi
 
+
+#
+# Vulkan driver configuration
+#
+
+# Keep this in sync with the --with-vulkan-drivers help string default value
+VULKAN_DRIVERS_DEFAULT="intel"
+
+AC_ARG_WITH([vulkan-drivers],
+    [AS_HELP_STRING([--with-vulkan-drivers@<:@=DIRS...@:>@],
+        [comma delimited Vulkan drivers list, e.g.
+        "intel"
+        @<:@default=intel@:>@])],
+    [with_vulkan_drivers="$withval"],
+    [with_vulkan_drivers="$VULKAN_DRIVERS_DEFAULT"])
+
+# Doing '--without-vulkan-drivers' will set this variable to 'no'.  Clear it
+# here so that the script doesn't choke on an unknown driver name later.
+case "$with_vulkan_drivers" in
+    yes) with_vulkan_drivers="$VULKAN_DRIVERS_DEFAULT" ;;
+    no) with_vulkan_drivers='' ;;
+esac
+
+AC_ARG_WITH([vulkan-icddir],
+    [AS_HELP_STRING([--with-vulkan-icddir=DIR],
+        [directory for the Vulkan driver icd files @<:@${libdir}/dri@:>@])],
+    [VULKAN_ICD_INSTALL_DIR="$withval"],
+    [VULKAN_ICD_INSTALL_DIR='${sysconfdir}/vulkan/icd.d'])
+AC_SUBST([VULKAN_ICD_INSTALL_DIR])
+
+if test -n "$with_vulkan_drivers"; then
+    VULKAN_DRIVERS=`IFS=', '; echo $with_vulkan_drivers`
+    for driver in $VULKAN_DRIVERS; do
+        case "x$driver" in
+        xintel)
+            if test "x$HAVE_I965_DRI" != xyes; then
+                AC_MSG_ERROR([Intel Vulkan driver requires the i965 dri driver])
+            fi
+            if test "x$with_sha1" == "x"; then
+                AC_MSG_ERROR([Intel Vulkan driver requires SHA1])
+            fi
+            HAVE_INTEL_VULKAN=yes;
+
+            ;;
+        *)
+            AC_MSG_ERROR([Vulkan driver '$driver' does not exist])
+            ;;
+        esac
+    done
+    VULKAN_DRIVERS=`echo $VULKAN_DRIVERS|tr " " "\n"|sort -u|tr "\n" " "`
+fi
+
+
 AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
 AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
                                   "x$enable_osmesa" = xyes -o \
@@ -1632,8 +1685,6 @@ GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
 AC_SUBST([GBM_PC_REQ_PRIV])
 AC_SUBST([GBM_PC_LIB_PRIV])
 
-AM_CONDITIONAL(HAVE_VULKAN, true)
-
 dnl
 dnl EGL configuration
 dnl
@@ -2401,6 +2452,10 @@ AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
 AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
 AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
 
+AM_CONDITIONAL(HAVE_INTEL_VULKAN, test "x$HAVE_INTEL_VULKAN" = xyes)
+
+AM_CONDITIONAL(HAVE_INTEL_DRIVERS, test "x$HAVE_INTEL_VULKAN" = xyes)
+
 AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$HAVE_GALLIUM_R300" = xyes -o \
                                             "x$HAVE_GALLIUM_R600" = xyes -o \
                                             "x$HAVE_GALLIUM_RADEONSI" = xyes)
@@ -2647,6 +2702,15 @@ if test "$enable_egl" = yes; then
     echo "        EGL drivers:    $egl_drivers"
 fi
 
+# Vulkan
+echo ""
+if test "x$VULKAN_DRIVERS" != x; then
+    echo "        Vulkan drivers:  $VULKAN_DRIVERS"
+    echo "        Vulkan ICD dir:  $VULKAN_ICD_INSTALL_DIR"
+else
+    echo "        Vulkan drivers:  no"
+fi
+
 echo ""
 if test "x$MESA_LLVM" = x1; then
     echo "        llvm:            yes"
index 73686a93b3c2384dd6ce6eb8b56c960ab1cc73dc..a0572b7a563adbbd32ddbf74c1747caf5bbe1e07 100644 (file)
@@ -56,7 +56,7 @@ EXTRA_DIST = \
 AM_CFLAGS = $(VISIBILITY_CFLAGS)
 AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
 
-if HAVE_VULKAN
+if HAVE_INTEL_DRIVERS
 SUBDIRS += intel
 endif
 
index d5bd0b3b5df849de24dbc9ab8c3eb09c4a6f9331..c3673c6e7c88f7bca83d054e20c49e41c0db5ec7 100644 (file)
@@ -19,4 +19,8 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
-SUBDIRS = genxml isl vulkan
+SUBDIRS = genxml isl
+
+if HAVE_INTEL_VULKAN
+SUBDIRS += vulkan
+endif