summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Ślusarz <marcin.slusarz@gmail.com>2015-09-19 19:17:34 +0200
committerMarcin Ślusarz <marcin.slusarz@gmail.com>2015-09-19 19:17:34 +0200
commitc228514c72cb2fd5fb9e510808e29204fc9e7ae1 (patch)
tree5b06403fbbecda27bd079e164b26f11af366522f
parent9ffc1049cae07e4e2d2dc8f4d1f5f113b4b1fdc4 (diff)
downloadexternal_mesa3d-c228514c72cb2fd5fb9e510808e29204fc9e7ae1.zip
external_mesa3d-c228514c72cb2fd5fb9e510808e29204fc9e7ae1.tar.gz
external_mesa3d-c228514c72cb2fd5fb9e510808e29204fc9e7ae1.tar.bz2
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 <marcin.slusarz@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--docs/autoconf.html9
-rw-r--r--src/mesa/drivers/dri/common/Makefile.am1
-rw-r--r--src/mesa/drivers/dri/common/xmlconfig.c6
3 files changed, 14 insertions, 2 deletions
diff --git a/docs/autoconf.html b/docs/autoconf.html
index 2ef8c63..5c29e5e 100644
--- a/docs/autoconf.html
+++ b/docs/autoconf.html
@@ -87,6 +87,13 @@ created in a <code>lib64</code> directory at the top of the Mesa source
tree.</p>
</dd>
+<dt><code>--sysconfdir=DIR</code></dt>
+<dd><p>This option specifies the directory where the configuration
+files will be installed. The default is <code>${prefix}/etc</code>.
+Currently there's only one config file provided when dri drivers are
+enabled - it's <code>drirc</code>.</p>
+</dd>
+
<dt><code>--enable-static, --disable-shared</code></dt>
<dd><p>By default, Mesa
will build shared libraries. Either of these options will force static
@@ -217,7 +224,7 @@ GLX.
<dt><code>--with-expat=DIR</code>
<dd><p><strong>DEPRECATED</strong>, use <code>PKG_CONFIG_PATH</code> instead.</p>
<p>The DRI-enabled libGL uses expat to
-parse the DRI configuration files in <code>/etc/drirc</code> and
+parse the DRI configuration files in <code>${sysconfdir}/drirc</code> and
<code>~/.drirc</code>. This option allows a specific expat installation
to be used. For example, <code>--with-expat=/usr/local</code> will
search for expat headers and libraries in <code>/usr/local/include</code>
diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am
index b307f10..ea52cb5 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 f17693e..b8ab480 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;