/build-extras/2009.1-tahi/Kid.pm.diff
https://code.google.com/p/camelbox/ · text · 89 lines · 85 code · 4 blank · 0 comment · 0 complexity · 9e9a4739be7ced175ff7724b9855fadf MD5 · raw file
- --- Kid.pm.orig Fri Apr 24 11:38:29 2009
- +++ Kid.pm Fri Apr 24 10:43:28 2009
- @@ -305,54 +305,40 @@
- next;
- }
-
- - # handle possible library arguments
- - if (s/^-l// and $GC and !/^lib/i) {
- - $_ = "lib$_";
- - }
- - $_ .= $libext if !/\Q$libext\E$/i;
- + # try $_$libext, lib$_$libext, $_.dll$libext, lib$_.dll$libext
- + s/^-l//;
- + my $found_lib = 0;
- + for my $libname ($_.$libext, 'lib'.$_.$libext,
- + $_.'.dll'.$libext, 'lib'.$_.'.dll'.$libext) {
- +
- + # look for the file itself
- + if (-f $libname) {
- + warn "'$thislib' found as '$libname'\n" if $verbose;
- + $found++;
- + $found_lib++;
- + push(@extralibs, $libname);
- + last;
- + } # if (-f $libname)
- +
- + foreach $thispth (@searchpath, @libpath){
- + unless (-f ($fullname="$thispth\\$libname")) {
- + warn "'$thislib' not found as '$fullname'\n" if $verbose;
- + next;
- + }
- + warn "'$thislib' found as '$fullname'\n" if $verbose;
- + $found++;
- + $found_lib++;
- + push(@extralibs, $fullname);
- + push @libs, $fullname unless $libs_seen{$fullname}++;
- + last;
- + } # foreach $thispth (@searchpath, @libpath)
-
- - my $secondpass = 0;
- - LOOKAGAIN:
- -
- - # look for the file itself
- - if (-f) {
- - warn "'$thislib' found as '$_'\n" if $verbose;
- - $found++;
- - push(@extralibs, $_);
- - next;
- - }
- -
- - my $found_lib = 0;
- - foreach $thispth (@searchpath, @libpath){
- - unless (-f ($fullname="$thispth\\$_")) {
- - warn "'$thislib' not found as '$fullname'\n" if $verbose;
- - next;
- - }
- - warn "'$thislib' found as '$fullname'\n" if $verbose;
- - $found++;
- - $found_lib++;
- - push(@extralibs, $fullname);
- - push @libs, $fullname unless $libs_seen{$fullname}++;
- - last;
- - }
- -
- - # do another pass with (or without) leading 'lib' if they used -l
- - if (!$found_lib and $thislib =~ /^-l/ and !$secondpass++) {
- - if ($GC) {
- - goto LOOKAGAIN if s/^lib//i;
- - }
- - elsif (!/^lib/i) {
- - $_ = "lib$_";
- - goto LOOKAGAIN;
- - }
- - }
- -
- - # give up
- - warn "Note (probably harmless): "
- + # express frustration
- + warn "Note (probably harmless): "
- ."No library found for $thislib\n"
- - unless $found_lib>0;
- -
- - }
- + unless $found_lib>0;
- + } # for my $libname
- + } # foreach (Text::ParseWords::quotewords
-
- return ('','','','', ($give_libs ? \@libs : ())) unless $found;