summaryrefslogtreecommitdiff
path: root/source4/build/smb_build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r--source4/build/smb_build/config_mk.pm8
-rw-r--r--source4/build/smb_build/input.pm5
-rw-r--r--source4/build/smb_build/main.pl2
-rw-r--r--source4/build/smb_build/makefile.pm23
4 files changed, 32 insertions, 6 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index ddc928c8e2..4435258c2c 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -29,6 +29,9 @@ my $section_types = {
"NOPROTO" => "bool",
"MANPAGE" => "string",
+
+ "PUBLIC_PROTO_HEADER" => "string",
+ "PRIVATE_PROTO_HEADER" => "string"
},
"MODULE" => {
"SUBSYSTEM" => "string",
@@ -71,7 +74,10 @@ my $section_types = {
"MANPAGE" => "string",
- "PUBLIC_HEADERS" => "list"
+ "PUBLIC_HEADERS" => "list",
+
+ "PUBLIC_PROTO_HEADER" => "string",
+ "PRIVATE_PROTO_HEADER" => "string"
}
};
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index bbf7efd8a0..53cd0f218e 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -140,6 +140,11 @@ sub check($$$$$)
$part->{NOPROTO} = "NO";
}
+ if (defined($part->{PRIVATE_PROTO_HEADER}) or
+ defined($part->{PUBLIC_PROTO_HEADER})) {
+ $part->{NOPROTO} = "YES";
+ }
+
if (defined($enabled->{$part->{NAME}})) {
$part->{ENABLE} = $enabled->{$part->{NAME}};
next;
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl
index 22b316a108..80f2e5fe9a 100644
--- a/source4/build/smb_build/main.pl
+++ b/source4/build/smb_build/main.pl
@@ -74,6 +74,8 @@ foreach my $key (values %$OUTPUT) {
$mkenv->Binary($key) if $key->{OUTPUT_TYPE} eq "BINARY";
$mkenv->Manpage($key) if defined($key->{MANPAGE});
$mkenv->Header($key) if defined($key->{PUBLIC_HEADERS});
+ $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER});
+
}
$mkenv->write("Makefile");
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 598aaaba44..bae6fd5b93 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -425,8 +425,8 @@ sub Manpage($$)
my ($self,$ctx) = @_;
my $dir = $ctx->{BASEDIR};
-
- $dir =~ s/^\.\///g;
+
+ $ctx->{BASEDIR} =~ s/^\.\///g;
push (@{$self->{manpages}}, "$dir/$ctx->{MANPAGE}");
}
@@ -463,7 +463,21 @@ sub ProtoHeader($$)
{
my ($self,$ctx) = @_;
- $self->_prepare_list($ctx, "OBJ_LIST");
+ my $dir = $ctx->{BASEDIR};
+ $ctx->{BASEDIR} =~ s/^\.\///g;
+
+ my $comment = "";
+ my $target = "$dir/$ctx->{PRIVATE_PROTO_HEADER}";
+ if (defined($ctx->{PUBLIC_PROTO_HEADER})) {
+ $comment.= " and $dir/$ctx->{PRIVATE_PROTO_HEADER}";
+ } else {
+ $ctx->{PUBLIC_PROTO_HEADER} = $ctx->{PRIVATE_PROTO_HEADER};
+ }
+
+ $self->output("$target: \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST:.o=.c)\n");
+ $self->output("\t\@echo \"Creating $dir/$ctx->{PRIVATE_PROTO_HEADER}$comment\"\n");
+
+ $self->output("\t\@\$(PERL) \${srcdir}/script/mkproto.pl --private=$dir/$ctx->{PRIVATE_PROTO_HEADER} --public=$dir/$ctx->{PUBLIC_PROTO_HEADER} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)\n\n");
}
sub write($$)
@@ -479,8 +493,7 @@ sub write($$)
$self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
$self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
$self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n");
- $self->output("PROTO_OBJS = " . array2oneperline($self->{proto_objs}) . "\n");
-
+ $self->output("PROTO_OBJS = " . array2oneperline($self->{proto_objs}) . "\n");
$self->_prepare_mk_files();