/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

  1. --- Kid.pm.orig Fri Apr 24 11:38:29 2009
  2. +++ Kid.pm Fri Apr 24 10:43:28 2009
  3. @@ -305,54 +305,40 @@
  4. next;
  5. }
  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. + # try $_$libext, lib$_$libext, $_.dll$libext, lib$_.dll$libext
  12. + s/^-l//;
  13. + my $found_lib = 0;
  14. + for my $libname ($_.$libext, 'lib'.$_.$libext,
  15. + $_.'.dll'.$libext, 'lib'.$_.'.dll'.$libext) {
  16. +
  17. + # look for the file itself
  18. + if (-f $libname) {
  19. + warn "'$thislib' found as '$libname'\n" if $verbose;
  20. + $found++;
  21. + $found_lib++;
  22. + push(@extralibs, $libname);
  23. + last;
  24. + } # if (-f $libname)
  25. +
  26. + foreach $thispth (@searchpath, @libpath){
  27. + unless (-f ($fullname="$thispth\\$libname")) {
  28. + warn "'$thislib' not found as '$fullname'\n" if $verbose;
  29. + next;
  30. + }
  31. + warn "'$thislib' found as '$fullname'\n" if $verbose;
  32. + $found++;
  33. + $found_lib++;
  34. + push(@extralibs, $fullname);
  35. + push @libs, $fullname unless $libs_seen{$fullname}++;
  36. + last;
  37. + } # foreach $thispth (@searchpath, @libpath)
  38. - my $secondpass = 0;
  39. - LOOKAGAIN:
  40. -
  41. - # look for the file itself
  42. - if (-f) {
  43. - warn "'$thislib' found as '$_'\n" if $verbose;
  44. - $found++;
  45. - push(@extralibs, $_);
  46. - next;
  47. - }
  48. -
  49. - my $found_lib = 0;
  50. - foreach $thispth (@searchpath, @libpath){
  51. - unless (-f ($fullname="$thispth\\$_")) {
  52. - warn "'$thislib' not found as '$fullname'\n" if $verbose;
  53. - next;
  54. - }
  55. - warn "'$thislib' found as '$fullname'\n" if $verbose;
  56. - $found++;
  57. - $found_lib++;
  58. - push(@extralibs, $fullname);
  59. - push @libs, $fullname unless $libs_seen{$fullname}++;
  60. - last;
  61. - }
  62. -
  63. - # do another pass with (or without) leading 'lib' if they used -l
  64. - if (!$found_lib and $thislib =~ /^-l/ and !$secondpass++) {
  65. - if ($GC) {
  66. - goto LOOKAGAIN if s/^lib//i;
  67. - }
  68. - elsif (!/^lib/i) {
  69. - $_ = "lib$_";
  70. - goto LOOKAGAIN;
  71. - }
  72. - }
  73. -
  74. - # give up
  75. - warn "Note (probably harmless): "
  76. + # express frustration
  77. + warn "Note (probably harmless): "
  78. ."No library found for $thislib\n"
  79. - unless $found_lib>0;
  80. -
  81. - }
  82. + unless $found_lib>0;
  83. + } # for my $libname
  84. + } # foreach (Text::ParseWords::quotewords
  85. return ('','','','', ($give_libs ? \@libs : ())) unless $found;