in reply to Re: EU::MM again.
in thread EU::MM again.
but what you want to do is quite simple: ...
Hm. The only reference in Makefile.pl to libpq the following which comes after WriteMakeFile() has been called, and is used to check if it was detected (It is; I get no errors):
my $output = WriteMakefile(%opts); if (!exists $output->{EXTRALIBS} or ($output->{EXTRALIBS} !~ /\-lpq/ and $output->{EXTRALIBS} !~ /libp +q/)) { my $makefile = exists $output->{MAKEFILE} ? "\nRemoving ($output->{MAKEFILE})\n" : ''; warn qq{ ========================================================== WARNING! No libpq libraries were detected! You need to install the postgresql-libs package for your system, or set the POSTGRES_LIB environment variable to the correct place. $makefile =========================================================== }; ## Do not let make proceed unlink $output->{MAKEFILE} if $makefile; exit 1; } exit 0;
And the only references to the key LIBS in %opts as passed to WriteMakeFile() are these:
LIBS => ["-L$POSTGRES_LIB -lpq -lm"], ... elsif ($os =~ /Win32/) { my $msdir = $POSTGRES_LIB; $msdir =~ s{"$}{/ms"}; $opts{LIBS}[0] .= " -L$msdir -lsecur32";
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?
On the basis that it EU::MM might simply generate references to all .libs it finds in the directory denoted by $ENV{ POSTGRES_LIB }, I tried placing a copy of libpq64.lb there, but it is ignored. As are the other .lib files that are located there: postgres.lib, libpgport.lib; libecpg.lib;.
So, something, somewhere, is telling EU::MM to generate references to libpq.lib, but I cannot see where or when that is occuring.
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.
Ie. How to reliably determine that the target is X64 (on Windows).
Given I can't see where libpq.lib is being referenced (other than in the post-facto test), it's hard to see where I would incorporate your code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: EU::MM again.
by syphilis (Archbishop) on Mar 25, 2009 at 22:20 UTC | |
by BrowserUk (Patriarch) on Mar 25, 2009 at 23:06 UTC | |
|
Re^3: EU::MM again.
by grinder (Bishop) on Mar 25, 2009 at 20:29 UTC | |
by BrowserUk (Patriarch) on Mar 25, 2009 at 23:05 UTC | |
by grinder (Bishop) on Mar 26, 2009 at 22:25 UTC | |
by BrowserUk (Patriarch) on Mar 26, 2009 at 23:40 UTC |