tools/winemaker: change tabs into eight spaces

André Hentschel nerv at dawncrow.de
Tue Feb 17 08:12:14 CST 2009


---
 tools/winemaker |  368 +++++++++++++++++++++++++++---------------------------
 1 files changed, 184 insertions(+), 184 deletions(-)
 mode change 100755 => 100644 tools/winemaker

diff --git a/tools/winemaker b/tools/winemaker
old mode 100755
new mode 100644
index 8c78987..861d3bf
--- a/tools/winemaker
+++ b/tools/winemaker
@@ -557,50 +557,50 @@ sub source_scan_directory($$$$)
     my $fullentry="$path$dentry";
     if (-d "$fullentry") {
       if ($dentry =~ /^(Release|Debug)/i) {
-	# These directories are often used to store the object files and the
-	# resulting executable/library. They should not contain anything else.
-	my @candidates=grep /\.(exe|dll)$/i, @{get_directory_contents("$fullentry")};
-	foreach my $candidate (@candidates) {
-	  $targets{$candidate}=1;
-	}
+        # These directories are often used to store the object files and the
+        # resulting executable/library. They should not contain anything else.
+        my @candidates=grep /\.(exe|dll)$/i, @{get_directory_contents("$fullentry")};
+        foreach my $candidate (@candidates) {
+          $targets{$candidate}=1;
+        }
       } elsif ($dentry =~ /^include/i) {
         # This directory must contain headers we're going to need
         push @{@$project_settings[$T_INCLUDE_PATH]},"-I$dentry";
         source_scan_directory($project,"$fullentry/","$dentry/",1);
       } else {
-	# Recursively scan this directory. Any source file that cannot be
-	# attributed to a project in one of the subdirectories will be
-	# attributed to this project.
-	source_scan_directory($project,"$fullentry/","$dentry/",$no_target);
+        # Recursively scan this directory. Any source file that cannot be
+        # attributed to a project in one of the subdirectories will be
+        # attributed to this project.
+        source_scan_directory($project,"$fullentry/","$dentry/",$no_target);
       }
     } elsif (-f "$fullentry") {
       if ($dentry =~ /\.(exe|dll)$/i) {
-	$targets{$dentry}=1;
+        $targets{$dentry}=1;
       } elsif ($dentry =~ /\.c$/i and $dentry !~ /\.(dbg|spec)\.c$/) {
-	push @sources_c,"$dentry";
+        push @sources_c,"$dentry";
       } elsif ($dentry =~ /\.(cpp|cxx)$/i) {
-	if ($dentry =~ /^stdafx.cpp$/i && !(@$project_settings[$T_FLAGS] & $TF_NOMFC)) {
-	  push @sources_misc,"$dentry";
-	  @$project_settings[$T_FLAGS]|=$TF_MFC;
-	} else {
-	  push @sources_cxx,"$dentry";
-	}
+        if ($dentry =~ /^stdafx.cpp$/i && !(@$project_settings[$T_FLAGS] & $TF_NOMFC)) {
+          push @sources_misc,"$dentry";
+          @$project_settings[$T_FLAGS]|=$TF_MFC;
+        } else {
+          push @sources_cxx,"$dentry";
+        }
       } elsif ($dentry =~ /\.rc$/i) {
-	push @sources_rc,"$dentry";
+        push @sources_rc,"$dentry";
       } elsif ($dentry =~ /\.(h|hxx|hpp|inl|rc2|dlg)$/i) {
-	$has_headers=1;
-	push @sources_misc,"$dentry";
-	if ($dentry =~ /^stdafx.h$/i && !(@$project_settings[$T_FLAGS] & $TF_NOMFC)) {
-	  @$project_settings[$T_FLAGS]|=$TF_MFC;
-	}
+        $has_headers=1;
+        push @sources_misc,"$dentry";
+        if ($dentry =~ /^stdafx.h$/i && !(@$project_settings[$T_FLAGS] & $TF_NOMFC)) {
+          @$project_settings[$T_FLAGS]|=$TF_MFC;
+        }
       } elsif ($dentry =~ /\.dsp$/i) {
-	push @dsp_files,"$dentry";
-	$has_win_project=1;
+        push @dsp_files,"$dentry";
+        $has_win_project=1;
       } elsif ($dentry =~ /\.mak$/i) {
-	push @mak_files,"$dentry";
-	$has_win_project=1;
+        push @mak_files,"$dentry";
+        $has_win_project=1;
       } elsif ($dentry =~ /^makefile/i) {
-	$has_win_project=1;
+        $has_win_project=1;
       }
     }
   }
