From: Kristian Høgsberg Kristensen Date: Wed, 17 Feb 2016 07:23:17 +0000 (-0800) Subject: anv: Make driver and icd file installable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ecc67f1aacffd848887a711511772fc3f175279b;p=mesa.git anv: Make driver and icd file installable Change the name of the .so to libvulkan_intel.so and add an installable icd with the installed paths. Keep the icd file with build-tree paths, but rename to dev_icd.json to make it clear that it's for development purposes. --- diff --git a/configure.ac b/configure.ac index acfca57a400..71bec624121 100644 --- a/configure.ac +++ b/configure.ac @@ -2541,7 +2541,6 @@ AC_CONFIG_FILES([Makefile src/mesa/drivers/x11/Makefile src/mesa/main/tests/Makefile src/vulkan/Makefile - src/vulkan/anv_icd.json src/vulkan/tests/Makefile src/util/Makefile src/util/tests/hash_table/Makefile]) diff --git a/src/vulkan/.gitignore b/src/vulkan/.gitignore index 2980dbfece3..40afc2e3989 100644 --- a/src/vulkan/.gitignore +++ b/src/vulkan/.gitignore @@ -4,5 +4,6 @@ /anv_entrypoints.h /wayland-drm-protocol.c /wayland-drm-client-protocol.h -/anv_icd.json +/dev_icd.json +/intel_icd.json /gen*_pack.h \ No newline at end of file diff --git a/src/vulkan/Makefile.am b/src/vulkan/Makefile.am index 081f6b67682..220bdbf5cec 100644 --- a/src/vulkan/Makefile.am +++ b/src/vulkan/Makefile.am @@ -34,7 +34,7 @@ VULKAN_ENTRYPOINT_CPPFLAGS = \ -DVK_USE_PLATFORM_XCB_KHR \ -DVK_USE_PLATFORM_WAYLAND_KHR -lib_LTLIBRARIES = libvulkan.la +lib_LTLIBRARIES = libvulkan_intel.la check_LTLIBRARIES = libvulkan-test.la @@ -67,7 +67,7 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/compiler/nir \ -I$(top_builddir)/src/vulkan -libvulkan_la_CFLAGS = $(CFLAGS) -Wno-override-init +libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init VULKAN_SOURCES = \ anv_allocator.c \ @@ -111,7 +111,7 @@ libanv_gen7_la_SOURCES = \ gen7_cmd_buffer.c \ gen7_pipeline.c \ gen7_state.c -libanv_gen7_la_CFLAGS = $(libvulkan_la_CFLAGS) -DANV_GENx10=70 +libanv_gen7_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DANV_GENx10=70 libanv_gen75_la_SOURCES = \ genX_cmd_buffer.c \ @@ -119,7 +119,7 @@ libanv_gen75_la_SOURCES = \ gen7_cmd_buffer.c \ gen7_pipeline.c \ gen7_state.c -libanv_gen75_la_CFLAGS = $(libvulkan_la_CFLAGS) -DANV_GENx10=75 +libanv_gen75_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DANV_GENx10=75 libanv_gen8_la_SOURCES = \ genX_cmd_buffer.c \ @@ -127,7 +127,7 @@ libanv_gen8_la_SOURCES = \ gen8_cmd_buffer.c \ gen8_pipeline.c \ gen8_state.c -libanv_gen8_la_CFLAGS = $(libvulkan_la_CFLAGS) -DANV_GENx10=80 +libanv_gen8_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DANV_GENx10=80 libanv_gen9_la_SOURCES = \ genX_cmd_buffer.c \ @@ -135,7 +135,7 @@ libanv_gen9_la_SOURCES = \ gen8_cmd_buffer.c \ gen8_pipeline.c \ gen8_state.c -libanv_gen9_la_CFLAGS = $(libvulkan_la_CFLAGS) -DANV_GENx10=90 +libanv_gen9_la_CFLAGS = $(libvulkan_intel_la_CFLAGS) -DANV_GENx10=90 if HAVE_EGL_PLATFORM_WAYLAND BUILT_SOURCES += \ @@ -152,10 +152,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/egl/wayland/wayland-drm VULKAN_SOURCES += \ wayland-drm-protocol.c \ anv_wsi_wayland.c -libvulkan_la_CFLAGS += -DHAVE_WAYLAND_PLATFORM +libvulkan_intel_la_CFLAGS += -DHAVE_WAYLAND_PLATFORM endif -libvulkan_la_SOURCES = \ +libvulkan_intel_la_SOURCES = \ $(VULKAN_SOURCES) \ anv_gem.c @@ -170,7 +170,7 @@ anv_entrypoints.c : anv_entrypoints_gen.py $(vulkan_include_HEADERS) CLEANFILES = $(BUILT_SOURCES) -libvulkan_la_LIBADD = $(WAYLAND_LIBS) -lxcb -lxcb-dri3 \ +libvulkan_intel_la_LIBADD = $(WAYLAND_LIBS) -lxcb -lxcb-dri3 \ $(top_builddir)/src/isl/libisl.la \ $(top_builddir)/src/mesa/drivers/dri/i965/libi965_compiler.la \ ../mesa/libmesa.la \ @@ -178,6 +178,26 @@ libvulkan_la_LIBADD = $(WAYLAND_LIBS) -lxcb -lxcb-dri3 \ -lpthread -ldl -lstdc++ \ $(PER_GEN_LIBS) +libvulkan_intel_la_LDFLAGS = \ + -module -avoid-version -shared -shrext .so + + +# Generate icd files. It would be nice to just be able to add these to +# AC_CONFIG_FILES, but @libdir@ typically expands to '${exec_prefix}/lib64', +# which we can't put in the icd file. When running sed from the Makefile we +# can use ${libdir}, which expands completely and we avoid putting Makefile +# variables in the icd file. + +icdconfdir=$(sysconfdir)/vulkan/icd.d +icdconf_DATA = intel_icd.json +noinst_DATA = dev_icd.json + +%.json : %.json.in + $(AM_V_GEN) $(SED) \ + -e "s#@build_libdir@#${abs_top_builddir}/${LIB_DIR}#" \ + -e "s#@install_libdir@#${libdir}#" < $< > $@ + + # Libvulkan with dummy gem. Used for unit tests. libvulkan_test_la_SOURCES = \ diff --git a/src/vulkan/anv_icd.json.in b/src/vulkan/anv_icd.json.in deleted file mode 100644 index 40de043668b..00000000000 --- a/src/vulkan/anv_icd.json.in +++ /dev/null @@ -1,8 +0,0 @@ -{ - "file_format_version": "1.0.0", - "ICD": { - "library_path": "@abs_top_builddir@/@LIB_DIR@/libvulkan.so.0.0.0", - "abi_versions": "1.0.3" - } -} - diff --git a/src/vulkan/dev_icd.json.in b/src/vulkan/dev_icd.json.in new file mode 100644 index 00000000000..84920365289 --- /dev/null +++ b/src/vulkan/dev_icd.json.in @@ -0,0 +1,7 @@ +{ + "file_format_version": "1.0.0", + "ICD": { + "library_path": "@build_libdir@/libvulkan_intel.so", + "abi_versions": "1.0.3" + } +} diff --git a/src/vulkan/intel_icd.json.in b/src/vulkan/intel_icd.json.in new file mode 100644 index 00000000000..d9b363a9762 --- /dev/null +++ b/src/vulkan/intel_icd.json.in @@ -0,0 +1,7 @@ +{ + "file_format_version": "1.0.0", + "ICD": { + "library_path": "@install_libdir@/libvulkan_intel.so", + "abi_versions": "1.0.3" + } +}