Alexandre Julliard : make_progs: Update the directory list in configure. ac too.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 25 05:26:59 CDT 2006


Module: wine
Branch: master
Commit: 9a2df7deebceb28ba6e437c5d053d99f82c119ac
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=9a2df7deebceb28ba6e437c5d053d99f82c119ac

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Aug 25 11:50:21 2006 +0200

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

---

 programs/make_progs |   72 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/programs/make_progs b/programs/make_progs
index e854ed9..01788d4 100755
--- a/programs/make_progs
+++ b/programs/make_progs
@@ -22,8 +22,6 @@ #
 
 use strict;
 
-my $makefiles = `find . -name Makefile.in -print`;
-
 my %directories = ();
 
 # Programs that we want to install in the bin directory too
@@ -55,12 +53,30 @@ (
   "winetest" => 1,
 );
 
+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 programs dir, go up one level
+if (! -f "configure.ac" && -f "../configure.ac") { chdir(".."); }
+
+my $makefiles = `find programs -name Makefile.in -print`;
+
 foreach my $i (split(/\s/,$makefiles))
 {
     my $module;
 
-    next if $i =~ /\/tests\/Makefile.in/;
-
     open MAKE,$i;
 
     $module = undef;
@@ -75,7 +91,7 @@ foreach my $i (split(/\s/,$makefiles))
         {
             $module = $1;
             next if ($module eq "none");
-            ($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+            ($directories{$module} = $i) =~ s/^programs\/(.*)\/[^\/]+$/$1/;
             die "invalid module $module in dir $directories{$module}\n" if "$directories{$module}.exe" ne $module;
             last;
         }
@@ -93,7 +109,7 @@ foreach my $i (split(/\s/,$makefiles))
     close MAKE;
 }
 
-open NEWMAKE,">Makefile.in.new" or die "cannot create Makefile.in.new";
+open NEWMAKE,">programs/Makefile.in.new" or die "cannot create programs/Makefile.in.new";
 
 ################################################################
 # makefile header
@@ -140,6 +156,8 @@ # output the build and install targets
 print NEWMAKE <<EOF;
 
 
+INSTALLDIRS = \$(DESTDIR)\$(bindir)
+
 \@MAKE_RULES\@
 
 all: wineapploader winelauncher \$(SUBDIRS)
@@ -154,8 +172,7 @@ # Rules for installation
 
 .PHONY: install-apploader install-progs install-progs.so \$(INSTALLPROGS:%=%/__installprog__)
 
-install-apploader: wineapploader dummy
-	\$(MKINSTALLDIRS) \$(DESTDIR)\$(bindir)
+install-apploader: wineapploader \$(INSTALLDIRS) dummy
 	\$(INSTALL_SCRIPT) wineapploader \$(DESTDIR)\$(bindir)/wineapploader
 
 \$(INSTALLPROGS:%=%/__installprog__): install-apploader
@@ -166,8 +183,7 @@ install-progs.so: \$(INSTALLPROGS:%=%/__
 
 install-progs: # nothing to do here
 
-install:: winelauncher install-progs\$(DLLEXT)
-	\$(MKINSTALLDIRS) \$(DESTDIR)\$(bindir)
+install:: winelauncher install-progs\$(DLLEXT) \$(INSTALLDIRS)
 	\$(INSTALL_SCRIPT) winelauncher \$(DESTDIR)\$(bindir)/winelauncher
 
 uninstall::
@@ -185,13 +201,12 @@ ### Dependencies:
 EOF
 
 close NEWMAKE;
-rename "Makefile.in.new", "Makefile.in";
-printf "Successfully updated Makefile.in\n";
+update_file("programs/Makefile.in");
 
 ################################################################
 # .gitignore file
 
-open GITIGNORE, ">.gitignore.new" or die "cannot create .gitignore.new";
+open GITIGNORE, ">programs/.gitignore.new" or die "cannot create programs/.gitignore.new";
 print GITIGNORE "# Automatically generated by make_dlls; DO NOT EDIT!!\n";
 
 my @ignores =
@@ -209,5 +224,32 @@ foreach my $dir (sort keys %alldirs)
 print GITIGNORE join("\n", sort @ignores) . "\n";
 
 close GITIGNORE;
-rename ".gitignore.new", ".gitignore";
-printf "Successfully updated .gitignore\n";
+update_file("programs/.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 /^programs\/Makefile/;
+}
+
+foreach my $dir (sort values %directories)
+{
+    print NEW_CONFIG "programs/$dir/Makefile\n";
+}
+
+my $skip=1;
+while (<OLD_CONFIG>)
+{
+    $skip = 0 unless /^programs\//;
+    print NEW_CONFIG $_ unless $skip;
+}
+
+close OLD_CONFIG;
+close NEW_CONFIG;
+update_file("configure.ac");




More information about the wine-cvs mailing list