@@ -657,47 +657,47 @@ sub source_scan_directory($$$$)
       # Try to come up with a target list based on .dsp/.mak files
       my $prj_list;
       if (@dsp_files > 0) {
-	$prj_list=\@dsp_files;
+        $prj_list=\@dsp_files;
       } else {
-	$prj_list=\@mak_files;
+        $prj_list=\@mak_files;
       }
       foreach my $filename (@$prj_list) {
-	$filename =~ s/\.(dsp|mak)$//i;
-	if ($opt_target_type == $TT_DLL) {
-	  $filename = "$filename.dll";
-	}
-	$targets{$filename}=1;
+        $filename =~ s/\.(dsp|mak)$//i;
+        if ($opt_target_type == $TT_DLL) {
+          $filename = "$filename.dll";
+        }
+        $targets{$filename}=1;
       }
       $target_count=keys %targets;
       if ($target_count == 0) {
-	# Still nothing, try the name of the directory
-	my $name;
-	if ($dirname eq "") {
-	  # Bad luck, this is the top level directory!
-	  $name=(split /\//, cwd)[-1];
-	} else {
-	  $name=$dirname;
-	  # Remove the trailing '/'. Also eliminate whatever is after the last
-	  # '.' as it is likely to be meaningless (.orig, .new, ...)
-	  $name =~ s+(/|\.[^.]*)$++;
-	  if ($name eq "src") {
-	    # 'src' is probably a subdirectory of the real project directory.
-	    # Try again with the parent (if any).
-	    my $parent=$path;
-	    if ($parent =~ s+([^/]*)/[^/]*/$+$1+) {
-	      $name=$parent;
-	    } else {
-	      $name=(split /\//, cwd)[-1];
-	    }
-	  }
-	}
-	$name =~ s+(/|\.[^.]*)$++;
-	if ($opt_target_type == $TT_DLL) {
-	  $name = "$name.dll";
-	} else {
-	  $name = "$name.exe";
-	}
-	$targets{$name}=1;
+        # Still nothing, try the name of the directory
+        my $name;
+        if ($dirname eq "") {
+          # Bad luck, this is the top level directory!
+          $name=(split /\//, cwd)[-1];
+        } else {
+          $name=$dirname;
+          # Remove the trailing '/'. Also eliminate whatever is after the last
+          # '.' as it is likely to be meaningless (.orig, .new, ...)
+          $name =~ s+(/|\.[^.]*)$++;
+          if ($name eq "src") {
+            # 'src' is probably a subdirectory of the real project directory.
+            # Try again with the parent (if any).
+            my $parent=$path;
+            if ($parent =~ s+([^/]*)/[^/]*/$+$1+) {
+              $name=$parent;
+            } else {
+              $name=(split /\//, cwd)[-1];
+            }
+          }
+        }
+        $name =~ s+(/|\.[^.]*)$++;
+        if ($opt_target_type == $TT_DLL) {
+          $name = "$name.dll";
+        } else {
+          $name = "$name.exe";
+        }
+        $targets{$name}=1;
       }
     }
 
@@ -714,20 +714,20 @@ sub source_scan_directory($$$$)
       $target_list=<STDIN>;
       chomp $target_list;
       if ($target_list eq "") {
-	# Keep the target list as is, i.e. do nothing
+        # Keep the target list as is, i.e. do nothing
       } elsif ($target_list eq "none") {
-	# Empty the target list
-	undef %targets;
+        # Empty the target list
+        undef %targets;
       } elsif ($target_list eq "ignore") {
-	# Ignore this subtree altogether
-	return;
+        # Ignore this subtree altogether
+        return;
       } else {
-	undef %targets;
-	foreach my $target (split /,/,$target_list) {
-	  $target =~ s+^\s*++;
-	  $target =~ s+\s*$++;
-	  $targets{$target}=1;
-	}
+        undef %targets;
+        foreach my $target (split /,/,$target_list) {
+          $target =~ s+^\s*++;
+          $target =~ s+\s*$++;
+          $targets{$target}=1;
+        }
       }
     }
   }
@@ -826,10 +826,10 @@ sub source_scan_directory($$$$)
     if ($opt_ask_target_options == $OPT_ASK_YES) {
       my $flag_desc="";
       if ((@$target[$T_FLAGS] & $TF_MFC)!=0) {
-	$flag_desc=" (mfc";
+        $flag_desc=" (mfc";
       }
       if ($flag_desc ne "") {
-	$flag_desc.=")";
+        $flag_desc.=")";
       }
       print "* Specify any link option (-P/-i/-L/-l/--mfc) specific to the target\n";
       print "* \"$target_name\"$flag_desc or 'never' to not be asked this question again:\n";
@@ -875,28 +875,28 @@ sub source_scan_directory($$$$)
       @sources_misc=();
     } else {
       foreach my $source (@sources_c) {
-	if ($source =~ /^$basename/i) {
-	  push @{@$target[$T_SOURCES_C]},$source;
-	  $source="";
-	}
+        if ($source =~ /^$basename/i) {
+          push @{@$target[$T_SOURCES_C]},$source;
+          $source="";
+        }
       }
       foreach my $source (@sources_cxx) {
-	if ($source =~ /^$basename/i) {
-	  push @{@$target[$T_SOURCES_CXX]},$source;
-	  $source="";
-	}
+        if ($source =~ /^$basename/i) {
+          push @{@$target[$T_SOURCES_CXX]},$source;
+          $source="";
+        }
       }
       foreach my $source (@sources_rc) {
-	if ($source =~ /^$basename/i) {
-	  push @{@$target[$T_SOURCES_RC]},$source;
-	  $source="";
-	}
+        if ($source =~ /^$basename/i) {
+          push @{@$target[$T_SOURCES_RC]},$source;
+          $source="";
+        }
       }
       foreach my $source (@sources_misc) {
-	if ($source =~ /^$basename/i) {
-	  push @{@$target[$T_SOURCES_MISC]},$source;
-	  $source="";
-	}
+        if ($source =~ /^$basename/i) {
+          push @{@$target[$T_SOURCES_MISC]},$source;
+          $source="";
+        }
       }
     }
     @$target[$T_SOURCES_C]=[sort @{@$target[$T_SOURCES_C]}];
@@ -1000,7 +1000,7 @@ sub fix_file_and_directory_names($)
   if (opendir(DIRECTORY, "$dirname")) {
     foreach my $dentry (readdir DIRECTORY) {
       if ($dentry =~ /^\./ or $dentry eq "CVS") {
-	next;
+        next;
       }
       # Set $warn to 1 if the user should be warned of the renaming
       my $warn;
@@ -1017,12 +1017,12 @@ sub fix_file_and_directory_names($)
 
         # Only all lowercase extensions are supported (because of
         # rules like '.c.o:'.
-	$new_name =~ s/\.C$/.c/;
-	$new_name =~ s/\.cpp$/.cpp/i;
-	$warn=1 if ($new_name =~ s/\.cxx$/.cpp/i);
-	$new_name =~ s/\.rc$/.rc/i;
-	# And this last one is to avoid confusion then running make
-	$warn=1 if ($new_name =~ s/^makefile$/makefile.win/i);
+        $new_name =~ s/\.C$/.c/;
+        $new_name =~ s/\.cpp$/.cpp/i;
+        $warn=1 if ($new_name =~ s/\.cxx$/.cpp/i);
+        $new_name =~ s/\.rc$/.rc/i;
+        # And this last one is to avoid confusion then running make
+        $warn=1 if ($new_name =~ s/^makefile$/makefile.win/i);
       }
 
       # Adjust the case to the user's preferences
@@ -1037,17 +1037,17 @@ sub fix_file_and_directory_names($)
 
       # And finally, perform the renaming
       if ($new_name ne $dentry) {
-	if ($warn) {
-	  print STDERR "warning: in \"$dirname\", renaming \"$dentry\" to \"$new_name\"\n";
-	}
-	if (!rename("$dirname/$dentry","$dirname/$new_name")) {
-	  print STDERR "error: in \"$dirname\", unable to rename \"$dentry\" to \"$new_name\"\n";
-	  print STDERR "       $!\n";
-	  $new_name=$dentry;
-	}
+        if ($warn) {
+          print STDERR "warning: in \"$dirname\", renaming \"$dentry\" to \"$new_name\"\n";
+        }
+        if (!rename("$dirname/$dentry","$dirname/$new_name")) {
+          print STDERR "error: in \"$dirname\", unable to rename \"$dentry\" to \"$new_name\"\n";
+          print STDERR "       $!\n";
+          $new_name=$dentry;
+        }
       }
       if (-d "$dirname/$new_name") {
-	fix_file_and_directory_names("$dirname/$new_name");
+        fix_file_and_directory_names("$dirname/$new_name");
       }
     }
     closedir(DIRECTORY);
@@ -1102,19 +1102,19 @@ sub search_from($$)
       my $directory=get_directory_contents $dirname;
       my $found;
       foreach my $dentry (@$directory) {
-	if ($dentry =~ /^\Q$component\E$/i or
+        if ($dentry =~ /^\Q$component\E$/i or
             (defined $renamed and $dentry =~ /^$renamed$/i)
            ) {
-	  $dirname.="$dentry/";
-	  $real_path.="$dentry/";
-	  $found=1;
-	  last;
-	}
+          $dirname.="$dentry/";
+          $real_path.="$dentry/";
+          $found=1;
+          last;
+        }
       }
       if (!defined $found) {
-	# Give up
-	#print "    could not find $component in $dirname\n";
-	return;
+        # Give up
+        #print "    could not find $component in $dirname\n";
+        return;
       }
     }
   }
