On Fri, Jul 20, 2007 at 11:39:35PM -0400, Farokh Irani wrote:
> I took a further look at apxs, and it appears that the bad coding for the
> source files continues. In my apxs around line 406, you'll find the
> following:
>
> foreach $s (@srcs) {
> my $slo = $s;
> $slo =~ s|\.c$|.slo|;
> my $lo = $s;
> $lo =~ s|\.c$|.lo|;
> my $la = $s;
> $la =~ s|\.c$|.la|;
> my $o = $s;
> $o =~ s|\.c$|.o|;
>
> When I replaced the .c in the above with .cpp, everything worked fine using
> .cpp.
Change substitution command separators (s|||) to s///.
Then create regex disjunction (operator |).
$slo =~ s|\.c$|.slo|;
change to
$slo =~ s/\.c$|\.cpp$|\.cc$/.slo/;
and all the rest with the same style.
> Now, I'm not sure if the perl from the first fix:
>
> if ( $f =~ m/\.c(c|pp){0,1}$/i ) instead of
> if ($f =~ m|\.c$|)
Here same rule as above.
I reviewed apxs code and it's just poor coded must-use tool :/
Kind regards.