make_dlls enhancement(s)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this patch implements two things
1/ it now runs the script in strict mode, which
   is always better for error catching
2/ it allows not to take into account some
   Makefile.in in the tree (you need to add a 
   #MKDLL_STRIP comment at the top of Makefile.in)
   (another solution would have been to look for the
   directory presence/absence in configure.ac)

A+
Name:          mkdll
ChangeLog:     now runs in Perl strict mode
	added ability to skip DLL from the tree
License:       X11
GenDate:       2002/05/20 19:28:30 UTC
ModifiedFiles: dlls/make_dlls
AddedFiles:    
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/make_dlls,v
retrieving revision 1.9
diff -u -u -r1.9 make_dlls
--- dlls/make_dlls	17 May 2002 04:32:20 -0000	1.9
+++ dlls/make_dlls	20 May 2002 07:19:40 -0000
@@ -20,15 +20,17 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
-$makefiles = `find . -name Makefile.in -print`;
+use strict;
 
-%imports = ();
-%directories = ();
-%altnames = ();
-%linked_dlls = ();
+my $makefiles = `find . -name Makefile.in -print`;
+
+my %imports = ();
+my %directories = ();
+my %altnames = ();
+my %linked_dlls = ();
 
 # list of special dlls that can be switched on or off by configure
-%special_dlls =
+my %special_dlls =
 (
   "ddraw"    => "XFILES",
   "glu32"    => "GLU32FILES",
@@ -36,12 +38,19 @@
   "x11drv"   => "XFILES"
 );
 
-foreach $i (split(/\s/,$makefiles))
+foreach my $i (split(/\s/,$makefiles))
 {
+	my $module;
+
     open MAKE,$i;
+
+	 $module = undef;
     while (<MAKE>)
     {
         chop;
+		  # EPP hack to disable this DLL... the MKDLL_SKIP comment must appear
+		  # at the very top of the Makefile.in
+		  last if (/^\#\s*MKDLL_SKIP/);
         if (/^MODULE\s*=\s*([a-zA-Z0-9_.]+)/)
         {
             $module = $1;
@@ -68,7 +77,8 @@
             next;
         }
     }
-    push @{$imports{$module}}, "kernel32.dll" unless @{$imports{$module}} || $module eq "ntdll.dll";
+	 close MAKE;
+	 push @{$imports{$module}}, "kernel32.dll" unless !defined($module) || @{$imports{$module}} || $module eq "ntdll.dll";
 }
 
 open NEWMAKE,">Makefile.in.new" or die "cannot create Makefile.in.new";
@@ -91,16 +101,16 @@
 
 printf NEWMAKE "# special configure-dependent targets\n\n";
 my %specials = ();
-foreach $mod (sort keys %special_dlls)
+foreach my $mod (sort keys %special_dlls)
 {
     $specials{$special_dlls{$mod}} .= " " . $mod;
 }
-foreach $i (sort keys %specials)
+foreach my $i (sort keys %specials)
 {
     printf NEWMAKE "%s =%s\n", $i, $specials{$i};
 }
 printf NEWMAKE "EXTRADIRS =";
-foreach $i (sort keys %specials) { printf NEWMAKE " \@%s\@", $i; }
+foreach my $i (sort keys %specials) { printf NEWMAKE " \@%s\@", $i; }
 printf NEWMAKE "\n\n";
 
 
@@ -113,7 +123,7 @@
 SUBDIRS = \\
 EOF
 printf NEWMAKE "\t\$(EXTRADIRS)";
-foreach $dir (sort values %directories)
+foreach my $dir (sort values %directories)
 {
     next if defined($special_dlls{$dir});  # skip special dlls
     printf NEWMAKE " \\\n\t%s", $dir;
@@ -125,12 +135,12 @@
 # output the all: target
 
 my %targets = ();  # use a hash to get rid of duplicate target names
-foreach $mod (sort keys %directories)
+foreach my $mod (sort keys %directories)
 {
     next if defined($special_dlls{$directories{$mod}});  # skip special dlls
     $targets{sprintf("%s\$(DLLEXT)",$mod)} = 1;
     next unless defined $altnames{$mod};
-    foreach $i (sort @{$altnames{$mod}})
+    foreach my $i (sort @{$altnames{$mod}})
     {
         $targets{sprintf("%s\$(DLLEXT)",$i)} = 1;
     }
@@ -156,13 +166,13 @@
 
 EOF
 
-foreach $mod (sort keys %directories)
+foreach my $mod (sort keys %directories)
 {
     printf NEWMAKE "%s\$(DLLEXT)", $mod;
     if (defined $altnames{$mod})
     {
         my $count = 1;
-        foreach $i (sort @{$altnames{$mod}})
+        foreach my $i (sort @{$altnames{$mod}})
         {
             if (!($count++ % 3)) { printf NEWMAKE " \\\n "; }
             printf NEWMAKE " %s\$(DLLEXT)", $i;
@@ -179,11 +189,11 @@
 print NEWMAKE "# Inter-dll dependencies\n\n";
 
 my @depends = ();
-foreach $mod (sort keys %imports)
+foreach my $mod (sort keys %imports)
 {
     my $count = 1;
     my $dep = sprintf("%s/%s\$(DLLEXT): dummy", $directories{$mod}, $mod);
-    foreach $i (@{$imports{$mod}})
+    foreach my $i (@{$imports{$mod}})
     {
         if ($count++ >= 3)
         {
@@ -192,7 +202,7 @@
         }
         $dep .= sprintf(" %s\$(DLLEXT)", $i);
     }
-    foreach $i (@{$linked_dlls{$mod}})
+    foreach my $i (@{$linked_dlls{$mod}})
     {
         if ($count++ >= 3)
         {
@@ -210,14 +220,14 @@
 ################################################################
 # output the linkable dlls special links
 
-%linkable_dlls = ();
-foreach $mod (keys %imports)
+my %linkable_dlls = ();
+foreach my $mod (keys %imports)
 {
-    foreach $i (@{$linked_dlls{$mod}}) { $linkable_dlls{$i} = 1; }
+    foreach my $i (@{$linked_dlls{$mod}}) { $linkable_dlls{$i} = 1; }
 }
 
 print NEWMAKE "# Special targets for dlls that we need to link to\n\n";
-foreach $mod (keys %linkable_dlls)
+foreach my $mod (keys %linkable_dlls)
 {
     printf NEWMAKE "lib%s.\$(LIBEXT): %s/%s\$(DLLEXT)\n", $mod, $directories{$mod}, $mod;
     printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s\$(DLLEXT) \$@\n\n", $directories{$mod}, $mod;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux