From: Marcin Ślusarz Date: Sat, 19 Sep 2015 17:17:34 +0000 (+0200) Subject: dri/common: use sysconfdir when looking for drirc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c228514c72cb2fd5fb9e510808e29204fc9e7ae1;p=mesa.git dri/common: use sysconfdir when looking for drirc Useful when locally installed mesa has more quirks than the system one. Signed-off-by: Marcin Ślusarz Reviewed-by: Ilia Mirkin Reviewed-by: Emil Velikov --- diff --git a/docs/autoconf.html b/docs/autoconf.html index 2ef8c63dbee..5c29e5ee2c6 100644 --- a/docs/autoconf.html +++ b/docs/autoconf.html @@ -87,6 +87,13 @@ created in a lib64 directory at the top of the Mesa source tree.

+
--sysconfdir=DIR
+

This option specifies the directory where the configuration +files will be installed. The default is ${prefix}/etc. +Currently there's only one config file provided when dri drivers are +enabled - it's drirc.

+
+
--enable-static, --disable-shared

By default, Mesa will build shared libraries. Either of these options will force static @@ -217,7 +224,7 @@ GLX.

--with-expat=DIR

DEPRECATED, use PKG_CONFIG_PATH instead.

The DRI-enabled libGL uses expat to -parse the DRI configuration files in /etc/drirc and +parse the DRI configuration files in ${sysconfdir}/drirc and ~/.drirc. This option allows a specific expat installation to be used. For example, --with-expat=/usr/local will search for expat headers and libraries in /usr/local/include diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am index b307f10f56b..ea52cb5a0d8 100644 --- a/src/mesa/drivers/dri/common/Makefile.am +++ b/src/mesa/drivers/dri/common/Makefile.am @@ -34,6 +34,7 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/gallium/auxiliary \ $(LIBDRM_CFLAGS) \ $(DEFINES) \ + -DSYSCONFDIR=\"$(sysconfdir)\" $(VISIBILITY_CFLAGS) noinst_LTLIBRARIES = \ diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index f17693e739f..b8ab480ddfe 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -935,9 +935,13 @@ static void parseOneConfigFile (XML_Parser p) { #undef BUF_SIZE } +#ifndef SYSCONFDIR +#define SYSCONFDIR "/etc" +#endif + void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info, int screenNum, const char *driverName) { - char *filenames[2] = {"/etc/drirc", NULL}; + char *filenames[2] = { SYSCONFDIR "/drirc", NULL}; char *home; uint32_t i; struct OptConfData userData;