Fix file lossage in subdirectories of an 'include' directory (closes #163).

When case fixing #includes, take into account that the file may have
been renamed (closes #161).
Better support of $(SRCDIR) in -I directives.
RTF was not recognised in rc files because it was in the wrong place.
Escape weird characters when putting the rc filename in the spec file.
This commit is contained in:
Francois Gouget 2001-04-20 18:26:35 +00:00 committed by Alexandre Julliard
parent 532cae2f6c
commit 647bb8f03d
1 changed files with 10 additions and 4 deletions

View File

@ -554,6 +554,7 @@ sub source_scan_directory
push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_cxx;
push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_rc;
push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@sources_misc;
push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@{@$project_settings[$T_SOURCES_MISC]};
return;
}
@ -1174,12 +1175,14 @@ sub get_real_include_name
}
} else {
# Here's how we proceed:
# - compute the 'renamed' filename (see renaming phase)
# - split the filename we look for into its components
# - then for each directory in the include path
# - trace the directory components starting from that directory
# - if we fail to find a match at any point then continue with
# the next directory in the include path
# - otherwise, rejoice, our quest is over.
$filename =~ s/[ \$]/_/g;
my @file_components=split /[\/\\]+/, $filename;
#print " Searching for $filename from @$project[$P_PATH]\n";
@ -1200,6 +1203,7 @@ sub get_real_include_name
$dirname="@$project[$P_PATH]$dirname";
} else {
$dirname=~ s+^\$\(TOPSRCDIR\)/++;
$dirname=~ s+^\$\(SRCDIR\)/+@$project[$P_PATH]+;
}
#print " in $dirname\n";
$real_filename=search_from("$dirname",\@file_components);
@ -1213,6 +1217,7 @@ sub get_real_include_name
my $dirname=$include;
$dirname=~ s+^-I++;
$dirname=~ s+^\$\(TOPSRCDIR\)\/++;
$dirname=~ s+^\$\(SRCDIR\)\/+@$project[$P_PATH]+;
#print " in $dirname (global setting)\n";
$real_filename=search_from("$dirname",\@file_components);
if (defined $real_filename) {
@ -1458,7 +1463,7 @@ sub fix_file
$modified=1;
} elsif ($is_rc) {
if ($rc_block_depth == 0 and /^(\w+\s+(BITMAP|CURSOR|FONT|FONTDIR|ICON|MESSAGETABLE|TEXT)\s+((DISCARDABLE|FIXED|IMPURE|LOADONCALL|MOVEABLE|PRELOAD|PURE|RTF)\s+)*)([\"<]?)([^\">\r\n]+)([\">]?)/) {
if ($rc_block_depth == 0 and /^(\w+\s+(BITMAP|CURSOR|FONT|FONTDIR|ICON|MESSAGETABLE|TEXT|RTF)\s+((DISCARDABLE|FIXED|IMPURE|LOADONCALL|MOVEABLE|PRELOAD|PURE)\s+)*)([\"<]?)([^\">\r\n]+)([\">]?)/) {
my $from_file=($5 eq "<"?"":$dirname);
my $real_include_name=get_real_include_name($line,$6,$from_file,$project,$target);
print FILEO "$1$5$real_include_name$7$'";
@ -1578,6 +1583,7 @@ sub generate_spec_file
}
my $rcname=@{@$target[$T_SOURCES_RC]}[0];
$rcname =~ s+\.rc$++i;
$rcname =~ s+([^/\w])+\\\1+g;
print FILEO "rsrc $rcname.res\n";
}
print FILEO "\n";