Skip to content
Snippets Groups Projects
Commit c6629293 authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard
Browse files

Minor bug fixes and improvements.

parent 66fcb2b7
No related branches found
No related tags found
No related merge requests found
......@@ -220,8 +220,10 @@ MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
next if !$module;
my $c_srcs = [];
my $source_files = [];
if(exists($vars{C_SRCS})) {
$c_srcs = [sort(@{$vars{C_SRCS}})];
$source_files = [sort(@{$vars{C_SRCS}})];
}
......@@ -272,6 +274,7 @@ MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
$modules{$module}{project} = $project;
$modules{$module}{type} = $type;
$modules{$module}{dsp_file} = $dsp_file;
$modules{$module}{c_srcs} = $c_srcs;
$modules{$module}{source_files} = $local_source_files;
$modules{$module}{header_files} = $local_header_files;
$modules{$module}{resource_files} = $local_resource_files;
......@@ -294,6 +297,7 @@ MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
$modules{$module}{project} = $project;
$modules{$module}{type} = $type;
$modules{$module}{dsp_file} = $dsp_file;
$modules{$module}{c_srcs} = $c_srcs;
$modules{$module}{source_files} = $local_source_files;
$modules{$module}{header_files} = $local_header_files;
$modules{$module}{resource_files} = $local_resource_files;
......@@ -319,6 +323,7 @@ MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
$modules{$module}{project} = $project;
$modules{$module}{type} = $type;
$modules{$module}{dsp_file} = $dsp_file;
$modules{$module}{c_srcs} = $c_srcs;
$modules{$module}{source_files} = $local_source_files;
$modules{$module}{header_files} = $local_header_files;
$modules{$module}{resource_files} = $local_resource_files;
......@@ -328,6 +333,7 @@ MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
$modules{$module}{project} = $project;
$modules{$module}{type} = $type;
$modules{$module}{dsp_file} = $dsp_file;
$modules{$module}{c_srcs} = $c_srcs;
$modules{$module}{source_files} = $source_files;
$modules{$module}{header_files} = $header_files;
$modules{$module}{resource_files} = $resource_files;
......@@ -376,6 +382,7 @@ sub _generate_dsp {
$progress_current++;
$output->progress("$dsp_file (file $progress_current of $progress_max)");
my @c_srcs = @{$modules{$module}{c_srcs}};
my @source_files = @{$modules{$module}{source_files}};
my @header_files = @{$modules{$module}{header_files}};
my @resource_files = @{$modules{$module}{resource_files}};
......@@ -449,7 +456,6 @@ sub _generate_dsp {
print OUT "CPP=cl.exe\r\n";
print OUT "MTL=midl.exe\r\n" if !$lib;
print OUT "RSC=rc.exe\r\n";
print OUT "\r\n";
my $n = 0;
......@@ -604,7 +610,7 @@ sub _generate_dsp {
print OUT "# ADD RSC /l 0x41d";
if($wine) {
foreach my $include (@includes) {
print OUT " /I \"$include\"";
print OUT " /i \"$include\"";
}
}
print OUT " /d \"_DEBUG\"\r\n";
......@@ -616,7 +622,7 @@ sub _generate_dsp {
print OUT "# ADD RSC /l 0x41d";
if($wine) {
foreach my $include (@includes) {
print OUT " /I \"$include\"";
print OUT " /i \"$include\"";
}
}
print OUT "/d \"NDEBUG\"\r\n";
......@@ -641,9 +647,11 @@ sub _generate_dsp {
}
print OUT "# ADD LINK32 /nologo";
print OUT " libcmt.lib" if $project =~ /^ntdll$/; # FIXME: Kludge
print OUT " /dll" if $dll;
print OUT " /debug" if $debug;
print OUT " /machine:I386";
print OUT " /nodefaultlib" if $project =~ /^ntdll$/; # FIXME: Kludge
print OUT " /def:\"$project.def\"" if $dll;
print OUT " /pdbtype:sept" if $debug;
print OUT "\r\n";
......@@ -711,27 +719,42 @@ sub _generate_dsp {
my $def_file = "$basename.def";
$basename = "$basename.dll" if $basename !~ /\..{1,3}$/;
my $dbg_file = "$basename.dbg";
my $dbg_c_file = "$basename.dbg.c";
my $srcdir = "."; # FIXME: Is this really always correct?
my $c_srcs = join(" ", grep(/\.c$/, @source_files));
print OUT "\r\n";
print OUT "# Begin Custom Build\r\n";
print OUT "InputPath=$spec_file\r\n";
print OUT "\r\n";
print OUT "BuildCmds= \\\r\n";
print OUT "\t..\\..\\tools\\winebuild\\$output_dir\\winebuild.exe -def $spec_file > $def_file \\\r\n";
print OUT "\t..\\..\\tools\\winebuild\\$output_dir\\winebuild.exe -o $dbg_c_file -debug -C$srcdir $c_srcs \\\r\n";
print OUT "\r\n";
if($project =~ /^ntdll$/) {
my $n = 0;
foreach my $c_src (@c_srcs) {
if($n++ > 0) {
print OUT "\techo $c_src >> $dbg_file \\\r\n";
} else {
print OUT "\techo $c_src > $dbg_file \\\r\n";
}
}
print OUT "\t..\\..\\tools\\winebuild\\$output_dir\\winebuild.exe";
print OUT " -o $dbg_c_file -debug -C$srcdir $dbg_file \\\r\n";
} else {
my $c_srcs = join(" ", grep(/\.c$/, @c_srcs));
print OUT "\t..\\..\\tools\\winebuild\\$output_dir\\winebuild.exe";
print OUT " -o $dbg_c_file -debug -C$srcdir $c_srcs \\\r\n";
}
print OUT "\t\r\n";
print OUT "\r\n";
print OUT "\"$def_file\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\r\n";
print OUT " \$(BuildCmds)\r\n";
print OUT "\r\n";
print OUT "\"$dbg_c_file\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\r\n";
print OUT " \$(BuildCmds)\r\n";
print OUT "\r\n";
print OUT "# End Custom Build\r\n";
}
......@@ -887,7 +910,8 @@ sub _generate_config_h {
}
my @functions = qw(
_access _chdir _close _lseek _mkdir _open _pclose _popen _read _rmdir _write _stat
_alldiv _allmul _allrem _aulldiv _aullrem
_access _chdir _close _lseek _mkdir _open _pclose _popen _read _rmdir _write _stat
_snprintf _stricmp _strnicmp _vsnprintf _wcsicmp wcslen
ecvt fcvt gcvt
strerror
......@@ -907,24 +931,31 @@ sub _generate_config_h {
print OUT "/* Define to a macro to generate an assembly function directive */\n";
print OUT "#define __ASM_FUNC(name) \"\"\n";
print OUT "\n";
print OUT "/* Define to a macro to generate an assembly name from a C symbol */\n";
print OUT "#define __ASM_NAME(name) name\n";
print OUT "\n";
print OUT "/* Define to the address where bug reports for this package should be sent. */\n";
print OUT "#define PACKAGE_BUGREPORT \"\"\n";
print OUT "\n";
print OUT "/* Define to the full name of this package. */\n";
print OUT "#define PACKAGE_NAME \"Wine\"\n";
print OUT "\n";
print OUT "/* Define to the full name and version of this package. */\n";
print OUT "#define PACKAGE_STRING \"Wine YYYYMMDD\"\n";
print OUT "\n";
print OUT "/* Define to the one symbol short name of this package. */\n";
print OUT "#define PACKAGE_TARNAME \"wine\"\n";
print OUT "\n";
print OUT "/* Define to the version of this package. */\n";
print OUT "#define PACKAGE_VERSION \"YYYYMMDD\"\n";
print OUT "\n";
close(OUT);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment