Commit 39f357f8 authored by Alexandre Julliard's avatar Alexandre Julliard

make_dlls: Update the directory list in configure.ac too.

parent 32e3437d
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Update the dll dependencies in the dlls main Makefile.in. # 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 # Copyright 2001 Alexandre Julliard
# #
...@@ -22,9 +21,8 @@ ...@@ -22,9 +21,8 @@
use strict; use strict;
my $makefiles = `find . -name Makefile.in -print`;
my %directories = (); my %directories = ();
my %testdirs = ();
my %importlibs = (); my %importlibs = ();
my %static_implibs = (); my %static_implibs = ();
my %staticlib_dirs = (); my %staticlib_dirs = ();
...@@ -46,15 +44,39 @@ sub needs_symlink($) ...@@ -46,15 +44,39 @@ sub needs_symlink($)
return $mod ne $directories{$_[0]}; return $mod ne $directories{$_[0]};
} }
foreach my $i (split(/\s/,$makefiles)) sub update_file($)
{ {
my $module; my $file = shift;
if (!system "cmp $file $file.new >/dev/null")
{
unlink "$file.new";
print "$file is unchanged\n";
}
else
{
rename "$file.new", "$file";
print "$file updated\n";
}
}
next if $i =~ /\/tests\/Makefile.in/; # if we are inside the dlls dir, go up one level
if (! -f "configure.ac" && -f "../configure.ac") { chdir(".."); }
my $makefiles = `find dlls -name Makefile.in -print`;
foreach my $i (split(/\s/,$makefiles))
{
if ($i =~ /dlls\/(.*)\/tests\/Makefile.in/)
{
$testdirs{$1} = "$1/tests";
next;
}
open MAKE,$i; open MAKE,$i;
$module = undef; my $module = undef;
my $dir = $i;
while (<MAKE>) while (<MAKE>)
{ {
chop; chop;
...@@ -67,12 +89,12 @@ foreach my $i (split(/\s/,$makefiles)) ...@@ -67,12 +89,12 @@ foreach my $i (split(/\s/,$makefiles))
$module = $1; $module = $1;
if ($module =~ /^lib.*\.a$/) if ($module =~ /^lib.*\.a$/)
{ {
($staticlib_dirs{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/; ($staticlib_dirs{$module} = $i) =~ s/^dlls\/(.*)\/[^\/]+$/$1/;
die "invalid module $module in dir $staticlib_dirs{$module}\n" if "lib$staticlib_dirs{$module}.a" ne $module; die "invalid module $module in dir $staticlib_dirs{$module}\n" if "lib$staticlib_dirs{$module}.a" ne $module;
} }
else else
{ {
($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/; ($directories{$module} = $i) =~ s/^dlls\/(.*)\/[^\/]+$/$1/;
} }
next; next;
} }
...@@ -99,7 +121,7 @@ foreach my $i (split(/\s/,$makefiles)) ...@@ -99,7 +121,7 @@ foreach my $i (split(/\s/,$makefiles))
close MAKE; close MAKE;
} }
open NEWMAKE,">Makefile.in.new" or die "cannot create Makefile.in.new"; open NEWMAKE,">dlls/Makefile.in.new" or die "cannot create dlls/Makefile.in.new";
################################################################ ################################################################
# makefile header # makefile header
...@@ -349,13 +371,12 @@ checklink:: \$(BUILDSUBDIRS:%=%/__checklink__) ...@@ -349,13 +371,12 @@ checklink:: \$(BUILDSUBDIRS:%=%/__checklink__)
EOF EOF
close NEWMAKE; close NEWMAKE;
rename "Makefile.in.new", "Makefile.in"; update_file("dlls/Makefile.in");
printf "Successfully updated Makefile.in\n";
################################################################ ################################################################
# .gitignore file # .gitignore file
open GITIGNORE, ">.gitignore.new" or die "cannot create .gitignore.new"; open GITIGNORE, ">dlls/.gitignore.new" or die "cannot create dlls/.gitignore.new";
print GITIGNORE "# Automatically generated by make_dlls; DO NOT EDIT!!\n"; print GITIGNORE "# Automatically generated by make_dlls; DO NOT EDIT!!\n";
my @ignores = my @ignores =
...@@ -387,5 +408,32 @@ foreach my $mod (sort keys %importlibs) ...@@ -387,5 +408,32 @@ foreach my $mod (sort keys %importlibs)
print GITIGNORE join("\n", sort @ignores) . "\n"; print GITIGNORE join("\n", sort @ignores) . "\n";
close GITIGNORE; close GITIGNORE;
rename ".gitignore.new", ".gitignore"; update_file("dlls/.gitignore");
printf "Successfully updated .gitignore\n";
################################################################
# configure.ac file
open OLD_CONFIG, "configure.ac" or die "cannot open configure.ac";
open NEW_CONFIG, ">configure.ac.new" or die "cannot create configure.ac.new";
while (<OLD_CONFIG>)
{
print NEW_CONFIG $_;
last if /^dlls\/Makefile/;
}
foreach my $dir (sort (values %directories, values %staticlib_dirs, values %testdirs))
{
print NEW_CONFIG "dlls/$dir/Makefile\n";
}
my $skip=1;
while (<OLD_CONFIG>)
{
$skip = 0 unless /^dlls\//;
print NEW_CONFIG $_ unless $skip;
}
close OLD_CONFIG;
close NEW_CONFIG;
update_file("configure.ac");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment