make_dlls: Update the directory list in configure.ac too.
diff --git a/dlls/make_dlls b/dlls/make_dlls
index 9bd3710..339e28c 100755
--- a/dlls/make_dlls
+++ b/dlls/make_dlls
@@ -1,7 +1,6 @@
#!/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
#
@@ -22,9 +21,8 @@
use strict;
-my $makefiles = `find . -name Makefile.in -print`;
-
my %directories = ();
+my %testdirs = ();
my %importlibs = ();
my %static_implibs = ();
my %staticlib_dirs = ();
@@ -46,15 +44,39 @@
return $mod ne $directories{$_[0]};
}
+sub update_file($)
+{
+ 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";
+ }
+}
+
+# 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))
{
- my $module;
-
- next if $i =~ /\/tests\/Makefile.in/;
+ if ($i =~ /dlls\/(.*)\/tests\/Makefile.in/)
+ {
+ $testdirs{$1} = "$1/tests";
+ next;
+ }
open MAKE,$i;
- $module = undef;
+ my $module = undef;
+ my $dir = $i;
+
while (<MAKE>)
{
chop;
@@ -67,12 +89,12 @@
$module = $1;
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;
}
else
{
- ($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+ ($directories{$module} = $i) =~ s/^dlls\/(.*)\/[^\/]+$/$1/;
}
next;
}
@@ -99,7 +121,7 @@
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
@@ -349,13 +371,12 @@
EOF
close NEWMAKE;
-rename "Makefile.in.new", "Makefile.in";
-printf "Successfully updated Makefile.in\n";
+update_file("dlls/Makefile.in");
################################################################
# .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";
my @ignores =
@@ -387,5 +408,32 @@
print GITIGNORE join("\n", sort @ignores) . "\n";
close GITIGNORE;
-rename ".gitignore.new", ".gitignore";
-printf "Successfully updated .gitignore\n";
+update_file("dlls/.gitignore");
+
+################################################################
+# 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");