#!/usr/bin/perl -w # # Update the dll dependencies in the dlls main Makefile.in. # Must be run in the dlls/ directory of the Wine tree. # # Copyright 2001 Alexandre Julliard # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # use strict; 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 my %special_dlls = ( "ddraw" => "XFILES", "glu32" => "GLU32FILES", "opengl32" => "OPENGLFILES", "d3d8" => "OPENGLFILES", "d3dx8" => "OPENGLFILES", "x11drv" => "XFILES" ); foreach my $i (split(/\s/,$makefiles)) { my $module; next if $i =~ /\/tests\/Makefile.in/; 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; $imports{$module} = [ ]; ($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/; next; } if (/^ALTNAMES\s*=\s*(.*)/) { my @list = split(/\s/,$1); $altnames{$module} = \@list; next; } if (/^(DELAYIMPORTS|IMPORTS)\s*=\s*(.*)/) { my @list = map { /\./ ? $_ : $_ . ".dll"; } split(/\s/,$2); push @{$imports{$module}}, @list; next; } if (/^LDIMPORTS\s*=\s*(.*)/) { my @list = map { /\./ ? $_ : $_ . ".dll"; } split(/\s/,$1); $linked_dlls{$module} = \@list; next; } } 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"; ################################################################ # makefile header print NEWMAKE < directory rules print NEWMAKE <