]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/xserver.git/blob - debian/patches/191-Xorg-add-an-extra-module-path.patch
e4a8cf726d1f2ad26ffb2ff65ae358808b297abf
[glsdk/xserver.git] / debian / patches / 191-Xorg-add-an-extra-module-path.patch
1 From 416a66de9d428a11776331926c23a61188b8fc16 Mon Sep 17 00:00:00 2001
2 From: Ander Conselvan de Oliveira <ander@localhost.(none)>
3 Date: Thu, 12 Mar 2009 09:45:57 -0300
4 Subject: [PATCH 908/911] Xorg: add an extra module path
6 If the extra module path is not an empty string (the default value),
7 module path will be searched first in the extra module path and then in
8 the default module path. This should simplify the alternatives system
9 used on Mandriva's fglrx package.
10 ---
11 Index: xserver/configure.ac
12 ===================================================================
13 --- xserver.orig/configure.ac   2012-03-15 11:16:17.000000000 +0000
14 +++ xserver/configure.ac        2012-03-15 11:16:23.000000000 +0000
15 @@ -480,6 +480,10 @@
16                                   [Directory where modules are installed (default: $libdir/xorg/modules)]),
17                                 [ moduledir="$withval" ],
18                                 [ moduledir="${libdir}/xorg/modules" ])
19 +AC_ARG_WITH(extra-module-dir,AS_HELP_STRING([--with-extra-module-dir=DIR],
20 +                                 [Extra module directory to search for modules before the default one (default: empty)]),
21 +                               [ extra_moduledir="$withval" ],
22 +                               [ extra_moduledir="" ])
23  AC_ARG_WITH(log-dir,         AS_HELP_STRING([--with-log-dir=DIR],
24                                   [Directory where log files are kept (default: $localstatedir/log)]),
25                                 [ logdir="$withval" ],
26 @@ -1768,6 +1772,7 @@
27         AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
28         AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
29         AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
30 +       AC_DEFINE_DIR(EXTRA_MODULE_PATH, extra_moduledir, [Extra module search path, searched before the default one])
31         AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
32         AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
33         AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
34 Index: xserver/hw/xfree86/common/xf86Config.c
35 ===================================================================
36 --- xserver.orig/hw/xfree86/common/xf86Config.c 2012-03-15 11:09:39.000000000 +0000
37 +++ xserver/hw/xfree86/common/xf86Config.c      2012-03-15 11:16:23.000000000 +0000
38 @@ -628,11 +628,21 @@
39    
40    /* ModulePath */
41  
42 -  if (fileconf) {
43 -    if (xf86ModPathFrom != X_CMDLINE && fileconf->file_modulepath) {
44 +  if (xf86ModPathFrom != X_CMDLINE) {
45 +    if (fileconf && fileconf->file_modulepath) {
46        xf86ModulePath = fileconf->file_modulepath;
47        xf86ModPathFrom = X_CONFIG;
48      }
49 +    else if (strcmp(xf86ExtraModulePath, "") != 0) {
50 +      char *newpath = malloc(strlen(xf86ExtraModulePath)
51 +                            + strlen(xf86ModulePath)
52 +                            + 2);
53 +      strcpy(newpath, xf86ExtraModulePath);
54 +      strcat(newpath, ",");
55 +      strcat(newpath, xf86ModulePath);
56 +
57 +      xf86ModulePath = newpath;
58 +    }
59    }
60  
61    xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath);
62 Index: xserver/hw/xfree86/common/xf86Globals.c
63 ===================================================================
64 --- xserver.orig/hw/xfree86/common/xf86Globals.c        2012-03-15 11:09:21.000000000 +0000
65 +++ xserver/hw/xfree86/common/xf86Globals.c     2012-03-15 11:16:23.000000000 +0000
66 @@ -139,6 +139,7 @@
67  const char *xf86ConfigFile = NULL;
68  const char *xf86ConfigDir = NULL;
69  const char *xf86ModulePath = DEFAULT_MODULE_PATH;
70 +const char *xf86ExtraModulePath = EXTRA_MODULE_PATH;
71  MessageType xf86ModPathFrom = X_DEFAULT;
72  const char *xf86LogFile = DEFAULT_LOGPREFIX;
73  MessageType xf86LogFileFrom = X_DEFAULT;
74 Index: xserver/hw/xfree86/common/xf86Priv.h
75 ===================================================================
76 --- xserver.orig/hw/xfree86/common/xf86Priv.h   2012-03-15 11:09:21.000000000 +0000
77 +++ xserver/hw/xfree86/common/xf86Priv.h        2012-03-15 11:16:23.000000000 +0000
78 @@ -75,6 +75,7 @@
79  
80  extern _X_EXPORT  xf86InfoRec xf86Info;
81  extern _X_EXPORT  const char *xf86ModulePath;
82 +extern _X_EXPORT  const char *xf86ExtraModulePath;
83  extern _X_EXPORT  MessageType xf86ModPathFrom;
84  extern _X_EXPORT  const char *xf86LogFile;
85  extern _X_EXPORT  MessageType xf86LogFileFrom;
86 Index: xserver/include/xorg-config.h.in
87 ===================================================================
88 --- xserver.orig/include/xorg-config.h.in       2012-03-15 11:09:22.000000000 +0000
89 +++ xserver/include/xorg-config.h.in    2012-03-15 11:16:23.000000000 +0000
90 @@ -42,6 +42,9 @@
91  /* Path to loadable modules. */
92  #undef DEFAULT_MODULE_PATH
93  
94 +/* Path to extra loadable modules. */
95 +#undef EXTRA_MODULE_PATH
96 +
97  /* Path to installed libraries. */
98  #undef DEFAULT_LIBRARY_PATH
99