----- Original Message ----- 
From: "Jan Dubois"
>
> Thanks for pointing this out.  You are certainly correct that 815 will not
> automatically link with .a files.  Just changing lib_ext to .a will not
really
> solve this though, as are also linking against perl58.lib instead of
libperl58.a,
> so we really need to support "both".  I guess this needs some more
research.
>

Aaaah ... I've checked a little further and found that my problem can be
overcome by simply overriding $Config{libpth} in addition to
$Config{lib_ext}. There's *no* problem in linking against perl58.lib (which
I can still do).

When I inserted the following at the beginning of the Math::GMP Makefile.PL
it built fine (without invoking Config_m.pm):

$obj = tied %Config::Config;
$obj->{lib_ext} = '.a';
$obj->{libpth} = '"D:\MinGW\lib" "D:\MinGW\i386-mingw32msvc\lib"';

I possibly might have worked out the problem earlier, except that I
originally had that second line as:

$obj->{libpth} = '"(CC)\lib" "(CC)\i386-mingw32msvc\lib"';

(not realising that '(CC)' was not being interpolated :-)

But there's something going on here that's a bit unusual. The above works
for me because I have placed a copy of libgmp.a in my MinGW/lib folder. A
more orthodox approach is to place libgmp.a in some *other* folder (eg
/usr/local/lib) and have it be found using the '-L' switch.

When I follow that more orthodox approach I find that there's no need to
override $Config{libpth} - all I need to do is set $Config{lib_ext} to '.a'.
It would probably still be a good idea if ActiveState overrode
$Config{libpth}. For one thing it would eliminate the warnings one gets when
'perl Makefile.PL' is run:

Note (probably harmless): No library found for -lkernel32
Note (probably harmless): No library found for -luser32
.
.
Note (probably harmless): No library found for -lodbccp32
Note (probably harmless): No library found for -lmsvcrt

Here's a list of the changes (copied directly from Config_m.pm) that EU::FC
initiates when I install it on AS
build 815:

my $values = <<'EOT';
cc='gcc'
ccflags='-g -O2 -DWIN32 -DPERL_IMPLICIT_CONTEXT -DPERL_MSVCRT_READFIX'
cccdlflags='-DHASATTRIBUTE'
libpth='"(CC)\lib" "(CC)\i386-mingw32msvc\lib"'
libs=' -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr -
lwinmm -lversion -lodbc32'
_a='.a'
_o='.o'
ar='ar'
cpp='gcc -E'
cppminus='-'
cpprun='gcc -E'
cppstdin='gcc -E'
d_attribut='define'
d_casti32='define'
i64type='long long'
ld='gcc'
lddlflags='-mdll -g -L"(PERL)\lib\CORE"'
ldflags='-g -L"(PERL)\lib\CORE"'
lib_ext='.a'
libc='-lmsvcrt'
libperl='libperl58.a'
longdblsize='12'
lseektype='long long'
nm='nm'
obj_ext='.o'
optimize='-g -O2'
perlpath='(PERL)\bin'perl.exe'
perllibs=' -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomd
lg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lwsock32 -lm
pr -lwinmm -lversion -lodbc32'
quadtype='long long'
u64type='unsigned long long'
uquadtype='unsigned long long'
make='dmake'
EOT

Note that it also sets ld to 'gcc' - which I don't think is correct. I
usually change that to 'g++', and I also usually remove the '-g' switches.
Other than that it seems very serviceable.

Cheers,
Rob


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to