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 die("Unable to map $p");
80 print "Installing $p as $includedir/$p2\n";
82 my $dirname = dirname
($p2);
84 if (! -d
"$includedir/$dirname") {
85 mkdir("$includedir/$dirname", 0777);
88 if ( -f
"$includedir/$p2" ) {
89 unlink("$includedir/$p2.old");
90 rename("$includedir/$p2", "$includedir/$p2.old");
93 install_header
($p,"$includedir/$p2");
97 ======================================================================
98 The headers are installed. You may restore the old headers (if there
99 were any) using the command "make revert". You may uninstall the headers
100 using the command "make uninstallheader" or "make uninstall" to uninstall
101 binaries, man pages and shell scripts.
102 ======================================================================