Git init
[external/pango1.0.git] / debian / patches / 12_module-files-append-compat-module-files-d.patch
1 Index: pango1.0-1.16.0/pango/modules.c
2 ===================================================================
3 --- pango1.0-1.16.0.orig/pango/modules.c        2007-03-07 11:16:26.000000000 +0100
4 +++ pango1.0-1.16.0/pango/modules.c     2007-03-07 11:16:33.000000000 +0100
5 @@ -24,6 +24,7 @@
6  #include <string.h>
7  #include <limits.h>
8  #include <errno.h>
9 +#include <unistd.h>
10  
11  #include <gmodule.h>
12  #include <glib/gstdio.h>
13 @@ -508,6 +509,18 @@
14                                                MODULE_VERSION,
15                                                "module-files.d",
16                                                NULL);
17 +
18 +#if defined(__linux__) && defined (__i386__)
19 +  char *compat_module_files_d_str = g_build_filename ("/usr/lib32/pango",
20 +                                              MODULE_VERSION,
21 +                                              "module-files.d",
22 +                                              NULL);
23 +#elif defined(__linux__) && ( defined (__x86_64__) || defined(__ia64__) )
24 +  char *compat_module_files_d_str = g_build_filename ("/usr/lib64/pango",
25 +                                              MODULE_VERSION,
26 +                                              "module-files.d",
27 +                                              NULL);
28 +#endif
29    char *list_str;
30    char **files;
31    int n;
32 @@ -519,6 +532,17 @@
33                                  "pango.modules",
34                                  NULL);
35  
36 +#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
37 +  /* prefer compat_module_files_d_str over module_files_d_str on the above
38 +   * arches if it's usable */
39 +  if (! g_access(compat_module_files_d_str, R_OK|X_OK))
40 +      list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
41 +                           file_str,
42 +                           compat_module_files_d_str,
43 +                           NULL);
44 +  else /* continued below */
45 +#endif
46 +
47    list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
48                         file_str,
49                         module_files_d_str,
50 @@ -568,6 +592,9 @@
51    g_strfreev (files);
52    g_free (list_str);
53    g_free (module_files_d_str);
54 +#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
55 +  g_free (compat_module_files_d_str);
56 +#endif
57    g_free (file_str);
58  
59    dlloaded_engines = g_slist_reverse (dlloaded_engines);