@@ -279,7 +279,7 @@ sub _win32_ext {
279
279
next ;
280
280
}
281
281
282
- my ( $found_lib )= 0;
282
+ my $found_lib = 0;
283
283
foreach $thispth (@searchpath , @libpath ){
284
284
unless (-f ($fullname =" $thispth \\ $_ " )) {
285
285
warn " '$thislib ' not found as '$fullname '\n " if $verbose ;
@@ -293,10 +293,14 @@ sub _win32_ext {
293
293
}
294
294
295
295
# do another pass with (or without) leading 'lib' if they used -l
296
- if (!$found_lib and $thislib =~ / ^-l/ ) {
297
- if ($GC ) { s / ^lib// i }
298
- else { $_ = " lib$_ " }
299
- goto LOOKAGAIN unless $secondpass ++;
296
+ if (!$found_lib and $thislib =~ / ^-l/ and !$secondpass ++) {
297
+ if ($GC ) {
298
+ goto LOOKAGAIN if s / ^lib// i ;
299
+ }
300
+ elsif (!/^lib/i) {
301
+ $_ = " lib$_ " ;
302
+ goto LOOKAGAIN;
303
+ }
300
304
}
301
305
302
306
# give up
@@ -670,6 +674,10 @@ C<-lfoo> still happens as appropriate (depending on compiler being used,
670
674
as reflected by C<$Config{cc} > ), but the entries are not verified to be
671
675
valid files or directories.
672
676
677
+ An entry that matches C</:search/i > reenables searching for
678
+ the libraries specified after it. You can put it at the end to
679
+ enable searching for default libraries specified by C<$Config{libs} > .
680
+
673
681
=item *
674
682
675
683
The libraries specified may be a mixture of static libraries and
@@ -697,7 +705,7 @@ to protect the spaces.
697
705
698
706
Since this module is most often used only indirectly from extension
699
707
C<Makefile.PL > files, here is an example C<Makefile.PL > entry to add
700
- a set of libraries to the build process for an extension:
708
+ a library to the build process for an extension:
701
709
702
710
LIBS => ['-lgl']
703
711
@@ -708,6 +716,11 @@ C<$Config{libpth}>.
708
716
When using a compiler other than GCC, the above entry will search for
709
717
C<gl.lib > (followed by C<libgl.lib > ).
710
718
719
+ If the library happens to be in a location not in C<$Config{libpth} > ,
720
+ you need:
721
+
722
+ LIBS => ['-Lc:\gllibs -lgl']
723
+
711
724
Here is a less often used example:
712
725
713
726
LIBS => ['-lgl', ':nosearch -Ld:\mesalibs -lmesa -luser32']
@@ -722,7 +735,9 @@ When using the Visual C compiler, the second item is returned as
722
735
C<-libpath:d:\mesalibs mesa.lib user32.lib > .
723
736
724
737
When using the Borland compiler, the second item is returned as
725
- C<-Ld:\mesalibs mesa.lib user32.lib > .
738
+ C<-Ld:\mesalibs mesa.lib user32.lib > , and MakeMaker takes care of
739
+ moving the C<-Ld:\mesalibs > to the correct place in the linker
740
+ command line.
726
741
727
742
=back
728
743
0 commit comments