summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-12-04 14:20:46 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:11 +0100
commit188b029ff61195f53679ffc0610c26b73544dcf1 (patch)
tree66edaad09255b829b0db0c3b8467bce1ce2eb5a4 /source4/build
parente736a215cecd0b6cb7a735313b8be59114dec68d (diff)
downloadsamba-188b029ff61195f53679ffc0610c26b73544dcf1.tar.gz
samba-188b029ff61195f53679ffc0610c26b73544dcf1.tar.bz2
samba-188b029ff61195f53679ffc0610c26b73544dcf1.zip
r26291: build: make use of output::add_dir_str() to avoid ugly foo/../bla pathes
metze (This used to be commit 120e5e08f77c97817bc0ce0971c6c0503b15c399)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/smb_build/makefile.pm57
1 files changed, 27 insertions, 30 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 3c48d031e9..3b43dfb0b7 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -7,6 +7,7 @@
package smb_build::makefile;
use smb_build::env;
+use smb_build::output;
use File::Basename;
use strict;
@@ -463,12 +464,8 @@ sub Header($$)
{
my ($self,$ctx) = @_;
- my $dir = $ctx->{BASEDIR};
-
- $dir =~ s/^\.\///g;
-
foreach (@{$ctx->{PUBLIC_HEADERS}}) {
- push (@{$self->{headers}}, "$dir/$_");
+ push (@{$self->{headers}}, output::add_dir_str($ctx->{BASEDIR}, $_));
}
}
@@ -533,21 +530,19 @@ sub PythonFiles($$)
foreach (@{$ctx->{PYTHON_FILES}}) {
my $target = "bin/python/".basename($_);
- $self->output("$target: $ctx->{BASEDIR}/$_\n" .
- "\tcp $ctx->{BASEDIR}/$_ \$@\n\n");
+ my $source = output::add_dir_str($ctx->{BASEDIR}, $_);
+ $self->output("$target: $source\n" .
+ "\tcp $source \$@\n\n");
push (@{$self->{python_dsos}}, $target);
- }
+ }
}
sub Manpage($$)
{
my ($self,$ctx) = @_;
- my $dir = $ctx->{BASEDIR};
-
- $dir =~ s/^\.\///g;
-
- push (@{$self->{manpages}}, "$dir/$ctx->{MANPAGE}");
+ my $path = output::add_dir_str($ctx->{BASEDIR}, $ctx->{MANPAGE});
+ push (@{$self->{manpages}}, $path);
}
sub PkgConfig($$$)
@@ -561,7 +556,7 @@ sub PkgConfig($$$)
return if (not defined($ctx->{DESCRIPTION}));
- my $path = "$ctx->{BASEDIR}/$link_name.pc";
+ my $path = output::add_dir_str($ctx->{BASEDIR}, "$link_name.pc");
push (@{$self->{pc_files}}, $path);
@@ -648,37 +643,39 @@ sub ProtoHeader($$)
{
my ($self,$ctx) = @_;
- my $dir = $ctx->{BASEDIR};
-
- $dir =~ s/^\.\///g;
-
my $target = "";
-
my $comment = "Creating ";
+
+ my $priv = undef;
+ my $pub = undef;
+
if (defined($ctx->{PRIVATE_PROTO_HEADER})) {
- $target.= "$dir/$ctx->{PRIVATE_PROTO_HEADER}";
- $comment.= "$dir/$ctx->{PRIVATE_PROTO_HEADER}";
+ $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER});
+ $target .= $priv;
+ $comment .= $priv;
if (defined($ctx->{PUBLIC_PROTO_HEADER})) {
$comment .= " and ";
$target.= " ";
}
- push (@{$self->{proto_headers}}, "$dir/$ctx->{PRIVATE_PROTO_HEADER}");
+ push (@{$self->{proto_headers}}, $priv);
} else {
$ctx->{PRIVATE_PROTO_HEADER} = $ctx->{PUBLIC_PROTO_HEADER};
+ $priv = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PRIVATE_PROTO_HEADER});
}
-
+
if (defined($ctx->{PUBLIC_PROTO_HEADER})) {
- $comment.= "$dir/$ctx->{PUBLIC_PROTO_HEADER}";
- $target .= "$dir/$ctx->{PUBLIC_PROTO_HEADER}";
- push (@{$self->{proto_headers}}, "$dir/$ctx->{PUBLIC_PROTO_HEADER}");
+ $pub = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PUBLIC_PROTO_HEADER});
+ $comment .= $pub;
+ $target .= $pub;
+ push (@{$self->{proto_headers}}, $pub);
} else {
$ctx->{PUBLIC_PROTO_HEADER} = $ctx->{PRIVATE_PROTO_HEADER};
- }
+ $pub = output::add_dir_str($ctx->{BASEDIR}, $ctx->{PUBLIC_PROTO_HEADER});
+ }
- $self->output("$dir/$ctx->{PUBLIC_PROTO_HEADER}: $ctx->{MK_FILE} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n");
+ $self->output("$pub: $ctx->{MK_FILE} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST:.o=.c) \$(srcdir)/script/mkproto.pl\n");
$self->output("\t\@echo \"$comment\"\n");
-
- $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --private=$dir/$ctx->{PRIVATE_PROTO_HEADER} --public=$dir/$ctx->{PUBLIC_PROTO_HEADER} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)\n\n");
+ $self->output("\t\@\$(PERL) \$(srcdir)/script/mkproto.pl --srcdir=\$(srcdir) --builddir=\$(builddir) --private=$priv --public=$pub \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)\n\n");
}
sub write($$)