On Fri, Jan 12, 2007, Goswin von Brederlow wrote:
> >  Is it more useful to turn on the support for /usr/lib32 at runtime
> >  only, or is it ok to unconditionally setup this support at build time?
> How would you turn it on at runtime? Policy forbidds to set an
> environment variable in a package. You could have an /etc/pango/config
> that tells libpango i386 to use lib32 and we ship it in ia32-libs-gtk
> only. But isn't than more work than always using lib32?

 Check the patch in the Ubuntu package, I thought I already sent it to
 you during the multiarch discussion.  It uses uname().  Attached.

> Alternatively you could include the gnu tripple in the path to the
> modules file like gcc uses:
> /usr/lib/pango/x86_64-linux-gnu/1.5.0/module-files.d/
> /usr/lib/pango/i486-linux-gnu/1.5.0/module-files.d/
> or like cross-compilers:
> /usr/x86_64-linux-gnu/lib/pango/1.5.0/module-files.d/ 
> /usr/i486-linux-gnu/lib/pango/1.5.0/module-files.d/ 

 This would require updating of the pangohack in ia32-libs-gtk I
 suppose.

-- 
Loïc Minier <[EMAIL PROTECTED]>
diff -Nur pango-1.15.2.orig/pango/pango-utils.c pango-1.15.2/pango/pango-utils.c
--- pango-1.15.2.orig/pango/pango-utils.c	2006-12-07 03:16:13.000000000 +0100
+++ pango-1.15.2/pango/pango-utils.c	2006-12-21 17:23:55.000000000 +0100
@@ -24,6 +24,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <math.h>
+#include <unistd.h>
+#include <sys/utsname.h>
 #include <locale.h>
 
 #include "pango-font.h"
@@ -688,7 +690,23 @@
 
   return result;
 #else
-  return SYSCONFDIR "/pango";
+  static gchar *result = NULL;
+  struct utsname uts;
+
+  if (result == NULL)
+    {
+      result = g_getenv("PANGO_SYSCONFDIR");
+      if (!access(result, R_OK|X_OK))
+	return result;
+#if defined(__linux__) && defined (__i386__)
+      uname(&uts);
+      if (!strcmp("x86_64", uts.machine)
+	  && !access(SYSCONFDIR "/pango32", R_OK|X_OK))
+	result = SYSCONFDIR "/pango32";
+#endif
+      result = SYSCONFDIR "/pango";
+    }
+  return result;
 #endif
 }
 
@@ -716,6 +734,14 @@
 
   return result;
 #else
+#if defined(__linux__) && defined (__i386__)
+  struct utsname uts;
+
+  uname(&uts);
+  if (!strcmp("x86_64", uts.machine)
+      && !access("/usr/lib32/pango", R_OK|X_OK))
+    return "/usr/lib32/pango";
+#endif
   return LIBDIR "/pango";
 #endif
 }

Reply via email to