build: auto generate ASN1 and ET rules
authorAndrew Tridgell <tridge@samba.org>
Tue, 23 Feb 2010 08:04:16 +0000 (19:04 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:37 +0000 (20:26 +1000)
buildtools/mktowscript/mktowscript.pl

index 07ade21d0e82efaa7b887d4bf18ff909b8946af4..1db7297261af7b20eecbb936ddfb76d222a57282 100755 (executable)
@@ -143,11 +143,6 @@ sub read_config_mk($)
                # lines beginning with '#' are ignored
                next if (/^\#.*$/);
 
-               if (/^(mkinclude perl_path_wrapper.sh.*)/) {
-                       printf(STDERR "Ignoring: %s", $1);
-                       next;
-               }
-
                if (/^(.*)\\$/) {
                        $prev .= $1;
                        next;
@@ -156,6 +151,35 @@ sub read_config_mk($)
                        $prev = "";
                }
 
+               if ($line =~ /^mkinclude.*asn1_deps.pl\s+([^\s]+)\s+([^\s]+)\s+\\\$\\\(\w+\\\)\/([^\s|]+)\s*([^|]*)\|$/) {
+                       my $src = $1;
+                       $section = $2;
+                       my $dir = $3;
+                       my $options = $4;
+                       $section = "HEIMDAL_" . uc($section);
+                       $result->{$section}->{TYPE} = 'ASN1';
+                       $result->{$section}->{SECNUMBER} = $secnumber++;
+                       if ($options ne '') {
+                               $result->{$section}->{OPTIONS} = $options;
+                       }
+                       $result->{$section}->{DIRECTORY} = $dir;
+                       $result->{$section}->{$section . '_OBJ_FILES'} = $src;
+                       next;
+               }
+
+               if ($line =~ /^mkinclude.*et_deps.pl\s+([^\s]+)\s+\\\$\\\(\w+\\\)\/([^\s|]+)\|$/) {
+                       my $src = $1;
+                       my $dir = $2;
+                       $section = basename($src);
+                       $section =~ s/\./_/g;
+                       $section = "HEIMDAL_" . uc($section);
+                       $result->{$section}->{TYPE} = 'ERRTABLE';
+                       $result->{$section}->{SECNUMBER} = $secnumber++;
+                       $result->{$section}->{DIRECTORY} = "$dir";
+                       $result->{$section}->{$section . '_OBJ_FILES'} = $src;
+                       next;
+               }
+
                if ($line =~ /^\[(\w+)::([\w-]+)\]/)
                {
                        my $type = $1;
@@ -281,6 +305,14 @@ foreach my $s (sort {$result->{$a}->{SECNUMBER} <=> $result->{$b}->{SECNUMBER}}
                            $trailer .= sprintf(",\n\tcflags='%s'", strlist($sec->{$k}));
                            next;
                    }
+                   if ($k eq "OPTIONS") {
+                           $trailer .= sprintf(",\n\toptions='%s'", strlist($sec->{$k}));
+                           next;
+                   }
+                   if ($k eq "DIRECTORY") {
+                           $trailer .= sprintf(",\n\tdirectory='%s'", strlist($sec->{$k}));
+                           next;
+                   }
                    if ($k eq "LDFLAGS") {
                            $trailer .= sprintf(",\n\tldflags='%s'", strlist($sec->{$k}));
                            next;