From c0d955e8c4a097f44361e53614ae1cf3aedf7f19 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 21 May 2002 18:29:31 +0000 Subject: [PATCH] Now runs in Perl strict mode. Added ability to skip DLL from the tree. --- dlls/make_dlls | 57 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/dlls/make_dlls b/dlls/make_dlls index 3ceb1b96e8c..35f42fcf663 100755 --- a/dlls/make_dlls +++ b/dlls/make_dlls @@ -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,20 @@ $makefiles = `find . -name Makefile.in -print`; "x11drv" => "XFILES" ); -foreach $i (split(/\s/,$makefiles)) +foreach my $i (split(/\s/,$makefiles)) { + my $module; + open MAKE,$i; + + $module = undef; while () { 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 +78,8 @@ foreach $i (split(/\s/,$makefiles)) 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 +102,16 @@ EOF 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 +124,7 @@ print NEWMAKE <= 3) { @@ -192,7 +203,7 @@ foreach $mod (sort keys %imports) } $dep .= sprintf(" %s\$(DLLEXT)", $i); } - foreach $i (@{$linked_dlls{$mod}}) + foreach my $i (@{$linked_dlls{$mod}}) { if ($count++ >= 3) { @@ -210,14 +221,14 @@ print NEWMAKE sort @depends; ################################################################ # 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;