| 1 | 271c271 |
| 2 | < foreach (Text::ParseWords::quotewords('\s+', 0, $potential_libs)){ |
| 3 | --- |
| 4 | > foreach (Text::ParseWords::quotewords('\s+', 0, $potential_libs)) { |
| 5 | 308,315c308,312 |
| 6 | < # handle possible library arguments |
| 7 | < if (s/^-l// and $GC and !/^lib/i) { |
| 8 | < $_ = "lib$_"; |
| 9 | < } |
| 10 | < $_ .= $libext if !/\Q$libext\E$/i; |
| 11 | < |
| 12 | < my $secondpass = 0; |
| 13 | < LOOKAGAIN: |
| 14 | --- |
| 15 | > # try , $_.dll$libext, lib$_.dll$libext, $_$libext, lib$_$libext |
| 16 | > # the order is important since we want to use .dll.a before .a |
| 17 | > s/^-l//; |
| 18 | > my $found_lib = 0; |
| 19 | > for my $libname ('lib'.$_.'.dll'.$libext, $_.'.dll'.$libext, 'lib'.$_.$libext, $_.$libext) { |
| 20 | 318,319c315,316 |
| 21 | < if (-f) { |
| 22 | < warn "'$thislib' found as '$_'\n" if $verbose; |
| 23 | --- |
| 24 | > if (-f $libname) { |
| 25 | > warn "'$thislib' found as '$libname'\n" if $verbose; |
| 26 | 321,322c318,320 |
| 27 | < push(@extralibs, $_); |
| 28 | < next; |
| 29 | --- |
| 30 | > $found_lib++; |
| 31 | > push(@extralibs, $libname); |
| 32 | > last; |
| 33 | 325,327c323,324 |
| 34 | < my $found_lib = 0; |
| 35 | < foreach my $thispth (@searchpath, @libpath){ |
| 36 | < unless (-f ($fullname="$thispth\\$_")) { |
| 37 | --- |
| 38 | > foreach my $thispth (reverse @searchpath, @libpath) { |
| 39 | > unless (-f ($fullname="$thispth\\$libname")) { |
| 40 | 339,347c336 |
| 41 | < # do another pass with (or without) leading 'lib' if they used -l |
| 42 | < if (!$found_lib and $thislib =~ /^-l/ and !$secondpass++) { |
| 43 | < if ($GC) { |
| 44 | < goto LOOKAGAIN if s/^lib//i; |
| 45 | < } |
| 46 | < elsif (!/^lib/i) { |
| 47 | < $_ = "lib$_"; |
| 48 | < goto LOOKAGAIN; |
| 49 | < } |
| 50 | --- |
| 51 | > last if $found_lib; |
| 52 | 350c339 |
| 53 | < # give up |
| 54 | --- |
| 55 | > # express frustration |