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>
This commit is contained in:
parent
c8a608cb6c
commit
2460e921d1
|
@ -34,7 +34,9 @@ libxf86config_a_SOURCES = \
|
||||||
$(INTERNAL_SOURCES)
|
$(INTERNAL_SOURCES)
|
||||||
libxf86config_a_CFLAGS = $(AM_CFLAGS)
|
libxf86config_a_CFLAGS = $(AM_CFLAGS)
|
||||||
|
|
||||||
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
|
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
|
||||||
|
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||||
|
-DDATADIR=\"$(datadir)\"
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
Configint.h \
|
Configint.h \
|
||||||
|
|
|
@ -599,6 +599,8 @@ xf86pathIsSafe(const char *path)
|
||||||
* %F config file environment ($XORGCONFIG) as a relative path
|
* %F config file environment ($XORGCONFIG) as a relative path
|
||||||
* %G config file environment ($XORGCONFIG) as a safe path
|
* %G config file environment ($XORGCONFIG) as a safe path
|
||||||
* %P projroot
|
* %P projroot
|
||||||
|
* %C sysconfdir
|
||||||
|
* %D datadir
|
||||||
* %M major version number
|
* %M major version number
|
||||||
* %% %
|
* %% %
|
||||||
*/
|
*/
|
||||||
|
@ -615,6 +617,12 @@ xf86pathIsSafe(const char *path)
|
||||||
#ifndef PROJECTROOT
|
#ifndef PROJECTROOT
|
||||||
#define PROJECTROOT "/usr/X11R6"
|
#define PROJECTROOT "/usr/X11R6"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef SYSCONFDIR
|
||||||
|
#define SYSCONFDIR PROJECTROOT "/etc"
|
||||||
|
#endif
|
||||||
|
#ifndef DATADIR
|
||||||
|
#define DATADIR PROJECTROOT "/share"
|
||||||
|
#endif
|
||||||
#ifndef XCONFENV
|
#ifndef XCONFENV
|
||||||
#define XCONFENV "XORGCONFIG"
|
#define XCONFENV "XORGCONFIG"
|
||||||
#endif
|
#endif
|
||||||
|
@ -755,6 +763,12 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
|
||||||
else
|
else
|
||||||
BAIL_OUT;
|
BAIL_OUT;
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
APPEND_STR(SYSCONFDIR);
|
||||||
|
break;
|
||||||
|
case 'D':
|
||||||
|
APPEND_STR(DATADIR);
|
||||||
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
if (!majorvers[0]) {
|
if (!majorvers[0]) {
|
||||||
if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {
|
if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {
|
||||||
|
|
Loading…
Reference in New Issue