PageRenderTime 29ms CodeModel.GetById 26ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

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