summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-04-03 09:33:47 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2010-04-09 11:49:24 +1000
commiteb07b8606f9a1349baf8114bb36dc2712e5d3419 (patch)
tree6ac936fd5d1736379997c20f86d0b85f606a4033 /hw/xfree86
parentad6c5e450cacee3777e7c541d4841ee580339a5d (diff)
xfree86: Allow adding sysconfdir and datadir to config search paths
We could just use $projectroot/etc and $projectroot/share, but the user might have other plans for them. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 2460e921d18fd264e6f6374be0908f4100442650) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/parser/Makefile.am4
-rw-r--r--hw/xfree86/parser/scan.c14
2 files changed, 17 insertions, 1 deletions
diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
index 49c191f2a..caf7079d4 100644
--- a/hw/xfree86/parser/Makefile.am
+++ b/hw/xfree86/parser/Makefile.am
@@ -34,7 +34,9 @@ libxf86config_a_SOURCES = \
$(INTERNAL_SOURCES)
libxf86config_a_CFLAGS = $(AM_CFLAGS)
-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DDATADIR=\"$(datadir)\"
EXTRA_DIST = \
Configint.h \
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index cdca9ca1c..8aab0cf41 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -599,6 +599,8 @@ xf86pathIsSafe(const char *path)
* %F config file environment ($XORGCONFIG) as a relative path
* %G config file environment ($XORGCONFIG) as a safe path
* %P projroot
+ * %C sysconfdir
+ * %D datadir
* %M major version number
* %% %
*/
@@ -615,6 +617,12 @@ xf86pathIsSafe(const char *path)
#ifndef PROJECTROOT
#define PROJECTROOT "/usr/X11R6"
#endif
+#ifndef SYSCONFDIR
+#define SYSCONFDIR PROJECTROOT "/etc"
+#endif
+#ifndef DATADIR
+#define DATADIR PROJECTROOT "/share"
+#endif
#ifndef XCONFENV
#define XCONFENV "XORGCONFIG"
#endif
@@ -755,6 +763,12 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
else
BAIL_OUT;
break;
+ case 'C':
+ APPEND_STR(SYSCONFDIR);
+ break;
+ case 'D':
+ APPEND_STR(DATADIR);
+ break;
case 'M':
if (!majorvers[0]) {
if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {