2 # Re-generate symbol renaming defines
3 # (c) 2014 Martin Mares <mj@ucw.cz>
8 open my $f, '<', 'maint/libucw.abi' or die;
15 push @{$renames{$current}}, $_;
20 for my $g (sort keys %renames) {
21 my @symbols = sort @{$renames{$g}};
24 open my $in, '<', $g or die;
25 open my $out, '>', "$g.new" or die;
30 if (m{^/\*$} && !$cmt) {
38 # Waiting for the right spot
39 } elsif (m{^#ifdef CONFIG_UCW_CLEAN_ABI$}) {
44 print $out "#ifdef CONFIG_UCW_CLEAN_ABI\n";
45 for my $sym (@symbols) {
46 print $out "#define $sym ucw_$sym\n";
48 print $out "#endif\n\n";
50 } elsif ($mode == 2) {
61 system "cmp", "-s", $g, "$g.new";
63 print "### $g: updated\n";
64 rename "$g.new", $g or die;
66 print "--- $g: not modified\n";
67 unlink "$g.new" or die;