summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac23
-rw-r--r--src/util/Makefile.am4
-rw-r--r--src/util/Makefile.sources2
-rw-r--r--src/util/SConscript5
4 files changed, 30 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 5b867de481..a4c5c74c29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1043,11 +1043,26 @@ if test "x$with_sha1" = xlibcrypto; then
fi
fi
AC_MSG_CHECKING([for SHA1 implementation])
-AM_CONDITIONAL([HAVE_SHA1], [test x$with_sha1 != x])
AC_MSG_RESULT([$with_sha1])
AC_SUBST(SHA1_LIBS)
AC_SUBST(SHA1_CFLAGS)
+# Allow user to configure out the shader-cache feature
+AC_ARG_ENABLE([shader-cache],
+ AS_HELP_STRING([--disable-shader-cache], [Disable binary shader cache]),
+ [enable_shader_cache="$enableval"],
+ [if test "x$with_sha1" != "x"; then
+ enable_shader_cache=yes
+ else
+ enable_shader_cache=no
+ fi])
+if test "x$with_sha1" = "x"; then
+ if test "x$enable_shader_cache" = "xyes"; then
+ AC_MSG_ERROR([Cannot enable shader cache (no SHA-1 implementation found)])
+ fi
+fi
+AM_CONDITIONAL([ENABLE_SHADER_CACHE], [test x$enable_shader_cache = xyes])
+
# Check for libdrm
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
[have_libdrm=yes], [have_libdrm=no])
@@ -2490,6 +2505,12 @@ else
echo " Gallium: no"
fi
+dnl Shader cache
+echo ""
+echo " Shader cache: $enable_shader_cache"
+if test "x$enable_shader_cache" = "xyes"; then
+ echo " With SHA1 from: $with_sha1"
+fi
dnl Libraries
echo ""
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 03b619efeb..7512138a89 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -38,8 +38,8 @@ libmesautil_la_SOURCES = \
$(MESA_UTIL_FILES) \
$(MESA_UTIL_GENERATED_FILES)
-if HAVE_SHA1
-libmesautil_la_SOURCES += $(MESA_UTIL_SHA1_FILES)
+if ENABLE_SHADER_CACHE
+libmesautil_la_SOURCES += $(MESA_UTIL_SHADER_CACHE_FILES)
endif
libmesautil_la_LIBADD = $(SHA1_LIBS)
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index 4e54c74600..52ae5cc7a9 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -1,4 +1,4 @@
-MESA_UTIL_SHA1_FILES := \
+MESA_UTIL_SHADER_CACHE_FILES := \
sha1.c \
sha1.h
diff --git a/src/util/SConscript b/src/util/SConscript
index 34b9a2deaa..28fedd80cd 100644
--- a/src/util/SConscript
+++ b/src/util/SConscript
@@ -29,6 +29,11 @@ mesautil_sources = (
source_lists['MESA_UTIL_GENERATED_FILES']
)
+# XXX We don't yet have scons support for detecting any of the various
+# HAVE_SHA1_* definitions, so for now simply disable the shader cache.
+if False:
+ mesautil_sources += source_lists['MESA_UTIL_SHADER_CACHE_FILES']
+
mesautil = env.ConvenienceLibrary(
target = 'mesautil',
source = mesautil_sources,