Subject: | Missing -L and nonportable -I |
Date: | Wed, 21 Jan 2015 03:56:15 -0500 |
To: | bug-Font-FreeType [...] rt.cpan.org |
From: | "Daniel Macks" <dmacks [...] netspace.org> |
I have several different freetype libraries installed, one supplied by vendor, one by a third-party package, etc. None of the headers are in a default search location, so I need to patch the hardcoded -I in Makefile.PL to select the one I want. And I also need to insert a hardcoded -L to find the library that goes with it (rather than the one in the compiler's default search path), both for the Devel::CheckLib::check_lib_or_exit() and the actual WriteMakefile(). That's a lot of hacking and non-portable hardcoding.
Bug #50287 only scratches the surface (the /opt path is just one possible place that Mac users might have freetype depending on their x11 version).
Freetype already publishes, via a freetype-config script and a freetype2.pc pkg-config file, the full and consistent set of flags to use (which may also entail other -I and -L/-l for freetype's own dependencies). A portable solution for determining the self-consistent paths and platform-specific flags is therefore just to ask freetype. The only setting one would have to do is (using standard shell env-vars) make sure the right -config or .pc is being used.
dan
--
Daniel Macks
dmacks@netspace.org