Commit b430295c authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Fix the include path handling in get_real_include_name

Modified get_real_include_name so that it can follow an include path starting with $(TOPSRCDIR) Indent the debug messages a bit more so that winemaker's is still readable when they are on The ATL_INCLUDE_ROOT variable was set wrong (configure.in) The MFC include path must contain the path to the ATL headers (configure.in)
parent a2882e03
...@@ -650,8 +650,6 @@ sub source_scan_directory ...@@ -650,8 +650,6 @@ sub source_scan_directory
$opt_ask_project_options="never"; $opt_ask_project_options="never";
} else { } else {
source_set_options($project_settings,$options); source_set_options($project_settings,$options);
print "project_settings: defines=@{@$project_settings[$T_DEFINES]}\n";
print "project_settings: includes=@{@$project_settings[$T_INCLUDE_PATH]}\n";
} }
} }
...@@ -1006,7 +1004,7 @@ sub search_from ...@@ -1006,7 +1004,7 @@ sub search_from
} }
foreach $component (@$path) { foreach $component (@$path) {
#print " looking for $component in \"$dirname\"\n"; #print " looking for $component in \"$dirname\"\n";
if ($component eq ".") { if ($component eq ".") {
# Pass it as is # Pass it as is
$real_path.="./"; $real_path.="./";
...@@ -1027,13 +1025,13 @@ sub search_from ...@@ -1027,13 +1025,13 @@ sub search_from
} }
if (!defined $found) { if (!defined $found) {
# Give up # Give up
#print " could not find $component in $dirname\n"; #print " could not find $component in $dirname\n";
return; return;
} }
} }
} }
$real_path=~ s+/$++; $real_path=~ s+/$++;
#print " ->found $real_path\n"; #print " -> found $real_path\n";
return $real_path; return $real_path;
} }
...@@ -1070,19 +1068,27 @@ sub get_real_include_name ...@@ -1070,19 +1068,27 @@ sub get_real_include_name
# the next directory in the include path # the next directory in the include path
# - otherwise, rejoice, our quest is over. # - otherwise, rejoice, our quest is over.
my @file_components=split /[\/\\]+/, $filename; my @file_components=split /[\/\\]+/, $filename;
#print "Searching for $filename from @$project[$P_PATH]\n"; #print " Searching for $filename from @$project[$P_PATH]\n";
my $real_filename; my $real_filename;
if ($dirname ne "") { if ($dirname ne "") {
#print " in $dirname (include \"\")\n"; # This is an 'include ""' -> look in dirname first.
#print " in $dirname (include \"\")\n";
$real_filename=search_from($dirname,\@file_components); $real_filename=search_from($dirname,\@file_components);
if (defined $real_filename) { if (defined $real_filename) {
return $real_filename; return $real_filename;
} }
} }
my $project_settings=@$project[$P_SETTINGS]; my $project_settings=@$project[$P_SETTINGS];
foreach $dirname (@{@$target[$T_INCLUDE_PATH]}, @{@$project_settings[$T_INCLUDE_PATH]}) { foreach $include (@{@$target[$T_INCLUDE_PATH]}, @{@$project_settings[$T_INCLUDE_PATH]}) {
#print " in $dirname\n"; my $dirname=$include;
$dirname=~ s+^-I++;
if (!is_absolute($dirname)) {
$dirname="@$project[$P_PATH]$dirname";
} else {
$dirname=~ s+^\$\(TOPSRCDIR\)/++;
}
#print " in $dirname\n";
$real_filename=search_from("$dirname",\@file_components); $real_filename=search_from("$dirname",\@file_components);
if (defined $real_filename) { if (defined $real_filename) {
return $real_filename; return $real_filename;
...@@ -1090,14 +1096,11 @@ sub get_real_include_name ...@@ -1090,14 +1096,11 @@ sub get_real_include_name
} }
my $dotdotpath=@$project[$P_PATH]; my $dotdotpath=@$project[$P_PATH];
$dotdotpath =~ s/[^\/]+/../g; $dotdotpath =~ s/[^\/]+/../g;
foreach $dirname (@{$global_settings[$T_INCLUDE_PATH]}) { foreach $include (@{$global_settings[$T_INCLUDE_PATH]}) {
my $ipath; my $dirname=$include;
if (!is_absolute($dirname)) { $dirname=~ s+^-I++;
$ipath="$dotdotpath$dirname"; $dirname=~ s+^\$\(TOPSRCDIR\)\/++;
} else { #print " in $dirname (global setting)\n";
$ipath=$dirname;
}
#print " in $ipath (global setting)\n";
$real_filename=search_from("$dirname",\@file_components); $real_filename=search_from("$dirname",\@file_components);
if (defined $real_filename) { if (defined $real_filename) {
return $real_filename; return $real_filename;
...@@ -1120,6 +1123,8 @@ sub get_real_include_name ...@@ -1120,6 +1123,8 @@ sub get_real_include_name
# and path separator of '#include' directives. This requires that each # and path separator of '#include' directives. This requires that each
# source file be associated to a project & target so that the proper # source file be associated to a project & target so that the proper
# include path is used. # include path is used.
# Also note that the include path is relative to the directory in which the
# compiler is run, i.e. that of the project, not to that of the file.
sub fix_file sub fix_file
{ {
my $filename=$_[0]; my $filename=$_[0];
...@@ -2367,11 +2372,11 @@ then ...@@ -2367,11 +2372,11 @@ then
then then
if test -f "$ATL_INCLUDE_ROOT/atl/atlbase.h" if test -f "$ATL_INCLUDE_ROOT/atl/atlbase.h"
then then
ATL_INCLUDE_ROOT="$ATL_INCLUDE_ROOT/mfc" ATL_INCLUDE_ROOT="$ATL_INCLUDE_ROOT/atl"
else else
if test -f "$ATL_INCLUDE_ROOT/atl/include/atlbase.h" if test -f "$ATL_INCLUDE_ROOT/atl/include/atlbase.h"
then then
ATL_INCLUDE_ROOT="$ATL_INCLUDE_ROOT/mfc/include" ATL_INCLUDE_ROOT="$ATL_INCLUDE_ROOT/atl/include"
else else
AC_MSG_ERROR([Could not find the ATL includes]) AC_MSG_ERROR([Could not find the ATL includes])
fi fi
...@@ -2397,7 +2402,7 @@ then ...@@ -2397,7 +2402,7 @@ then
fi fi
fi fi
fi fi
MFC_INCLUDE_PATH="-D_DLL -D_MT -I$MFC_INCLUDE_ROOT -I\$(WINELIB_INCLUDE_ROOT)/mixedcrt" MFC_INCLUDE_PATH="-D_DLL -D_MT -I$ATL_INCLUDE_ROOT -I$MFC_INCLUDE_ROOT -I\$(WINELIB_INCLUDE_ROOT)/mixedcrt"
if test -z "$MFC_LIBRARY_ROOT" if test -z "$MFC_LIBRARY_ROOT"
then then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment