michael@0: #!/usr/bin/perl michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: $output_dir = shift; michael@0: michael@0: while () { michael@0: chomp; michael@0: if (-e "$output_dir/$_") { michael@0: next; michael@0: } michael@0: michael@0: if (/(.*)\/[^\/*]/) { michael@0: mkdir "$output_dir/$1"; michael@0: } michael@0: michael@0: open OUT, ">$output_dir/$_"; michael@0: print OUT "#pragma GCC system_header\n"; # suppress include_next warning michael@0: print OUT "#pragma GCC visibility push(default)\n"; michael@0: print OUT "#include_next \<$_\>\n"; michael@0: print OUT "#pragma GCC visibility pop\n"; michael@0: close OUT; michael@0: } michael@0: