Re^3: EU::MM again.by grinder (Bishop)
|on Mar 25, 2009 at 20:29 UTC||Need Help??|
So, I guess the "subtle point to my question" is how (and where/when) does -lpq get manipulated to cause it to add the reference to -llibpq?
Ah, that is handled ExtUtils::Liblist which is invoked by WriteMakefile() itself. It should Just Work.
["-L$POSTGRES_LIB -lpq -lm"]
Right, so libpq is hardcoded into the LIBS key's value. You shall have to interpolate something in its place instead. (Hence my conditional construct in my first snippet).
The second part of my question was how to automate the choice of whether to use libpq.lib or libpq64.lib. Your pseudo-code above neatly dodges both parts of that question.
And here I was hoping you wouldn't notice. I blithely assumed that this would be trivial for you. So... as for knowing whether you're on 64-bit or not, my next thought would then be to rummage through %Config and see what turns up. Other than that, I honestly don't know. But Dave "DrHyde" Cantrell would surely be happy to take on board any code you figure out, and place it in Devel::CheckOS for others to use.
As to where you put this code, it has do be sorted out before WriteMakefile() gets called. That DBD::Pg grovels through the resulting Makefile afterwards sounds like a dreadful hack of the highest order. Also I don't know what App::Info does these days; I haven't been keeping up with the mailing lists to keep track.
• another intruder with the mooring in the heart of the Perl