- Handle autoconf/autoheader requirements better when asked to build.
authorWayne Davison <wayned@samba.org>
Fri, 8 Oct 2004 21:06:20 +0000 (21:06 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 8 Oct 2004 21:06:20 +0000 (21:06 +0000)
- Look for ./configure options specified in the opening comments and
  use it/them when asked to build.

verify-patches

index e215b0d..29f48b3 100755 (executable)
@@ -114,8 +114,25 @@ foreach my $diff (@ARGV) {
                    close IN;
                    close OUT;
                }
+               my $need_autoconf;
+               my $conf_opts;
+               open(IN, "../$diff") or die $!;
+               while (<IN>) {
+                   if (!defined $conf_opts) {
+                       $conf_opts = '' if /^---/;
+                       if (m#^\s*\./configure( .+)#) {
+                           $conf_opts = $1;
+                       }
+                   }
+                   if (m#^--- orig/(configure\.in|/aclocal\.m4)#) {
+                       $need_autoconf = 1;
+                       last;
+                   }
+               }
+               close IN;
                chdir('workdir') or die $!;
-               system "make gen; ./configure $CONF_OPTS; make";
+               system "autoconf; autoheader" if $need_autoconf;
+               system "make proto; ./configure $CONF_OPTS $conf_opts; make";
                chdir('..') or die $!;
                $default = '!make test';
                next;