GNOME Bugzilla – Bug 328291
pango/examples use installed pango.modules if available
Last modified: 2006-01-23 19:01:43 UTC
Currently, the examples in pango/examples use the installed pango.modules if it's available. That means, if you compile and install pango, then modify the modules, the examples still use the installed modules, not the modified ones. That's a bit confusing when developing the modules... Seems like setting PANGO_RC_FILE=./pangorc fixes that. One way would be to set PANGO_RC_FILE using putenv in the examples, but a better fix is to make the libtool wrapper for the examples set this. I'm investigating how this can be done using libtool. If no official way exists, we can patch the wrappers...
The problem with doing putenv is that it doesn't work for out-of-tree builds... The easiest way I see so far is patching libtool. That's far easier than patching the wrappers.
thomasvs suggests another solution, to define the srcdir as a C macro and look for pangorc in that directory first in the examples. jdahlin suggests using relative path to srcdir.
Owen, is it too harsh if pango looks for ./pangorc or ./.pangorc unconditionally? That way we can rename pangorc to pangorc.in and add a rule to Makefile to cp/ln/whatever pangorc.in to (.)pangorc. That solves the srcdir problem. For now I'm going to putenv PANGO_RC_FILE=./pangorc to solve the problem. BTW, I moved examples/pango.modules and tests/pango.modules to modules/pango.modules.
Am I correct that we don't nee examples/pangox.aliases anymore?
Created attachment 57951 [details] [review] patch This is the patch I'm committing. Works perfect here.
2006-01-23 Behdad Esfahbod <behdad@gnome.org> Make tests/examples do use generated pango.modules. (bug #328291) * examples/pangorc, tests/pangorc: Removed. Moved to modules/. * examples/pangox.aliases: Removed. Moved to pango/. * examples/Makefile.am, tests/Makefile.am: Remove pango.modules creation stuff, copy pangorc from $(srcdir)/../modules/pangorc insteadd. * examples/renderdemo.c: Add --pangorc option, default to ./pangorc. Setenv PANGO_RC_FILE to whatever pangorc file decided. * tests/*.c: Setenv PANGO_RC_FILE to ./pangorc. * pango/pangox.aliases: Added. * pango/Makefile.am: Install pangox.aliases. * modules/pangorc: Added. * modules/Makefile.am: Create pango.modules. Added pangorc. * modules/.cvsignore, examples/.cvsignore, tests/.cvsignore: Updated.
Pango should not look for files relative to the path by default. This tends to make security nuts really grumpy. (It's effectively having . in your path in a hidden way.)
Yup, true. You can load a module that rewrites the strings, w00t.