build: added public_headers support
[ira/wip.git] / buildtools / mktowscript / mktowscript.pl
index b1a929a4b31f54684c87359c51412bfb956546d1..18c8779055ac66e6407d27fb0b88e3f322c9bc09 100755 (executable)
@@ -210,7 +210,6 @@ foreach my $s (sort {$result->{$a}->{SECNUMBER} <=> $result->{$b}->{SECNUMBER}}
                        $k eq "COV_TARGET" ||
                        $k eq "GCOV" ||
                        $k eq "PC_FILES" ||
-                       $k eq "PUBLIC_HEADERS" ||
                        $k eq "CONFIG4FILE" ||
                        $k eq "LMHOSTSFILE4") {
                            $trailer .= sprintf(",\n\t# %s='%s'", $k, trim($sec->{$k}));
@@ -273,6 +272,17 @@ foreach my $s (sort {$result->{$a}->{SECNUMBER} <=> $result->{$b}->{SECNUMBER}}
                            $trailer .= sprintf(",\n\tautoproto='%s'", $list);
                            next;
                    }
+                   if ($k eq "PUBLIC_HEADERS") {
+                           my $list = trim(strlist($sec->{$k}));
+                           if ($list =~ /\$\(addprefix .*,(.*)\)(.*)$/) {
+                                   $list = trim("$1 $2");
+                                   $list = find_files($list);
+                           } else {
+                                   $list = trim(find_files(strlist($sec->{$k})));
+                           }
+                           $trailer .= sprintf(",\n\tpublic_headers='%s'", $list);
+                           next;
+                   }
                    if ($k eq "MANPAGES") {
                            my $list = trim(find_files(strlist($sec->{$k})));
                            $trailer .= sprintf(",\n\tmanpages='%s'", $list);