2002-08-27 02:29:36 +02:00
|
|
|
#! /usr/bin/perl -w
|
|
|
|
|
|
|
|
# Copyright 2002 Patrik Stridvall
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
$0 =~ m%^(.*?/?tools)/winapi/msvcmaker$%;
|
|
|
|
require "$1/winapi/setup.pm";
|
|
|
|
}
|
|
|
|
|
2004-10-06 02:04:54 +02:00
|
|
|
use setup qw($current_dir $wine_dir);
|
|
|
|
use lib $setup::winapi_dir;
|
2004-10-26 02:12:21 +02:00
|
|
|
use config qw(get_spec_files get_makefile_in_files);
|
2002-08-27 02:29:36 +02:00
|
|
|
use output qw($output);
|
2002-10-29 22:25:09 +01:00
|
|
|
use util qw(replace_file);
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
use msvcmaker_options qw($options);
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
if($options->progress) {
|
|
|
|
$output->enable_progress;
|
|
|
|
} else {
|
|
|
|
$output->disable_progress;
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# main
|
|
|
|
|
|
|
|
my @spec_files = get_spec_files("winelib");
|
|
|
|
my @makefile_in_files = get_makefile_in_files("winelib");
|
|
|
|
|
|
|
|
my $wine = 1;
|
|
|
|
|
|
|
|
my $output_prefix_dir = "Output";
|
|
|
|
my $no_release = 1;
|
|
|
|
|
|
|
|
my %modules;
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub read_spec_file($) {
|
2002-10-29 22:25:09 +01:00
|
|
|
my $spec_file = shift;
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
my $module = $spec_file;
|
|
|
|
$module =~ s%^.*?([^/]+)\.spec$%$1%;
|
|
|
|
$module .= ".dll" if $module !~ /\./;
|
|
|
|
|
|
|
|
my $type = "win32";
|
|
|
|
|
|
|
|
open(IN, "< $wine_dir/$spec_file");
|
|
|
|
|
|
|
|
my $header = 1;
|
|
|
|
my $lookahead = 0;
|
|
|
|
while($lookahead || defined($_ = <IN>)) {
|
|
|
|
$lookahead = 0;
|
|
|
|
|
|
|
|
s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begining and end of line
|
|
|
|
s/^(.*?)\s*#.*$/$1/; # remove comments
|
|
|
|
/^$/ && next; # skip empty lines
|
|
|
|
|
|
|
|
if($header) {
|
2004-10-22 21:55:42 +02:00
|
|
|
if(/^(?:\d+|@)/) {
|
2002-08-27 02:29:36 +02:00
|
|
|
$header = 0;
|
|
|
|
$lookahead = 1;
|
|
|
|
}
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(/^(\d+|@)\s+pascal(?:16)?/) {
|
|
|
|
$type = "win16";
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(IN);
|
|
|
|
|
|
|
|
# FIXME: Kludge
|
2004-10-05 20:14:02 +02:00
|
|
|
if($module =~ /^(?:(?:imm|ole2conv|ole2prox|ole2thk|rasapi16|windebug)\.dll|comm\.drv)$/) {
|
2002-08-27 02:29:36 +02:00
|
|
|
$type = "win16";
|
|
|
|
}
|
|
|
|
|
|
|
|
if($type eq "win32") {
|
|
|
|
$modules{$module}{module} = $module;
|
|
|
|
$modules{$module}{type} = $type;
|
|
|
|
$modules{$module}{spec_file} = $spec_file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
if ($options->wine || $options->winetest) {
|
|
|
|
foreach my $spec_file (@spec_files) {
|
|
|
|
read_spec_file($spec_file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-31 03:10:08 +02:00
|
|
|
my @gdi32_dirs = qw(dlls/gdi/enhmfdrv dlls/gdi/mfdrv);
|
|
|
|
my @ntdll_dirs = qw(misc);
|
|
|
|
my @user32_dirs = qw(dlls/user/dde windows);
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
push @makefile_in_files, "tools/winebuild/Makefile.in";
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub filter_files($$) {
|
2002-08-27 02:29:36 +02:00
|
|
|
my $files = shift;
|
|
|
|
my $filter = shift;
|
|
|
|
|
|
|
|
my $filtered_files = [];
|
|
|
|
my $rest_of_files = [];
|
|
|
|
foreach my $file (@$files) {
|
|
|
|
if($file =~ /$filter/) {
|
|
|
|
$file =~ s%.*?([^/]+)$%./$1%; # FIXME: Kludge
|
|
|
|
push @$filtered_files, $file;
|
|
|
|
} else {
|
|
|
|
push @$rest_of_files, $file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ($rest_of_files, $filtered_files);
|
|
|
|
}
|
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
my %wine_test_dsp_files;
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
|
|
|
|
open(IN, "< $wine_dir/$makefile_in_file");
|
|
|
|
|
|
|
|
my $topobjdir;
|
|
|
|
my $module;
|
2002-10-23 22:16:12 +02:00
|
|
|
my $testdll;
|
|
|
|
my @imports;
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
my %vars;
|
|
|
|
|
|
|
|
my $again = 0;
|
|
|
|
my $lookahead = 0;
|
|
|
|
while($again || defined(my $line = <IN>)) {
|
|
|
|
if(!$again) {
|
|
|
|
chomp $line;
|
|
|
|
if($lookahead) {
|
|
|
|
$lookahead = 0;
|
|
|
|
$_ .= "\n" . $line;
|
|
|
|
} else {
|
|
|
|
$_ = $line;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$again = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begining and end of line
|
|
|
|
s/^(.*?)\s*#.*$/$1/; # remove comments
|
|
|
|
/^$/ && next; # skip empty lines
|
|
|
|
|
|
|
|
if(s/\\$/ /s) {
|
|
|
|
$lookahead = 1;
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(/^MODULE\s*=\s*([\w\.]+)$/) {
|
|
|
|
$module = $1;
|
|
|
|
|
|
|
|
if($module eq "none") {
|
|
|
|
if($makefile_in_file eq "library/Makefile.in") {
|
|
|
|
$module = "wine.dll";
|
|
|
|
} elsif($makefile_in_file eq "unicode/Makefile.in") {
|
|
|
|
$module = "wine_unicode.dll";
|
|
|
|
} elsif($makefile_in_file eq "tools/winebuild/Makefile.in") {
|
|
|
|
$module = "winebuild.exe";
|
|
|
|
} else {
|
|
|
|
next MAKEFILE_IN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} elsif(/^TOPOBJDIR\s*=\s*(\S+)\s*$/) {
|
|
|
|
$topobjdir = $1;
|
2002-10-23 22:16:12 +02:00
|
|
|
} elsif (/^TESTDLL\s*=\s*(\S+)\s*$/) {
|
|
|
|
$testdll = $1;
|
|
|
|
} elsif (/^IMPORTS\s*=\s*/) {
|
2004-10-04 21:14:49 +02:00
|
|
|
push @imports, grep !/^ntdll$/, split /\s+/s, $';
|
|
|
|
} elsif (/^EXTRALIBS\s*=\s*/) {
|
|
|
|
push @imports, map { /^-l(dxerr8|dxerr9|dxguid|strmiids|uuid)$/ ? $1 : () } split /\s+/s, $';
|
2002-10-23 22:16:12 +02:00
|
|
|
} elsif (/^CTESTS\s*=\s*/) {
|
|
|
|
my @files = split /\s+/s, $';
|
|
|
|
|
|
|
|
my $dir = $makefile_in_file;
|
|
|
|
$dir =~ s/\/Makefile\.in$//;
|
2003-01-07 20:40:00 +01:00
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
my $dsp_file = $testdll;
|
2003-01-07 20:40:00 +01:00
|
|
|
$dsp_file =~ s/\.(dll|drv)$/_test.dsp/;
|
2002-10-23 22:16:12 +02:00
|
|
|
$dsp_file = "$dir/$dsp_file";
|
|
|
|
|
|
|
|
$wine_test_dsp_files{$dsp_file}{files} = [@files, "testlist.c"];
|
|
|
|
$wine_test_dsp_files{$dsp_file}{imports} = [@imports];
|
2002-08-27 02:29:36 +02:00
|
|
|
} elsif(/^(\w+)\s*=\s*/) {
|
|
|
|
my $var = $1;
|
|
|
|
my @files = split /\s+/s, $';
|
|
|
|
|
|
|
|
@files = map {
|
|
|
|
if(/^\$\((\w+):\%=(.*?)\%(.*?)\)$/) {
|
|
|
|
my @list = @{$vars{$1}};
|
|
|
|
my $prefix = $2;
|
|
|
|
my $suffix = $3;
|
|
|
|
foreach my $item (@list) {
|
|
|
|
$item = "$prefix$item$suffix";
|
|
|
|
}
|
|
|
|
@list;
|
|
|
|
} elsif(/^\$\(TOPOBJDIR\)(.*?)$/) {
|
|
|
|
"$topobjdir$1";
|
|
|
|
} elsif(/^\$/) {
|
|
|
|
print STDERR "unknown variable '$_'\n" if 0;
|
|
|
|
();
|
|
|
|
} else {
|
|
|
|
$_;
|
|
|
|
}
|
|
|
|
} @files;
|
|
|
|
|
|
|
|
$vars{$var} = \@files;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
close(IN);
|
|
|
|
|
|
|
|
next if !$module;
|
|
|
|
|
2002-09-13 00:25:35 +02:00
|
|
|
my $c_srcs = [];
|
2002-08-27 02:29:36 +02:00
|
|
|
my $source_files = [];
|
|
|
|
if(exists($vars{C_SRCS})) {
|
2002-09-13 00:25:35 +02:00
|
|
|
$c_srcs = [sort(@{$vars{C_SRCS}})];
|
2002-08-27 02:29:36 +02:00
|
|
|
$source_files = [sort(@{$vars{C_SRCS}})];
|
|
|
|
}
|
|
|
|
|
|
|
|
my $header_files = [];
|
|
|
|
if(exists($vars{H_SRCS})) {
|
|
|
|
$header_files = [sort(@{$vars{H_SRCS}})];
|
|
|
|
}
|
|
|
|
|
|
|
|
my $resource_files = [];
|
|
|
|
if(exists($vars{RC_SRCS})) {
|
|
|
|
$resource_files = [sort(@{$vars{RC_SRCS}})];
|
|
|
|
}
|
|
|
|
|
|
|
|
my $project = $module;
|
|
|
|
$project =~ s/\.(?:dll|exe|lib)$//;
|
|
|
|
$project =~ y/./_/;
|
|
|
|
|
|
|
|
my $type;
|
|
|
|
if($module =~ /\.exe$/) {
|
|
|
|
$type = "exe";
|
|
|
|
} elsif($module =~ /\.lib$/) {
|
|
|
|
$type = "lib";
|
|
|
|
} else {
|
|
|
|
$type = "dll";
|
|
|
|
}
|
|
|
|
|
|
|
|
my $dsp_file = $makefile_in_file;
|
|
|
|
$dsp_file =~ s/Makefile.in$/$project.dsp/;
|
|
|
|
|
2002-08-30 02:01:55 +02:00
|
|
|
if($module eq "gdi32.dll") {
|
|
|
|
foreach my $dir (@gdi32_dirs) {
|
|
|
|
my $dir2 = $dir;
|
|
|
|
$dir2 =~ s%^.*?/([^/]+)$%$1%;
|
|
|
|
|
|
|
|
my $module = "gdi32_$dir2.lib";
|
|
|
|
$module =~ s%/%_%g;
|
|
|
|
|
|
|
|
my $project = "gdi32_$dir2";
|
|
|
|
$project =~ s%/%_%g;
|
|
|
|
|
|
|
|
my $type = "lib";
|
|
|
|
my $dsp_file = "$dir/$project.dsp";
|
|
|
|
|
|
|
|
($source_files, my $local_source_files) = filter_files($source_files, "$dir2/");
|
|
|
|
($header_files, my $local_header_files) = filter_files($header_files, "$dir2/");
|
|
|
|
($resource_files, my $local_resource_files) = filter_files($resource_files, "$dir2/");
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
$modules{$module}{wine} = 1;
|
|
|
|
$modules{$module}{winetest} = 0;
|
2002-08-30 02:01:55 +02:00
|
|
|
$modules{$module}{project} = $project;
|
|
|
|
$modules{$module}{type} = $type;
|
|
|
|
$modules{$module}{dsp_file} = $dsp_file;
|
2002-09-13 00:25:35 +02:00
|
|
|
$modules{$module}{c_srcs} = $c_srcs;
|
2002-08-30 02:01:55 +02:00
|
|
|
$modules{$module}{source_files} = $local_source_files;
|
|
|
|
$modules{$module}{header_files} = $local_header_files;
|
|
|
|
$modules{$module}{resource_files} = $local_resource_files;
|
2002-10-23 22:16:12 +02:00
|
|
|
$modules{$module}{imports} = [];
|
2002-08-30 02:01:55 +02:00
|
|
|
}
|
|
|
|
} elsif($module eq "ntdll.dll") {
|
2002-08-27 02:29:36 +02:00
|
|
|
foreach my $dir (@ntdll_dirs) {
|
|
|
|
my $module = "ntdll_$dir.lib";
|
|
|
|
$module =~ s%/%_%g;
|
|
|
|
|
|
|
|
my $project = "ntdll_$dir";
|
|
|
|
$project =~ s%/%_%g;
|
|
|
|
|
|
|
|
my $type = "lib";
|
|
|
|
my $dsp_file = "$dir/$project.dsp";
|
|
|
|
|
|
|
|
($source_files, my $local_source_files) = filter_files($source_files, "/$dir/");
|
|
|
|
($header_files, my $local_header_files) = filter_files($header_files, "/$dir/");
|
|
|
|
($resource_files, my $local_resource_files) = filter_files($resource_files, "/$dir/");
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
$modules{$module}{wine} = 1;
|
|
|
|
$modules{$module}{winetest} = 0;
|
2002-08-30 02:01:55 +02:00
|
|
|
$modules{$module}{project} = $project;
|
|
|
|
$modules{$module}{type} = $type;
|
|
|
|
$modules{$module}{dsp_file} = $dsp_file;
|
2002-09-13 00:25:35 +02:00
|
|
|
$modules{$module}{c_srcs} = $c_srcs;
|
2002-08-30 02:01:55 +02:00
|
|
|
$modules{$module}{source_files} = $local_source_files;
|
|
|
|
$modules{$module}{header_files} = $local_header_files;
|
|
|
|
$modules{$module}{resource_files} = $local_resource_files;
|
2002-10-23 22:16:12 +02:00
|
|
|
$modules{$module}{imports} = [];
|
2002-08-30 02:01:55 +02:00
|
|
|
}
|
|
|
|
} elsif($module eq "user32.dll") {
|
|
|
|
foreach my $dir (@user32_dirs) {
|
|
|
|
my $dir2 = $dir;
|
|
|
|
$dir2 =~ s%^.*?/([^/]+)$%$1%;
|
|
|
|
|
|
|
|
my $module = "user32_$dir2.lib";
|
|
|
|
$module =~ s%/%_%g;
|
|
|
|
|
|
|
|
my $project = "user32_$dir2";
|
|
|
|
$project =~ s%/%_%g;
|
|
|
|
|
|
|
|
my $type = "lib";
|
|
|
|
my $dsp_file = "$dir/$project.dsp";
|
|
|
|
|
|
|
|
($source_files, my $local_source_files) = filter_files($source_files, "$dir2/");
|
|
|
|
($header_files, my $local_header_files) = filter_files($header_files, "$dir2/");
|
|
|
|
($resource_files, my $local_resource_files) = filter_files($resource_files, "$dir2/");
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
$modules{$module}{wine} = 1;
|
|
|
|
$modules{$module}{winetest} = 0;
|
2002-08-27 02:29:36 +02:00
|
|
|
$modules{$module}{project} = $project;
|
|
|
|
$modules{$module}{type} = $type;
|
|
|
|
$modules{$module}{dsp_file} = $dsp_file;
|
2002-09-13 00:25:35 +02:00
|
|
|
$modules{$module}{c_srcs} = $c_srcs;
|
2002-08-27 02:29:36 +02:00
|
|
|
$modules{$module}{source_files} = $local_source_files;
|
|
|
|
$modules{$module}{header_files} = $local_header_files;
|
|
|
|
$modules{$module}{resource_files} = $local_resource_files;
|
2002-10-23 22:16:12 +02:00
|
|
|
$modules{$module}{imports} = [];
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
$modules{$module}{wine} = 1;
|
|
|
|
$modules{$module}{winetest} = 0;
|
2002-08-27 02:29:36 +02:00
|
|
|
$modules{$module}{project} = $project;
|
|
|
|
$modules{$module}{type} = $type;
|
|
|
|
$modules{$module}{dsp_file} = $dsp_file;
|
2002-09-13 00:25:35 +02:00
|
|
|
$modules{$module}{c_srcs} = $c_srcs;
|
2002-08-27 02:29:36 +02:00
|
|
|
$modules{$module}{source_files} = $source_files;
|
|
|
|
$modules{$module}{header_files} = $header_files;
|
|
|
|
$modules{$module}{resource_files} = $resource_files;
|
2002-10-23 22:16:12 +02:00
|
|
|
$modules{$module}{imports} = [];
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
|
2002-11-30 20:03:51 +01:00
|
|
|
$wine_test_dsp_files{"wineruntests.dsp"}{files} = ["runtests.c"];
|
|
|
|
$wine_test_dsp_files{"wineruntests.dsp"}{imports} = [];
|
|
|
|
|
|
|
|
$wine_test_dsp_files{"winetest.dsp"}{files} = [
|
|
|
|
'include/wine/exception.h',
|
|
|
|
'include/wine/test.h',
|
2003-03-15 20:36:16 +01:00
|
|
|
'include/wine/unicode.h',
|
|
|
|
'winetest.c'
|
2002-11-04 23:41:00 +01:00
|
|
|
];
|
2002-11-30 20:03:51 +01:00
|
|
|
$wine_test_dsp_files{"winetest.dsp"}{imports} = [];
|
|
|
|
|
|
|
|
my %runtests = ();
|
2002-10-18 02:20:58 +02:00
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
foreach my $dsp_file (keys(%wine_test_dsp_files)) {
|
2002-10-18 02:20:58 +02:00
|
|
|
my $project = $dsp_file;
|
2002-11-30 20:03:51 +01:00
|
|
|
$project =~ s%^(?:.*?/)?([^/]+)\.dsp$%$1%;
|
2002-10-18 02:20:58 +02:00
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
my @files = @{$wine_test_dsp_files{$dsp_file}{files}};
|
|
|
|
my @imports = @{$wine_test_dsp_files{$dsp_file}{imports}};
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
my $type;
|
|
|
|
my $c_srcs = [];
|
|
|
|
my $source_files = [];
|
|
|
|
my $header_files = [];
|
|
|
|
my $resource_files = [];
|
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
my @tests = ();
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
if ($project eq "winetest") {
|
|
|
|
$type = "lib";
|
2002-10-23 22:16:12 +02:00
|
|
|
$c_srcs = [@files];
|
|
|
|
$source_files = [@files];
|
2002-10-18 02:20:58 +02:00
|
|
|
$header_files = [];
|
|
|
|
$resource_files = [];
|
2002-11-30 20:03:51 +01:00
|
|
|
} elsif ($project eq "wineruntests") {
|
|
|
|
$type = "exe";
|
|
|
|
$c_srcs = [@files];
|
|
|
|
$source_files = [@files];
|
|
|
|
$header_files = [];
|
|
|
|
$resource_files = [];
|
2002-10-18 02:20:58 +02:00
|
|
|
} else {
|
|
|
|
$type = "exe";
|
2002-10-23 22:16:12 +02:00
|
|
|
$c_srcs = [@files];
|
|
|
|
$source_files = [@files];
|
2002-10-18 02:20:58 +02:00
|
|
|
$header_files = [];
|
|
|
|
$resource_files = [];
|
2002-10-23 22:16:12 +02:00
|
|
|
|
|
|
|
@tests = map {
|
|
|
|
if (/^testlist\.c$/) {
|
|
|
|
();
|
|
|
|
} else {
|
|
|
|
s/\.c$//;
|
|
|
|
$_;
|
|
|
|
}
|
|
|
|
} @files;
|
2002-11-30 20:03:51 +01:00
|
|
|
|
|
|
|
$runtests{$dsp_file} = [@tests];
|
2002-10-18 02:20:58 +02:00
|
|
|
}
|
|
|
|
my $module = "$project.$type";
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
$modules{$module}{wine} = 0;
|
|
|
|
$modules{$module}{winetest} = 1;
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
$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;
|
2002-10-23 22:16:12 +02:00
|
|
|
$modules{$module}{imports} = [@imports];
|
|
|
|
|
|
|
|
$modules{$module}{tests} = [@tests];
|
2002-10-18 02:20:58 +02:00
|
|
|
}
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
foreach my $module (sort(keys(%modules))) {
|
|
|
|
if($module =~ /^(?:ttydrv.dll|x11drv.dll)$/) {
|
|
|
|
delete $modules{$module};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
my @modules = ();
|
|
|
|
foreach my $module (sort(keys(%modules))) {
|
|
|
|
if (($options->wine && $modules{$module}{wine}) ||
|
|
|
|
($options->winetest && $modules{$module}{winetest}))
|
|
|
|
{
|
|
|
|
push @modules, $module;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
my $progress_output;
|
|
|
|
my $progress_current = 0;
|
2002-10-29 22:25:09 +01:00
|
|
|
my $progress_max = scalar(@modules);
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
foreach my $module (@modules) {
|
2002-08-27 02:29:36 +02:00
|
|
|
my $dsp_file = $modules{$module}{dsp_file};
|
|
|
|
replace_file("$wine_dir/$dsp_file", \&_generate_dsp, $module);
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_dsp($$) {
|
2002-08-27 02:29:36 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
my $module = shift;
|
|
|
|
|
|
|
|
my $dsp_file = $modules{$module}{dsp_file};
|
|
|
|
my $project = $modules{$module}{project};
|
2002-10-23 22:16:12 +02:00
|
|
|
my @imports = @{$modules{$module}{imports}};
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
my $lib = ($modules{$module}{type} eq "lib");
|
|
|
|
my $dll = ($modules{$module}{type} eq "dll");
|
|
|
|
my $exe = ($modules{$module}{type} eq "exe");
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
my $console = $exe; # FIXME: Not always correct
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
my $msvc_wine_dir = do {
|
2002-08-27 02:29:36 +02:00
|
|
|
my @parts = split(m%/%, $dsp_file);
|
|
|
|
if($#parts == 1) {
|
2002-10-23 22:16:12 +02:00
|
|
|
"..";
|
2002-08-27 02:29:36 +02:00
|
|
|
} elsif($#parts == 2) {
|
2002-10-23 22:16:12 +02:00
|
|
|
"..\\..";
|
2002-08-27 02:29:36 +02:00
|
|
|
} else {
|
2002-10-23 22:16:12 +02:00
|
|
|
"..\\..\\..";
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
};
|
2002-10-23 22:16:12 +02:00
|
|
|
my $wine_include_dir = "$msvc_wine_dir\\include";
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
$progress_current++;
|
|
|
|
$output->progress("$dsp_file (file $progress_current of $progress_max)");
|
|
|
|
|
2002-09-13 00:25:35 +02:00
|
|
|
my @c_srcs = @{$modules{$module}{c_srcs}};
|
2002-08-27 02:29:36 +02:00
|
|
|
my @source_files = @{$modules{$module}{source_files}};
|
|
|
|
my @header_files = @{$modules{$module}{header_files}};
|
|
|
|
my @resource_files = @{$modules{$module}{resource_files}};
|
|
|
|
|
2004-10-22 21:55:42 +02:00
|
|
|
if ($project !~ /^wine(?:_unicode|build|runtests|test)?$/ &&
|
2002-10-18 02:20:58 +02:00
|
|
|
$project !~ /^(?:gdi32|ntdll|user32)_.+?$/ &&
|
|
|
|
$project !~ /_test$/)
|
2002-08-27 02:29:36 +02:00
|
|
|
{
|
|
|
|
push @source_files, "$project.spec";
|
|
|
|
# push @source_files, "$project.spec.c";
|
|
|
|
@source_files = sort(@source_files);
|
|
|
|
}
|
|
|
|
|
2002-11-04 23:41:00 +01:00
|
|
|
my $no_cpp = 1;
|
2002-10-23 22:16:12 +02:00
|
|
|
my $no_msvc_headers = 1;
|
2004-10-22 21:55:42 +02:00
|
|
|
if ($project =~ /^wine(?:runtests|test)$/ || $project =~ /_test$/) {
|
2002-10-23 22:16:12 +02:00
|
|
|
$no_msvc_headers = 0;
|
|
|
|
}
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
my @cfgs;
|
2002-11-04 23:41:00 +01:00
|
|
|
|
|
|
|
push @cfgs, "$project - Win32";
|
|
|
|
|
|
|
|
if (!$no_cpp) {
|
|
|
|
my @_cfgs;
|
|
|
|
foreach my $cfg (@cfgs) {
|
|
|
|
push @_cfgs, "$cfg C";
|
|
|
|
push @_cfgs, "$cfg C++";
|
|
|
|
}
|
|
|
|
@cfgs = @_cfgs;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$no_release) {
|
|
|
|
my @_cfgs;
|
|
|
|
foreach my $cfg (@cfgs) {
|
|
|
|
push @_cfgs, "$cfg Debug";
|
|
|
|
push @_cfgs, "$cfg Release";
|
|
|
|
}
|
|
|
|
@cfgs = @_cfgs;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$no_msvc_headers) {
|
|
|
|
my @_cfgs;
|
|
|
|
foreach my $cfg (@cfgs) {
|
|
|
|
push @_cfgs, "$cfg MSVC Headers";
|
|
|
|
push @_cfgs, "$cfg Wine Headers";
|
|
|
|
}
|
|
|
|
@cfgs = @_cfgs;
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
2002-11-04 23:41:00 +01:00
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
my $default_cfg = $cfgs[$#cfgs];
|
|
|
|
|
|
|
|
print OUT "# Microsoft Developer Studio Project File - Name=\"$project\" - Package Owner=<4>\r\n";
|
|
|
|
print OUT "# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n";
|
|
|
|
print OUT "# ** DO NOT EDIT **\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
if ($lib) {
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\r\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
} elsif ($dll) {
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\r\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
} else {
|
|
|
|
print OUT "# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
print OUT "\r\n";
|
|
|
|
|
|
|
|
print OUT "CFG=$default_cfg\r\n";
|
|
|
|
print OUT "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n";
|
|
|
|
print OUT "!MESSAGE use the Export Makefile command and run\r\n";
|
|
|
|
print OUT "!MESSAGE \r\n";
|
|
|
|
print OUT "!MESSAGE NMAKE /f \"$project.mak\".\r\n";
|
|
|
|
print OUT "!MESSAGE \r\n";
|
|
|
|
print OUT "!MESSAGE You can specify a configuration when running NMAKE\r\n";
|
|
|
|
print OUT "!MESSAGE by defining the macro CFG on the command line. For example:\r\n";
|
|
|
|
print OUT "!MESSAGE \r\n";
|
|
|
|
print OUT "!MESSAGE NMAKE /f \"$project.mak\" CFG=\"$default_cfg\"\r\n";
|
|
|
|
print OUT "!MESSAGE \r\n";
|
|
|
|
print OUT "!MESSAGE Possible choices for configuration are:\r\n";
|
|
|
|
print OUT "!MESSAGE \r\n";
|
|
|
|
foreach my $cfg (@cfgs) {
|
2002-10-18 02:20:58 +02:00
|
|
|
if ($lib) {
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "!MESSAGE \"$cfg\" (based on \"Win32 (x86) Static Library\")\r\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
} elsif ($dll) {
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "!MESSAGE \"$cfg\" (based on \"Win32 (x86) Dynamic-Link Library\")\r\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
} else {
|
|
|
|
print OUT "!MESSAGE \"$cfg\" (based on \"Win32 (x86) Console Application\")\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
print OUT "!MESSAGE \r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
|
|
|
|
print OUT "# Begin Project\r\n";
|
|
|
|
print OUT "# PROP AllowPerConfigDependencies 0\r\n";
|
|
|
|
print OUT "# PROP Scc_ProjName \"\"\r\n";
|
|
|
|
print OUT "# PROP Scc_LocalPath \"\"\r\n";
|
|
|
|
print OUT "CPP=cl.exe\r\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "MTL=midl.exe\r\n" if !$lib && !$exe;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "RSC=rc.exe\r\n";
|
|
|
|
|
|
|
|
my $n = 0;
|
|
|
|
|
|
|
|
my $output_dir;
|
|
|
|
foreach my $cfg (@cfgs) {
|
|
|
|
if($#cfgs == 0) {
|
|
|
|
# Nothing
|
|
|
|
} elsif($n == 0) {
|
|
|
|
print OUT "!IF \"\$(CFG)\" == \"$cfg\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
} else {
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "!ELSEIF \"\$(CFG)\" == \"$cfg\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
my $debug = ($cfg !~ /Release/);
|
2002-10-23 22:16:12 +02:00
|
|
|
my $msvc_headers = ($cfg =~ /MSVC Headers/);
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
print OUT "# PROP BASE Use_MFC 0\r\n";
|
|
|
|
|
|
|
|
if($debug) {
|
|
|
|
print OUT "# PROP BASE Use_Debug_Libraries 1\r\n";
|
|
|
|
} else {
|
|
|
|
print OUT "# PROP BASE Use_Debug_Libraries 0\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$output_dir = $cfg;
|
2002-10-23 22:16:12 +02:00
|
|
|
$output_dir =~ s/^$project - //;
|
|
|
|
$output_dir =~ s/ /_/g;
|
2002-11-04 23:41:00 +01:00
|
|
|
$output_dir =~ s/C\+\+/Cxx/g;
|
2002-08-27 02:29:36 +02:00
|
|
|
if($output_prefix_dir) {
|
|
|
|
$output_dir = "$output_prefix_dir\\$output_dir";
|
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "# PROP BASE Output_Dir \"$output_dir\"\r\n";
|
|
|
|
print OUT "# PROP BASE Intermediate_Dir \"$output_dir\"\r\n";
|
|
|
|
|
|
|
|
print OUT "# PROP BASE Target_Dir \"\"\r\n";
|
|
|
|
|
|
|
|
print OUT "# PROP Use_MFC 0\r\n";
|
|
|
|
if($debug) {
|
|
|
|
print OUT "# PROP Use_Debug_Libraries 1\r\n";
|
|
|
|
} else {
|
|
|
|
print OUT "# PROP Use_Debug_Libraries 0\r\n";
|
|
|
|
}
|
|
|
|
print OUT "# PROP Output_Dir \"$output_dir\"\r\n";
|
|
|
|
print OUT "# PROP Intermediate_Dir \"$output_dir\"\r\n";
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "# PROP Ignore_Export_Lib 0\r\n" if $dll;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# PROP Target_Dir \"\"\r\n";
|
|
|
|
|
|
|
|
my @defines;
|
|
|
|
if($debug) {
|
2002-10-18 02:20:58 +02:00
|
|
|
if($lib || $exe) {
|
2003-03-15 20:36:16 +01:00
|
|
|
print OUT "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od";
|
2004-10-11 21:51:43 +02:00
|
|
|
@defines = (qw(WINVER=0x0501 _WIN32_WINNT=0x0501 _WIN32_IE=0x0600 WIN32 _DEBUG _MBCS _LIB));
|
2002-08-27 02:29:36 +02:00
|
|
|
} else {
|
2003-03-15 20:36:16 +01:00
|
|
|
print OUT "# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od";
|
2004-10-11 21:51:43 +02:00
|
|
|
@defines = (qw(WINVER=0x0501 _WIN32_WINNT=0x0501 _WIN32_IE=0x0600 WIN32 _DEBUG _WINDOWS _MBCS _USRDLL), ("\U${project}\E_EXPORTS"));
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
} else {
|
2002-10-18 02:20:58 +02:00
|
|
|
if($lib || $exe) {
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# ADD BASE CPP /nologo /W3 /GX /O2";
|
|
|
|
@defines = (qw(WIN32 NDEBUG _MBCS _LIB));
|
|
|
|
} else {
|
|
|
|
print OUT "# ADD BASE CPP /nologo /MT /W3 /GX /O2";
|
|
|
|
@defines = (qw(WIN32 NDEBUG _WINDOWS _MBCS _USRDLL), ("\U${project}\E_EXPORTS"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach my $define (@defines) {
|
|
|
|
print OUT " /D \"$define\"";
|
|
|
|
}
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT " /YX" if $lib || $exe;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT " /FD";
|
|
|
|
print OUT " /GZ" if $debug;
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT " " if $debug && ($lib || $exe);
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT " /c";
|
|
|
|
print OUT "\r\n";
|
|
|
|
|
|
|
|
my @defines2;
|
|
|
|
if($debug) {
|
|
|
|
if($lib) {
|
2003-03-15 20:36:16 +01:00
|
|
|
print OUT "# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od";
|
2002-08-27 02:29:36 +02:00
|
|
|
@defines2 = qw(WIN32 _DEBUG _WINDOWS _MBCS _LIB);
|
|
|
|
} else {
|
2003-03-15 20:36:16 +01:00
|
|
|
print OUT "# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od";
|
2002-08-27 02:29:36 +02:00
|
|
|
@defines2 = qw(_DEBUG WIN32 _WINDOWS _MBCS _USRDLL);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if($lib) {
|
|
|
|
print OUT "# ADD CPP /nologo /MT /W3 /GX /O2";
|
|
|
|
@defines2 = qw(WIN32 NDEBUG _WINDOWS _MBCS _LIB);
|
|
|
|
} else {
|
|
|
|
print OUT "# ADD CPP /nologo /MT /W3 /GX /O2";
|
|
|
|
@defines2 = qw(NDEBUG WIN32 _WINDOWS _MBCS _USRDLL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-30 02:01:55 +02:00
|
|
|
my @includes = ();
|
2002-08-27 02:29:36 +02:00
|
|
|
if($wine) {
|
|
|
|
push @defines2, "_\U${project}\E_";
|
2003-01-04 01:52:18 +01:00
|
|
|
push @defines2, qw(__WINESRC__) if $project !~ /^(?:wine(?:build|test)|.*?_test)$/;
|
2003-03-15 20:36:16 +01:00
|
|
|
if ($msvc_headers) {
|
|
|
|
push @defines2, qw(__WINE_USE_NATIVE_HEADERS);
|
|
|
|
}
|
2002-11-30 20:03:51 +01:00
|
|
|
my $output_dir2 = $output_dir;
|
|
|
|
$output_dir =~ s/\\/\\\\/g;
|
|
|
|
push @defines2, "__WINETEST_OUTPUT_DIR=\\\"$output_dir\\\"";
|
2002-08-27 02:29:36 +02:00
|
|
|
push @defines2, qw(__i386__ _X86_);
|
|
|
|
|
2004-10-22 21:55:42 +02:00
|
|
|
if($project =~ /^gdi32_(?:enhmfdrv|mfdrv)$/) {
|
2002-08-30 02:01:55 +02:00
|
|
|
push @includes, "..";
|
|
|
|
}
|
|
|
|
|
2004-10-22 21:55:42 +02:00
|
|
|
if($project eq "user32_windows") {
|
2002-08-30 02:01:55 +02:00
|
|
|
push @includes, "..\\dlls\\user";
|
|
|
|
}
|
|
|
|
|
2004-10-22 21:55:42 +02:00
|
|
|
if($project eq "user32_dde") {
|
2002-08-30 02:01:55 +02:00
|
|
|
push @includes, "..";
|
|
|
|
}
|
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
if ($project =~ /_test$/) {
|
2002-11-30 20:03:51 +01:00
|
|
|
push @includes, "$msvc_wine_dir\\$output_dir";
|
2004-10-22 21:55:42 +02:00
|
|
|
}
|
2002-10-23 22:16:12 +02:00
|
|
|
|
2004-10-22 21:55:42 +02:00
|
|
|
if (!$msvc_headers || $project eq "winetest") {
|
2002-10-23 22:16:12 +02:00
|
|
|
push @includes, $wine_include_dir;
|
|
|
|
}
|
2002-08-30 02:01:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if($wine) {
|
2002-08-27 02:29:36 +02:00
|
|
|
foreach my $include (@includes) {
|
2002-11-30 20:03:51 +01:00
|
|
|
if ($include !~ /[\\\"]/) {
|
|
|
|
print OUT " /I \"$include\"";
|
|
|
|
} else {
|
|
|
|
print OUT " /I $include";
|
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach my $define (@defines2) {
|
2002-11-30 20:03:51 +01:00
|
|
|
if ($define !~ /[\\\"]/) {
|
|
|
|
print OUT " /D \"$define\"";
|
|
|
|
} else {
|
|
|
|
print OUT " /D $define";
|
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
print OUT " /D inline=__inline" if $wine;
|
|
|
|
print OUT " /D \"__STDC__\"" if 0 && $wine;
|
|
|
|
|
|
|
|
print OUT " /YX" if $lib;
|
|
|
|
print OUT " /FR" if !$lib;
|
|
|
|
print OUT " /FD";
|
|
|
|
print OUT " /GZ" if $debug;
|
|
|
|
print OUT " " if $debug && $lib;
|
|
|
|
print OUT " /c";
|
2002-11-04 23:41:00 +01:00
|
|
|
print OUT " /TP" if !$no_cpp;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "\r\n";
|
|
|
|
|
|
|
|
if($debug) {
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "# SUBTRACT CPP /X /YX\r\n" if $dll;
|
|
|
|
print OUT "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n" if $dll;
|
|
|
|
print OUT "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n" if $dll;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# ADD BASE RSC /l 0x41d /d \"_DEBUG\"\r\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT "# ADD RSC /l 0x41d";
|
|
|
|
if($wine) {
|
|
|
|
foreach my $include (@includes) {
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT " /i \"$include\"";
|
2002-08-30 02:01:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
print OUT " /d \"_DEBUG\"\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
} else {
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "# SUBTRACT CPP /YX\r\n" if $dll;
|
|
|
|
print OUT "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n" if $dll;
|
|
|
|
print OUT "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n" if $dll;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# ADD BASE RSC /l 0x41d /d \"NDEBUG\"\r\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT "# ADD RSC /l 0x41d";
|
|
|
|
if($wine) {
|
|
|
|
foreach my $include (@includes) {
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT " /i \"$include\"";
|
2002-08-30 02:01:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
print OUT "/d \"NDEBUG\"\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
print OUT "BSC32=bscmake.exe\r\n";
|
|
|
|
print OUT "# ADD BASE BSC32 /nologo\r\n";
|
|
|
|
print OUT "# ADD BSC32 /nologo\r\n";
|
|
|
|
|
|
|
|
if($exe || $dll) {
|
|
|
|
print OUT "LINK32=link.exe\r\n";
|
|
|
|
print OUT "# ADD BASE LINK32 ";
|
|
|
|
my @libraries = qw(kernel32.lib user32.lib gdi32.lib winspool.lib
|
|
|
|
comdlg32.lib advapi32.lib shell32.lib ole32.lib
|
|
|
|
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib);
|
|
|
|
foreach my $library (@libraries) {
|
|
|
|
print OUT "$library ";
|
|
|
|
}
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT " /nologo";
|
|
|
|
print OUT " /dll" if $dll;
|
|
|
|
print OUT " /subsystem:console" if $console;
|
|
|
|
print OUT " /debug" if $debug;
|
|
|
|
print OUT " /machine:I386";
|
|
|
|
print OUT " /pdbtype:sept" if $debug;
|
|
|
|
print OUT "\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "# ADD LINK32";
|
|
|
|
print OUT " /nologo";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT " libcmt.lib" if $project =~ /^ntdll$/; # FIXME: Kludge
|
2002-10-23 22:16:12 +02:00
|
|
|
foreach my $import (@imports) {
|
2002-12-18 03:22:12 +01:00
|
|
|
print OUT " $import.lib" if ($import ne "msvcrt");
|
2002-10-23 22:16:12 +02:00
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT " /dll" if $dll;
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT " /subsystem:console" if $console;
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT " /debug" if $debug;
|
|
|
|
print OUT " /machine:I386";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT " /nodefaultlib" if $project =~ /^ntdll$/; # FIXME: Kludge
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT " /def:\"$project.def\"" if $dll;
|
|
|
|
print OUT " /pdbtype:sept" if $debug;
|
|
|
|
print OUT "\r\n";
|
|
|
|
} else {
|
|
|
|
print OUT "LIB32=link.exe -lib\r\n";
|
|
|
|
print OUT "# ADD BASE LIB32 /nologo\r\n";
|
|
|
|
print OUT "# ADD LIB32 /nologo\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$n++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($#cfgs != 0) {
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "!ENDIF \r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
if ($project eq "winebuild") {
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# Begin Special Build Tool\r\n";
|
|
|
|
print OUT "SOURCE=\"\$(InputPath)\"\r\n";
|
|
|
|
print OUT "PostBuild_Desc=Copying wine.dll and wine_unicode.dll ...\r\n";
|
|
|
|
print OUT "PostBuild_Cmds=";
|
|
|
|
print OUT "copy ..\\..\\library\\$output_dir\\wine.dll \$(OutDir)\t";
|
|
|
|
print OUT "copy ..\\..\\unicode\\$output_dir\\wine_unicode.dll \$(OutDir)\r\n";
|
|
|
|
print OUT "# End Special Build Tool\r\n";
|
|
|
|
}
|
|
|
|
print OUT "# Begin Target\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
foreach my $cfg (@cfgs) {
|
|
|
|
print OUT "# Name \"$cfg\"\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "# Begin Group \"Source Files\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\r\n";
|
|
|
|
|
|
|
|
foreach my $source_file (@source_files) {
|
|
|
|
$source_file =~ s%/%\\%g;
|
|
|
|
if($source_file !~ /^\./) {
|
|
|
|
$source_file = ".\\$source_file";
|
|
|
|
}
|
|
|
|
|
2002-08-30 02:01:55 +02:00
|
|
|
if($source_file =~ /^(.*?)\.spec$/) {
|
|
|
|
my $basename = $1;
|
|
|
|
|
|
|
|
$basename = "$basename.dll" if $basename !~ /\..{1,3}$/;
|
|
|
|
my $dbg_c_file = "$basename.dbg.c";
|
|
|
|
|
|
|
|
print OUT "# Begin Source File\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "SOURCE=$dbg_c_file\r\n";
|
|
|
|
print OUT "# End Source File\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "# Begin Source File\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "SOURCE=$source_file\r\n";
|
|
|
|
|
|
|
|
if($source_file =~ /^(.*?)\.spec$/) {
|
2002-08-30 02:01:55 +02:00
|
|
|
my $basename = $1;
|
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
my $spec_file = $source_file;
|
2002-08-30 02:01:55 +02:00
|
|
|
my $def_file = "$basename.def";
|
|
|
|
|
|
|
|
$basename = "$basename.dll" if $basename !~ /\..{1,3}$/;
|
2002-09-13 00:25:35 +02:00
|
|
|
my $dbg_file = "$basename.dbg";
|
2002-08-30 02:01:55 +02:00
|
|
|
my $dbg_c_file = "$basename.dbg.c";
|
|
|
|
|
|
|
|
my $srcdir = "."; # FIXME: Is this really always correct?
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
print OUT "# Begin Custom Build\r\n";
|
|
|
|
print OUT "InputPath=$spec_file\r\n";
|
|
|
|
print OUT "\r\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT "BuildCmds= \\\r\n";
|
2003-12-15 20:50:42 +01:00
|
|
|
print OUT "\t..\\..\\tools\\winebuild\\$output_dir\\winebuild.exe --def $spec_file > $def_file \\\r\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
|
|
|
|
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";
|
2003-12-15 20:50:42 +01:00
|
|
|
print OUT " -o $dbg_c_file --debug -C$srcdir $dbg_file \\\r\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
} else {
|
|
|
|
my $c_srcs = join(" ", grep(/\.c$/, @c_srcs));
|
|
|
|
|
|
|
|
print OUT "\t..\\..\\tools\\winebuild\\$output_dir\\winebuild.exe";
|
2003-12-15 20:50:42 +01:00
|
|
|
print OUT " -o $dbg_c_file --debug -C$srcdir $c_srcs \\\r\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "\t\r\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT "\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "\"$def_file\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\r\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT " \$(BuildCmds)\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "\r\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT "\"$dbg_c_file\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\r\n";
|
|
|
|
print OUT " \$(BuildCmds)\r\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
print OUT "# End Custom Build\r\n";
|
2002-11-04 23:41:00 +01:00
|
|
|
} elsif($source_file =~ /([^\\]*?\.h)$/) {
|
|
|
|
my $h_file = $1;
|
|
|
|
|
|
|
|
foreach my $cfg (@cfgs) {
|
|
|
|
if($#cfgs == 0) {
|
|
|
|
# Nothing
|
|
|
|
} elsif($n == 0) {
|
|
|
|
print OUT "!IF \"\$(CFG)\" == \"$cfg\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
} else {
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "!ELSEIF \"\$(CFG)\" == \"$cfg\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$output_dir = $cfg;
|
|
|
|
$output_dir =~ s/^$project - //;
|
|
|
|
$output_dir =~ s/ /_/g;
|
|
|
|
$output_dir =~ s/C\+\+/Cxx/g;
|
|
|
|
if($output_prefix_dir) {
|
|
|
|
$output_dir = "$output_prefix_dir\\$output_dir";
|
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "# Begin Custom Build\r\n";
|
|
|
|
print OUT "OutDir=$output_dir\r\n";
|
|
|
|
print OUT "InputPath=$source_file\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "\"\$(OutDir)\\wine\\$h_file\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\r\n";
|
2003-07-19 00:53:33 +02:00
|
|
|
print OUT "\tcopy \"\$(InputPath)\" \"\$(OutDir)\\wine\"\r\n";
|
2002-11-04 23:41:00 +01:00
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "# End Custom Build\r\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if($#cfgs != 0) {
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "!ENDIF \r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "# End Source File\r\n";
|
|
|
|
}
|
|
|
|
print OUT "# End Group\r\n";
|
|
|
|
|
|
|
|
print OUT "# Begin Group \"Header Files\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\r\n";
|
|
|
|
foreach my $header_file (@header_files) {
|
|
|
|
print OUT "# Begin Source File\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "SOURCE=.\\$header_file\r\n";
|
|
|
|
print OUT "# End Source File\r\n";
|
|
|
|
}
|
|
|
|
print OUT "# End Group\r\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print OUT "# Begin Group \"Resource Files\"\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\r\n";
|
|
|
|
foreach my $resource_file (@resource_files) {
|
|
|
|
print OUT "# Begin Source File\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "SOURCE=.\\$resource_file\r\n";
|
|
|
|
print OUT "# End Source File\r\n";
|
|
|
|
}
|
|
|
|
print OUT "# End Group\r\n";
|
|
|
|
|
|
|
|
print OUT "# End Target\r\n";
|
|
|
|
print OUT "# End Project\r\n";
|
|
|
|
|
|
|
|
close(OUT);
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_dsw_header($) {
|
2002-10-18 02:20:58 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
print OUT "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n";
|
|
|
|
print OUT "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_dsw_project($$$$) {
|
2002-10-18 02:20:58 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
my $project = shift;
|
|
|
|
my $dsp_file = shift;
|
|
|
|
my @dependencies = @{(shift)};
|
|
|
|
|
|
|
|
$dsp_file = "./$dsp_file";
|
|
|
|
$dsp_file =~ y%/%\\%;
|
|
|
|
|
|
|
|
@dependencies = sort(@dependencies);
|
|
|
|
|
|
|
|
print OUT "###############################################################################\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "Project: \"$project\"=$dsp_file - Package Owner=<4>\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "Package=<5>\r\n";
|
|
|
|
print OUT "{{{\r\n";
|
|
|
|
print OUT "}}}\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "Package=<4>\r\n";
|
|
|
|
print OUT "{{{\r\n";
|
|
|
|
foreach my $dependency (@dependencies) {
|
|
|
|
print OUT " Begin Project Dependency\r\n";
|
|
|
|
print OUT " Project_Dep_Name $dependency\r\n";
|
|
|
|
print OUT " End Project Dependency\r\n";
|
|
|
|
}
|
|
|
|
print OUT "}}}\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_dsw_footer($) {
|
2002-10-18 02:20:58 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
print OUT "###############################################################################\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "Global:\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "Package=<5>\r\n";
|
|
|
|
print OUT "{{{\r\n";
|
|
|
|
print OUT "}}}\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "Package=<3>\r\n";
|
|
|
|
print OUT "{{{\r\n";
|
|
|
|
print OUT "}}}\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
print OUT "###############################################################################\r\n";
|
|
|
|
print OUT "\r\n";
|
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
if ($options->wine) {
|
2002-08-27 02:29:36 +02:00
|
|
|
my $dsw_file = "wine.dsw";
|
|
|
|
$output->progress("$dsw_file");
|
2002-10-18 02:20:58 +02:00
|
|
|
replace_file("$wine_dir/$dsw_file", \&_generate_wine_dsw);
|
2002-10-29 22:25:09 +01:00
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_wine_dsw($) {
|
2002-08-27 02:29:36 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
_generate_dsw_header(\*OUT);
|
2002-08-27 02:29:36 +02:00
|
|
|
foreach my $module (sort(keys(%modules))) {
|
2002-11-30 20:03:51 +01:00
|
|
|
next if $module =~ /(?:winetest\.lib|wineruntests\.exe|_test\.exe)$/;
|
2002-10-18 02:20:58 +02:00
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
my $project = $modules{$module}{project};
|
|
|
|
my $dsp_file = $modules{$module}{dsp_file};
|
|
|
|
|
|
|
|
my @dependencies;
|
|
|
|
if($project =~ /^wine(?:_unicode)?$/) {
|
|
|
|
@dependencies = ();
|
|
|
|
} elsif($project =~ /^winebuild$/) {
|
|
|
|
@dependencies = ("wine", "wine_unicode");
|
2002-08-30 02:01:55 +02:00
|
|
|
} elsif($project =~ /^(?:gdi32|ntdll|user32)_.+?$/) {
|
2002-08-27 02:29:36 +02:00
|
|
|
@dependencies = ();
|
|
|
|
} else {
|
|
|
|
@dependencies = ("wine", "wine_unicode", "winebuild");
|
|
|
|
}
|
|
|
|
|
2002-08-30 02:01:55 +02:00
|
|
|
if($project =~ /^gdi32$/) {
|
|
|
|
foreach my $dir (@gdi32_dirs) {
|
|
|
|
my $dir2 = $dir;
|
|
|
|
$dir2 =~ s%^.*?/([^/]+)$%$1%;
|
|
|
|
|
|
|
|
my $module = "gdi32_$dir2";
|
|
|
|
$module =~ s%/%_%g;
|
|
|
|
push @dependencies, $module;
|
|
|
|
}
|
|
|
|
} elsif($project =~ /^ntdll$/) {
|
2002-08-27 02:29:36 +02:00
|
|
|
foreach my $dir (@ntdll_dirs) {
|
|
|
|
my $module = "ntdll_$dir";
|
|
|
|
$module =~ s%/%_%g;
|
|
|
|
push @dependencies, $module;
|
|
|
|
}
|
2002-08-30 02:01:55 +02:00
|
|
|
} elsif($project =~ /^user32$/) {
|
|
|
|
foreach my $dir (@user32_dirs) {
|
|
|
|
my $dir2 = $dir;
|
|
|
|
$dir2 =~ s%^.*?/([^/]+)$%$1%;
|
|
|
|
|
|
|
|
my $module = "user32_$dir2";
|
|
|
|
$module =~ s%/%_%g;
|
|
|
|
push @dependencies, $module;
|
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
_generate_dsw_project(\*OUT, $project, $dsp_file, \@dependencies);
|
|
|
|
}
|
|
|
|
_generate_dsw_footer(\*OUT);
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
if ($options->winetest) {
|
2002-10-18 02:20:58 +02:00
|
|
|
my $dsw_file = "winetest.dsw";
|
|
|
|
$output->progress("$dsw_file");
|
|
|
|
replace_file("$wine_dir/$dsw_file", \&_generate_winetest_dsw);
|
2002-10-29 22:25:09 +01:00
|
|
|
}
|
2002-10-18 02:20:58 +02:00
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_winetest_dsw($) {
|
2002-10-18 02:20:58 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
_generate_dsw_header(\*OUT);
|
|
|
|
|
2002-11-30 20:03:51 +01:00
|
|
|
my @runtests_dependencies = ();
|
2002-10-18 02:20:58 +02:00
|
|
|
foreach my $module (sort(keys(%modules))) {
|
2002-11-30 20:03:51 +01:00
|
|
|
next if $module !~ /(?:winetest\.lib|wineruntests\.exe|_test\.exe)$/;
|
|
|
|
next if $module eq "wineruntests";
|
|
|
|
|
|
|
|
my $project = $modules{$module}{project};
|
|
|
|
|
|
|
|
push @runtests_dependencies, $project;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach my $module (sort(keys(%modules))) {
|
|
|
|
next if $module !~ /(?:winetest\.lib|wineruntests\.exe|_test\.exe)$/;
|
2002-10-18 02:20:58 +02:00
|
|
|
|
|
|
|
my $project = $modules{$module}{project};
|
|
|
|
my $dsp_file = $modules{$module}{dsp_file};
|
|
|
|
|
|
|
|
my @dependencies;
|
|
|
|
if($project =~ /^winetest$/) {
|
|
|
|
@dependencies = ();
|
2002-11-30 20:03:51 +01:00
|
|
|
} elsif($project =~ /^wineruntests$/) {
|
|
|
|
@dependencies = @runtests_dependencies;
|
2002-10-18 02:20:58 +02:00
|
|
|
} else {
|
|
|
|
@dependencies = ("winetest");
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
2002-10-18 02:20:58 +02:00
|
|
|
|
|
|
|
_generate_dsw_project(\*OUT, $project, $dsp_file, \@dependencies);
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
|
2002-10-18 02:20:58 +02:00
|
|
|
_generate_dsw_footer(\*OUT);
|
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
if ($options->winetest) {
|
2002-10-18 02:20:58 +02:00
|
|
|
foreach my $module (sort(keys(%modules))) {
|
|
|
|
next if $module !~ /_test\.exe$/;
|
|
|
|
|
|
|
|
my $project = $modules{$module}{project};
|
|
|
|
my $dsp_file = $modules{$module}{dsp_file};
|
2002-10-23 22:16:12 +02:00
|
|
|
my @tests = @{$modules{$module}{tests}};
|
2002-10-18 02:20:58 +02:00
|
|
|
|
|
|
|
my $testlist_c = $dsp_file;
|
|
|
|
$testlist_c =~ s%[^/]*\.dsp$%testlist.c%;
|
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
replace_file("$wine_dir/$testlist_c", \&_generate_testlist_c, \@tests);
|
2002-10-18 02:20:58 +02:00
|
|
|
}
|
2002-10-29 22:25:09 +01:00
|
|
|
}
|
2002-10-18 02:20:58 +02:00
|
|
|
|
2004-07-16 21:14:43 +02:00
|
|
|
# ***** Keep in sync with tools/make_ctests *****
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_testlist_c($$) {
|
2002-10-18 02:20:58 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
2002-10-23 22:16:12 +02:00
|
|
|
my @tests = @{(shift)};
|
2002-10-18 02:20:58 +02:00
|
|
|
|
|
|
|
print OUT "/* Automatically generated file; DO NOT EDIT!! */\n";
|
|
|
|
print OUT "\n";
|
2004-07-16 21:14:43 +02:00
|
|
|
print OUT "/* stdarg.h is needed for Winelib */\n";
|
|
|
|
print OUT "#include <stdarg.h>\n";
|
2002-11-04 23:41:00 +01:00
|
|
|
print OUT "#include <stdio.h>\n";
|
|
|
|
print OUT "#include <stdlib.h>\n";
|
|
|
|
print OUT "#include \"windef.h\"\n";
|
|
|
|
print OUT "#include \"winbase.h\"\n";
|
|
|
|
print OUT "\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
foreach my $test (@tests) {
|
|
|
|
print OUT "extern void func_$test(void);\n";
|
|
|
|
}
|
|
|
|
print OUT "\n";
|
2002-11-04 23:41:00 +01:00
|
|
|
print OUT "struct test\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "{\n";
|
|
|
|
print OUT " const char *name;\n";
|
|
|
|
print OUT " void (*func)(void);\n";
|
2002-11-04 23:41:00 +01:00
|
|
|
print OUT "};\n";
|
|
|
|
print OUT "\n";
|
|
|
|
print OUT "static const struct test winetest_testlist[] =\n";
|
2002-10-18 02:20:58 +02:00
|
|
|
print OUT "{\n";
|
|
|
|
foreach my $test (@tests) {
|
|
|
|
print OUT " { \"$test\", func_$test },\n";
|
|
|
|
}
|
|
|
|
print OUT " { 0, 0 }\n";
|
|
|
|
print OUT "};\n";
|
2002-11-04 23:41:00 +01:00
|
|
|
print OUT "\n";
|
|
|
|
print OUT "#define WINETEST_WANT_MAIN\n";
|
|
|
|
print OUT "#include \"wine/test.h\"\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
}
|
|
|
|
|
2002-11-30 20:03:51 +01:00
|
|
|
if ($options->winetest) {
|
|
|
|
replace_file("$wine_dir/runtests.c", \&_generate_runtests_c);
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_runtests_c($) {
|
2002-11-30 20:03:51 +01:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
print OUT "/* Automatically generated file; DO NOT EDIT!! */\n";
|
|
|
|
|
|
|
|
print OUT "\n";
|
|
|
|
print OUT "#include <stdio.h>\n";
|
|
|
|
print OUT "#include <stdlib.h>\n";
|
|
|
|
print OUT "\n";
|
|
|
|
|
|
|
|
print OUT "int main(int argc, char *argv[])\n";
|
|
|
|
print OUT "{\n";
|
|
|
|
print OUT " char output_dir[] = __WINETEST_OUTPUT_DIR;\n";
|
|
|
|
print OUT " char command[4096];\n";
|
|
|
|
print OUT "\n";
|
|
|
|
foreach my $dsp_file (keys(%runtests)) {
|
|
|
|
my @tests = @{$runtests{$dsp_file}};
|
|
|
|
|
|
|
|
my $project = $dsp_file;
|
|
|
|
$project =~ s%^(.*?)/?([^/]+)\.dsp$%$2%;
|
|
|
|
my $dir = $1;
|
|
|
|
$dir =~ s%/%\\\\%g;
|
|
|
|
|
|
|
|
foreach my $test (@tests) {
|
|
|
|
print OUT " sprintf(command, \"$dir\\\\%s\\\\$project.exe $test\", output_dir);\n";
|
|
|
|
print OUT " system(command);\n";
|
|
|
|
print OUT "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print OUT " return 0;\n";
|
|
|
|
print OUT "}\n";
|
|
|
|
}
|
|
|
|
|
2003-03-15 20:36:16 +01:00
|
|
|
if ($options->winetest) {
|
|
|
|
replace_file("$wine_dir/winetest.c", \&_generate_winetest_c);
|
|
|
|
}
|
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_winetest_c($) {
|
2003-03-15 20:36:16 +01:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
print OUT "/* Automatically generated file; DO NOT EDIT!! */\n\n";
|
|
|
|
|
|
|
|
print OUT "/* Force the linker to generate a .lib file */\n";
|
|
|
|
print OUT "void __wine_dummy_lib_function()\n{\n}\n\n";
|
|
|
|
}
|
2002-11-30 20:03:51 +01:00
|
|
|
|
2002-10-29 22:25:09 +01:00
|
|
|
if ($options->wine) {
|
2002-08-27 02:29:36 +02:00
|
|
|
my $config_h = "include/config.h";
|
|
|
|
|
|
|
|
$output->progress("$config_h");
|
|
|
|
|
|
|
|
replace_file("$wine_dir/$config_h", \&_generate_config_h);
|
2002-10-29 22:25:09 +01:00
|
|
|
}
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2004-10-05 20:08:40 +02:00
|
|
|
sub _generate_config_h($) {
|
2002-08-27 02:29:36 +02:00
|
|
|
local *OUT = shift;
|
|
|
|
|
|
|
|
print OUT "#define __WINE_CONFIG_H\n";
|
|
|
|
print OUT "\n";
|
|
|
|
|
2003-09-24 00:51:11 +02:00
|
|
|
my @headers = qw(direct.h fcntl.h io.h string.h process.h);
|
2002-08-27 02:29:36 +02:00
|
|
|
foreach my $header (@headers) {
|
|
|
|
$header =~ y/\.\//__/;
|
|
|
|
print OUT "#define HAVE_\U$header\E\n";
|
|
|
|
print OUT "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
my @functions = qw(
|
2002-09-13 00:25:35 +02:00
|
|
|
_alldiv _allmul _allrem _aulldiv _aullrem
|
|
|
|
_access _chdir _close _lseek _mkdir _open _pclose _popen _read _rmdir _write _stat
|
2003-09-24 00:51:11 +02:00
|
|
|
_snprintf _spawnvp _stricmp _strnicmp _vsnprintf _wcsicmp
|
2002-08-27 02:29:36 +02:00
|
|
|
ecvt fcvt gcvt
|
2003-09-24 00:51:11 +02:00
|
|
|
memmove
|
2002-08-27 02:29:36 +02:00
|
|
|
strerror
|
2003-09-24 00:51:11 +02:00
|
|
|
wcslen
|
2002-08-27 02:29:36 +02:00
|
|
|
);
|
|
|
|
foreach my $function (@functions) {
|
|
|
|
print OUT "#define HAVE_\U$function\E 1\n";
|
|
|
|
print OUT "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(0) {
|
|
|
|
print OUT "#define NEED_STDCALL_DECORATION 1\n";
|
|
|
|
print OUT "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
print OUT "#define X_DISPLAY_MISSING 1\n";
|
|
|
|
print OUT "\n";
|
|
|
|
|
|
|
|
print OUT "/* Define to a macro to generate an assembly function directive */\n";
|
|
|
|
print OUT "#define __ASM_FUNC(name) \"\"\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
|
|
|
|
print OUT "/* Define to a macro to generate an assembly name from a C symbol */\n";
|
|
|
|
print OUT "#define __ASM_NAME(name) name\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-27 02:29:36 +02:00
|
|
|
|
2004-10-06 20:52:15 +02:00
|
|
|
print OUT "/* Define to the assembler keyword used to specify a word value */\n";
|
|
|
|
print OUT "#define __ASM_SHORT \".short\"\n";
|
2003-09-24 00:51:11 +02:00
|
|
|
print OUT "\n";
|
|
|
|
|
2004-10-06 20:52:15 +02:00
|
|
|
print OUT "/* Define to the assembler keyword used to specify an ASCII string */\n";
|
|
|
|
print OUT "#define __ASM_STRING \".string\"\n";
|
2003-09-24 00:51:11 +02:00
|
|
|
print OUT "\n";
|
|
|
|
|
2002-08-30 02:01:55 +02:00
|
|
|
print OUT "/* Define to the address where bug reports for this package should be sent. */\n";
|
|
|
|
print OUT "#define PACKAGE_BUGREPORT \"\"\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
|
|
|
|
print OUT "/* Define to the full name of this package. */\n";
|
|
|
|
print OUT "#define PACKAGE_NAME \"Wine\"\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
|
|
|
|
print OUT "/* Define to the full name and version of this package. */\n";
|
|
|
|
print OUT "#define PACKAGE_STRING \"Wine YYYYMMDD\"\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
|
|
|
|
print OUT "/* Define to the one symbol short name of this package. */\n";
|
|
|
|
print OUT "#define PACKAGE_TARNAME \"wine\"\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
|
|
|
|
print OUT "/* Define to the version of this package. */\n";
|
|
|
|
print OUT "#define PACKAGE_VERSION \"YYYYMMDD\"\n";
|
2002-09-13 00:25:35 +02:00
|
|
|
print OUT "\n";
|
2002-08-30 02:01:55 +02:00
|
|
|
|
2002-08-27 02:29:36 +02:00
|
|
|
close(OUT);
|
|
|
|
}
|