6 use vars
qw($VERSION @ISA @EXPORT @EXPORT_OK);
11 @EXPORT_OK = qw($current_dir $wine_dir $winapi_dir $winapi_check_dir);
13 use vars qw($current_dir $wine_dir $winapi_dir $winapi_check_dir);
16 $tool =~ s%^(?:.*?/)?([^/]+)$%$1%;
18 if(defined($current_dir) && defined($wine_dir) &&
19 defined($winapi_dir) && defined($winapi_check_dir))
22 } elsif($0 =~ m%^(.*?)/?tools/([^/]+)/[^/]+$%) {
25 if(defined($1) && $1 ne "")
36 if($wine_dir =~ /^\./) {
38 my $pwd; chomp($pwd = `pwd`);
39 foreach my $n (1..((length($wine_dir) + 1) / 3)) {
40 $pwd =~ s/\/([^\/]*)$//;
41 $current_dir = "$1/$current_dir";
43 $current_dir =~ s%/\.$%%;
44 } elsif($wine_dir eq $cwd) {
47 } elsif($cwd =~ m%^$wine_dir/(.*?)?$%) {
50 foreach my $dir (split(m%/%, $current_dir)) {
51 $wine_dir = "../$wine_dir";
53 $wine_dir =~ s%/\.$%%;
55 print STDERR "$tool: You must run this tool in the main Wine directory or a sub directory\n";
59 $winapi_dir = "$wine_dir/tools/winapi";
60 $winapi_dir =~ s%^\./%%;
62 $winapi_check_dir = "$wine_dir/tools/winapi_check";
63 $winapi_check_dir =~ s%^\./%%;
65 push @INC, ($winapi_dir, $winapi_check_dir);
67 print STDERR "$tool: You must run this tool in the main Wine directory or a sub directory\n";