<div dir="ltr"><div><div><div><div><div>I'm not sure what the final consensus will be on how to do this, but FWIW:<br></div>Tested-By: Aaron Watry <<a href="mailto:awatry@gmail.com">awatry@gmail.com</a>><br><br></div>I've tested this with 4 combinations:<br></div>no --with-opencl-icd option specified : libOpenCL.so gets installed in ${prefix}/lib<br>--with-opencl-icd=no : libOpenCL.so gets installed in ${prefix}/lib<br></div>--with-opencl-icd=standard : libMesaOpenCL.so installed in ${prefix}/lib, icd in /etc/OpenCL/vendors/mesa.icd<br>--with-opencl-icd=sysconfdir : libMesaOpenCL.so installed in ${prefix}/lib, icd in ${prefix}/etc//mesa.icd.  I only specified --prefix, no other directories overridden in configure command.<br><br></div>--Aaron<br><div><div>  <br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 4:34 PM, EdB <span dir="ltr"><<a href="mailto:edb+mesa@sigluy.net" target="_blank">edb+mesa@sigluy.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The standard ICD file path is /etc/OpenCL/vendor/.<br>
However it doesn't fit well with custom build.<br>
This option allow ICD vendor file installation path override<br>
---<br>
 <a href="http://configure.ac" target="_blank">configure.ac</a>                           | 46 +++++++++++++++++++++++-----------<br>
 src/gallium/targets/opencl/Makefile.am |  2 +-<br>
 2 files changed, 33 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" target="_blank">configure.ac</a> b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
index 095e23e..90dba4e 100644<br>
--- a/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
@@ -804,12 +804,6 @@ AC_ARG_ENABLE([opencl],<br>
          [enable OpenCL library @<:@default=disabled@:>@])],<br>
    [enable_opencl="$enableval"],<br>
    [enable_opencl=no])<br>
-AC_ARG_ENABLE([opencl_icd],<br>
-   [AS_HELP_STRING([--enable-opencl-icd],<br>
-          [Build an OpenCL ICD library to be loaded by an ICD implementation<br>
-           @<:@default=disabled@:>@])],<br>
-    [enable_opencl_icd="$enableval"],<br>
-    [enable_opencl_icd=no])<br>
 AC_ARG_ENABLE([xlib-glx],<br>
     [AS_HELP_STRING([--enable-xlib-glx],<br>
         [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],<br>
@@ -1689,19 +1683,11 @@ if test "x$enable_opencl" = xyes; then<br>
     # XXX: Use $enable_shared_pipe_drivers once converted to use static/shared pipe-drivers<br>
     enable_gallium_loader=yes<br>
<br>
-    if test "x$enable_opencl_icd" = xyes; then<br>
-        OPENCL_LIBNAME="MesaOpenCL"<br>
-    else<br>
-        OPENCL_LIBNAME="OpenCL"<br>
-    fi<br>
-<br>
     if test "x$have_libelf" != xyes; then<br>
        AC_MSG_ERROR([Clover requires libelf])<br>
     fi<br>
 fi<br>
 AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)<br>
-AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)<br>
-AC_SUBST([OPENCL_LIBNAME])<br>
<br>
 dnl<br>
 dnl Gallium configuration<br>
@@ -2006,6 +1992,38 @@ AC_ARG_WITH([d3d-libdir],<br>
     [D3D_DRIVER_INSTALL_DIR="${libdir}/d3d"])<br>
 AC_SUBST([D3D_DRIVER_INSTALL_DIR])<br>
<br>
+dnl OpenCL ICD<br>
+<br>
+AC_ARG_WITH([opencl-icd],<br>
+    [AS_HELP_STRING([--with-opencl-icd=@<:@no,standard,sysconfdir@:>@],<br>
+        [Build an OpenCL ICD library to be loaded by an ICD implementation.<br>
+         If @<:@standard@:>@ the OpenCL ICD vendor file installs in /etc/OpenCL/vendors.<br>
+         @<:@sysconfdir@:>@ installs the file in $sysconfdir/OpenCL/vendors<br>
+         @<:@default=no@:>@])],<br>
+    [OPENCL_ICD="$withval"],<br>
+    [OPENCL_ICD="no"])<br>
+<br>
+case "x$OPENCL_ICD" in<br>
+xno)<br>
+    OPENCL_LIBNAME="OpenCL"<br>
+    ;;<br>
+xstandard)<br>
+    OPENCL_LIBNAME="MesaOpenCL"<br>
+    ICD_FILE_DIR="/etc/OpenCL/vendors"<br>
+    ;;<br>
+xsysconfdir)<br>
+    OPENCL_LIBNAME="MesaOpenCL"<br>
+    ICD_FILE_DIR="$sysconfdir/OpenCL/vendors"<br>
+    ;;<br>
+*)<br>
+    AC_MSG_ERROR(['$OPENCL_ICD' is not a valid option for --with-opencl-icd])<br>
+    ;;<br>
+esac<br>
+<br>
+AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$OPENCL_ICD" != xno)<br>
+AC_SUBST([OPENCL_LIBNAME])<br>
+AC_SUBST([ICD_FILE_DIR])<br>
+<br>
 dnl<br>
 dnl Gallium helper functions<br>
 dnl<br>
diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am<br>
index 5daf327..781daa0 100644<br>
--- a/src/gallium/targets/opencl/Makefile.am<br>
+++ b/src/gallium/targets/opencl/Makefile.am<br>
@@ -47,7 +47,7 @@ EXTRA_lib@OPENCL_LIBNAME@_la_DEPENDENCIES = opencl.sym<br>
 EXTRA_DIST = mesa.icd opencl.sym<br>
<br>
 if HAVE_CLOVER_ICD<br>
-icddir = /etc/OpenCL/vendors/<br>
+icddir = $(ICD_FILE_DIR)<br>
 icd_DATA = mesa.icd<br>
 endif<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.1.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>