anv: Make driver and icd file installable
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Wed, 17 Feb 2016 07:23:17 +0000 (23:23 -0800)
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Wed, 17 Feb 2016 07:23:17 +0000 (23:23 -0800)
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.

configure.ac
src/vulkan/.gitignore
src/vulkan/Makefile.am
src/vulkan/anv_icd.json.in [deleted file]
src/vulkan/dev_icd.json.in [new file with mode: 0644]
src/vulkan/intel_icd.json.in [new file with mode: 0644]

index acfca57a40005fbb609f3c374c8520dd2fc3cab2..71bec62412157e7fab7e7c5da89e216e5bc01f71 100644 (file)
@@ -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])
index 2980dbfece35e71cdbc18fc6990f8d376ccf8a4c..40afc2e39899d96a269d4735f6ddec5647cc6f23 100644 (file)
@@ -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
index 081f6b67682a2dbb080d591c79807b79a81b50fe..220bdbf5cec257bdf42777d3719046d488129caa 100644 (file)
@@ -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 (file)
index 40de043..0000000
+++ /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 (file)
index 0000000..8492036
--- /dev/null
@@ -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 (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"
+    }
+}