@@ -1164,7 +1164,7 @@ sub get_real_include_name($$$$$)
       #print "    in $dirname (include \"\")\n";
       $real_filename=search_from($dirname,\@file_components);
       if (defined $real_filename) {
-	return $real_filename;
+        return $real_filename;
       }
     }
     my $project_settings=@$project[$P_SETTINGS];
@@ -1172,7 +1172,7 @@ sub get_real_include_name($$$$$)
       my $dirname=$include;
       $dirname=~ s+^-I++;
       if (!is_absolute($dirname)) {
-	$dirname="@$project[$P_PATH]$dirname";
+        $dirname="@$project[$P_PATH]$dirname";
       } else {
         $dirname=~ s+^\$\(TOPSRCDIR\)/++;
         $dirname=~ s+^\$\(SRCDIR\)/+@$project[$P_PATH]+;
@@ -1180,7 +1180,7 @@ sub get_real_include_name($$$$$)
       #print "    in $dirname\n";
       $real_filename=search_from("$dirname",\@file_components);
       if (defined $real_filename) {
-	return $real_filename;
+        return $real_filename;
       }
     }
     my $dotdotpath=@$project[$P_PATH];
@@ -1193,7 +1193,7 @@ sub get_real_include_name($$$$$)
       #print "    in $dirname  (global setting)\n";
       $real_filename=search_from("$dirname",\@file_components);
       if (defined $real_filename) {
-	return $real_filename;
+        return $real_filename;
       }
     }
   }
