Remove the anonymous function parameter from generate_list calls when

it is unnecessary.
Modify the .spec.c rule to allow compilation out of $(TOPSRCDIR).
This commit is contained in:
Francois Gouget 2001-05-07 18:19:57 +00:00 committed by Alexandre Julliard
parent fcba601cf4
commit 35246cbb8d
1 changed files with 24 additions and 57 deletions

View File

@ -1751,11 +1751,11 @@ sub generate_project_files
}); });
} }
if (@{@$project[$P_TARGETS]} > 0) { if (@{@$project[$P_TARGETS]} > 0) {
generate_list("DLLS",1,\@dll_list,sub generate_list("DLLS",1,\@dll_list,sub
{ {
return @{$_[0]}[$T_NAME]; return @{$_[0]}[$T_NAME];
}); });
generate_list("EXES",1,\@exe_list,sub generate_list("EXES",1,\@exe_list,sub
{ {
return "@{$_[0]}[$T_NAME]"; return "@{$_[0]}[$T_NAME]";
}); });
@ -1763,50 +1763,26 @@ sub generate_project_files
print FILEO "### Global settings\n\n"; print FILEO "### Global settings\n\n";
# Make it so that the project-wide settings override the global settings # Make it so that the project-wide settings override the global settings
generate_list("DEFINES",0,@$project_settings[$T_DEFINES],sub generate_list("DEFINES",0,@$project_settings[$T_DEFINES]);
generate_list("",1,$global_settings[$T_DEFINES]);
generate_list("INCLUDE_PATH",$no_extra,@$project_settings[$T_INCLUDE_PATH]);
generate_list("",1,$global_settings[$T_INCLUDE_PATH],sub
{ {
return "$_[0]"; if ($_[0] !~ /^-I/ or is_absolute($')) {
});
generate_list("",1,$global_settings[$T_DEFINES],sub
{
return "$_[0]";
});
generate_list("INCLUDE_PATH",$no_extra,@$project_settings[$T_INCLUDE_PATH],sub
{
return "$_[0]";
});
generate_list("",1,$global_settings[$T_INCLUDE_PATH],sub
{
if ($_[0] !~ /^-I/) {
return "$_[0]";
}
if (is_absolute($')) {
return "$_[0]"; return "$_[0]";
} }
return "-I\$(TOPSRCDIR)/$'"; return "-I\$(TOPSRCDIR)/$'";
}); });
generate_list("LIBRARY_PATH",$no_extra,@$project_settings[$T_LIBRARY_PATH],sub generate_list("LIBRARY_PATH",$no_extra,@$project_settings[$T_LIBRARY_PATH]);
generate_list("",1,$global_settings[$T_LIBRARY_PATH],sub
{ {
return "$_[0]"; if ($_[0] !~ /^-L/ or is_absolute($')) {
});
generate_list("",1,$global_settings[$T_LIBRARY_PATH],sub
{
if ($_[0] !~ /^-L/) {
return "$_[0]";
}
if (is_absolute($')) {
return "$_[0]"; return "$_[0]";
} }
return "-L\$(TOPSRCDIR)/$'"; return "-L\$(TOPSRCDIR)/$'";
}); });
generate_list("LIBRARIES",$no_extra,@$project_settings[$T_LIBRARIES],sub generate_list("LIBRARIES",$no_extra,@$project_settings[$T_LIBRARIES]);
{ generate_list("",1,$global_settings[$T_LIBRARIES]);
return "$_[0]";
});
generate_list("",1,$global_settings[$T_LIBRARIES],sub
{
return "$_[0]";
});
print FILEO "\n\n"; print FILEO "\n\n";
my $extra_source_count=@{@$project_settings[$T_SOURCES_C]}+ my $extra_source_count=@{@$project_settings[$T_SOURCES_C]}+
@ -1822,7 +1798,7 @@ sub generate_project_files
generate_list("EXTRA_OBJS",1,["\$(EXTRA_C_SRCS:.c=.o)","\$(EXTRA_CXX_SRCS:.cpp=.o)"]); generate_list("EXTRA_OBJS",1,["\$(EXTRA_C_SRCS:.c=.o)","\$(EXTRA_CXX_SRCS:.cpp=.o)"]);
print FILEO "\n\n\n"; print FILEO "\n\n\n";
} }
# Iterate over all the targets... # Iterate over all the targets...
foreach $target (@{@$project[$P_TARGETS]}) { foreach $target (@{@$project[$P_TARGETS]}) {
print FILEO "### @$target[$T_NAME] sources and settings\n\n"; print FILEO "### @$target[$T_NAME] sources and settings\n\n";
@ -1838,25 +1814,16 @@ sub generate_project_files
} elsif (@$target[$T_FLAGS] & $TF_WRAPPER) { } elsif (@$target[$T_FLAGS] & $TF_WRAPPER) {
$basename.="_wrapper"; $basename.="_wrapper";
} }
generate_list("${canon}_SPEC_SRCS",1,[ "$basename.spec"]); generate_list("${canon}_SPEC_SRCS",1,[ "$basename.spec" ]);
generate_list("${canon}_LIBRARY_PATH",1,@$target[$T_LIBRARY_PATH],sub generate_list("${canon}_LIBRARY_PATH",1,@$target[$T_LIBRARY_PATH]);
{ generate_list("${canon}_LIBRARIES",1,@$target[$T_LIBRARIES]);
return "$_[0]"; generate_list("${canon}_DEPENDS",1,@$target[$T_DEPENDS]);
});
generate_list("${canon}_LIBRARIES",1,@$target[$T_LIBRARIES],sub
{
return "$_[0]";
});
generate_list("${canon}_DEPENDS",1,@$target[$T_DEPENDS],sub
{
return "$_[0]";
});
print FILEO "\n"; print FILEO "\n";
generate_list("${canon}_OBJS",1,["\$(${canon}_C_SRCS:.c=.o)","\$(${canon}_CXX_SRCS:.cpp=.o)","\$(EXTRA_OBJS)"]); generate_list("${canon}_OBJS",1,["\$(${canon}_C_SRCS:.c=.o)","\$(${canon}_CXX_SRCS:.cpp=.o)","\$(EXTRA_OBJS)"]);
print FILEO "\n\n\n"; print FILEO "\n\n\n";
} }
print FILEO "### Global source lists\n\n"; print FILEO "### Global source lists\n\n";
generate_list("C_SRCS",$no_extra,@$project[$P_TARGETS],sub generate_list("C_SRCS",$no_extra,@$project[$P_TARGETS],sub
{ {
my $canon=canonize(@{$_[0]}[$T_NAME]); my $canon=canonize(@{$_[0]}[$T_NAME]);
$canon =~ s+_so$++; $canon =~ s+_so$++;
@ -1865,7 +1832,7 @@ sub generate_project_files
if (!$no_extra) { if (!$no_extra) {
generate_list("",1,[ "\$(EXTRA_C_SRCS)" ]); generate_list("",1,[ "\$(EXTRA_C_SRCS)" ]);
} }
generate_list("CXX_SRCS",$no_extra,@$project[$P_TARGETS],sub generate_list("CXX_SRCS",$no_extra,@$project[$P_TARGETS],sub
{ {
my $canon=canonize(@{$_[0]}[$T_NAME]); my $canon=canonize(@{$_[0]}[$T_NAME]);
$canon =~ s+_so$++; $canon =~ s+_so$++;
@ -1874,7 +1841,7 @@ sub generate_project_files
if (!$no_extra) { if (!$no_extra) {
generate_list("",1,[ "\$(EXTRA_CXX_SRCS)" ]); generate_list("",1,[ "\$(EXTRA_CXX_SRCS)" ]);
} }
generate_list("RC_SRCS",$no_extra,@$project[$P_TARGETS],sub generate_list("RC_SRCS",$no_extra,@$project[$P_TARGETS],sub
{ {
my $canon=canonize(@{$_[0]}[$T_NAME]); my $canon=canonize(@{$_[0]}[$T_NAME]);
$canon =~ s+_so$++; $canon =~ s+_so$++;
@ -1883,7 +1850,7 @@ sub generate_project_files
if (!$no_extra) { if (!$no_extra) {
generate_list("",1,[ "\$(EXTRA_RC_SRCS)" ]); generate_list("",1,[ "\$(EXTRA_RC_SRCS)" ]);
} }
generate_list("SPEC_SRCS",1,@$project[$P_TARGETS],sub generate_list("SPEC_SRCS",1,@$project[$P_TARGETS],sub
{ {
my $canon=canonize(@{$_[0]}[$T_NAME]); my $canon=canonize(@{$_[0]}[$T_NAME]);
$canon =~ s+_so$++; $canon =~ s+_so$++;
@ -1925,7 +1892,7 @@ sub generate_project_files
print FILEO "\tfor i in \$(EXES:%=%.so) \$(DLLS); do \$(RM) \$(libdir)/\$\$i;done\n"; print FILEO "\tfor i in \$(EXES:%=%.so) \$(DLLS); do \$(RM) \$(libdir)/\$\$i;done\n";
} }
print FILEO "\n\n\n"; print FILEO "\n\n\n";
if (@{@$project[$P_TARGETS]} > 0) { if (@{@$project[$P_TARGETS]} > 0) {
print FILEO "### Target specific build rules\n\n"; print FILEO "### Target specific build rules\n\n";
foreach $target (@{@$project[$P_TARGETS]}) { foreach $target (@{@$project[$P_TARGETS]}) {
@ -1936,7 +1903,7 @@ sub generate_project_files
print FILEO "\t-\$(STRIP) \$(STRIPFLAGS) \$\@\n"; print FILEO "\t-\$(STRIP) \$(STRIPFLAGS) \$\@\n";
print FILEO "\n"; print FILEO "\n";
print FILEO "\$(${canon}_SPEC_SRCS:.spec=.spec.c): \$(${canon}_SPEC_SRCS:.spec) \$(${canon}_SPEC_SRCS:.spec=.tmp.o) \$(${canon}_RC_SRCS:.rc=.res)\n"; print FILEO "\$(${canon}_SPEC_SRCS:.spec=.spec.c): \$(${canon}_SPEC_SRCS:.spec) \$(${canon}_SPEC_SRCS:.spec=.tmp.o) \$(${canon}_RC_SRCS:.rc=.res)\n";
print FILEO "\t\$(LD_PATH) \$(WINEBUILD) -fPIC \$(${canon}_LIBRARY_PATH) \$(WINE_LIBRARY_PATH) -sym \$(${canon}_SPEC_SRCS:.spec=.tmp.o) -o \$\@ -spec \$(${canon}_SPEC_SRCS)\n"; print FILEO "\t\$(LD_PATH) \$(WINEBUILD) -fPIC \$(${canon}_LIBRARY_PATH) \$(WINE_LIBRARY_PATH) -sym \$(${canon}_SPEC_SRCS:.spec=.tmp.o) -o \$\@ -spec \$(SRCDIR)/\$(${canon}_SPEC_SRCS)\n";
print FILEO "\n"; print FILEO "\n";
my $t_name=@$target[$T_NAME]; my $t_name=@$target[$T_NAME];
if (@$target[$T_TYPE]!=$TT_DLL) { if (@$target[$T_TYPE]!=$TT_DLL) {
@ -1956,7 +1923,7 @@ sub generate_project_files
} }
} }
close(FILEO); close(FILEO);
foreach $target (@{@$project[$P_TARGETS]}) { foreach $target (@{@$project[$P_TARGETS]}) {
generate_spec_file(@$project[$P_PATH],$target,$project_settings); generate_spec_file(@$project[$P_PATH],$target,$project_settings);
if (@$target[$T_FLAGS] & $TF_WRAPPER) { if (@$target[$T_FLAGS] & $TF_WRAPPER) {