[Mesa-dev] [PATCH] meson: correctly set SYSCONFDIR for loading dirrc
Marc Dietrich
marvin24 at gmx.de
Wed Jan 24 10:39:11 UTC 2018
Hi Dylan,
Am Dienstag, 23. Januar 2018, 19:28:08 CET schrieb Dylan Baker:
> Fixes: d1992255bb29 ("meson: Add build Intel "anv" vulkan driver")
> Reported-by: Marc Dietrich <marvin24 at gmx.de>
> Signed-off-by: Dylan Baker <dylan.c.baker at intel.com>
> ---
> src/util/meson.build | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/util/meson.build b/src/util/meson.build
> index fa591c92e56..b23dba3a985 100644
> --- a/src/util/meson.build
> +++ b/src/util/meson.build
> @@ -112,8 +112,12 @@ libxmlconfig = static_library(
> files_xmlconfig,
> include_directories : inc_common,
> dependencies : [dep_expat, dep_m],
> - c_args : [c_msvc_compat_args, c_vis_args,
> - '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
> + c_args : [
> + c_msvc_compat_args, c_vis_args,
> + '-DSYSCONFDIR="@0@"'.format(
> + join_paths(get_option('prefix'), get_option('sysconfdir'))
> + ),
> + ],
> build_by_default : false,
> )
this won't work as the prefix is often set to /usr, which results in
sysconfdir to be /usr/etc. As this is a special case, and "/etc" is the
default meson sysconfdir, we could just test for "prefix=/usr" and set
sysconfdir to prefix/sysconfdir if it is not.
This works for me, but dosn't look meson-stylish:
diff --git a/src/util/meson.build b/src/util/meson.build
index fa591c92e5..6294e188f2 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -83,8 +83,6 @@ files_mesa_util = files(
'u_vector.h',
)
-install_data('drirc', install_dir : get_option('sysconfdir'))
-
files_xmlconfig = files(
'xmlconfig.c',
'xmlconfig.h',
@@ -107,13 +105,23 @@ libmesa_util = static_library(
build_by_default : false
)
+if get_option('prefix') != '/usr'
+ sysconfarg = join_paths(get_option('prefix'), get_option('sysconfdir'))
+else
+ sysconfarg = '/' + get_option('sysconfdir')
+endif
+
+install_data('drirc', install_dir : sysconfarg)
+
libxmlconfig = static_library(
'xmlconfig',
files_xmlconfig,
include_directories : inc_common,
dependencies : [dep_expat, dep_m],
- c_args : [c_msvc_compat_args, c_vis_args,
- '-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
+ c_args : [
+ c_msvc_compat_args, c_vis_args,
+ '-DSYSCONFDIR="' + sysconfarg + '"',
+ ],
build_by_default : false,
)
Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180124/34e6d815/attachment.sig>
More information about the mesa-dev
mailing list