anv: Give the installed intel_icd.json file an absolute path
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Aug 2016 16:01:14 +0000 (09:01 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 20 Aug 2016 07:50:03 +0000 (00:50 -0700)
Not providing a path allows the ICD to work on multi-arch systems but
breaks it if you install anywhere other than /usr/lib.  Given that users
may be installing locally in .local or similar, we probably do want to
provide a filename.  Distros can carry a revert of this commit if they want
an intel_icd.json file without the path.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chad@kiwitree.net>
src/intel/vulkan/.gitignore
src/intel/vulkan/Makefile.am
src/intel/vulkan/intel_icd.json [deleted file]
src/intel/vulkan/intel_icd.json.in [new file with mode: 0644]

index bde5cd82f40f2a56fb64a25244f246270a15282d..a099ff6a1db8be168902cfbc37d341b30c16e14c 100644 (file)
@@ -3,3 +3,4 @@
 /anv_entrypoints.h
 /anv_timestamp.h
 /dev_icd.json
+/intel_icd.json
index ad0148da57b2be601a57fb3591a81e089702e5b3..9fef960baa04e7de2850b757c04ebce0e5e4a051 100644 (file)
@@ -141,7 +141,7 @@ anv_timestamp.h:
        $(AM_V_GEN) echo "#define ANV_TIMESTAMP \"$(TIMESTAMP_CMD)\"" > $@
 
 BUILT_SOURCES = $(VULKAN_GENERATED_FILES)
-CLEANFILES = $(BUILT_SOURCES) dev_icd.json
+CLEANFILES = $(BUILT_SOURCES) dev_icd.json intel_icd.json
 EXTRA_DIST = \
        $(top_srcdir)/include/vulkan/vk_icd.h \
        anv_entrypoints_gen.py \
@@ -170,6 +170,11 @@ dev_icd.json : dev_icd.json.in
                -e "s#@build_libdir@#${abs_top_builddir}/${LIB_DIR}#" \
                < $(srcdir)/dev_icd.json.in > $@
 
+intel_icd.json : intel_icd.json.in
+       $(AM_V_GEN) $(SED) \
+               -e "s#@install_libdir@#${libdir}#" \
+               < $(srcdir)/intel_icd.json.in > $@
+
 # Libvulkan with dummy gem. Used for unit tests.
 libvulkan_test_la_SOURCES = $(VULKAN_GEM_STUB_FILES)
 libvulkan_test_la_LIBADD = $(VULKAN_LIB_DEPS) -lX11-xcb
diff --git a/src/intel/vulkan/intel_icd.json b/src/intel/vulkan/intel_icd.json
deleted file mode 100644 (file)
index 277c14e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "file_format_version": "1.0.0",
-    "ICD": {
-        "library_path": "libvulkan_intel.so",
-        "abi_versions": "1.0.3"
-    }
-}
diff --git a/src/intel/vulkan/intel_icd.json.in b/src/intel/vulkan/intel_icd.json.in
new file mode 100644 (file)
index 0000000..d9b363a
--- /dev/null
@@ -0,0 +1,7 @@
+{
+    "file_format_version": "1.0.0",
+    "ICD": {
+        "library_path": "@install_libdir@/libvulkan_intel.so",
+        "abi_versions": "1.0.3"
+    }
+}