[Mesa-dev] [PATCH] clover: add --with-icd-file-dir option

Ilia Mirkin imirkin at alum.mit.edu
Sat May 2 10:31:41 PDT 2015


On Sat, May 2, 2015 at 1:19 PM, EdB <edb+mesa at sigluy.net> wrote:
> The standard ICD file path is /etc/OpenCL/vendor/.
> However it doesn't fit well with custom build.
> This option allow ICD vendor file installation path override
> ---
>  configure.ac                           | 6 ++++++
>  src/gallium/targets/opencl/Makefile.am | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 095e23e..bf08d76 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2005,6 +2005,12 @@ AC_ARG_WITH([d3d-libdir],
>      [D3D_DRIVER_INSTALL_DIR="$withval"],
>      [D3D_DRIVER_INSTALL_DIR="${libdir}/d3d"])
>  AC_SUBST([D3D_DRIVER_INSTALL_DIR])
> +AC_ARG_WITH([icd-file-dir],
> +    [AS_HELP_STRING([--with-icd-file-dir=DIR],
> +        [directory for the OpenCL ICD vendor file @<:@/etc/OpenCL/vendors@:>@])],
> +    [ICD_FILE_INSTALL_DIR="$withval"],
> +    [ICD_FILE_INSTALL_DIR="/etc/OpenCL/vendors"])

What about making this default to ${sysconfdir}/OpenCL/vendors ? That
way using --prefix should auto-make it go into the prefix instead of
unexpectedly installing things outside of the specified prefix? That
way a distro build which specifies --sysconfdir as /etc will get it in
the right place, while by default it'll go into /usr/local/etc and a
user can override the icd loader's default behaviour with
OPENCL_VENDOR_PATH?

> +AC_SUBST([ICD_FILE_INSTALL_DIR])
>
>  dnl
>  dnl Gallium helper functions
> diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
> index 5daf327..9f0e58e 100644
> --- a/src/gallium/targets/opencl/Makefile.am
> +++ b/src/gallium/targets/opencl/Makefile.am
> @@ -47,7 +47,7 @@ EXTRA_lib at OPENCL_LIBNAME@_la_DEPENDENCIES = opencl.sym
>  EXTRA_DIST = mesa.icd opencl.sym
>
>  if HAVE_CLOVER_ICD
> -icddir = /etc/OpenCL/vendors/
> +icddir = $(ICD_FILE_INSTALL_DIR)
>  icd_DATA = mesa.icd
>  endif
>
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list