# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
-my $version="0.7.0";
+my $version="0.7.1";
use Cwd;
use File::Basename;
my $OPT_ASK_SKIP=-1;
+# The following constants define the architecture
+
+##
+# 32-Bit Target
+my $OPT_ARCH_32=32;
+
+##
+# 64-Bit Target
+my $OPT_ARCH_64=64;
+
+
# General options
##
# Contains the default set of flags to be used when creating a new target.
my $opt_flags;
+##
+# Contains 32 for 32-Bit-Targets and 64 for 64-Bit-Targets
+my $opt_arch;
+
##
# If true then winemaker should ask questions to the user as it goes
# along.
# Disables inline Expansion
$prj_target_cflags.="-fno-inline ";
} elsif (/^Ob1$/) {
- # In-line Function Expansion
+ #In-line Function Expansion
+ $prj_target_cflags.="-finline-functions ";
} elsif (/^Ob2$/) {
# auto In-line Function Expansion
$prj_target_cflags.="-finline-functions ";
+ } elsif (/^Ox$/) {
+ # Use maximum optimization
+ $prj_target_cflags.="-O3 ";
} elsif (/^Oy$/) {
# Frame-Pointer Omission
$prj_target_cflags.="-fomit-frame-pointer ";
+ } elsif (/^Oy-$/) {
+ # Frame-Pointer Omission
+ $prj_target_cflags.="-fno-omit-frame-pointer ";
} elsif (/^GZ$/) {
# Catch Release-Build Errors in Debug Build
} elsif (/^M[DLT]d?$/) {
} elsif (/^D\s*\"(.*)\"/) {
# Preprocessor Definitions
$prj_target_cflags.="-D".$1." ";
- } elsif (/^I/) {
+ } elsif (/^I\s*\"(.*)\"/) {
# Additional Include Directories
- #$prj_target_cflags.="-I" fixpath(option)
+ $sfilet=$1;
+ $sfilet=~s/\\/\//g;
+ push @{@$project_settings[$T_INCLUDE_PATH]},"-I".$sfilet." ";
} elsif (/^U\s*\"(.*)\"/) {
# Undefines a previously defined symbol
$prj_target_cflags.="-U".$1." ";
}
if ((@$target[$T_FLAGS] & $TF_NOMSVCRT) == 0) {
push @{@$target[$T_LDFLAGS]},"-mno-cygwin";
- push @{@$target[$T_LDFLAGS]},"-m32";
+ push @{@$target[$T_LDFLAGS]},"-m$opt_arch";
}
push @{@$project[$P_TARGETS]},$target;
if (/^Project:\s\"(.*)\"=(.*)\s-/) {
$prj_name=$1;
$prj_path=$2;
- @components=split /[\/\\]+/, $2;
+ @components=split /[\/\\]+/, $prj_path;
$prj_path=search_from($path, \@components);
print "Name: $prj_name\nPath: $prj_path\n";
source_scan_project_file(\@main_project,1,$prj_path);
}
$name =~ s+(/|\.[^.]*)$++;
if ($opt_target_type == $TT_DLL) {
- $name = "$name.dll";
+ $name = canonize($name).".dll";
} else {
- $name = "$name.exe";
+ $name = canonize($name).".exe";
}
$targets{$name}=1;
}
}
if ((@$target[$T_FLAGS] & $TF_NOMSVCRT) == 0) {
push @{@$target[$T_LDFLAGS]},"-mno-cygwin";
- push @{@$target[$T_LDFLAGS]},"-m32";
+ push @{@$target[$T_LDFLAGS]},"-m$opt_arch";
}
push @{@$project[$P_TARGETS]},$target;
my $path=$_[1];
my $real_path="";
- if ($dirname eq "" or $dirname eq ".") {
+ if ($dirname eq "" or $dirname eq "." or $dirname eq "./") {
$dirname=cwd;
} elsif ($dirname !~ m+^/+) {
$dirname=cwd . "/" . $dirname;
}
foreach my $component (@$path) {
+ $component=~s/^\"//;
+ $component=~s/\"$//;
#print " looking for $component in \"$dirname\"\n";
if ($component eq ".") {
# Pass it as is
foreach my $include (@{@$target[$T_INCLUDE_PATH]}, @{@$project_settings[$T_INCLUDE_PATH]}) {
my $dirname=$include;
$dirname=~ s+^-I++;
+ $dirname=~ s+\s$++;
if (!is_absolute($dirname)) {
$dirname="@$project[$P_PATH]$dirname";
} else {
return;
}
- print FILEO "### Generated by Winemaker\n";
+ print FILEO "### Generated by Winemaker $version\n";
print FILEO "\n\n";
generate_list("SRCDIR",1,[ "." ]);
$opt_single_target=undef;
$opt_target_type=$TT_GUIEXE;
$opt_flags=0;
+$opt_arch=$OPT_ARCH_32;
$opt_is_interactive=$OPT_ASK_NO;
$opt_ask_project_options=$OPT_ASK_NO;
$opt_ask_target_options=$OPT_ASK_NO;
{
print "Winemaker $version\n";
print "Copyright 2000 Francois Gouget <fgouget\@codeweavers.com> for CodeWeavers\n";
+ print "Copyright 2004 Dimitrie O. Paun\n";
+ print "Copyright 2009 André Hentschel\n";
}
sub usage()
print STDERR " [-Dmacro[=defn]] [-Idir] [-Pdir] [-idll] [-Ldir] [-llibrary]\n";
print STDERR " [--nodlls] [--nomsvcrt] [--interactive] [--single-target name]\n";
print STDERR " [--generated-files|--nogenerated-files]\n";
+ print STDERR " [--wine64]\n";
print STDERR " work_directory|project_file|workspace_file\n";
print STDERR "\nWinemaker is designed to recursively convert all the Windows sources found in\n";
print STDERR "the specified directory so that they can be compiled with Winelib. During this\n";
$opt_no_generated_files=0;
} elsif ($arg eq "--nogenerated-files") {
$opt_no_generated_files=1;
+ } elsif ($arg eq "--wine64") {
+ $opt_arch=$OPT_ARCH_64;
} elsif ($arg =~ /^-D/) {
push @{$global_settings[$T_DEFINES]},$arg;
} elsif ($arg =~ /^-I/) {