ODROID-U3 xorg-server debian package fork :
[deb_xorg-server.git] / debian / patches / 191-Xorg-add-an-extra-module-path.patch
CommitLineData
7217e0ca
ML
1--- a/configure.ac
2+++ b/configure.ac
4db25562 3@@ -466,6 +466,10 @@ AC_ARG_WITH(module-dir, AS_HELP_STR
7217e0ca
ML
4 [Directory where modules are installed (default: $libdir/xorg/modules)]),
5 [ moduledir="$withval" ],
6 [ moduledir="${libdir}/xorg/modules" ])
7+AC_ARG_WITH(extra-module-dir,AS_HELP_STRING([--with-extra-module-dir=DIR],
8+ [Extra module directory to search for modules before the default one (default: empty)]),
9+ [ extra_moduledir="$withval" ],
10+ [ extra_moduledir="" ])
11 AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR],
12 [Directory where log files are kept (default: $localstatedir/log)]),
13 [ logdir="$withval" ],
4db25562 14@@ -2039,6 +2043,7 @@ if test "x$XORG" = xyes; then
7217e0ca
ML
15 AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
16 AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
17 AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
18+ AC_DEFINE_DIR(EXTRA_MODULE_PATH, extra_moduledir, [Extra module search path, searched before the default one])
19 AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
20 AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
21 AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
7217e0ca
ML
22--- a/hw/xfree86/common/xf86Config.c
23+++ b/hw/xfree86/common/xf86Config.c
4db25562 24@@ -640,11 +640,22 @@ configFiles(XF86ConfFilesPtr fileconf)
7217e0ca
ML
25
26 /* ModulePath */
27
28- if (fileconf) {
29- if (xf86ModPathFrom != X_CMDLINE && fileconf->file_modulepath) {
30+ if (xf86ModPathFrom != X_CMDLINE) {
31+ if (fileconf && fileconf->file_modulepath) {
32 xf86ModulePath = fileconf->file_modulepath;
33 xf86ModPathFrom = X_CONFIG;
34 }
35+ else if (strcmp(xf86ExtraModulePath, "") != 0) {
36+ char *newpath = malloc(strlen(xf86ExtraModulePath)
37+ + strlen(xf86ModulePath)
38+ + 2);
39+
40+ strcpy(newpath, xf86ExtraModulePath);
41+ strcat(newpath, ",");
42+ strcat(newpath, xf86ModulePath);
43+
44+ xf86ModulePath = newpath;
45+ }
46 }
47
48 xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath);
7217e0ca
ML
49--- a/hw/xfree86/common/xf86Globals.c
50+++ b/hw/xfree86/common/xf86Globals.c
4db25562 51@@ -143,6 +143,7 @@ xf86InfoRec xf86Info = {
7217e0ca
ML
52 const char *xf86ConfigFile = NULL;
53 const char *xf86ConfigDir = NULL;
54 const char *xf86ModulePath = DEFAULT_MODULE_PATH;
55+const char *xf86ExtraModulePath = EXTRA_MODULE_PATH;
56 MessageType xf86ModPathFrom = X_DEFAULT;
57 const char *xf86LogFile = DEFAULT_LOGPREFIX;
58 MessageType xf86LogFileFrom = X_DEFAULT;
7217e0ca
ML
59--- a/hw/xfree86/common/xf86Priv.h
60+++ b/hw/xfree86/common/xf86Priv.h
4db25562 61@@ -77,6 +77,7 @@ extern _X_EXPORT const char *xf86ServerN
7217e0ca
ML
62
63 extern _X_EXPORT xf86InfoRec xf86Info;
64 extern _X_EXPORT const char *xf86ModulePath;
65+extern _X_EXPORT const char *xf86ExtraModulePath;
66 extern _X_EXPORT MessageType xf86ModPathFrom;
67 extern _X_EXPORT const char *xf86LogFile;
68 extern _X_EXPORT MessageType xf86LogFileFrom;
7217e0ca
ML
69--- a/include/xorg-config.h.in
70+++ b/include/xorg-config.h.in
71@@ -42,6 +42,9 @@
72 /* Path to loadable modules. */
73 #undef DEFAULT_MODULE_PATH
74
75+/* Path to extra loadable modules. */
76+#undef EXTRA_MODULE_PATH
77+
78 /* Path to installed libraries. */
79 #undef DEFAULT_LIBRARY_PATH
80