2 # Copyright (C) 2006 Jelmer Vernooij
6 my $includedir = shift;
14 open(MAP, "<headermap.txt");
19 if (! /^(.*): (.*)$/) {
20 print STDERR "headermap.txt:$ln: Malformed line\n";
31 my %map = read_headermap("headermap.txt");
38 if (! -f $_ && -f "lib/$_") { $_ = "lib/$_"; }
43 sub rewrite_include($$)
52 sub install_header($$)
63 if (/^#include \"(.*)\"/) {
64 print OUT "#include <" . rewrite_include("$src:$lineno", $1) . ">\n";
78 warn("Unable to map $p");
81 print "Installing $p as $includedir/$p2\n";
83 my $dirname = dirname($p2);
85 if (! -d "$includedir/$dirname") {
86 mkdir("$includedir/$dirname", 0777);
89 if ( -f "$includedir/$p2" ) {
90 unlink("$includedir/$p2.old");
91 rename("$includedir/$p2", "$includedir/$p2.old");
94 install_header($p,"$includedir/$p2");
98 ======================================================================
99 The headers are installed. You may restore the old headers (if there
100 were any) using the command "make revert". You may uninstall the headers
101 using the command "make uninstallheader" or "make uninstall" to uninstall
102 binaries, man pages and shell scripts.
103 ======================================================================