@@ -1289,9 +1289,9 @@ sub fix_file($$$)
       # projects can compile in Wine without the MFC sources.
       my $warning="mfc:afxres.h";
       if (!defined $warnings{$warning}) {
-	$warnings{$warning}="1";
-	print STDERR "warning: In non-MFC projects, winemaker replaces the MFC specific header 'afxres.h' with 'winres.h'\n";
-	print STDERR "warning: the above warning is issued only once\n";
+        $warnings{$warning}="1";
+        print STDERR "warning: In non-MFC projects, winemaker replaces the MFC specific header 'afxres.h' with 'winres.h'\n";
+        print STDERR "warning: the above warning is issued only once\n";
       }
       print FILEO "$1/* winemaker: $2\"afxres.h\" */\n";
       print FILEO "$1/* winemaker:warning: 'afxres.h' is an MFC specific header. Replacing it with 'winres.h' */\n";
@@ -1441,39 +1441,39 @@ sub fix_file($$$)
 
     } elsif ($is_rc) {
       if ($rc_block_depth == 0 and /^(\w+\s+(BITMAP|CURSOR|FONT|FONTDIR|ICON|MESSAGETABLE|TEXT|RTF)\s+((DISCARDABLE|FIXED|IMPURE|LOADONCALL|MOVEABLE|PRELOAD|PURE)\s+)*)([\"<]?)([^\">\r\n]+)([\">]?)/) {
-	my $from_file=($5 eq "<"?"":$dirname);
-	my $real_include_name=get_real_include_name($line,$6,$from_file,$project,$target);
-	print FILEO "$1$5$real_include_name$7$'";
-	$modified|=($real_include_name ne $6);
+        my $from_file=($5 eq "<"?"":$dirname);
+        my $real_include_name=get_real_include_name($line,$6,$from_file,$project,$target);
+        print FILEO "$1$5$real_include_name$7$'";
+        $modified|=($real_include_name ne $6);
 
       } elsif (/^(\s*RCINCLUDE\s*)([\"<]?)([^\">\r\n]+)([\">]?)/) {
-	my $from_file=($2 eq "<"?"":$dirname);
-	my $real_include_name=get_real_include_name($line,$3,$from_file,$project,$target);
-	print FILEO "$1$2$real_include_name$4$'";
-	$modified|=($real_include_name ne $3);
+        my $from_file=($2 eq "<"?"":$dirname);
+        my $real_include_name=get_real_include_name($line,$3,$from_file,$project,$target);
+        print FILEO "$1$2$real_include_name$4$'";
+        $modified|=($real_include_name ne $3);
 
       } elsif ($is_rc and !$is_mfc and $rc_block_depth == 0 and /^\s*\d+\s+TEXTINCLUDE\s*/) {
-	$rc_textinclude_state=1;
-	print FILEO;
+        $rc_textinclude_state=1;
+        print FILEO;
 
       } elsif ($rc_textinclude_state == 3 and /^(\s*\"\#\s*include\s*\"\")afxres\.h(\"\"\\r\\n\")/) {
-	print FILEO "$1winres.h$2$'";
-	$modified=1;
+        print FILEO "$1winres.h$2$'";
+        $modified=1;
 
       } elsif (/^\s*BEGIN(\W.*)?$/) {
-	$rc_textinclude_state|=2;
-	$rc_block_depth++;
-	print FILEO;
+        $rc_textinclude_state|=2;
+        $rc_block_depth++;
+        print FILEO;
 
       } elsif (/^\s*END(\W.*)?$/) {
-	$rc_textinclude_state=0;
-	if ($rc_block_depth>0) {
-	  $rc_block_depth--;
-	}
-	print FILEO;
+        $rc_textinclude_state=0;
+        if ($rc_block_depth>0) {
+          $rc_block_depth--;
+        }
+        print FILEO;
 
       } else {
-	print FILEO;
+        print FILEO;
       }
 
     } else {
@@ -1500,7 +1500,7 @@ sub fix_source()
   foreach my $project (@projects) {
     foreach my $target (@$project[$P_SETTINGS],@{@$project[$P_TARGETS]}) {
       foreach my $source (@{@$target[$T_SOURCES_C]}, @{@$target[$T_SOURCES_CXX]}, @{@$target[$T_SOURCES_RC]}, @{@$target[$T_SOURCES_MISC]}) {
-	fix_file($source,$project,$target);
+        fix_file($source,$project,$target);
       }
     }
   }
@@ -1532,17 +1532,17 @@ sub generate_list($$$;$)
     foreach my $item (@$list) {
       my $value;
       if (defined $data) {
-	$value=&$data($item);
+        $value=&$data($item);
       } else {
-	$value=$item;
+        $value=$item;
       }
       if ($value ne "") {
-	if ($first) {
-	  print FILEO " $value";
-	  $first=0;
-	} else {
-	  print FILEO " \\\n\t\t\t$value";
-	}
+        if ($first) {
+          print FILEO " $value";
+          $first=0;
+        } else {
+          print FILEO " \\\n\t\t\t$value";
+        }
       }
     }
   }
@@ -1586,24 +1586,24 @@ sub generate_project_files($)
     # This is the main project. It is also responsible for recursively
     # calling the other projects
     generate_list("SUBDIRS",1,\@projects,sub
-		  {
-		    if ($_[0] != \@main_project) {
-		      my $subdir=@{$_[0]}[$P_PATH];
-		      $subdir =~ s+/$++;
-		      return $subdir;
-		    }
-		    # Eliminating the main project by returning undefined!
-		  });
+                  {
+                    if ($_[0] != \@main_project) {
+                      my $subdir=@{$_[0]}[$P_PATH];
+                      $subdir =~ s+/$++;
+                      return $subdir;
+                    }
+                    # Eliminating the main project by returning undefined!
+                  });
   }
   if (@{@$project[$P_TARGETS]} > 0) {
     generate_list("DLLS",1,\@dll_list,sub
-		  {
-		    return @{$_[0]}[$T_NAME];
-		  });
+                  {
+                    return @{$_[0]}[$T_NAME];
+                  });
     generate_list("EXES",1,\@exe_list,sub
-		  {
-		    return "@{$_[0]}[$T_NAME]";
-		  });
+                  {
+                    return "@{$_[0]}[$T_NAME]";
+                  });
     print FILEO "\n\n\n";
 
     print FILEO "### Common settings\n\n";
@@ -1652,29 +1652,29 @@ sub generate_project_files($)
     }
     print FILEO "### Global source lists\n\n";
     generate_list("C_SRCS",$no_extra,@$project[$P_TARGETS],sub
-		  {
-		    my $canon=canonize(@{$_[0]}[$T_NAME]);
-		    $canon =~ s+_so$++;
-		    return "\$(${canon}_C_SRCS)";
-		  });
+                  {
+                    my $canon=canonize(@{$_[0]}[$T_NAME]);
+                    $canon =~ s+_so$++;
+                    return "\$(${canon}_C_SRCS)";
+                  });
     if (!$no_extra) {
       generate_list("",1,[ "\$(EXTRA_C_SRCS)" ]);
     }
     generate_list("CXX_SRCS",$no_extra,@$project[$P_TARGETS],sub
-		  {
-		    my $canon=canonize(@{$_[0]}[$T_NAME]);
-		    $canon =~ s+_so$++;
-		    return "\$(${canon}_CXX_SRCS)";
-		  });
+                  {
+                    my $canon=canonize(@{$_[0]}[$T_NAME]);
+                    $canon =~ s+_so$++;
+                    return "\$(${canon}_CXX_SRCS)";
+                  });
     if (!$no_extra) {
       generate_list("",1,[ "\$(EXTRA_CXX_SRCS)" ]);
     }
     generate_list("RC_SRCS",$no_extra,@$project[$P_TARGETS],sub
-		  {
-		    my $canon=canonize(@{$_[0]}[$T_NAME]);
-		    $canon =~ s+_so$++;
-		    return "\$(${canon}_RC_SRCS)";
-		  });
+                  {
+                    my $canon=canonize(@{$_[0]}[$T_NAME]);
+                    $canon =~ s+_so$++;
+                    return "\$(${canon}_RC_SRCS)";
+                  });
     if (!$no_extra) {
       generate_list("",1,[ "\$(EXTRA_RC_SRCS)" ]);
     }
-- 
1.6.0.4


--------------020304090203050902030401--



More information about the wine-patches mailing list