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";
67 } elsif (/^#if _SAMBA_BUILD_ == 4/) {
82 die("Unable to map $p");
84 print "Installing $p as $includedir/$p2\n";
86 my $dirname = dirname
($p2);
88 if (! -d
"$includedir/$dirname") {
89 mkdir("$includedir/$dirname", 0777);
92 if ( -f
"$includedir/$p2" ) {
93 unlink("$includedir/$p2.old");
94 rename("$includedir/$p2", "$includedir/$p2.old");
97 install_header
($p,"$includedir/$p2");
101 ======================================================================
102 The headers are installed. You may restore the old headers (if there
103 were any) using the command "make revert". You may uninstall the headers
104 using the command "make uninstallheader" or "make uninstall" to uninstall
105 binaries, man pages and shell scripts.
106 ======================================================================