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 die("Will not install autogenerated header $src") if (/This file was automatically generated by mkproto.pl. DO NOT EDIT/);
65 if (/^#include \"(.*)\"/) {
66 print OUT
"#include <" . rewrite_include
("$src:$lineno", $1) . ">\n";
80 die("Unable to map $p");
82 print "Installing $p as $includedir/$p2\n";
84 my $dirname = dirname
($p2);
86 if (! -d
"$includedir/$dirname") {
87 mkdir("$includedir/$dirname", 0777);
90 if ( -f
"$includedir/$p2" ) {
91 unlink("$includedir/$p2.old");
92 rename("$includedir/$p2", "$includedir/$p2.old");
95 install_header
($p,"$includedir/$p2");
99 ======================================================================
100 The headers are installed. You may restore the old headers (if there
101 were any) using the command "make revert". You may uninstall the headers
102 using the command "make uninstallheader" or "make uninstall" to uninstall
103 binaries, man pages and shell scripts.
104 ======================================================================