1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r15378: Fix installheader script. Alexander, this will break installation of headers

for srcdir != builddir
(This used to be commit 527a40d80b)
This commit is contained in:
Jelmer Vernooij 2006-05-01 15:45:26 +00:00 committed by Gerald (Jerry) Carter
parent 66a4c270d4
commit cad3914619

View File

@ -2,18 +2,16 @@
# Copyright (C) 2006 Jelmer Vernooij
use strict;
use File::Basename;
use Cwd 'abs_path';
my $includedir = shift;
my $builddir = abs_path($ENV{samba_builddir});
my $srcdir = abs_path($ENV{samba_srcdir});
sub read_headermap($)
{
my ($fn) = @_;
my %map = ();
my $ln = 0;
open(MAP, "<$fn");
open(MAP, "<headermap.txt");
while(<MAP>) {
$ln++;
s/#.*$//g;
@ -30,19 +28,14 @@ sub read_headermap($)
return %map;
}
my %map = read_headermap("$srcdir/headermap.txt");
my %map = read_headermap("headermap.txt");
sub findmap($)
{
$_ = shift;
s/^\.\///g;
s/$builddir\///g;
s/$srcdir\///g;
if (! -f $_ && -f "lib/$_") { $_ = "lib/$_"; }
if ($srcdir !~ $builddir) {
if (! -f "$srcdir/$_" && -f "$srcdir/lib/$_") { $_ = "lib/$_"; }
}
return $map{$_};
}
@ -62,7 +55,7 @@ sub install_header($$)
my $lineno = 0;
open(IN, "<$src") || open(IN, "<$srcdir/$src");
open(IN, "<$src");
open(OUT, ">$dst");
while (<IN>) {