diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-05 22:55:59 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-05 22:55:59 +0000 |
commit | e47a9bbca96e471a9294a62ab64a70b15c968ec0 (patch) | |
tree | 6a00840593101ba1d096e44ffc562df06f655de9 /lib/ExtUtils/Liblist.pm | |
parent | 5e3006a4b5e1e97051d365105eeca85fc2884f7b (diff) | |
download | perl-e47a9bbca96e471a9294a62ab64a70b15c968ec0.tar.gz |
MM_Win32.pm and Liblist.pm tweaks
p4raw-id: //depot/maint-5.005/perl@1746
Diffstat (limited to 'lib/ExtUtils/Liblist.pm')
-rw-r--r-- | lib/ExtUtils/Liblist.pm | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 9df8752fa6..b072c1292c 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -279,7 +279,7 @@ sub _win32_ext { next; } - my($found_lib)=0; + my $found_lib = 0; foreach $thispth (@searchpath, @libpath){ unless (-f ($fullname="$thispth\\$_")) { warn "'$thislib' not found as '$fullname'\n" if $verbose; @@ -293,10 +293,14 @@ sub _win32_ext { } # do another pass with (or without) leading 'lib' if they used -l - if (!$found_lib and $thislib =~ /^-l/) { - if ($GC) { s/^lib//i } - else { $_ = "lib$_" } - goto LOOKAGAIN unless $secondpass++; + if (!$found_lib and $thislib =~ /^-l/ and !$secondpass++) { + if ($GC) { + goto LOOKAGAIN if s/^lib//i; + } + elsif (!/^lib/i) { + $_ = "lib$_"; + goto LOOKAGAIN; + } } # give up @@ -670,6 +674,10 @@ C<-lfoo> still happens as appropriate (depending on compiler being used, as reflected by C<$Config{cc}>), but the entries are not verified to be valid files or directories. +An entry that matches C</:search/i> reenables searching for +the libraries specified after it. You can put it at the end to +enable searching for default libraries specified by C<$Config{libs}>. + =item * The libraries specified may be a mixture of static libraries and @@ -697,7 +705,7 @@ to protect the spaces. Since this module is most often used only indirectly from extension C<Makefile.PL> files, here is an example C<Makefile.PL> entry to add -a set of libraries to the build process for an extension: +a library to the build process for an extension: LIBS => ['-lgl'] @@ -708,6 +716,11 @@ C<$Config{libpth}>. When using a compiler other than GCC, the above entry will search for C<gl.lib> (followed by C<libgl.lib>). +If the library happens to be in a location not in C<$Config{libpth}>, +you need: + + LIBS => ['-Lc:\gllibs -lgl'] + Here is a less often used example: LIBS => ['-lgl', ':nosearch -Ld:\mesalibs -lmesa -luser32'] @@ -722,7 +735,9 @@ When using the Visual C compiler, the second item is returned as C<-libpath:d:\mesalibs mesa.lib user32.lib>. When using the Borland compiler, the second item is returned as -C<-Ld:\mesalibs mesa.lib user32.lib>. +C<-Ld:\mesalibs mesa.lib user32.lib>, and MakeMaker takes care of +moving the C<-Ld:\mesalibs> to the correct place in the linker +command line. =back |