Library dependencies not found in Trick 15 #325

There are 2 bugs.  The first in ICG.pm did not look for dependencies
that included "src" in the name correctly.  The code was inserting the
"src" in the incorrect place.  The second bug is in mis_dep.pm.  That
bug did not include non ".o" files from the beginning.
This commit is contained in:
Alex Lin 2016-10-06 10:42:46 -05:00
parent e9a3a54fad
commit 3260e54cd7
2 changed files with 6 additions and 4 deletions

View File

@ -400,6 +400,8 @@ sub ICG(\@$$$) {
}
} else {
$l =~ s/o$// ;
my $file_name = basename($l) ;
my $dir_name = dirname($l) ;
foreach my $inc ( $file_path_dir , @inc_paths) {
foreach my $ext ( "cpp" , "cc" , "c" , "c++" , "cxx" , "C" ) {
if ( -e "$inc/$l$ext" ) {
@ -410,9 +412,9 @@ sub ICG(\@$$$) {
$found = 1 ;
last ;
}
elsif ( -e "$inc/src/$l$ext" ) {
#print "found $inc/src/$l$ext\n" ;
my $f = abs_path(dirname("$inc/src/$l$ext")) . "/" . basename("$inc/src/$l$ext") ;
elsif ( -e "$inc/$dir_name/src/$file_name$ext" ) {
#print "found $inc/$dir_name/src/$file_name$ext\n" ;
my $f = abs_path("$inc/$dir_name/src/$file_name$ext") ;
push @{$$sim_ref{mis_entry_files}} , $f ;
push @{$$sim_ref{head_deps}{$f}{files}} , $f ;
$found = 1 ;

View File

@ -114,7 +114,7 @@ sub get_depends($$) {
s/\(|\)|\s+//g ;
s/\${(.+?)}/$ENV{$1}/eg ;
}
@list_objects = grep /\.o$/ , @lib_list ;
@list_objects = grep !/\.so$|\.a$/ , @lib_list ;
@list_libs = grep /\.so$|\.a$/ , @lib_list ;
# Always add self-dependency