Subject: | LIBS=>[ '...', '...' ] behaviour on Win32 |
Hello,
this post is perhaps more a question than a bug report but I would appreciate any feedback on this.
Let us have a module with Makefile.PL calling WriteMakefile with the following LIBS:
LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb", "-lgdbm_compat -lgdbm"],
We are on Win32 platform (gcc compiler) where:
- /usr/local/lib does not exists
- we DO NOT HAVE libraries for -lndbm, -ldbm and -lucb
- we DO HAVE libraries for -lgdbm_compat and -lgdbm
What I would expect is that EU::MM will try all three items in LIBS list, tests all of them and in the end chooses the last one as it is the only one fully satisfied in our scenario. However this does not happed, MM takes just the first one, says "Note (probably harmless): No library found for -lndbm" and creates Makefile using "-lndbm" (nonexisting).
If the current EU::MM behaviour is correct it does not make much sense (at least on Win32) to specify more than one item in LIBS list as the first one is in fact always satisfied.
In LibList/Kid.pm (_win32_ext) there is:
return ('','','','', ($give_libs ? \@libs : ())) unless $found;
which is IMHO the line that shoud move us to the next item in LIBS list; however $found variable also counts libraries that come from $Config{'perllibs'} not only from LIBS list, therefore it is nearly impossible to have it 0.
Thanks in advance for any advice on this.
--
kmx
this post is perhaps more a question than a bug report but I would appreciate any feedback on this.
Let us have a module with Makefile.PL calling WriteMakefile with the following LIBS:
LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb", "-lgdbm_compat -lgdbm"],
We are on Win32 platform (gcc compiler) where:
- /usr/local/lib does not exists
- we DO NOT HAVE libraries for -lndbm, -ldbm and -lucb
- we DO HAVE libraries for -lgdbm_compat and -lgdbm
What I would expect is that EU::MM will try all three items in LIBS list, tests all of them and in the end chooses the last one as it is the only one fully satisfied in our scenario. However this does not happed, MM takes just the first one, says "Note (probably harmless): No library found for -lndbm" and creates Makefile using "-lndbm" (nonexisting).
If the current EU::MM behaviour is correct it does not make much sense (at least on Win32) to specify more than one item in LIBS list as the first one is in fact always satisfied.
In LibList/Kid.pm (_win32_ext) there is:
return ('','','','', ($give_libs ? \@libs : ())) unless $found;
which is IMHO the line that shoud move us to the next item in LIBS list; however $found variable also counts libraries that come from $Config{'perllibs'} not only from LIBS list, therefore it is nearly impossible to have it 0.
Thanks in advance for any advice on this.
--
kmx